Hi Eden Li,
There are a few easy things to modify the code generation in order to be more easy to read and a bit faster:

#1: use boolean constants instead of performing necessary conversions
This will remove extra RAM for holding data type conversion and an additional assignment instruction

#2: remove the S-function input arguments
This will remove extra RAM by avoiding loading unnecessary structures;

#3: even this is not absolutely needed - i prefer to use atomic system for each of the steps needed for resolver initialization
#4: use priorities (see https://community.nxp.com/thread/449904#comment-899761 ) to ensure the proper calling sequence of each step
The final model should look like this (this is a personal preference)

For more complex model you can also deploy Code Generation Objectives to get better performance/code size/debuggin.

Hope this helps!
Best regards,
Daniel
PS: Attached is a modified version i used to capture the screenshots