dead code removal for loops
better dead code removal
hoist variable declarations to avoid semantic changes due to dead code removal