Can you share the model?
From the generated code, i assume you are using some Simulink division blocks. As you know division is highly inefficient on embedded processor and usually ends up in compiler runtime function calls.
You should look for ways to minimize the divisions like:
#1: precompute the inverse of a1 and use multiplication instead
rtb_Divide_e = (real32_T)FOC_INTC_test1_z_B.SFunction / a1 * a2;
rtb_Sum = (real32_T)FOC_INTC_test1_z_B.SFunction_e / a1 * a3 - a4;
#2: use additional coefficients to pre-compute the constant multiplications/divisions
rtb_Fcn = (((real32_T)FOC_INTC_test1_z_B.SFunction_i / a1 * a3 - a4) * a7 + rtb_Sum) * a5;
#3: try using shifting instead of divisions whenever is possible
An additional question: does your application requires such fast control loop @50us ? Typically in FOC the inner loop (current control) can be executed at 100us while the outer loop (speed/position control) is usually executed at 1ms.
Hope this helps!
Best regards,
Daniel