semantic: Move all variable declarations to the top of the function.