// File: lhydave[P]SysYCompilerLab/back/no_alloc.cpp
// Function: no_alloc::dealloc_temp_reg(std::shared_ptr<eeyore_AST::op_node> const&, int)
void dealloc_temp_reg(const shared_ptr<op_node> &temp, int tempid)
{
	if (temp->exp_type == EXP_NUM)
		return;
	auto var = std::static_pointer_cast<var_node>(temp);
	auto reg = temp_prefix + to_string(tempid);
	if (is_global(var->eeyore_name)) // global
	{
		tigger_dst << emit_loadaddr(
			global_prefix + to_string(global_var2no[var->eeyore_name]),
			temp_prefix + to_string(6));
		tigger_dst << emit_exp_assign(temp_prefix + to_string(6) + "[0]", reg);
	}
	else // local
		tigger_dst << emit_store(reg, var2no[var->eeyore_name]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x42390
cmpl $0x4, 0x8(%rax)
jne 0x41616
jmp 0x419d9
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x42460
movl -0xc(%rbp), %esi
leaq -0x60(%rbp), %rdi
callq 0x13410
jmp 0x41631
leaq 0x314d8(%rip), %rsi     # 0x72b10
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x42130
jmp 0x41647
leaq -0x60(%rbp), %rdi
callq 0x56c0
leaq -0x20(%rbp), %rdi
callq 0x42500
movq %rax, %rdi
addq $0x50, %rdi
callq 0x21fd0
movb %al, -0x1b1(%rbp)
jmp 0x4166d
movb -0x1b1(%rbp), %al
testb $0x1, %al
jne 0x4167c
jmp 0x4194a
leaq -0x20(%rbp), %rdi
callq 0x42500
movq %rax, %rsi
addq $0x50, %rsi
leaq 0x31515(%rip), %rdi     # 0x72ba8
callq 0x41ec0
movq %rax, -0x1c0(%rbp)
jmp 0x416a1
movq -0x1c0(%rbp), %rax
movl (%rax), %esi
leaq -0xd0(%rbp), %rdi
callq 0x13410
jmp 0x416b8
leaq 0x313b1(%rip), %rsi     # 0x72a70
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
callq 0x42130
jmp 0x416d4
leaq -0x110(%rbp), %rdi
movl $0x6, %esi
callq 0x13410
jmp 0x416e7
leaq 0x31422(%rip), %rsi     # 0x72b10
leaq -0xf0(%rbp), %rdi
leaq -0x110(%rbp), %rdx
callq 0x42130
jmp 0x41703
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x35b10
jmp 0x4171f
leaq 0x30d92(%rip), %rdi     # 0x724b8
leaq -0x90(%rbp), %rsi
callq 0x52b0
jmp 0x41734
leaq -0x90(%rbp), %rdi
callq 0x56c0
leaq -0xf0(%rbp), %rdi
callq 0x56c0
leaq -0x110(%rbp), %rdi
callq 0x56c0
leaq -0xb0(%rbp), %rdi
callq 0x56c0
leaq -0xd0(%rbp), %rdi
callq 0x56c0
leaq -0x190(%rbp), %rdi
movl $0x6, %esi
callq 0x13410
jmp 0x41783
leaq 0x31386(%rip), %rsi     # 0x72b10
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rdx
callq 0x42130
jmp 0x4179f
leaq 0xd336(%rip), %rdx      # 0x4eadc
leaq -0x150(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x12d10
jmp 0x417bb
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x34ea0
jmp 0x417d4
leaq 0x30cdd(%rip), %rdi     # 0x724b8
leaq -0x130(%rbp), %rsi
callq 0x52b0
jmp 0x417e9
leaq -0x130(%rbp), %rdi
callq 0x56c0
leaq -0x150(%rbp), %rdi
callq 0x56c0
leaq -0x170(%rbp), %rdi
callq 0x56c0
leaq -0x190(%rbp), %rdi
callq 0x56c0
jmp 0x419c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x419eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x56c0
jmp 0x419eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x419e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x418ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x418c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x418b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x418aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x56c0
leaq -0xf0(%rbp), %rdi
callq 0x56c0
leaq -0x110(%rbp), %rdi
callq 0x56c0
leaq -0xb0(%rbp), %rdi
callq 0x56c0
leaq -0xd0(%rbp), %rdi
callq 0x56c0
jmp 0x419e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x41939
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x4192d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x41921
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x56c0
leaq -0x150(%rbp), %rdi
callq 0x56c0
leaq -0x170(%rbp), %rdi
callq 0x56c0
leaq -0x190(%rbp), %rdi
callq 0x56c0
jmp 0x419e2
leaq -0x20(%rbp), %rdi
callq 0x42500
movq %rax, %rsi
addq $0x50, %rsi
leaq 0x3127f(%rip), %rdi     # 0x72be0
callq 0x41ec0
movq %rax, -0x1c8(%rbp)
jmp 0x4196f
movq -0x1c8(%rbp), %rax
movl (%rax), %edx
leaq -0x1b0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x355b0
jmp 0x4198a
leaq 0x30b27(%rip), %rdi     # 0x724b8
leaq -0x1b0(%rbp), %rsi
callq 0x52b0
jmp 0x4199f
leaq -0x1b0(%rbp), %rdi
callq 0x56c0
jmp 0x419c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x56c0
jmp 0x419e2
leaq -0x40(%rbp), %rdi
callq 0x56c0
leaq -0x20(%rbp), %rdi
callq 0x2b0a0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x56c0
leaq -0x20(%rbp), %rdi
callq 0x2b0a0
movq -0x68(%rbp), %rdi
callq 0x5610
nopl (%rax)