// File: zeeev[P]DASVC/src/main.cpp
// Function: main
int main(int argc, char ** argv)
{
    errorHandler EH;

    std::map< std::string, int > PROGS;

    PROGS[ "annotate" ] = 1;
    PROGS[ "varcall"  ] = 2;

    if(argc < 2){
        EH.croak(EH.USAGE, true);
    }

    std::string prog = argv[1];

    if(PROGS.find(prog) == PROGS.end()){
        EH.croak(EH.BAD_COMMAND_LINE_OPTION, true, prog);
    }

    switch(PROGS[argv[1]]){
    case 1:
        {
            return annotate((std::string)argv[2],
                            (std::string)argv[3],
                            (std::string)argv[4]);
            break;
        }
    case 2:
        {
            std::string bf = argv[2];
            std::string tf = argv[3];
            std::string qf = argv[4];

            return varcall(bf, tf, qf);
            break;
        }

    default:
        {
            /* should never hit here */
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x1e230
leaq -0x90(%rbp), %rdi
callq 0x1fc40
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x6a20
movq -0x268(%rbp), %rdx
leaq 0x60f69(%rip), %rsi     # 0x803e8
leaq -0xb0(%rbp), %rdi
callq 0x11570
jmp 0x1f48d
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1fc80
movq %rax, -0x270(%rbp)
jmp 0x1f4a9
movq -0x270(%rbp), %rax
movl $0x1, (%rax)
leaq -0xb0(%rbp), %rdi
callq 0x6ba8
leaq -0xb1(%rbp), %rdi
callq 0x6600
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x6a20
movq -0x278(%rbp), %rdx
leaq 0x60fce(%rip), %rsi     # 0x804bd
leaq -0xe8(%rbp), %rdi
callq 0x11570
jmp 0x1f4fd
leaq -0x90(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x1fc80
movq %rax, -0x280(%rbp)
jmp 0x1f519
movq -0x280(%rbp), %rax
movl $0x2, (%rax)
leaq -0xe8(%rbp), %rdi
callq 0x6ba8
leaq -0xe9(%rbp), %rdi
callq 0x6600
cmpl $0x2, -0x8(%rbp)
jge 0x1f5ff
leaq -0x60(%rbp), %rdi
movl $0x5, %esi
movl $0x1, %edx
callq 0x1e690
jmp 0x1f55d
jmp 0x1f5ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x1f594
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x6ba8
leaq -0xb1(%rbp), %rdi
callq 0x6600
jmp 0x1fc1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x1f5d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x6ba8
leaq -0xe9(%rbp), %rdi
callq 0x6600
jmp 0x1fc1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x1fc1d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x290(%rbp)
leaq -0x111(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x6a20
movq -0x290(%rbp), %rsi
movq -0x288(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x11570
jmp 0x1f63d
leaq -0x111(%rbp), %rdi
callq 0x6600
leaq -0x90(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1fd90
movq %rax, -0x298(%rbp)
jmp 0x1f665
movq -0x298(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x1fdc0
movq %rax, -0x128(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x1fd60
testb $0x1, %al
jne 0x1f6a2
jmp 0x1f73e
leaq -0x148(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x6200
jmp 0x1f6b7
leaq -0x60(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %edx
leaq -0x148(%rbp), %rcx
callq 0x1e6f0
jmp 0x1f6d3
leaq -0x148(%rbp), %rdi
callq 0x6ba8
jmp 0x1f73e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x111(%rbp), %rdi
callq 0x6600
jmp 0x1fc1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x1fc11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x6ba8
jmp 0x1fc11
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x169(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x6a20
movq -0x2a8(%rbp), %rsi
movq -0x2a0(%rbp), %rdx
leaq -0x168(%rbp), %rdi
callq 0x11570
jmp 0x1f77c
leaq -0x90(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x1fc80
movq %rax, -0x2b0(%rbp)
jmp 0x1f798
movq -0x2b0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2b4(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x6ba8
leaq -0x169(%rbp), %rdi
callq 0x6600
movl -0x2b4(%rbp), %eax
subl $0x1, %eax
je 0x1f823
jmp 0x1f7cc
movl -0x2b4(%rbp), %eax
subl $0x2, %eax
je 0x1f9fa
jmp 0x1fbd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x1f812
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x6ba8
leaq -0x169(%rbp), %rdi
callq 0x6600
jmp 0x1fc11
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x2c8(%rbp)
leaq -0x191(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x6a20
movq -0x2c8(%rbp), %rsi
movq -0x2c0(%rbp), %rdx
leaq -0x190(%rbp), %rdi
callq 0x11570
jmp 0x1f861
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x6a20
movq -0x2d8(%rbp), %rsi
movq -0x2d0(%rbp), %rdx
leaq -0x1b8(%rbp), %rdi
callq 0x11570
jmp 0x1f89f
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x6a20
movq -0x2e8(%rbp), %rsi
movq -0x2e0(%rbp), %rdx
leaq -0x1e0(%rbp), %rdi
callq 0x11570
jmp 0x1f8dd
leaq -0x190(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x10b30
movl %eax, -0x2ec(%rbp)
jmp 0x1f8ff
movl -0x2ec(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x6ba8
leaq -0x1e1(%rbp), %rdi
callq 0x6600
leaq -0x1b8(%rbp), %rdi
callq 0x6ba8
leaq -0x1b9(%rbp), %rdi
callq 0x6600
leaq -0x190(%rbp), %rdi
callq 0x6ba8
leaq -0x191(%rbp), %rdi
callq 0x6600
movl $0x1, -0x1e8(%rbp)
jmp 0x1fbe4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x1f9e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x1f9d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x1f9b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x6ba8
leaq -0x1e1(%rbp), %rdi
callq 0x6600
leaq -0x1b8(%rbp), %rdi
callq 0x6ba8
leaq -0x1b9(%rbp), %rdi
callq 0x6600
leaq -0x190(%rbp), %rdi
callq 0x6ba8
leaq -0x191(%rbp), %rdi
callq 0x6600
jmp 0x1fc11
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x300(%rbp)
leaq -0x209(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x6a20
movq -0x300(%rbp), %rsi
movq -0x2f8(%rbp), %rdx
leaq -0x208(%rbp), %rdi
callq 0x11570
jmp 0x1fa38
leaq -0x209(%rbp), %rdi
callq 0x6600
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x310(%rbp)
leaq -0x231(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x6a20
movq -0x310(%rbp), %rsi
movq -0x308(%rbp), %rdx
leaq -0x230(%rbp), %rdi
callq 0x11570
jmp 0x1fa82
leaq -0x231(%rbp), %rdi
callq 0x6600
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x320(%rbp)
leaq -0x259(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x6a20
movq -0x320(%rbp), %rsi
movq -0x318(%rbp), %rdx
leaq -0x258(%rbp), %rdi
callq 0x11570
jmp 0x1facc
leaq -0x259(%rbp), %rdi
callq 0x6600
leaq -0x208(%rbp), %rdi
leaq -0x230(%rbp), %rsi
leaq -0x258(%rbp), %rdx
callq 0x235b0
movl %eax, -0x324(%rbp)
jmp 0x1fafa
movl -0x324(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x1e8(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x6ba8
leaq -0x230(%rbp), %rdi
callq 0x6ba8
leaq -0x208(%rbp), %rdi
callq 0x6ba8
jmp 0x1fbe4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x209(%rbp), %rdi
callq 0x6600
jmp 0x1fc11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x231(%rbp), %rdi
callq 0x6600
jmp 0x1fbc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x259(%rbp), %rdi
callq 0x6600
jmp 0x1fbb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x6ba8
leaq -0x230(%rbp), %rdi
callq 0x6ba8
leaq -0x208(%rbp), %rdi
callq 0x6ba8
jmp 0x1fc11
jmp 0x1fbd3
movl $0x0, -0x4(%rbp)
movl $0x1, -0x1e8(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x6ba8
leaq -0x90(%rbp), %rdi
callq 0x1fc60
leaq -0x60(%rbp), %rdi
callq 0x129b0
movl -0x4(%rbp), %eax
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
leaq -0x110(%rbp), %rdi
callq 0x6ba8
leaq -0x90(%rbp), %rdi
callq 0x1fc60
leaq -0x60(%rbp), %rdi
callq 0x129b0
movq -0xc0(%rbp), %rdi
callq 0x6a10
nop