// File: lhydave[P]SysYCompilerLab/back/emit_tigger.cpp
// Function: tigger::emit_goto(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string emit_goto(int label, const string &cond)
{
	seq.push_back(make_shared<goto_stmt>(cond, label));
	if (cond.empty()) // unconditional jump
		return "\tgoto l" + to_string(label) + "\n";
	// conditional jump
	return "\tif " + cond + " goto l" + to_string(label) + "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x128(%rbp)
movq %rdi, %rax
movq %rax, -0x120(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x118(%rbp)
leaq -0xc(%rbp), %rdx
callq 0x362b0
movq -0x118(%rbp), %rsi
leaq -0x28(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x36330
movq -0x110(%rbp), %rsi
leaq 0x3d9c4(%rip), %rdi     # 0x72a58
callq 0x35f20
jmp 0x3509b
leaq -0x28(%rbp), %rdi
callq 0x36010
leaq -0x38(%rbp), %rdi
callq 0x36360
movq -0x18(%rbp), %rdi
callq 0x55b0
testb $0x1, %al
jne 0x350bf
jmp 0x35178
movl -0xc(%rbp), %esi
leaq -0x88(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x13410
movq -0x130(%rbp), %rdx
leaq 0x18b7f(%rip), %rsi     # 0x4dc62
leaq -0x68(%rbp), %rdi
callq 0x14000
jmp 0x350ee
movq -0x128(%rbp), %rdi
leaq 0x18b44(%rip), %rdx     # 0x4dc40
leaq -0x68(%rbp), %rsi
callq 0x12d10
jmp 0x35107
leaq -0x68(%rbp), %rdi
callq 0x56c0
leaq -0x88(%rbp), %rdi
callq 0x56c0
jmp 0x35295
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x36010
leaq -0x38(%rbp), %rdi
callq 0x36360
jmp 0x352a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35167
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x56c0
leaq -0x88(%rbp), %rdi
callq 0x56c0
jmp 0x352a5
movq -0x18(%rbp), %rdx
leaq 0x18d05(%rip), %rsi     # 0x4de88
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x12d60
movq -0x138(%rbp), %rsi
leaq 0x18cfb(%rip), %rdx     # 0x4de9f
leaq -0xc8(%rbp), %rdi
callq 0x12d10
jmp 0x351b2
movl -0xc(%rbp), %esi
leaq -0x108(%rbp), %rdi
callq 0x13410
jmp 0x351c3
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0x13340
jmp 0x351df
movq -0x128(%rbp), %rdi
leaq 0x18a53(%rip), %rdx     # 0x4dc40
leaq -0xa8(%rbp), %rsi
callq 0x12d10
jmp 0x351fb
leaq -0xa8(%rbp), %rdi
callq 0x56c0
leaq -0x108(%rbp), %rdi
callq 0x56c0
leaq -0xc8(%rbp), %rdi
callq 0x56c0
leaq -0xe8(%rbp), %rdi
callq 0x56c0
jmp 0x35295
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35287
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3527b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3526f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x56c0
leaq -0x108(%rbp), %rdi
callq 0x56c0
leaq -0xc8(%rbp), %rdi
callq 0x56c0
leaq -0xe8(%rbp), %rdi
callq 0x56c0
jmp 0x352a5
movq -0x120(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5610
nop