Not sure, but according to this description, auto variables are slower and constantly reserve and release memory than statically typed variables - even if both are resolved at compile time:
What is the difference between an auto and non auto variable?
Automatic variables create a new each time when program's execution enters in the function and destroys when leaves. Static variable create once, when program's execution enters in the function first time, destroys when program's execution finishes, they do not again.
I would always try to keep variable declarations before the iteration, just to be sure.