// File: lhydave[P]SysYCompilerLab/back/no_alloc.cpp
// Function: no_alloc::gen_goto(std::shared_ptr<eeyore_AST::goto_node> const&)
void gen_goto(const shared_ptr<goto_node> &stmt)
{
	if (stmt->cond) // conditional jump
	{
		gen_assign(temp_prefix + to_string(1), stmt->cond->left);
		if (std::static_pointer_cast<num_node>(stmt->cond->right)->val)
			tigger_dst << emit_goto(stmt->goto_label,
				temp_prefix + to_string(1) + " != " + zero_reg);
		else
			tigger_dst << emit_goto(stmt->goto_label,
				temp_prefix + to_string(1) + " == " + zero_reg);
	}
	else // unconditional jump
		tigger_dst << emit_goto(stmt->goto_label);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x27ad0
movq %rax, %rdi
addq $0x10, %rdi
callq 0x42370
testb $0x1, %al
jne 0x3fd1d
jmp 0x400f1
leaq -0x48(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
movl $0x1, %esi
callq 0x13410
movq -0x1f8(%rbp), %rdx
leaq 0x32dd0(%rip), %rsi     # 0x72b10
leaq -0x28(%rbp), %rdi
callq 0x42130
jmp 0x3fd4b
movq -0x8(%rbp), %rdi
callq 0x27ad0
movq %rax, %rdi
addq $0x10, %rdi
callq 0x42390
movq %rax, %rsi
addq $0x30, %rsi
leaq -0x28(%rbp), %rdi
callq 0x404d0
jmp 0x3fd72
leaq -0x28(%rbp), %rdi
callq 0x56c0
leaq -0x48(%rbp), %rdi
callq 0x56c0
movq -0x8(%rbp), %rdi
callq 0x27ad0
movq %rax, %rdi
addq $0x10, %rdi
callq 0x42390
movq %rax, %rsi
addq $0x40, %rsi
leaq -0x68(%rbp), %rdi
callq 0x423b0
leaq -0x68(%rbp), %rdi
callq 0x42400
movl 0x50(%rax), %eax
movl %eax, -0x1fc(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2afe0
movl -0x1fc(%rbp), %eax
cmpl $0x0, %eax
je 0x3ff78
movq -0x8(%rbp), %rdi
callq 0x27ad0
movl 0x8(%rax), %eax
movl %eax, -0x20c(%rbp)
leaq -0x108(%rbp), %rdi
movq %rdi, -0x208(%rbp)
movl $0x1, %esi
callq 0x13410
movq -0x208(%rbp), %rdx
leaq 0x32d05(%rip), %rsi     # 0x72b10
leaq -0xe8(%rbp), %rdi
callq 0x42130
jmp 0x3fe19
leaq 0xdf81(%rip), %rdx      # 0x4dda1
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x12d10
jmp 0x3fe35
leaq 0x32cb4(%rip), %rdx     # 0x72af0
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x132d0
jmp 0x3fe51
movl -0x20c(%rbp), %esi
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x35030
jmp 0x3fe6c
leaq 0x32645(%rip), %rdi     # 0x724b8
leaq -0x88(%rbp), %rsi
callq 0x52b0
jmp 0x3fe81
leaq -0x88(%rbp), %rdi
callq 0x56c0
leaq -0xa8(%rbp), %rdi
callq 0x56c0
leaq -0xc8(%rbp), %rdi
callq 0x56c0
leaq -0xe8(%rbp), %rdi
callq 0x56c0
leaq -0x108(%rbp), %rdi
callq 0x56c0
jmp 0x400ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3fee5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x56c0
leaq -0x48(%rbp), %rdi
callq 0x56c0
jmp 0x401df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3ff67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3ff5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3ff4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3ff43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x56c0
leaq -0xa8(%rbp), %rdi
callq 0x56c0
leaq -0xc8(%rbp), %rdi
callq 0x56c0
leaq -0xe8(%rbp), %rdi
callq 0x56c0
leaq -0x108(%rbp), %rdi
callq 0x56c0
jmp 0x401df
movq -0x8(%rbp), %rdi
callq 0x27ad0
movl 0x8(%rax), %eax
movl %eax, -0x21c(%rbp)
leaq -0x1a8(%rbp), %rdi
movq %rdi, -0x218(%rbp)
movl $0x1, %esi
callq 0x13410
movq -0x218(%rbp), %rdx
leaq 0x32b60(%rip), %rsi     # 0x72b10
leaq -0x188(%rbp), %rdi
callq 0x42130
jmp 0x3ffbe
leaq 0xddd7(%rip), %rdx      # 0x4dd9c
leaq -0x168(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x12d10
jmp 0x3ffda
leaq 0x32b0f(%rip), %rdx     # 0x72af0
leaq -0x148(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x132d0
jmp 0x3fff6
movl -0x21c(%rbp), %esi
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rdx
callq 0x35030
jmp 0x40011
leaq 0x324a0(%rip), %rdi     # 0x724b8
leaq -0x128(%rbp), %rsi
callq 0x52b0
jmp 0x40026
leaq -0x128(%rbp), %rdi
callq 0x56c0
leaq -0x148(%rbp), %rdi
callq 0x56c0
leaq -0x168(%rbp), %rdi
callq 0x56c0
leaq -0x188(%rbp), %rdi
callq 0x56c0
leaq -0x1a8(%rbp), %rdi
callq 0x56c0
jmp 0x400ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x400db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x400cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x400c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x400b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x56c0
leaq -0x148(%rbp), %rdi
callq 0x56c0
leaq -0x168(%rbp), %rdi
callq 0x56c0
leaq -0x188(%rbp), %rdi
callq 0x56c0
leaq -0x1a8(%rbp), %rdi
callq 0x56c0
jmp 0x401df
jmp 0x401d6
movq -0x8(%rbp), %rdi
callq 0x27ad0
movl 0x8(%rax), %eax
movl %eax, -0x22c(%rbp)
leaq -0x1e9(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x5620
movq -0x228(%rbp), %rdx
leaq 0xeb3c(%rip), %rsi      # 0x4ec60
leaq -0x1e8(%rbp), %rdi
callq 0x8780
jmp 0x40132
movl -0x22c(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
leaq -0x1e8(%rbp), %rdx
callq 0x35030
jmp 0x4014d
leaq 0x32364(%rip), %rdi     # 0x724b8
leaq -0x1c8(%rbp), %rsi
callq 0x52b0
jmp 0x40162
leaq -0x1c8(%rbp), %rdi
callq 0x56c0
leaq -0x1e8(%rbp), %rdi
callq 0x56c0
leaq -0x1e9(%rbp), %rdi
callq 0x5370
jmp 0x401d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x401c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x401bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x56c0
leaq -0x1e8(%rbp), %rdi
callq 0x56c0
leaq -0x1e9(%rbp), %rdi
callq 0x5370
jmp 0x401df
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x5610
nopl (%rax,%rax)