the x variable is placed on the stack when the loop is initialized. inside the loop you set a global pointer to point to that location on the stack. when the loop exits, the stack is adjusted so that the variable x is no longer being used (but the value is typically still there, but unreliably there). the next thing to use the stack (like a function call or locals etc) would then write on top of it, as it was marked unused.