Variables that can be used as local variables must be declared as local variables and not as global variables. There is a possibility that the value of a global variable will be changed by function calling or pointer operations, thus the efficiency of optimization is degraded.
The following advantages are available when local variables are used.
Case in which global variables are used for temporary variables (before improvement) and case in which local variables are used (after improvement)
Source code before improvement