Instead of trying to fix the stack at the end of every iteration, to be the same as before, we could just shift everything to memory when a loop is expensive enough. This wouldn't make sense for branches that run once like an if statement or switch, but for loops should probably always do this, unless w/ the dynamic programming thing above we can find a stack order that would eliminate the need to re-order the stack after every loop.
Before expensive loops, push stack vars to memory
Instead of trying to fix the stack at the end of every iteration, to be the same as before, we could just shift everything to memory when a loop is expensive enough. This wouldn't make sense for branches that run once like an if statement or switch, but for loops should probably always do this, unless w/ the dynamic programming thing above we can find a stack order that would eliminate the need to re-order the stack after every loop.