How do you optimize C/C++ code for execution speed and minimal memory footprint on resource-constrained microcontrollers?