// File: KJTang[P]SimpleCompiler/AST.cpp
// Function: CallFuncAST::eval[abi:cxx11]()
std::string CallFuncAST::eval() {
    std::string str;
    if (mCallee == "input") {   // system func "input(int)"
        str += "SCAN " + mArgs[0]->eval().substr(5);
    } else if (mCallee == "output") {   // system func "output(int)"
        str += mArgs[0]->eval() + "PRIT" + insEnd;
    } else {
        for (auto it = mArgs.begin(); it != mArgs.end(); ++it) {
            str += (*it)->eval();
        }
        str += "CALL " + mCallee + insEnd;
    }
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x178(%rbp)
movq %rdi, %rax
movq %rax, -0x170(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x33a0
movq -0x168(%rbp), %rdi
addq $0x10, %rdi
leaq 0xde47(%rip), %rsi      # 0x1b341
callq 0xa8e0
movb %al, -0x159(%rbp)
jmp 0xd507
movb -0x159(%rbp), %al
testb $0x1, %al
jne 0xd516
jmp 0xd604
movq -0x168(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x95c0
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0x88(%rbp), %rdi
callq *%rax
jmp 0xd53f
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movl $0x5, %edx
movq $-0x1, %rcx
callq 0x32c0
jmp 0xd55d
leaq 0xdde3(%rip), %rsi      # 0x1b347
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0xe250
jmp 0xd573
movq -0x178(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3360
jmp 0xd585
leaq -0x48(%rbp), %rdi
callq 0x34f8
leaq -0x68(%rbp), %rdi
callq 0x34f8
leaq -0x88(%rbp), %rdi
callq 0x34f8
jmp 0xd877
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd89d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd5f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd5ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x34f8
leaq -0x68(%rbp), %rdi
callq 0x34f8
leaq -0x88(%rbp), %rdi
callq 0x34f8
jmp 0xd89d
movq -0x168(%rbp), %rdi
addq $0x10, %rdi
leaq 0xdd37(%rip), %rsi      # 0x1b34d
callq 0xa8e0
movb %al, -0x179(%rbp)
jmp 0xd623
movb -0x179(%rbp), %al
testb $0x1, %al
jne 0xd632
jmp 0xd722
movq -0x168(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x95c0
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0xe8(%rbp), %rdi
callq *%rax
jmp 0xd65b
leaq 0xd9bf(%rip), %rdx      # 0x1b021
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0xe180
jmp 0xd677
leaq 0x1ac22(%rip), %rdx     # 0x282a0
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xdf10
jmp 0xd693
movq -0x178(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3360
jmp 0xd6a8
leaq -0xa8(%rbp), %rdi
callq 0x34f8
leaq -0xc8(%rbp), %rdi
callq 0x34f8
leaq -0xe8(%rbp), %rdi
callq 0x34f8
jmp 0xd875
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd711
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd705
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x34f8
leaq -0xc8(%rbp), %rdi
callq 0x34f8
leaq -0xe8(%rbp), %rdi
callq 0x34f8
jmp 0xd89d
movq -0x168(%rbp), %rdi
addq $0x30, %rdi
callq 0xddb0
movq %rax, -0xf0(%rbp)
movq -0x168(%rbp), %rdi
addq $0x30, %rdi
callq 0xde20
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xdde0
testb $0x1, %al
jne 0xd769
jmp 0xd7d6
leaq -0xf0(%rbp), %rdi
callq 0xde50
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0x118(%rbp), %rdi
callq *%rax
jmp 0xd78a
movq -0x178(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x3360
jmp 0xd79f
leaq -0x118(%rbp), %rdi
callq 0x34f8
leaq -0xf0(%rbp), %rdi
callq 0xde70
jmp 0xd739
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x34f8
jmp 0xd89d
movq -0x168(%rbp), %rdx
addq $0x10, %rdx
leaq 0xdb6c(%rip), %rsi      # 0x1b354
leaq -0x158(%rbp), %rdi
callq 0xdf60
jmp 0xd7f6
leaq 0x1aaa3(%rip), %rdx     # 0x282a0
leaq -0x138(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0xdf10
jmp 0xd812
movq -0x178(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x3360
jmp 0xd827
leaq -0x138(%rbp), %rdi
callq 0x34f8
leaq -0x158(%rbp), %rdi
callq 0x34f8
jmp 0xd875
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd867
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x34f8
leaq -0x158(%rbp), %rdi
callq 0x34f8
jmp 0xd89d
jmp 0xd877
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0xd88d
movq -0x178(%rbp), %rdi
callq 0x34f8
movq -0x170(%rbp), %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x178(%rbp), %rdi
callq 0x34f8
movq -0x20(%rbp), %rdi
callq 0x3470
nopw %cs:(%rax,%rax)