// File: /workspace/github_cpp_makefile_star2_O2/lhydave[P]SysYCompilerLab/front/node.cpp
// Function: sysY_AST::if_stmt_node::gen_code()
void if_stmt_node::gen_code()
{
	code = cond->code;

	if (has_else)
	{
		code += "l" + to_string(true_label) + ":\n";
		code += true_stmt->code;
		auto if_next_label = new_label();
		code += "\tgoto l" + to_string(if_next_label) + "\n";
		code += "l" + to_string(false_label) + ":\n";
		code += false_stmt->code;
		code += "l" + to_string(if_next_label) + ":\n";
	}
	else
	{
		code += true_stmt->code;
		code += "l" + to_string(false_label) + ":\n";
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movq 0x40(%rdi), %rsi
addq $0x18, %rsi
leaq 0x18(%rdi), %rbx
movq %rbx, %rdi
callq 0x5150
cmpb $0x1, 0x64(%r14)
jne 0x9d12
movl 0x58(%r14), %esi
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0xc6d2
leaq 0x14e85(%rip), %rsi     # 0x1ea04
leaq 0x8(%rsp), %rdi
movq %r15, %rdx
callq 0xc95f
leaq 0x14e68(%rip), %rdx     # 0x1e9fb
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc579
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x5530
leaq 0x28(%rsp), %rdi
callq 0x5548
leaq 0x8(%rsp), %rdi
callq 0x5548
leaq 0x48(%rsp), %rdi
callq 0x5548
movq 0x48(%r14), %rsi
addq $0x18, %rsi
movq %rbx, %rdi
callq 0x5530
movl 0x2477c(%rip), %r15d    # 0x2e360
leal 0x1(%r15), %eax
movl %eax, 0x24772(%rip)     # 0x2e360
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movl %r15d, %esi
callq 0xc6d2
leaq 0x14df9(%rip), %rsi     # 0x1e9fe
leaq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0xc95f
leaq 0x14dc3(%rip), %rdx     # 0x1e9dc
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc579
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x5530
leaq 0x28(%rsp), %rdi
callq 0x5548
leaq 0x8(%rsp), %rdi
callq 0x5548
leaq 0x48(%rsp), %rdi
callq 0x5548
movl 0x5c(%r14), %esi
leaq 0x48(%rsp), %r12
movq %r12, %rdi
callq 0xc6d2
leaq 0x14d99(%rip), %rsi     # 0x1ea04
leaq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0xc95f
leaq 0x14d7c(%rip), %rdx     # 0x1e9fb
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc579
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x5530
leaq 0x28(%rsp), %rdi
callq 0x5548
leaq 0x8(%rsp), %rdi
callq 0x5548
leaq 0x48(%rsp), %rdi
callq 0x5548
movq 0x50(%r14), %rsi
addq $0x18, %rsi
movq %rbx, %rdi
callq 0x5530
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
callq 0xc6d2
leaq 0x14d24(%rip), %rsi     # 0x1ea04
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0xc95f
leaq 0x14d07(%rip), %rdx     # 0x1e9fb
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc579
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x5530
jmp 0x9d6a
movq 0x48(%r14), %rsi
addq $0x18, %rsi
movq %rbx, %rdi
callq 0x5530
movl 0x5c(%r14), %esi
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0xc6d2
leaq 0x14cca(%rip), %rsi     # 0x1ea04
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0xc95f
leaq 0x14cad(%rip), %rdx     # 0x1e9fb
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc579
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x5530
leaq 0x28(%rsp), %rdi
callq 0x5548
leaq 0x8(%rsp), %rdi
callq 0x5548
leaq 0x48(%rsp), %rdi
callq 0x5548
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x9da8
jmp 0x9db9
jmp 0x9dca
jmp 0x9da8
jmp 0x9db9
jmp 0x9dca
jmp 0x9da8
jmp 0x9db9
jmp 0x9dca
jmp 0x9da8
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5548
jmp 0x9dbc
jmp 0x9db9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5548
jmp 0x9dcd
jmp 0x9dca
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x5548
movq %rbx, %rdi
callq 0x54c0
nop