// File: /workspace/github_cpp_makefile_star2_O2/lhydave[P]SysYCompilerLab/back/no_alloc.cpp
// Function: no_alloc::gen_array(std::shared_ptr<eeyore_AST::op_node> const&, int, int)
void gen_array(const shared_ptr<op_node> &temp, int tempid1, int tempid2)
{
	dbg_printf("gen array begin...\n");
	auto base = std::static_pointer_cast<var_node>(temp->left);
	auto temp1 = temp_prefix + to_string(tempid1);
	auto temp2 = temp_prefix + to_string(tempid2);
	if (is_global(base->eeyore_name)) // global
		tigger_dst << emit_loadaddr(
			global_prefix + to_string(global_var2no[base->eeyore_name]), temp1);
	else if (!is_param(base->eeyore_name) &&
		now_func.temps[base->eeyore_name].is_array) // array
		tigger_dst << emit_loadaddr(var2no[base->eeyore_name], temp1);
	else // variable or param
		tigger_dst << emit_load(var2no[base->eeyore_name], temp1);
	auto shift = alloc_temp_reg(temp->right, tempid2);
	tigger_dst << emit_exp_assign(temp1, temp1 + " + " + temp2);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq (%rdi), %rsi
addq $0x30, %rsi
leaq 0x20(%rsp), %rdi
callq 0x18eb7
leaq 0x70(%rsp), %rdi
movl %ebp, %esi
callq 0xc6d2
leaq 0x164b8(%rip), %rsi     # 0x2ea58
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x18e23
leaq 0x70(%rsp), %rdi
callq 0x5548
movq %rsp, %rdi
movl %ebx, %esi
callq 0xc6d2
leaq 0x1648b(%rip), %rsi     # 0x2ea58
leaq 0x70(%rsp), %rdi
movq %rsp, %rdx
callq 0x18e23
movq %rsp, %rdi
callq 0x5548
movq 0x20(%rsp), %rdi
addq $0x50, %rdi
callq 0x10030
testb %al, %al
je 0x1866b
movq 0x20(%rsp), %rsi
addq $0x50, %rsi
leaq 0x164ec(%rip), %rdi     # 0x2eaf0
callq 0x19624
movl (%rax), %esi
leaq 0x30(%rsp), %rdi
callq 0xc6d2
leaq 0x1639c(%rip), %rsi     # 0x2e9b8
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x18e23
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x15941
leaq 0x15db9(%rip), %rdi     # 0x2e400
movq %rsp, %rsi
callq 0x5210
movq %rsp, %rdi
callq 0x5548
leaq 0x50(%rsp), %rdi
callq 0x5548
leaq 0x30(%rsp), %rdi
jmp 0x18709
movq 0x20(%rsp), %rdi
addq $0x50, %rdi
callq 0x100a0
testb %al, %al
jne 0x186d0
movq 0x20(%rsp), %rsi
addq $0x50, %rsi
leaq 0x1640b(%rip), %rdi     # 0x2ea98
callq 0x11d64
cmpb $0x1, 0x24(%rax)
jne 0x186d0
movq 0x20(%rsp), %rsi
addq $0x50, %rsi
leaq 0x16480(%rip), %rdi     # 0x2eb28
callq 0x19624
movl (%rax), %esi
movq %rsp, %rdi
leaq 0x90(%rsp), %rdx
callq 0x15a5e
leaq 0x15d3a(%rip), %rdi     # 0x2e400
movq %rsp, %rsi
callq 0x5210
jmp 0x18706
movq 0x20(%rsp), %rsi
addq $0x50, %rsi
leaq 0x16448(%rip), %rdi     # 0x2eb28
callq 0x19624
movl (%rax), %esi
movq %rsp, %rdi
leaq 0x90(%rsp), %rdx
callq 0x157d8
leaq 0x15d02(%rip), %rdi     # 0x2e400
movq %rsp, %rsi
callq 0x5210
movq %rsp, %rdi
callq 0x5548
movq (%r14), %rsi
addq $0x40, %rsi
movq %rsp, %rdi
movl %ebx, %edx
callq 0x18224
leaq 0x642e(%rip), %rdx      # 0x1eb54
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xc9ad
leaq 0x30(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0xc64c
leaq 0x50(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x15048
leaq 0x15c90(%rip), %rdi     # 0x2e400
leaq 0x50(%rsp), %rsi
callq 0x5210
leaq 0x50(%rsp), %rdi
callq 0x5548
leaq 0x30(%rsp), %rdi
callq 0x5548
leaq 0xb0(%rsp), %rdi
callq 0x5548
movq %rsp, %rdi
callq 0x5548
leaq 0x70(%rsp), %rdi
callq 0x5548
leaq 0x90(%rsp), %rdi
callq 0x5548
leaq 0x28(%rsp), %rdi
callq 0x11548
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x18831
jmp 0x1885e
jmp 0x18831
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5548
jmp 0x187e9
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x5548
jmp 0x187f8
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x18837
jmp 0x1885e
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x5548
jmp 0x18813
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5548
jmp 0x18822
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x5548
jmp 0x18834
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5548
jmp 0x18861
jmp 0x1885e
jmp 0x1885e
movq %rax, %rbx
movq %rsp, %rdi
jmp 0x18866
movq %rax, %rbx
jmp 0x1886b
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x18873
movq %rax, %rbx
jmp 0x18878
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x5548
leaq 0x90(%rsp), %rdi
callq 0x5548
leaq 0x28(%rsp), %rdi
callq 0x11548
movq %rbx, %rdi
callq 0x54c0