// File: fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pIfElseStatement()
static void pIfElseStatement()
{
    std::string if_label = genLabelIf();
    std::string else_label = genLabelElse();
    std::string end_label  = genLabelIfEnd();

    assert(g_sym == IFSY);
    readSymbol();
    test3(Symset({LPARENT}));
    readSymbol();
    pCondition();
    test3(Symset({RPARENT}));
    readSymbol();
    // bz: brach if not satisfy
    genMidCode(BZ, else_label, NONE, NONE);
    // if body
    genMidCode(LABEL, if_label, NONE, NONE);
    pStatement();
    genMidCode(GOTO, end_label, NONE, NONE);
    test3(Symset({ELSESY}));
    readSymbol();
    // else body
    genMidCode(LABEL, else_label, NONE, NONE);
    pStatement();
    genMidCode(LABEL, end_label, NONE, NONE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
leaq -0x20(%rbp), %rdi
callq 0x27370
leaq -0x40(%rbp), %rdi
callq 0x27490
jmp 0x1c58f
leaq -0x70(%rbp), %rdi
callq 0x275a0
jmp 0x1c59a
leaq 0x2f10f(%rip), %rax     # 0x4b6b0
cmpl $0x5, (%rax)
jne 0x1c5a8
jmp 0x1c5e9
leaq 0x18f32(%rip), %rdi     # 0x354e1
leaq 0x18e72(%rip), %rsi     # 0x35428
movl $0xbf, %edx
leaq 0x18f2d(%rip), %rcx     # 0x354ef
callq 0x3230
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1ca59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1ca50
callq 0x2e050
jmp 0x1c5f0
jmp 0x1c5f2
movl $0x1d, -0x8c(%rbp)
leaq -0x8c(%rbp), %rax
movq %rax, -0x88(%rbp)
movq $0x1, -0x80(%rbp)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x227f0
jmp 0x1c628
movl $0x22, -0xb0(%rbp)
movl $0x26, -0xac(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq $0x2, -0xa0(%rbp)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0x227f0
jmp 0x1c671
movq -0x78(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x18170
jmp 0x1c683
movl $0x1d, -0xcc(%rbp)
leaq -0xcc(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq $0x1, -0xc0(%rbp)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0x227f0
jmp 0x1c6c2
leaq 0x2efe7(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0xb8(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1c6df
jmp 0x1c70f
callq 0x2e050
jmp 0x1c6e6
movl $0x1, -0xd0(%rbp)
jmp 0x1ca2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x35e8
jmp 0x1ca50
jmp 0x1c711
jmp 0x1c713
callq 0x2e050
jmp 0x1c71a
callq 0x1f380
jmp 0x1c721
jmp 0x1c723
movl $0x1e, -0xec(%rbp)
leaq -0xec(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq $0x1, -0xe0(%rbp)
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
callq 0x227f0
jmp 0x1c762
movl $0x22, -0x110(%rbp)
movl $0x26, -0x10c(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x108(%rbp)
movq $0x2, -0x100(%rbp)
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
leaq -0xf8(%rbp), %rdi
callq 0x227f0
jmp 0x1c7ab
movq -0xd8(%rbp), %rdi
movq -0xf8(%rbp), %rsi
callq 0x18170
jmp 0x1c7c0
movl $0x1e, -0x12c(%rbp)
leaq -0x12c(%rbp), %rax
movq %rax, -0x128(%rbp)
movq $0x1, -0x120(%rbp)
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0x118(%rbp), %rdi
callq 0x227f0
jmp 0x1c7ff
leaq 0x2eeaa(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0x118(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1c81c
jmp 0x1c832
callq 0x2e050
jmp 0x1c823
movl $0x1, -0xd0(%rbp)
jmp 0x1ca2c
jmp 0x1c834
jmp 0x1c836
callq 0x2e050
jmp 0x1c83d
movl $0x15, -0x130(%rbp)
leaq 0x2a7b2(%rip), %rcx     # 0x47000
leaq -0x130(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq %rcx, %rdx
callq 0x26340
jmp 0x1c863
movl $0x13, -0x134(%rbp)
leaq 0x2a78c(%rip), %rcx     # 0x47000
leaq -0x134(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movq %rcx, %rdx
callq 0x26340
jmp 0x1c889
callq 0x1c2d0
jmp 0x1c890
movl $0x14, -0x138(%rbp)
leaq 0x2a75f(%rip), %rcx     # 0x47000
leaq -0x138(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq %rcx, %rdx
callq 0x26340
jmp 0x1c8b6
jmp 0x1c8b8
movl $0x6, -0x154(%rbp)
leaq -0x154(%rbp), %rax
movq %rax, -0x150(%rbp)
movq $0x1, -0x148(%rbp)
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
leaq -0x140(%rbp), %rdi
callq 0x227f0
jmp 0x1c8f7
movl $0x22, -0x178(%rbp)
movl $0x26, -0x174(%rbp)
leaq -0x178(%rbp), %rax
movq %rax, -0x170(%rbp)
movq $0x2, -0x168(%rbp)
movq -0x170(%rbp), %rsi
movq -0x168(%rbp), %rdx
leaq -0x160(%rbp), %rdi
callq 0x227f0
jmp 0x1c940
movq -0x140(%rbp), %rdi
movq -0x160(%rbp), %rsi
callq 0x18170
jmp 0x1c955
movl $0x6, -0x194(%rbp)
leaq -0x194(%rbp), %rax
movq %rax, -0x190(%rbp)
movq $0x1, -0x188(%rbp)
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rdx
leaq -0x180(%rbp), %rdi
callq 0x227f0
jmp 0x1c994
leaq 0x2ed15(%rip), %rax     # 0x4b6b0
movl (%rax), %esi
leaq -0x180(%rbp), %rdi
callq 0x18b40
xorb $-0x1, %al
testb $0x1, %al
jne 0x1c9b1
jmp 0x1c9c4
callq 0x2e050
jmp 0x1c9b8
movl $0x1, -0xd0(%rbp)
jmp 0x1ca2c
jmp 0x1c9c6
jmp 0x1c9c8
callq 0x2e050
jmp 0x1c9cf
movl $0x13, -0x198(%rbp)
leaq 0x2a620(%rip), %rcx     # 0x47000
leaq -0x198(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq %rcx, %rdx
callq 0x26340
jmp 0x1c9f5
callq 0x1c2d0
jmp 0x1c9fc
movl $0x13, -0x19c(%rbp)
leaq 0x2a5f3(%rip), %rcx     # 0x47000
leaq -0x19c(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq %rcx, %rdx
callq 0x26340
jmp 0x1ca22
movl $0x0, -0xd0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x35e8
leaq -0x40(%rbp), %rdi
callq 0x35e8
leaq -0x20(%rbp), %rdi
callq 0x35e8
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x35e8
leaq -0x20(%rbp), %rdi
callq 0x35e8
movq -0x48(%rbp), %rdi
callq 0x3560
nopl (%rax,%rax)