// File: KJTang[P]SimpleCompiler/AST.cpp
// Function: IfExprAST::eval[abi:cxx11]()
std::string IfExprAST::eval() {
    std::string str = condAST->eval();
    std::string label = generateJmpLabel();
    str += "JZ " + label + insEnd;    // "JZ LABEL"
    str += ifBlockAST->eval() + label + ":" + insEnd;
    if (elseBlockAST) {
        str += elseBlockAST->eval();
    }
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x140(%rbp)
movq %rdi, %rax
movq %rax, -0x138(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
movb $0x0, -0x11(%rbp)
movq 0x10(%rax), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
callq *%rax
leaq -0x38(%rbp), %rdi
callq 0xcf80
jmp 0xcceb
leaq 0xe644(%rip), %rsi      # 0x1b336
leaq -0x88(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0xdf60
jmp 0xcd04
leaq 0x1b595(%rip), %rdx     # 0x282a0
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xdf10
jmp 0xcd1d
movq -0x140(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3360
jmp 0xcd2f
leaq -0x68(%rbp), %rdi
callq 0x34f8
leaq -0x88(%rbp), %rdi
callq 0x34f8
movq -0x130(%rbp), %rax
movq 0x18(%rax), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0x108(%rbp), %rdi
callq *%rax
jmp 0xcd61
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xdf10
jmp 0xcd7a
leaq 0xe5b9(%rip), %rdx      # 0x1b33a
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0xe180
jmp 0xcd96
leaq 0x1b503(%rip), %rdx     # 0x282a0
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xdf10
jmp 0xcdb2
movq -0x140(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3360
jmp 0xcdc7
leaq -0xa8(%rbp), %rdi
callq 0x34f8
leaq -0xc8(%rbp), %rdi
callq 0x34f8
leaq -0xe8(%rbp), %rdi
callq 0x34f8
leaq -0x108(%rbp), %rdi
callq 0x34f8
movq -0x130(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xcf24
movq -0x130(%rbp), %rax
movq 0x20(%rax), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0x128(%rbp), %rdi
callq *%rax
jmp 0xce26
movq -0x140(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x3360
jmp 0xce3b
leaq -0x128(%rbp), %rdi
callq 0x34f8
jmp 0xcf24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xcf60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xcf39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xce91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x34f8
leaq -0x88(%rbp), %rdi
callq 0x34f8
jmp 0xcf39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xcefc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xcef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xcee4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x34f8
leaq -0xc8(%rbp), %rdi
callq 0x34f8
leaq -0xe8(%rbp), %rdi
callq 0x34f8
leaq -0x108(%rbp), %rdi
callq 0x34f8
jmp 0xcf39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x34f8
jmp 0xcf39
movb $0x1, -0x11(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x34f8
testb $0x1, -0x11(%rbp)
jne 0xcf50
jmp 0xcf44
leaq -0x38(%rbp), %rdi
callq 0x34f8
jmp 0xcf60
movq -0x140(%rbp), %rdi
callq 0x34f8
movq -0x138(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x140(%rbp), %rdi
callq 0x34f8
movq -0x40(%rbp), %rdi
callq 0x3470
nopw %cs:(%rax,%rax)