// File: quiath[P]fast-atoi/main.cpp
// Function: main
int main(int argc, char* argv[])
{
    unsigned MAX_WORD_LEN = 8;
    unsigned long N = 10000000UL;
    unsigned WORD_COUNT = 10000;
    bool digits_only = false;
    bool use_atol = false;
    std::string out_filename = "";

    std::vector<std::string> args(argv, argv + argc);
    int i = 1;
    while (i < args.size())
    {
        if (args[i] == "-t" || args[i] == "--unittest")
        {
            unit_test();
            return 0;
        }
        if (args[i] == "-d" || args[i] == "--digitsonly")
        {
            digits_only = true;
        }
        if (args[i] == "-a" || args[i] == "--atol")
        {
            use_atol = true;
        }

        if ((args[i] == "-l" || args[i] == "--length") && 
            i < args.size()) 
        {
            if ((MAX_WORD_LEN = atoi(args[i + 1].c_str())) > 20 || MAX_WORD_LEN == 0) 
            {
                std::cerr << "Invalid length" << std::endl;
                return 1;
            }
            i++;
        }       
        if ((args[i] == "-w" || args[i] == "--words") && 
            i < args.size())
        {
            if ((WORD_COUNT = atol(args[i + 1].c_str())) > 1000000 || WORD_COUNT == 0) 
            {
                std::cerr << "Invalid word count" << std::endl;
                return 1;
            }
            i++;
        }
        if ((args[i] == "-n" || args[i] == "--numloops") && 
            i < args.size())
        {
            if ((N = atol(args[i + 1].c_str())) > 1000000000000UL || N == 0) 
            {
                std::cerr << "Invalid number of loops" << std::endl;
                return 1;
            }
            i++;
        }
        if ((args[i] == "-o" || args[i] == "--output") && 
            i < args.size())
        {
            out_filename = args[i + 1];
            i++;
        }

        i++;
    }

    for (size_t L = 1; L <= MAX_WORD_LEN; ++L)
    {

        Name2Time best;
        std::vector<std::string> v;
        generate_add(v, WORD_COUNT, L, digits_only);


        std::cout << "Digits per number: " << L << " The string contains"
                  << (digits_only ? " digits only" : " whitespace and sign" ) << std::endl; 
        std::cout << "Int size in bytes:" << sizeof(myint) << std::endl;
        std::cout << "Loops:" << N << std::endl;
        std::cout << "Words:" << WORD_COUNT << std::endl;
        std::cout << "Ramp up:" << std::endl;
        test(N, atoi, v, best, "");

        for (int i = 0; i < 3; ++i) 
        {
            test(N, zero, v, best,            "zero..........");
            if (use_atol)
            {
                test(N, atol, v, best,            "atol..........");
            }
            else
            {
                test(N, atoi, v, best,            "atoi..........");
            }
            test(N, atoisimple, v, best,      "atoisimple....");
            test(N, fastatoi, v, best,        "fastatoi......");
            test(N, fastatoiadd, v, best,     "fastatoiadd...");
            test(N, fastatoiaddunr, v, best,  "fastatoiaddunr");
        }

        for (auto& kv : best)
        {
            std::cout << "Best: " << kv.first << " : " << std::setw(11) << kv.second << std::endl;
        }

        if (out_filename.length() > 0) 
        {
            std::ofstream f(out_filename.c_str(), std::ios::app | std::ios::out);
            if (!f.fail())
            {
                if (L == 1)
                {
                    // header
                    f << "\"Length\",\"Digits only\"" ;
                    for (auto& kv : best)
                    {
                         f << ",\"" << kv.first << "\""; 
                    }
                    f << std::endl;
                }
                f << L << "," << (digits_only ? 1 : 0);

                for (auto& kv : best)
                {
                    f << "," << kv.second;
                }
                f << std::endl;
            }
        }
        else
        {
          std::cout << "No output file param" << std::endl;
        }
    
    }

    return 0;
}

// Assembly:
subq $0x658, %rsp            # imm = 0x658
movl $0x0, 0x654(%rsp)
movl %edi, 0x650(%rsp)
movq %rsi, 0x648(%rsp)
movl $0x8, 0x644(%rsp)
movq $0x989680, 0x638(%rsp) # imm = 0x989680
movl $0x2710, 0x634(%rsp) # imm = 0x2710
movb $0x0, 0x633(%rsp)
movb $0x0, 0x632(%rsp)
leaq 0x60f(%rsp), %rdi
movq %rdi, 0x1d0(%rsp)
callq 0x2350
movq 0x1d0(%rsp), %rdx
leaq 0x62a8(%rip), %rsi      # 0xa02f
leaq 0x610(%rsp), %rdi
callq 0x2290
jmp 0x3d96
leaq 0x60f(%rsp), %rdi
callq 0x2250
movq 0x648(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movslq 0x650(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x1c0(%rsp)
leaq 0x5df(%rsp), %rdi
movq %rdi, 0x1c8(%rsp)
callq 0x53e0
movq 0x1b8(%rsp), %rsi
movq 0x1c0(%rsp), %rdx
movq 0x1c8(%rsp), %rcx
leaq 0x5e0(%rsp), %rdi
callq 0x5a30
jmp 0x3e03
leaq 0x5df(%rsp), %rdi
callq 0x5480
movl $0x1, 0x5d8(%rsp)
movslq 0x5d8(%rsp), %rax
movq %rax, 0x1b0(%rsp)
leaq 0x5e0(%rsp), %rdi
callq 0x5ac0
movq %rax, %rcx
movq 0x1b0(%rsp), %rax
cmpq %rcx, %rax
jae 0x4518
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x6264(%rip), %rsi      # 0xa0cf
callq 0x5ae0
movb %al, 0x1af(%rsp)
jmp 0x3e79
movb 0x1af(%rsp), %al
testb $0x1, %al
jne 0x3ec3
jmp 0x3e86
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x622d(%rip), %rsi      # 0xa0d2
callq 0x5ae0
movb %al, 0x1ae(%rsp)
jmp 0x3eb3
movb 0x1ae(%rsp), %al
testb $0x1, %al
jne 0x3ec3
jmp 0x3f4a
callq 0x2b40
jmp 0x3eca
movl $0x0, 0x654(%rsp)
movl $0x1, 0x5d4(%rsp)
jmp 0x52d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x60f(%rsp), %rdi
callq 0x2250
jmp 0x5317
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x5df(%rsp), %rdi
callq 0x5480
jmp 0x530a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x52fd
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x6174(%rip), %rsi      # 0xa0dd
callq 0x5ae0
movb %al, 0x1ad(%rsp)
jmp 0x3f77
movb 0x1ad(%rsp), %al
testb $0x1, %al
jne 0x3fbe
jmp 0x3f84
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x613d(%rip), %rsi      # 0xa0e0
callq 0x5ae0
movb %al, 0x1ac(%rsp)
jmp 0x3fb1
movb 0x1ac(%rsp), %al
testb $0x1, %al
jne 0x3fbe
jmp 0x3fc6
movb $0x1, 0x633(%rsp)
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x6108(%rip), %rsi      # 0xa0ed
callq 0x5ae0
movb %al, 0x1ab(%rsp)
jmp 0x3ff3
movb 0x1ab(%rsp), %al
testb $0x1, %al
jne 0x403a
jmp 0x4000
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x60d1(%rip), %rsi      # 0xa0f0
callq 0x5ae0
movb %al, 0x1aa(%rsp)
jmp 0x402d
movb 0x1aa(%rsp), %al
testb $0x1, %al
jne 0x403a
jmp 0x4042
movb $0x1, 0x632(%rsp)
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x6096(%rip), %rsi      # 0xa0f7
callq 0x5ae0
movb %al, 0x1a9(%rsp)
jmp 0x406f
movb 0x1a9(%rsp), %al
testb $0x1, %al
jne 0x40b9
jmp 0x407c
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x605f(%rip), %rsi      # 0xa0fa
callq 0x5ae0
movb %al, 0x1a8(%rsp)
jmp 0x40a9
movb 0x1a8(%rsp), %al
testb $0x1, %al
jne 0x40b9
jmp 0x4189
movslq 0x5d8(%rsp), %rax
movq %rax, 0x1a0(%rsp)
leaq 0x5e0(%rsp), %rdi
callq 0x5ac0
movq %rax, %rcx
movq 0x1a0(%rsp), %rax
cmpq %rcx, %rax
jae 0x4189
movl 0x5d8(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x23a0
movl %eax, 0x644(%rsp)
cmpl $0x14, %eax
ja 0x412a
cmpl $0x0, 0x644(%rsp)
jne 0x4178
movq 0x9ebf(%rip), %rdi      # 0xdff0
leaq 0x5fcb(%rip), %rsi      # 0xa103
callq 0x2200
movq %rax, 0x198(%rsp)
jmp 0x4147
movq 0x198(%rsp), %rdi
movq 0x9e5a(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x415d
movl $0x1, 0x654(%rsp)
movl $0x1, 0x5d4(%rsp)
jmp 0x52d4
movl 0x5d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5d8(%rsp)
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x5f6a(%rip), %rsi      # 0xa112
callq 0x5ae0
movb %al, 0x197(%rsp)
jmp 0x41b6
movb 0x197(%rsp), %al
testb $0x1, %al
jne 0x4200
jmp 0x41c3
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x5f33(%rip), %rsi      # 0xa115
callq 0x5ae0
movb %al, 0x196(%rsp)
jmp 0x41f0
movb 0x196(%rsp), %al
testb $0x1, %al
jne 0x4200
jmp 0x42d2
movslq 0x5d8(%rsp), %rax
movq %rax, 0x188(%rsp)
leaq 0x5e0(%rsp), %rdi
callq 0x5ac0
movq %rax, %rcx
movq 0x188(%rsp), %rax
cmpq %rcx, %rax
jae 0x42d2
movl 0x5d8(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2398
movl %eax, 0x634(%rsp)
cmpl $0xf4240, %eax          # imm = 0xF4240
ja 0x4273
cmpl $0x0, 0x634(%rsp)
jne 0x42c1
movq 0x9d76(%rip), %rdi      # 0xdff0
leaq 0x5e9c(%rip), %rsi      # 0xa11d
callq 0x2200
movq %rax, 0x180(%rsp)
jmp 0x4290
movq 0x180(%rsp), %rdi
movq 0x9d11(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x42a6
movl $0x1, 0x654(%rsp)
movl $0x1, 0x5d4(%rsp)
jmp 0x52d4
movl 0x5d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5d8(%rsp)
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x5e3f(%rip), %rsi      # 0xa130
callq 0x5ae0
movb %al, 0x17f(%rsp)
jmp 0x42ff
movb 0x17f(%rsp), %al
testb $0x1, %al
jne 0x4349
jmp 0x430c
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x5e08(%rip), %rsi      # 0xa133
callq 0x5ae0
movb %al, 0x17e(%rsp)
jmp 0x4339
movb 0x17e(%rsp), %al
testb $0x1, %al
jne 0x4349
jmp 0x4425
movslq 0x5d8(%rsp), %rax
movq %rax, 0x170(%rsp)
leaq 0x5e0(%rsp), %rdi
callq 0x5ac0
movq %rax, %rcx
movq 0x170(%rsp), %rax
cmpq %rcx, %rax
jae 0x4425
movl 0x5d8(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2398
movq %rax, 0x638(%rsp)
movabsq $0xe8d4a51000, %rcx     # imm = 0xE8D4A51000
cmpq %rcx, %rax
ja 0x43c6
cmpq $0x0, 0x638(%rsp)
jne 0x4414
movq 0x9c23(%rip), %rdi      # 0xdff0
leaq 0x5d6a(%rip), %rsi      # 0xa13e
callq 0x2200
movq %rax, 0x168(%rsp)
jmp 0x43e3
movq 0x168(%rsp), %rdi
movq 0x9bbe(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x43f9
movl $0x1, 0x654(%rsp)
movl $0x1, 0x5d4(%rsp)
jmp 0x52d4
movl 0x5d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5d8(%rsp)
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x5d12(%rip), %rsi      # 0xa156
callq 0x5ae0
movb %al, 0x167(%rsp)
jmp 0x4452
movb 0x167(%rsp), %al
testb $0x1, %al
jne 0x4499
jmp 0x445f
movslq 0x5d8(%rsp), %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rdi
leaq 0x5cdb(%rip), %rsi      # 0xa159
callq 0x5ae0
movb %al, 0x166(%rsp)
jmp 0x448c
movb 0x166(%rsp), %al
testb $0x1, %al
jne 0x4499
jmp 0x4502
movslq 0x5d8(%rsp), %rax
movq %rax, 0x158(%rsp)
leaq 0x5e0(%rsp), %rdi
callq 0x5ac0
movq %rax, %rcx
movq 0x158(%rsp), %rax
cmpq %rcx, %rax
jae 0x4502
movl 0x5d8(%rsp), %eax
incl %eax
movslq %eax, %rsi
leaq 0x5e0(%rsp), %rdi
callq 0x5b10
movq %rax, %rsi
leaq 0x610(%rsp), %rdi
callq 0x2050
jmp 0x44f1
movl 0x5d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5d8(%rsp)
movl 0x5d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5d8(%rsp)
jmp 0x3e1b
movq $0x1, 0x5c8(%rsp)
movq 0x5c8(%rsp), %rax
movl 0x644(%rsp), %ecx
cmpq %rcx, %rax
ja 0x52be
leaq 0x598(%rsp), %rdi
callq 0x5b30
leaq 0x580(%rsp), %rdi
movq %rdi, 0x150(%rsp)
callq 0x5b40
movq 0x150(%rsp), %rdi
movl 0x634(%rsp), %esi
movl 0x5c8(%rsp), %edx
movzbl 0x633(%rsp), %ecx
andl $0x1, %ecx
callq 0x3920
jmp 0x4586
movq 0x9a3b(%rip), %rdi      # 0xdfc8
leaq 0x5bce(%rip), %rsi      # 0xa162
callq 0x2200
movq %rax, 0x148(%rsp)
jmp 0x45a3
movq 0x148(%rsp), %rdi
movq 0x5c8(%rsp), %rsi
callq 0x2090
movq %rax, 0x140(%rsp)
jmp 0x45c2
movq 0x140(%rsp), %rdi
leaq 0x5ba5(%rip), %rsi      # 0xa176
callq 0x2200
movq %rax, 0x138(%rsp)
jmp 0x45e0
movq 0x138(%rsp), %rdi
movb 0x633(%rsp), %cl
leaq 0x5b95(%rip), %rax      # 0xa18b
leaq 0x5b9b(%rip), %rsi      # 0xa198
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x2200
movq %rax, 0x130(%rsp)
jmp 0x4613
movq 0x130(%rsp), %rdi
movq 0x998e(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x4629
movq 0x9998(%rip), %rdi      # 0xdfc8
leaq 0x5b76(%rip), %rsi      # 0xa1ad
callq 0x2200
movq %rax, 0x128(%rsp)
jmp 0x4646
movq 0x128(%rsp), %rdi
movl $0x8, %esi
callq 0x2090
movq %rax, 0x120(%rsp)
jmp 0x4662
movq 0x120(%rsp), %rdi
movq 0x993f(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x4678
movq 0x9949(%rip), %rdi      # 0xdfc8
leaq 0x5b3a(%rip), %rsi      # 0xa1c0
callq 0x2200
movq %rax, 0x118(%rsp)
jmp 0x4695
movq 0x118(%rsp), %rdi
movq 0x638(%rsp), %rsi
callq 0x2090
movq %rax, 0x110(%rsp)
jmp 0x46b4
movq 0x110(%rsp), %rdi
movq 0x98ed(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x46ca
movq 0x98f7(%rip), %rdi      # 0xdfc8
leaq 0x5aef(%rip), %rsi      # 0xa1c7
callq 0x2200
movq %rax, 0x108(%rsp)
jmp 0x46e7
movq 0x108(%rsp), %rdi
movl 0x634(%rsp), %esi
callq 0x2280
movq %rax, 0x100(%rsp)
jmp 0x4705
movq 0x100(%rsp), %rdi
movq 0x989c(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x471b
movq 0x98a6(%rip), %rdi      # 0xdfc8
leaq 0x5aa5(%rip), %rsi      # 0xa1ce
callq 0x2200
movq %rax, 0xf8(%rsp)
jmp 0x4738
movq 0xf8(%rsp), %rdi
movq 0x9869(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x474e
movq 0x638(%rsp), %rax
movq %rax, 0xe8(%rsp)
leaq 0x55f(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
callq 0x2350
movq 0xf0(%rsp), %rdx
leaq 0x58ad(%rip), %rsi      # 0xa02f
leaq 0x560(%rsp), %rdi
callq 0x2290
jmp 0x4791
movq 0xe8(%rsp), %rdi
movq 0x9830(%rip), %rsi      # 0xdfd0
leaq 0x580(%rsp), %rdx
leaq 0x598(%rsp), %rcx
leaq 0x560(%rsp), %r8
callq 0x5b50
jmp 0x47bf
leaq 0x560(%rsp), %rdi
callq 0x2150
leaq 0x55f(%rsp), %rdi
callq 0x2250
movl $0x0, 0x558(%rsp)
cmpl $0x3, 0x558(%rsp)
jge 0x4e45
movq 0x638(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0x537(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0x2350
movq 0xe0(%rsp), %rdx
leaq 0x59b1(%rip), %rsi      # 0xa1d7
leaq 0x538(%rsp), %rdi
callq 0x2290
jmp 0x4835
movq 0xd8(%rsp), %rdi
leaq -0x1d34(%rip), %rsi     # 0x2b10
leaq 0x580(%rsp), %rdx
leaq 0x598(%rsp), %rcx
leaq 0x538(%rsp), %r8
callq 0x60e0
jmp 0x4863
leaq 0x538(%rsp), %rdi
callq 0x2150
leaq 0x537(%rsp), %rdi
callq 0x2250
testb $0x1, 0x632(%rsp)
je 0x4a0f
movq 0x638(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0x50f(%rsp), %rdi
movq %rdi, 0xd0(%rsp)
callq 0x2350
movq 0xd0(%rsp), %rdx
leaq 0x5927(%rip), %rsi      # 0xa1e6
leaq 0x510(%rsp), %rdi
callq 0x2290
jmp 0x48ce
movq 0xc8(%rsp), %rdi
movq 0x96e3(%rip), %rsi      # 0xdfc0
leaq 0x580(%rsp), %rdx
leaq 0x598(%rsp), %rcx
leaq 0x510(%rsp), %r8
callq 0x60e0
jmp 0x48fc
leaq 0x510(%rsp), %rdi
callq 0x2150
leaq 0x50f(%rsp), %rdi
callq 0x2250
jmp 0x4ae5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x52a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x496b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x560(%rsp), %rdi
callq 0x2150
leaq 0x55f(%rsp), %rdi
callq 0x2250
jmp 0x52a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x49b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x538(%rsp), %rdi
callq 0x2150
leaq 0x537(%rsp), %rdi
callq 0x2250
jmp 0x52a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x49fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x510(%rsp), %rdi
callq 0x2150
leaq 0x50f(%rsp), %rdi
callq 0x2250
jmp 0x52a2
movq 0x638(%rsp), %rax
movq %rax, 0xb8(%rsp)
leaq 0x4e7(%rsp), %rdi
movq %rdi, 0xc0(%rsp)
callq 0x2350
movq 0xc0(%rsp), %rdx
leaq 0x57b2(%rip), %rsi      # 0xa1f5
leaq 0x4e8(%rsp), %rdi
callq 0x2290
jmp 0x4a52
movq 0xb8(%rsp), %rdi
movq 0x956f(%rip), %rsi      # 0xdfd0
leaq 0x580(%rsp), %rdx
leaq 0x598(%rsp), %rcx
leaq 0x4e8(%rsp), %r8
callq 0x5b50
jmp 0x4a80
leaq 0x4e8(%rsp), %rdi
callq 0x2150
leaq 0x4e7(%rsp), %rdi
callq 0x2250
jmp 0x4ae5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x4ad3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x4e8(%rsp), %rdi
callq 0x2150
leaq 0x4e7(%rsp), %rdi
callq 0x2250
jmp 0x52a2
movq 0x638(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0x4bf(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
callq 0x2350
movq 0xb0(%rsp), %rdx
leaq 0x56eb(%rip), %rsi      # 0xa204
leaq 0x4c0(%rsp), %rdi
callq 0x2290
jmp 0x4b28
movq 0xa8(%rsp), %rdi
leaq -0x2657(%rip), %rsi     # 0x24e0
leaq 0x580(%rsp), %rdx
leaq 0x598(%rsp), %rcx
leaq 0x4c0(%rsp), %r8
callq 0x60e0
jmp 0x4b56
leaq 0x4c0(%rsp), %rdi
callq 0x2150
leaq 0x4bf(%rsp), %rdi
callq 0x2250
movq 0x638(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x497(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x2350
movq 0xa0(%rsp), %rdx
leaq 0x566f(%rip), %rsi      # 0xa213
leaq 0x498(%rsp), %rdi
callq 0x2290
jmp 0x4bb3
movq 0x98(%rsp), %rdi
leaq -0x2572(%rip), %rsi     # 0x2650
leaq 0x580(%rsp), %rdx
leaq 0x598(%rsp), %rcx
leaq 0x498(%rsp), %r8
callq 0x60e0
jmp 0x4be1
leaq 0x498(%rsp), %rdi
callq 0x2150
leaq 0x497(%rsp), %rdi
callq 0x2250
movq 0x638(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x46f(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x2350
movq 0x90(%rsp), %rdx
leaq 0x55f3(%rip), %rsi      # 0xa222
leaq 0x470(%rsp), %rdi
callq 0x2290
jmp 0x4c3e
movq 0x88(%rsp), %rdi
leaq -0x249d(%rip), %rsi     # 0x27b0
leaq 0x580(%rsp), %rdx
leaq 0x598(%rsp), %rcx
leaq 0x470(%rsp), %r8
callq 0x60e0
jmp 0x4c6c
leaq 0x470(%rsp), %rdi
callq 0x2150
leaq 0x46f(%rsp), %rdi
callq 0x2250
movq 0x638(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x447(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x2350
movq 0x80(%rsp), %rdx
leaq 0x557a(%rip), %rsi      # 0xa231
leaq 0x448(%rsp), %rdi
callq 0x2290
jmp 0x4cc6
movq 0x78(%rsp), %rdi
leaq -0x23b2(%rip), %rsi     # 0x2920
leaq 0x580(%rsp), %rdx
leaq 0x598(%rsp), %rcx
leaq 0x448(%rsp), %r8
callq 0x60e0
jmp 0x4cf1
leaq 0x448(%rsp), %rdi
callq 0x2150
leaq 0x447(%rsp), %rdi
callq 0x2250
movl 0x558(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x558(%rsp)
jmp 0x47e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x4d58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x4c0(%rsp), %rdi
callq 0x2150
leaq 0x4bf(%rsp), %rdi
callq 0x2250
jmp 0x52a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x4da1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x498(%rsp), %rdi
callq 0x2150
leaq 0x497(%rsp), %rdi
callq 0x2250
jmp 0x52a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x4dea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x470(%rsp), %rdi
callq 0x2150
leaq 0x46f(%rsp), %rdi
callq 0x2250
jmp 0x52a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
jmp 0x4e33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x448(%rsp), %rdi
callq 0x2150
leaq 0x447(%rsp), %rdi
callq 0x2250
jmp 0x52a2
leaq 0x598(%rsp), %rax
movq %rax, 0x438(%rsp)
movq 0x438(%rsp), %rdi
callq 0x6650
movq %rax, 0x430(%rsp)
movq 0x438(%rsp), %rdi
callq 0x6680
movq %rax, 0x428(%rsp)
leaq 0x430(%rsp), %rdi
leaq 0x428(%rsp), %rsi
callq 0x66b0
testb $0x1, %al
jne 0x4e9d
jmp 0x4f74
leaq 0x430(%rsp), %rdi
callq 0x66d0
movq %rax, 0x420(%rsp)
movq 0x910f(%rip), %rdi      # 0xdfc8
leaq 0x5380(%rip), %rsi      # 0xa240
callq 0x2200
movq %rax, 0x70(%rsp)
jmp 0x4ecc
movq 0x70(%rsp), %rdi
movq 0x420(%rsp), %rsi
callq 0x21d0
movq %rax, 0x68(%rsp)
jmp 0x4ee5
movq 0x68(%rsp), %rdi
leaq 0x5356(%rip), %rsi      # 0xa247
callq 0x2200
movq %rax, 0x60(%rsp)
jmp 0x4efd
movl $0xb, %edi
callq 0x66f0
movl %eax, 0x5c(%rsp)
jmp 0x4f0d
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0x41c(%rsp)
movl 0x41c(%rsp), %esi
callq 0x2270
movq %rax, 0x50(%rsp)
jmp 0x4f30
movq 0x50(%rsp), %rdi
movq 0x420(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x21e0
movq %rax, 0x48(%rsp)
jmp 0x4f4d
movq 0x48(%rsp), %rdi
movq 0x9057(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x4f60
jmp 0x4f62
leaq 0x430(%rsp), %rdi
callq 0x6710
jmp 0x4e7f
leaq 0x610(%rsp), %rdi
callq 0x22d0
cmpq $0x0, %rax
jbe 0x5242
leaq 0x610(%rsp), %rdi
callq 0x20f0
movq %rax, 0x38(%rsp)
movl $0x1, %edi
movl $0x10, %esi
callq 0x6740
movl %eax, 0x44(%rsp)
jmp 0x4fb2
movl 0x44(%rsp), %edx
movq 0x38(%rsp), %rsi
leaq 0x218(%rsp), %rdi
callq 0x2260
jmp 0x4fca
movq 0x218(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x218(%rsp,%rax), %rdi
callq 0x2030
movb %al, 0x37(%rsp)
jmp 0x4fe9
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x5233
jmp 0x4ff7
cmpq $0x1, 0x5c8(%rsp)
jne 0x5122
leaq 0x523e(%rip), %rsi      # 0xa24b
leaq 0x218(%rsp), %rdi
callq 0x2200
jmp 0x501c
leaq 0x598(%rsp), %rax
movq %rax, 0x210(%rsp)
movq 0x210(%rsp), %rdi
callq 0x6650
movq %rax, 0x208(%rsp)
movq 0x210(%rsp), %rdi
callq 0x6680
movq %rax, 0x200(%rsp)
leaq 0x208(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0x66b0
testb $0x1, %al
jne 0x5074
jmp 0x510a
leaq 0x208(%rsp), %rdi
callq 0x66d0
movq %rax, 0x1f8(%rsp)
leaq 0x51d2(%rip), %rsi      # 0xa262
leaq 0x218(%rsp), %rdi
callq 0x2200
movq %rax, 0x28(%rsp)
jmp 0x50a4
movq 0x28(%rsp), %rdi
movq 0x1f8(%rsp), %rsi
callq 0x21d0
movq %rax, 0x20(%rsp)
jmp 0x50bd
movq 0x20(%rsp), %rdi
leaq 0x519a(%rip), %rsi      # 0xa263
callq 0x2200
jmp 0x50d0
jmp 0x50d2
leaq 0x208(%rsp), %rdi
callq 0x6710
jmp 0x5056
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x600(%rsp)
movl %eax, 0x5fc(%rsp)
leaq 0x218(%rsp), %rdi
callq 0x22c0
jmp 0x52a2
movq 0x8e9f(%rip), %rsi      # 0xdfb0
leaq 0x218(%rsp), %rdi
callq 0x2230
jmp 0x5120
jmp 0x5122
movq 0x5c8(%rsp), %rsi
leaq 0x218(%rsp), %rdi
callq 0x2090
movq %rax, 0x18(%rsp)
jmp 0x513e
movq 0x18(%rsp), %rdi
leaq 0x511b(%rip), %rsi      # 0xa265
callq 0x2200
movq %rax, 0x10(%rsp)
jmp 0x5156
movq 0x10(%rsp), %rdi
movzbl 0x633(%rsp), %esi
andl $0x1, %esi
callq 0x2330
jmp 0x516d
leaq 0x598(%rsp), %rax
movq %rax, 0x1f0(%rsp)
movq 0x1f0(%rsp), %rdi
callq 0x6650
movq %rax, 0x1e8(%rsp)
movq 0x1f0(%rsp), %rdi
callq 0x6680
movq %rax, 0x1e0(%rsp)
leaq 0x1e8(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x66b0
testb $0x1, %al
jne 0x51c2
jmp 0x521b
leaq 0x1e8(%rsp), %rdi
callq 0x66d0
movq %rax, 0x1d8(%rsp)
leaq 0x5087(%rip), %rsi      # 0xa265
leaq 0x218(%rsp), %rdi
callq 0x2200
movq %rax, 0x8(%rsp)
jmp 0x51f2
movq 0x8(%rsp), %rdi
movq 0x1d8(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x21e0
jmp 0x520a
jmp 0x520c
leaq 0x1e8(%rsp), %rdi
callq 0x6710
jmp 0x51a7
movq 0x8d8e(%rip), %rsi      # 0xdfb0
leaq 0x218(%rsp), %rdi
callq 0x2230
jmp 0x5231
jmp 0x5233
leaq 0x218(%rsp), %rdi
callq 0x22c0
jmp 0x526f
movq 0x8d7f(%rip), %rdi      # 0xdfc8
leaq 0x5017(%rip), %rsi      # 0xa267
callq 0x2200
movq %rax, (%rsp)
jmp 0x525b
movq (%rsp), %rdi
movq 0x8d4a(%rip), %rsi      # 0xdfb0
callq 0x2230
jmp 0x526d
jmp 0x526f
leaq 0x580(%rsp), %rdi
callq 0x5630
leaq 0x598(%rsp), %rdi
callq 0x6760
movq 0x5c8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x5c8(%rsp)
jmp 0x4524
leaq 0x580(%rsp), %rdi
callq 0x5630
leaq 0x598(%rsp), %rdi
callq 0x6760
jmp 0x52fd
movl $0x0, 0x654(%rsp)
movl $0x1, 0x5d4(%rsp)
leaq 0x5e0(%rsp), %rdi
callq 0x5630
leaq 0x610(%rsp), %rdi
callq 0x2150
movl 0x654(%rsp), %eax
addq $0x658, %rsp            # imm = 0x658
retq
leaq 0x5e0(%rsp), %rdi
callq 0x5630
leaq 0x610(%rsp), %rdi
callq 0x2150
movq 0x600(%rsp), %rdi
callq 0x2340
nopw %cs:(%rax,%rax)
nop