// File: /workspace/github_cpp_makefile_star2_O1/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 0x1faea
movq %r15, %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x21600
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 0x15f9f(%rip), %rcx     # 0x35a50
movq 0x15fa0(%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 0x1fb10
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x1fb17
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x1fc3c
movq 0x154d2(%rip), %rax     # 0x34fd0
cmpb $0x0, (%rax)
je 0x1fc37
incl 0x8(%r14)
jmp 0x1fc3c
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 0x9c20(%rip), %rsi      # 0x29758
callq 0x5510
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1fb65
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x1fb6d
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 0x1fb9b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fbb2
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5240
movq %rsp, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0x20e25
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x1c354
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x15813(%rip), %rdi     # 0x353f8
callq 0x52a0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fc01
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5240
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1fc17
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fd13
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fd13
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 0x15de8(%rip), %rcx     # 0x35a50
movq 0x15de9(%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 0x1fc9f
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x1fca7
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 0x1fcd5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x2074c
movq %r15, %rdi
movl $0x1, %esi
callq 0x21dda
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fd06
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5240
testq %r14, %r14
je 0x1fd13
movq %r14, %rdi
callq 0x18722
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 0x1fd40
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fd40
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1fd5b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fd5b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fde2
movq 0x30(%rsp), %rsi
jmp 0x1fdb1
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1fdd5
movq 0x10(%rsp), %rsi
jmp 0x1fdcd
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1fda2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fda2
movq %rax, %rbx
jmp 0x1fdd5
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fde2
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x1fde2
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fdd5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5240
testq %r14, %r14
je 0x1fde2
movq %r14, %rdi
callq 0x18722
movq %rbx, %rdi
callq 0x54c0