1. A method comprising: interacting, using a processor, with a first intermediate representation, the first intermediate representation produced from at least one implementation in at least one source language of an executable system model in a graphical modeling environment; applying, using the processor, an optimization technique to the first intermediate representation; and generating, using the processor, a second intermediate representation based on the applying of the optimization technique to the first intermediate representation, the second intermediate representation being an augmentation, reduction, or transformation of the first intermediate representation; and generating code for the executable system model using the second intermediate representation, the generated code exhibiting at least one of reduced memory consumption or improved stack management as compared to code generated using the first intermediate representation.