// File: /workspace/github_cpp_makefile_star2_O3/lhydave[P]SysYCompilerLab/back/no_alloc.cpp
// Function: no_alloc::alloc_temp_reg[abi:cxx11](std::shared_ptr<eeyore_AST::op_node> const&, int)
string alloc_temp_reg(const shared_ptr<op_node> &temp, int tempid)
{
	auto reg = temp_prefix + to_string(tempid);
	if (temp->exp_type == EXP_NUM)
	{
		tigger_dst << emit_exp_assign(
			reg, to_string(std::static_pointer_cast<num_node>(temp)->val));
		return reg;
	}
	auto var = std::static_pointer_cast<var_node>(temp);
	dbg_printf("temp reg alloc for %s\n", var->eeyore_name.c_str());
	if (is_global(var->eeyore_name)) // global
	{
		if (func_table[""].temps[var->eeyore_name].is_array) // pointer
			tigger_dst << emit_loadaddr(
				global_prefix + to_string(global_var2no[var->eeyore_name]),
				reg);
		else // variable
			tigger_dst << emit_load(
				global_prefix + to_string(global_var2no[var->eeyore_name]),
				reg);
	}
	else if (!is_param(var->eeyore_name) &&
		now_func.temps[var->eeyore_name].is_array) // array
		tigger_dst << emit_loadaddr(var2no[var->eeyore_name], reg);
	else // variable or param
		tigger_dst << emit_load(var2no[var->eeyore_name], reg);
	return reg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %ebp
negl %ebp
cmovsl %edx, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x20e20
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x20e17
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x20e1d
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x20e20
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x20de4
addl $-0x3, %r12d
jmp 0x20e20
addl $-0x2, %r12d
jmp 0x20e20
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movl $0x2d, %edx
callq 0x52b0
addq (%r13), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x1205c
movq 0x14bf5(%rip), %rcx     # 0x35a50
movq 0x14bf6(%rip), %r8      # 0x35a58
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x10(%rbx), %r13
movq %r13, (%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20e90
movq %rdx, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x20e98
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20ecb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq (%r14), %r15
cmpl $0x4, 0x8(%r15)
jne 0x20ef0
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x20f14
movq 0x140eb(%rip), %rax     # 0x34fd0
cmpb $0x0, (%rax)
je 0x20f0f
incl 0x8(%r14)
jmp 0x20f14
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x20f84
movq 0x140cc(%rip), %rax     # 0x34fd0
cmpb $0x0, (%rax)
je 0x20f7f
incl 0x8(%r14)
jmp 0x20f84
lock
incl 0x8(%r14)
movl 0x50(%r15), %r15d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x211a8
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x2119f
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x211a5
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x211a8
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x20f3d
addl $-0x3, %r12d
jmp 0x211a8
lock
incl 0x8(%r14)
addq $0x50, %r15
movq %r15, %rdi
callq 0x16a6c
testb %al, %al
je 0x2107e
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x8985(%rip), %rdx      # 0x29931
movq %rdx, %rsi
movq %rbx, 0x28(%rsp)
movq %r13, 0x30(%rsp)
callq 0x6d8a
leaq 0x1472b(%rip), %rdi     # 0x356f0
leaq 0x8(%rsp), %rsi
callq 0x1b11a
addq $0x20, %rax
movq %rax, %rdi
movq %r15, %rsi
callq 0x18dca
movb 0x24(%rax), %bl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20ffd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
testb %bl, %bl
je 0x21126
leaq 0x14adc(%rip), %rdi     # 0x35ae8
movq %r15, %rsi
callq 0x2318c
movl (%rax), %r15d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x21279
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x21267
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x21276
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x21279
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2103c
addl $-0x3, %r12d
jmp 0x21279
movq %r15, %rdi
callq 0x16afe
testb %al, %al
jne 0x210d5
leaq 0x149ff(%rip), %rdi     # 0x35a90
movq %r15, %rsi
callq 0x18dca
cmpb $0x1, 0x24(%rax)
jne 0x210d5
leaq 0x14a7a(%rip), %rdi     # 0x35b20
movq %r15, %rsi
callq 0x2318c
movl (%rax), %esi
leaq 0x8(%rsp), %rdi
movq %rbx, %rdx
callq 0x1db61
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x1432a(%rip), %rdi     # 0x353f8
callq 0x52a0
jmp 0x21109
leaq 0x14a44(%rip), %rdi     # 0x35b20
movq %r15, %rsi
callq 0x2318c
movl (%rax), %esi
leaq 0x8(%rsp), %rdi
movq %rbx, %rdx
callq 0x1d4dc
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x142f4(%rip), %rdi     # 0x353f8
callq 0x52a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21451
movq 0x18(%rsp), %rsi
jmp 0x21449
leaq 0x149bb(%rip), %rdi     # 0x35ae8
movq %r15, %rsi
callq 0x2318c
movl (%rax), %r15d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x2133f
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x2126d
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2133c
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2133f
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2115d
addl $-0x3, %r12d
jmp 0x2133f
addl $-0x2, %r12d
jmp 0x211a8
decl %r12d
movq %r13, 0x30(%rsp)
movq %rbx, 0x28(%rsp)
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x38(%rsp), %rdi
movl $0x2d, %edx
callq 0x52b0
leaq 0x38(%rsp), %r13
addq (%r13), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x1205c
leaq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r13, %rdx
callq 0x1c338
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x141ed(%rip), %rdi     # 0x353f8
callq 0x52a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2122c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x21243
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5240
testq %r14, %r14
movq 0x28(%rsp), %rbx
je 0x21255
movq %r14, %rdi
callq 0x18806
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl $-0x2, %r12d
jmp 0x21279
addl $-0x2, %r12d
jmp 0x2133f
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x58(%rsp), %rdi
movl $0x2d, %edx
callq 0x52b0
leaq 0x58(%rsp), %r13
addq (%r13), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x1205c
movq 0x146fa(%rip), %rcx     # 0x359b0
movq 0x146fb(%rip), %r8      # 0x359b8
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x212f0
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x212f6
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x38(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rdx
callq 0x1d906
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x140c6(%rip), %rdi     # 0x353f8
callq 0x52a0
jmp 0x213fd
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x58(%rsp), %rdi
movl $0x2d, %edx
callq 0x52b0
leaq 0x58(%rsp), %r13
addq (%r13), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x1205c
movq 0x14634(%rip), %rcx     # 0x359b0
movq 0x14635(%rip), %r8      # 0x359b8
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x213b6
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x213bc
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x38(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rdx
callq 0x1d281
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x14000(%rip), %rdi     # 0x353f8
callq 0x52a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21419
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x21430
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
movq 0x28(%rsp), %rbx
je 0x21451
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5240
testq %r14, %r14
jne 0x2124d
jmp 0x21255
jmp 0x214c3
jmp 0x21463
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21489
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x21489
jmp 0x21486
movq %rax, %r15
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x214a7
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x214a7
jmp 0x214a4
movq %rax, %r15
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2153c
movq 0x68(%rsp), %rsi
jmp 0x21523
jmp 0x2152f
movq %r13, 0x30(%rsp)
movq %rbx, 0x28(%rsp)
jmp 0x214d7
jmp 0x21539
jmp 0x21539
jmp 0x21539
jmp 0x2152f
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2153c
movq 0x18(%rsp), %rsi
jmp 0x21523
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21514
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x21514
movq %rax, %r15
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2153c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x2153c
jmp 0x21539
movq %r13, 0x30(%rsp)
movq %rbx, 0x28(%rsp)
movq %rax, %r15
testq %r14, %r14
je 0x21549
movq %r14, %rdi
callq 0x18806
movq 0x28(%rsp), %rax
movq (%rax), %rdi
cmpq 0x30(%rsp), %rdi
je 0x21568
movq 0x30(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x5240
movq %r15, %rdi
callq 0x54c0
movq %rax, %r15
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x21568
movq 0x18(%rsp), %rsi
jmp 0x21560