simplified by ignoring temp regs