// File: /workspace/github_cpp_makefile_star2_O3/lhydave[P]SysYCompilerLab/back/no_alloc.cpp
// Function: no_alloc::gen_assign(std::shared_ptr<eeyore_AST::op_node> const&, std::shared_ptr<eeyore_AST::op_node> const&)
void gen_assign(
	const shared_ptr<op_node> &lval, const shared_ptr<op_node> &rval)
{
	if (lval->exp_type == EXP_ARRAY) // store
	{
		gen_array(lval, 1, 2);
		string left = temp_prefix + to_string(1) + "[0]";
		auto right = alloc_temp_reg(rval, 2);
		tigger_dst << emit_exp_assign(left, right);
		return;
	}
	auto var = std::static_pointer_cast<var_node>(lval);
	string left = temp_prefix + to_string(1);
	gen_assign(left, rval);
	dealloc_temp_reg(lval, 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdi), %rax
cmpl $0x2, 0x8(%rax)
jne 0x1fa5f
movq %r15, %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x21589
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x40(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdi
movl $0x2d, %edx
callq 0x52b0
movq (%r14), %rax
movb $0x31, (%rax)
movq 0x1602a(%rip), %rcx     # 0x35a50
movq 0x1602b(%rip), %r8      # 0x35a58
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1fa85
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x1fa8c
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x1fbb1
movq 0x1555d(%rip), %rax     # 0x34fd0
cmpb $0x0, (%rax)
je 0x1fbac
incl 0x8(%r14)
jmp 0x1fbb1
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x9d03(%rip), %rsi      # 0x297b0
callq 0x5510
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1fada
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x1fae2
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1fb10
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fb27
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5240
movq %rsp, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x20dae
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x1c338
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x1589e(%rip), %rdi     # 0x353f8
callq 0x52a0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fb76
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5240
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1fb8c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fc88
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fc88
lock
incl 0x8(%r14)
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rsp, %rdi
movl $0x1, %esi
movl $0x2d, %edx
callq 0x52b0
movq %rsp, %rdi
movq (%rdi), %rax
movb $0x31, (%rax)
movq 0x15e73(%rip), %rcx     # 0x35a50
movq 0x15e74(%rip), %r8      # 0x35a58
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1fc14
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x1fc1c
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1fc4a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x206d5
movq %r15, %rdi
movl $0x1, %esi
callq 0x21d63
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fc7b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5240
testq %r14, %r14
je 0x1fc88
movq %r14, %rdi
callq 0x18806
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fcb5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fcb5
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1fcd0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fcd0
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fd57
movq 0x30(%rsp), %rsi
jmp 0x1fd26
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1fd4a
movq 0x10(%rsp), %rsi
jmp 0x1fd42
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1fd17
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fd17
movq %rax, %rbx
jmp 0x1fd4a
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fd57
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fd57
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fd4a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5240
testq %r14, %r14
je 0x1fd57
movq %r14, %rdi
callq 0x18806
movq %rbx, %rdi
callq 0x54c0