// File: danfai[P]dboc/main.cpp
// Function: main
int main (int argc, char **argv)
{
    char *outFile = NULL;
    char *inFile = NULL;
    int index;
    int c;

    opterr = 0;

    while ((c = getopt (argc, argv, "ho:")) != -1)
        switch (c)
        {
            case 'h':
                printHelp();
                abort();
            case 'o':
                outFile = optarg;
                break;
            case '?':
                if (optopt == 'c')
                    fprintf (stderr, "Option -%c requires an argument.\n", optopt);
                else if (isprint (optopt))
                    fprintf (stderr, "Unknown option `-%c'.\n", optopt);
                else
                    fprintf (stderr,
                            "Unknown option character `\\x%x'.\n",
                            optopt);
                return 1;
            default:
                abort ();
        }

    for (index = optind; index < argc; index++) {
        inFile = argv[index];
    }

    if (inFile == NULL)
        std::cerr << "No input file specified" << std::endl;

    if (outFile == NULL)
        std::cerr << "No output file specified" << std::endl;

    try {
        Parser parser(inFile);
        parser.write(outFile);
    } catch(const char * c) {
        std::cerr << c << std::endl;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq 0xa970(%rip), %rax      # 0xdfd0
movl $0x0, (%rax)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x5a2b(%rip), %rdx      # 0x909f
callq 0x3080
movl %eax, -0x28(%rbp)
cmpl $-0x1, %eax
je 0x376d
movl -0x28(%rbp), %eax
movl %eax, -0xac(%rbp)
subl $0x3f, %eax
je 0x36cf
jmp 0x3695
movl -0xac(%rbp), %eax
subl $0x68, %eax
je 0x36b2
jmp 0x36a2
movl -0xac(%rbp), %eax
subl $0x6f, %eax
je 0x36bc
jmp 0x3763
callq 0x35a0
callq 0x3150
movq 0xa8cd(%rip), %rax      # 0xdf90
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x3768
movq 0xa8d2(%rip), %rax      # 0xdfa8
cmpl $0x63, (%rax)
jne 0x36fe
movq 0xa8de(%rip), %rax      # 0xdfc0
movq (%rax), %rdi
movq 0xa8bc(%rip), %rax      # 0xdfa8
movl (%rax), %edx
leaq 0x59ae(%rip), %rsi      # 0x90a3
movb $0x0, %al
callq 0x3320
jmp 0x3757
movq 0xa8a3(%rip), %rax      # 0xdfa8
movl (%rax), %edi
callq 0x33c0
cmpl $0x0, %eax
je 0x3734
movq 0xa8a8(%rip), %rax      # 0xdfc0
movq (%rax), %rdi
movq 0xa886(%rip), %rax      # 0xdfa8
movl (%rax), %edx
leaq 0x599a(%rip), %rsi      # 0x90c5
movb $0x0, %al
callq 0x3320
jmp 0x3755
movq 0xa885(%rip), %rax      # 0xdfc0
movq (%rax), %rdi
movq 0xa863(%rip), %rax      # 0xdfa8
movl (%rax), %edx
leaq 0x598e(%rip), %rsi      # 0x90dc
movb $0x0, %al
callq 0x3320
jmp 0x3757
movl $0x1, -0x4(%rbp)
jmp 0x398c
callq 0x3150
jmp 0x3666
movq 0xa854(%rip), %rax      # 0xdfc8
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x379c
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3779
cmpq $0x0, -0x20(%rbp)
jne 0x37c5
movq 0xa846(%rip), %rdi      # 0xdff0
leaq 0x594d(%rip), %rsi      # 0x90fe
callq 0x3210
movq %rax, %rdi
movq 0xa7c8(%rip), %rsi      # 0xdf88
callq 0x3270
cmpq $0x0, -0x18(%rbp)
jne 0x37ee
movq 0xa81d(%rip), %rdi      # 0xdff0
leaq 0x593c(%rip), %rsi      # 0x9116
callq 0x3210
movq %rax, %rdi
movq 0xa79f(%rip), %rsi      # 0xdf88
callq 0x3270
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x33d0
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x39b0
jmp 0x3822
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4520
jmp 0x3831
leaq -0x60(%rbp), %rdi
callq 0x3180
leaq -0x61(%rbp), %rdi
callq 0x3290
movq -0x18(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x33d0
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0x39b0
jmp 0x387d
leaq -0x40(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4bb0
jmp 0x388f
leaq -0x98(%rbp), %rdi
callq 0x3180
leaq -0x99(%rbp), %rdi
callq 0x3290
leaq -0x40(%rbp), %rdi
callq 0x3a60
jmp 0x3970
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x38d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3180
leaq -0x61(%rbp), %rdi
callq 0x3290
jmp 0x391e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x3909
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3180
leaq -0x99(%rbp), %rdi
callq 0x3290
leaq -0x40(%rbp), %rdi
callq 0x3a60
movl -0x74(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3998
movq -0x70(%rbp), %rdi
callq 0x30f0
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rsi
movq 0xa6a8(%rip), %rdi      # 0xdff0
callq 0x3210
movq %rax, -0xd8(%rbp)
jmp 0x3956
movq -0xd8(%rbp), %rdi
movq 0xa624(%rip), %rsi      # 0xdf88
callq 0x3270
jmp 0x396b
callq 0x3380
movl $0x0, -0x4(%rbp)
jmp 0x398c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
callq 0x3380
jmp 0x3998
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x33b0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)