I'm trying to use Csmith in my project where I dynamically link Csmith generated code. The Csmith generated main function is called repeatedly up to a certain number of times. Now, when the main function is called second (or third, fourth etc.) time, global variables have values different than their initial values (as a result of the computations performed when main was called first time). As a result, the program behaviors differently (different checksum, crashes etc.).
Is there any way to reset values of the global variables before main is called, so that, if I dynamically link a Csmith generated function and call it multiple times, it would have produced same behaviors (checksum) each time? Or, at least, should not exhibit any unspecified or undefined behaviors?