// File: philpoore[P]Math/./src/Parser.cpp
// Function: Parser::parseIf()
AstIf* Parser::parseIf() {
    AstIf* ast = new AstIf();
    expect(TOKEN_IF);  // if
    consumeWhiteSpace();

    expect(TOKEN_LPAREN);  // if's test expr e.g (10 = 10)
    ast->expr = parseExpr();
    expect(TOKEN_RPAREN);

    consumeWhiteSpace();
    expect(TOKEN_LCURLY);  // if's if_branch
    ast->if_branch = parseBlock();
    expect(TOKEN_RCURLY);
    consumeWhiteSpace();

    if (peekIs(TOKEN_ELSE)) {
        // Else branch.
        expect(TOKEN_ELSE);
        consumeWhiteSpace();
        expect(TOKEN_LCURLY);  // if's else_branch
        ast->else_branch = parseBlock();
        expect(TOKEN_RCURLY);
    }

    return ast;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movl $0x20, %edi
callq 0x42f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2e8(%rbp)
callq 0xcfc0
jmp 0x9618
movq -0x2e8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x4500
movq -0x2f8(%rbp), %rdx
leaq 0xceb2(%rip), %rsi      # 0x164f3
leaq -0x70(%rbp), %rdi
callq 0xbcf0
jmp 0x964c
movq -0x2f0(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movl $0x10e, %edx            # imm = 0x10E
leaq -0x70(%rbp), %rcx
callq 0x8ab0
jmp 0x9667
leaq -0x50(%rbp), %rdi
callq 0xcb70
leaq -0x70(%rbp), %rdi
callq 0x4200
leaq -0x71(%rbp), %rdi
callq 0x4340
movq -0x2f0(%rbp), %rdi
callq 0x8dc0
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x4500
movq -0x300(%rbp), %rdx
leaq 0xce44(%rip), %rsi      # 0x164f3
leaq -0xc8(%rbp), %rdi
callq 0xbcf0
jmp 0x96bd
movq -0x2f0(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
movl $0x10a, %edx            # imm = 0x10A
leaq -0xc8(%rbp), %rcx
callq 0x8ab0
jmp 0x96de
leaq -0xa8(%rbp), %rdi
callq 0xcb70
leaq -0xc8(%rbp), %rdi
callq 0x4200
leaq -0xc9(%rbp), %rdi
callq 0x4340
movq -0x2f0(%rbp), %rdi
movl $0xffffd8f1, %esi       # imm = 0xFFFFD8F1
callq 0x9c30
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x4500
movq -0x308(%rbp), %rdx
leaq 0xcdb4(%rip), %rsi      # 0x164f3
leaq -0x120(%rbp), %rdi
callq 0xbcf0
jmp 0x974d
movq -0x2f0(%rbp), %rsi
leaq -0x100(%rbp), %rdi
movl $0x10b, %edx            # imm = 0x10B
leaq -0x120(%rbp), %rcx
callq 0x8ab0
jmp 0x976e
leaq -0x100(%rbp), %rdi
callq 0xcb70
leaq -0x120(%rbp), %rdi
callq 0x4200
leaq -0x121(%rbp), %rdi
callq 0x4340
movq -0x2f0(%rbp), %rdi
callq 0x8dc0
leaq -0x179(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x4500
movq -0x310(%rbp), %rdx
leaq 0xcd34(%rip), %rsi      # 0x164f3
leaq -0x178(%rbp), %rdi
callq 0xbcf0
jmp 0x97cd
movq -0x2f0(%rbp), %rsi
leaq -0x158(%rbp), %rdi
movl $0x10c, %edx            # imm = 0x10C
leaq -0x178(%rbp), %rcx
callq 0x8ab0
jmp 0x97ee
leaq -0x158(%rbp), %rdi
callq 0xcb70
leaq -0x178(%rbp), %rdi
callq 0x4200
leaq -0x179(%rbp), %rdi
callq 0x4340
movq -0x2f0(%rbp), %rdi
callq 0xa020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
leaq -0x1d1(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x4500
movq -0x318(%rbp), %rdx
leaq 0xcca9(%rip), %rsi      # 0x164f3
leaq -0x1d0(%rbp), %rdi
callq 0xbcf0
jmp 0x9858
movq -0x2f0(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
movl $0x10d, %edx            # imm = 0x10D
leaq -0x1d0(%rbp), %rcx
callq 0x8ab0
jmp 0x9879
leaq -0x1b0(%rbp), %rdi
callq 0xcb70
leaq -0x1d0(%rbp), %rdi
callq 0x4200
leaq -0x1d1(%rbp), %rdi
callq 0x4340
movq -0x2f0(%rbp), %rdi
callq 0x8dc0
movq -0x2f0(%rbp), %rdi
movl $0x10f, %esi            # imm = 0x10F
callq 0x8a20
testb $0x1, %al
jne 0x98c3
jmp 0x9c12
leaq -0x229(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x4500
movq -0x320(%rbp), %rdx
leaq 0xcc0f(%rip), %rsi      # 0x164f3
leaq -0x228(%rbp), %rdi
callq 0xbcf0
jmp 0x98f2
movq -0x2f0(%rbp), %rsi
leaq -0x208(%rbp), %rdi
movl $0x10f, %edx            # imm = 0x10F
leaq -0x228(%rbp), %rcx
callq 0x8ab0
jmp 0x9913
leaq -0x208(%rbp), %rdi
callq 0xcb70
leaq -0x228(%rbp), %rdi
callq 0x4200
leaq -0x229(%rbp), %rdi
callq 0x4340
movq -0x2f0(%rbp), %rdi
callq 0x8dc0
leaq -0x281(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x4500
movq -0x328(%rbp), %rdx
leaq 0xcb8f(%rip), %rsi      # 0x164f3
leaq -0x280(%rbp), %rdi
callq 0xbcf0
jmp 0x9972
movq -0x2f0(%rbp), %rsi
leaq -0x260(%rbp), %rdi
movl $0x10c, %edx            # imm = 0x10C
leaq -0x280(%rbp), %rcx
callq 0x8ab0
jmp 0x9993
leaq -0x260(%rbp), %rdi
callq 0xcb70
leaq -0x280(%rbp), %rdi
callq 0x4200
leaq -0x281(%rbp), %rdi
callq 0x4340
movq -0x2f0(%rbp), %rdi
callq 0xa020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
leaq -0x2d9(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x4500
movq -0x330(%rbp), %rdx
leaq 0xcb04(%rip), %rsi      # 0x164f3
leaq -0x2d8(%rbp), %rdi
callq 0xbcf0
jmp 0x99fd
movq -0x2f0(%rbp), %rsi
leaq -0x2b8(%rbp), %rdi
movl $0x10d, %edx            # imm = 0x10D
leaq -0x2d8(%rbp), %rcx
callq 0x8ab0
jmp 0x9a1e
leaq -0x2b8(%rbp), %rdi
callq 0xcb70
leaq -0x2d8(%rbp), %rdi
callq 0x4200
leaq -0x2d9(%rbp), %rdi
callq 0x4340
jmp 0x9c12
movq -0x2e8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x20, %esi
callq 0x4300
jmp 0x9c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x9a8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x4200
leaq -0x71(%rbp), %rdi
callq 0x4340
jmp 0x9c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x9ac0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x4200
leaq -0xc9(%rbp), %rdi
callq 0x4340
jmp 0x9c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x9af7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x4200
leaq -0x121(%rbp), %rdi
callq 0x4340
jmp 0x9c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x9b2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x4200
leaq -0x179(%rbp), %rdi
callq 0x4340
jmp 0x9c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x9b65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x4200
leaq -0x1d1(%rbp), %rdi
callq 0x4340
jmp 0x9c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x9b9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x4200
leaq -0x229(%rbp), %rdi
callq 0x4340
jmp 0x9c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x9bd0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x4200
leaq -0x281(%rbp), %rdi
callq 0x4340
jmp 0x9c1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x9c04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x4200
leaq -0x2d9(%rbp), %rdi
callq 0x4340
jmp 0x9c1f
movq -0x10(%rbp), %rax
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x44f0
nopl (%rax,%rax)