Fatal Error C1509
The code exceeds an internal limit on exception handler states (32,768 states).
The most common cause is that the function contains a complex expression of user-defined class variables and arithmetic operators.
To fix by using the following possible solutions
Simplify expressions by assigning common subexpressions to temporary variables.
Split the function into smaller functions.