// File: /workspace/github_cpp_makefile_star2_O3/lhydave[P]SysYCompilerLab/back/no_alloc.cpp
// Function: no_alloc::gen_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::shared_ptr<eeyore_AST::op_node> const&)
void gen_assign(const string &lval, const shared_ptr<op_node> &rval)
{
	if (rval->exp_type == EXP_NUM) // number!
	{
		auto rnum = std::static_pointer_cast<num_node>(rval);
		tigger_dst << emit_exp_assign(lval, to_string(rnum->val));
		return;
	}
	if (rval->exp_type == EXP_VAR) // variable!
	{
		auto rreg = alloc_temp_reg(rval, 2);
		tigger_dst << emit_exp_assign(lval, rreg);
		return;
	}
	if (rval->exp_type == EXP_ARRAY) // array!
	{
		gen_array(rval, 2, 3);
		string right = temp_prefix + to_string(2) + "[0]";
		tigger_dst << emit_exp_assign(lval, right);
		return;
	}
	if (rval->exp_type == EXP_CALL) // call!
	{
		gen_call(std::static_pointer_cast<call_node>(rval), lval);
		return;
	}
	if (!rval->right) // unary operator
	{
		gen_unary(rval, 2);
		tigger_dst << emit_exp_assign(lval, temp_prefix + to_string(2));
		return;
	}
	// binary operator
	gen_binary(rval, 2, 3);
	tigger_dst << emit_exp_assign(lval, temp_prefix + to_string(2));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq (%rsi), %rax
movl 0x8(%rax), %ecx
decl %ecx
cmpl $0x4, %ecx
ja 0x20846
leaq 0x909e(%rip), %rdx      # 0x2979c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x2, %edx
callq 0x20dae
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1c338
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x14cbe(%rip), %rdi     # 0x353f8
callq 0x52a0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2075a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x20a3e
jmp 0x20c65
movq 0x8(%rsi), %r14
testq %r14, %r14
je 0x20a4d
movq 0x1484b(%rip), %rcx     # 0x34fd0
cmpb $0x0, (%rcx)
je 0x20a48
incl 0x8(%r14)
jmp 0x20a4d
movq %rsi, %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0x21589
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x48(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdi
movl $0x2d, %edx
callq 0x52b0
movq (%r14), %rax
movb $0x32, (%rax)
movq 0x1527a(%rip), %rcx     # 0x35a50
movq 0x1527b(%rip), %r8      # 0x35a58
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2094c
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x20953
movq %rax, 0x28(%rsp)
movq 0x8(%rsi), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x20abc
movq 0x1479b(%rip), %rcx     # 0x34fd0
cmpb $0x0, (%rcx)
je 0x20ab8
incl 0x8(%rax)
jmp 0x20abc
cmpq $0x0, 0x40(%rax)
je 0x208d1
movq %rsi, %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0x2258d
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x48(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdi
movl $0x2d, %edx
callq 0x52b0
movq (%r14), %rax
movb $0x32, (%rax)
movq 0x151c0(%rip), %rcx     # 0x35a50
movq 0x151c1(%rip), %r8      # 0x35a58
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20adc
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x20ae3
movq %rsi, %rdi
movl $0x2, %esi
callq 0x22470
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x48(%rsp), %r14
movl $0x1, %esi
movq %r14, %rdi
movl $0x2d, %edx
callq 0x52b0
movq (%r14), %rax
movb $0x32, (%rax)
movq 0x15145(%rip), %rcx     # 0x35a50
movq 0x15146(%rip), %r8      # 0x35a58
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5290
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20b24
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x20b2b
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x8e3a(%rip), %rsi      # 0x297b0
callq 0x5510
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x209a3
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x209ab
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x209da
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x209f1
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5240
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movq %rbx, %rsi
callq 0x1c338
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x149e4(%rip), %rdi     # 0x353f8
callq 0x52a0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x20a30
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x20c65
movq 0x38(%rsp), %rsi
jmp 0x20baf
lock
incl 0x8(%r14)
movl 0x50(%rax), %r15d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x20bc5
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x20bbc
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x20bc2
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x20bc5
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x20a76
addl $-0x3, %r12d
jmp 0x20bc5
lock
incl 0x8(%rax)
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x20473
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
jne 0x20c60
jmp 0x20c65
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rsi
leaq 0x8(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x1c338
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x148db(%rip), %rdi     # 0x353f8
callq 0x52a0
jmp 0x20b6a
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rsi
leaq 0x8(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x1c338
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x14893(%rip), %rdi     # 0x353f8
callq 0x52a0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20b85
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x20b9c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x20c65
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x20c65
addl $-0x2, %r12d
jmp 0x20bc5
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
movl $0x2d, %edx
callq 0x52b0
leaq 0x8(%rsp), %r13
addq (%r13), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x1205c
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1c338
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x147dc(%rip), %rdi     # 0x353f8
callq 0x52a0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20c3c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5240
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20c58
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
testq %r14, %r14
je 0x20c65
movq %r14, %rdi
callq 0x18806
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x20c7d
jmp 0x20cf6
jmp 0x20d62
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20cf9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x20cf9
jmp 0x20cf6
jmp 0x20d62
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x20cc3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x20cc3
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
jne 0x20d87
jmp 0x20da6
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20d35
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x20d35
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x20d65
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x20d65
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20d79
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x20d79
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20d99
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x20d99
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
jne 0x20da1
jmp 0x20da6
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x20da6
movq 0x58(%rsp), %rsi
jmp 0x20d8c
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20da6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5240
jmp 0x20da6
movq %rax, %rbx
testq %r14, %r14
je 0x20da6
movq %r14, %rdi
callq 0x18806
movq %rbx, %rdi
callq 0x54c0