Optimization of C code in a real-time environment