Walk me through how you would optimize a piece of C code that is consuming too much memory on a constrained microcontroller.