// File: /workspace/github_cpp_makefile_star2_O1/Bartor[P]kompilator/main.cpp
// Function: main
int main(int argc, char **argv) {
    std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();

    if (argc < 2) {
        std::cerr << "[i] Usage: compiler <source> [destination] [optimize=(0|1)]" << std::endl;
        return 1;
    }

    FILE *source = fopen(argv[1], "r");
    if (!source) {
        std::cerr << "[e] Can't open " << argv[1] << std::endl;
        return 1;
    }

    bool optimize = true, verbose = false;
    for (int i = 0; i < argc; i++) {
        if (argv[i][0] == '-' && argv[i][1] == 'v') verbose = true;
        if (argv[i][0] == '-' && argv[i][1] == 'o') optimize = false;
    }

    std::cout << "[i] Compiling file " << argv[1] << (optimize ? " with optimization" : " without optimization") << std::endl;

    std::cout << "[i] Parsing... " << std::endl;

    yyin = source;
    yyparse();

    std::cout << "   [i] done" << std::endl;

    if (commands == nullptr) commands = new CommandList();
    if (declarations == nullptr) declarations = new DeclarationList();

    Program *program = new Program(*declarations, *commands, *constants);

    if (verbose) std::cout << "-=- A S T -=-" << std::endl;
    if (verbose) std::cout << program->toString() << std::endl;

    if (optimize) {
        std::cout << "[i] AST Optimization... " << std::endl;
        if (verbose) std::cout << std::endl;
        ASTOptimizer *astOptimizer = new ASTOptimizer(program);
        astOptimizer->optimize(verbose);
        if (verbose) std::cout << std::endl;
        std::cout << "   [i] done" << std::endl;

        if (verbose) std::cout << "-=- OPTIMIZED A S T -=-" << std::endl;
        if (verbose) std::cout << program->toString() << std::endl;
    }

    AbstractAssembler *assembler = new AbstractAssembler(*program);

    std::cout << "[i] Compiling... " << std::endl;
    if (verbose) std::cout << std::endl;

    try {
        InstructionList &assembled = assembler->assemble(verbose);

        std::cout << "   [i] done" << std::endl;

        if (verbose) std::cout << std::endl << "-=- A S M -=-" << std::endl;

        std::ofstream output;
        output.open(argv[2] ? argv[2] : "a.out");

        for (const auto &ins : assembled.getInstructions()) {
            if (!ins->stub) {
                if (verbose) std::cout << std::setbase(10) << ins->getAddress() << ": " << ins->toAssemblyCode(true) << std::endl;
                if (!optimize) output << ins->toAssemblyCode(true) << std::endl;
            }
        }

        if (optimize) {
            std::cout << "[i] ASM Optimization... " << std::endl;
            if (verbose) std::cout << std::endl;
            PeepholeOptimizer *peepholeOptimizer = new PeepholeOptimizer(assembled);

            peepholeOptimizer->optimize(verbose);
            assembled.seal(false);

            if (verbose) std::cout << std::endl;
            std::cout << "   [i] done" << std::endl;

            if (verbose) std::cout << std::endl << "-=- OPTIMIZED A S M -=-" << std::endl;

            for (const auto &ins : assembled.getInstructions()) {
                if (!ins->stub) {
                    if (verbose) std::cout << std::setbase(10) << ins->getAddress() << ": " << ins->toAssemblyCode(true) << std::endl;
                    output << ins->toAssemblyCode(true) << std::endl;
                }
            }
            output.close();
        }

        std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();

        if (warning) {
            std::cout << "[w] Compiled with warnings in " << std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count() << " ms" << std::endl;

        } else {
            std::cout << "[i] Compiled successfully in " << std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count() << " ms" << std::endl;
        }

    } catch (std::string errorMessage) {
        std::cout << "   [e] " << errorMessage << std::endl;
        std::cout << "[e] Aborting" << std::endl;
        return 1;
    } catch (char const *errorMessage) {
        std::cout << "   [e] " << errorMessage << std::endl;
        std::cout << "[e] Aborting" << std::endl;
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, %r14
movl %edi, %r15d
callq 0x52c0
cmpl $0x1, %r15d
jg 0x1d201
movq 0xae34(%rip), %rbx      # 0x27ff0
leaq 0x38bb(%rip), %rsi      # 0x20a7e
movl $0x3b, %edx
movq %rbx, %rdi
callq 0x5250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x1, %eax
jmp 0x1de26
movq %rax, -0x60(%rbp)
movq 0x8(%r14), %rdi
leaq 0x338d(%rip), %rsi      # 0x2059d
callq 0x5270
testq %rax, %rax
je 0x1d2a7
movq %rax, -0x30(%rbp)
movl %r15d, %eax
movb $0x1, %r13b
xorl %ecx, %ecx
movl $0x1, %edx
xorl %esi, %esi
xorl %r15d, %r15d
movq (%r14,%rsi,8), %rdi
movb (%rdi), %r8b
cmpb $0x2d, %r8b
jne 0x1d24d
cmpb $0x76, 0x1(%rdi)
movzbl %r15b, %r15d
cmovel %edx, %r15d
cmpb $0x2d, %r8b
jne 0x1d25f
cmpb $0x6f, 0x1(%rdi)
movzbl %r13b, %r13d
cmovel %ecx, %r13d
incq %rsi
cmpq %rsi, %rax
jne 0x1d234
movq 0xad5a(%rip), %rbx      # 0x27fc8
leaq 0x3855(%rip), %rsi      # 0x20aca
movl $0x13, %edx
movq %rbx, %rdi
callq 0x5250
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x1d2e9
movq %r12, %rdi
callq 0x5100
movq 0xad2e(%rip), %rdi      # 0x27fc8
movq %r12, %rsi
movq %rax, %rdx
callq 0x5250
jmp 0x1d300
movq 0xad42(%rip), %rbx      # 0x27ff0
leaq 0x3805(%rip), %rsi      # 0x20aba
movl $0xf, %edx
movq %rbx, %rdi
callq 0x5250
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x1de38
movq %r14, %rdi
callq 0x5100
movq 0xad12(%rip), %rdi      # 0x27ff0
movq %r14, %rsi
movq %rax, %rdx
jmp 0x1d1cb
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x5380
leaq 0x37d7(%rip), %rax      # 0x20ade
leaq 0x37e3(%rip), %rsi      # 0x20af1
testb $0x1, %r13b
cmovneq %rax, %rsi
movl %r13d, %eax
notb %al
movzbl %al, %eax
andl $0x1, %eax
leaq (%rax,%rax,2), %rdx
addq $0x12, %rdx
movq %rbx, %rdi
callq 0x5250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq 0x37a8(%rip), %rsi      # 0x20b07
movl $0xf, %edx
movq %rbx, %rdi
callq 0x5250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq 0xaf0e(%rip), %rax      # 0x282a8
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
callq 0x588c
leaq 0x376a(%rip), %rsi      # 0x20b17
movl $0xb, %edx
movq %rbx, %rdi
callq 0x5250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq 0xae90(%rip), %rbx      # 0x28278
cmpq $0x0, (%rbx)
jne 0x1d418
movl $0x20, %edi
callq 0x51f0
leaq 0x9ec1(%rip), %rcx      # 0x272c0
addq $0x10, %rcx
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, (%rbx)
leaq 0xae51(%rip), %r12      # 0x28270
cmpq $0x0, (%r12)
jne 0x1d451
movl $0x20, %edi
callq 0x51f0
leaq 0xa159(%rip), %rcx      # 0x27590
addq $0x10, %rcx
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, (%r12)
movl $0x18, %edi
callq 0x51f0
movq (%r12), %rsi
movq (%rbx), %rcx
leaq 0xae17(%rip), %rdx      # 0x28280
movq (%rdx), %rdx
movq %rsi, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, -0x30(%rbp)
movq %rdx, 0x10(%rax)
testb $0x1, %r15b
movq 0xab42(%rip), %r12      # 0x27fc8
je 0x1d533
leaq 0x3690(%rip), %rsi      # 0x20b23
movl $0xd, %edx
movq %r12, %rdi
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq -0x260(%rbp), %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0xd208
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r12, %rdi
callq 0x5250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq -0x250(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d533
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x5200
testb $0x1, %r13b
je 0x1d6f7
leaq 0x35ed(%rip), %rsi      # 0x20b31
movl $0x18, %edx
movq %r12, %rdi
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, %r15b
je 0x1d5ef
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x8, %edi
callq 0x51f0
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq %rax, %rdi
movl $0x1, %esi
callq 0x19c3c
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
jmp 0x1d60a
movl $0x8, %edi
callq 0x51f0
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0x19c3c
leaq 0x3506(%rip), %rsi      # 0x20b17
movl $0xb, %edx
movq %r12, %rdi
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, %r15b
je 0x1d6f7
leaq 0x34f3(%rip), %rsi      # 0x20b4a
movl $0x17, %edx
movq %r12, %rdi
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq -0x260(%rbp), %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0xd208
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r12, %rdi
callq 0x5250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq -0x250(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d6f7
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x5200
movl $0x38, %edi
callq 0x51f0
movq %rax, %rbx
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x1e04c
leaq 0x344b(%rip), %rsi      # 0x20b62
movl $0x11, %edx
movq %r12, %rdi
callq 0x5250
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, %r15b
je 0x1d77a
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movzbl %r15b, %esi
andl $0x1, %esi
movq %rbx, %rdi
movl %esi, -0x54(%rbp)
callq 0x164a8
movq %rax, -0x30(%rbp)
movq 0xa831(%rip), %rbx      # 0x27fc8
leaq 0x3379(%rip), %rsi      # 0x20b17
movl $0xb, %edx
movq %rbx, %rdi
callq 0x5250
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0xa7ff(%rip), %rdi      # 0x27fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, %r15b
je 0x1d84c
movq 0xa7e5(%rip), %rcx      # 0x27fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0xa7c7(%rip), %rdi      # 0x27fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq %rax, %rbx
leaq 0x335c(%rip), %rsi      # 0x20b74
movl $0xd, %edx
movq %rax, %rdi
callq 0x5250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
leaq -0x260(%rbp), %rdi
callq 0x5390
movq 0x10(%r14), %rax
testq %rax, %rax
leaq 0x331c(%rip), %rsi      # 0x20b82
cmovneq %rax, %rsi
leaq -0x260(%rbp), %rdi
movl $0x10, %edx
callq 0x5050
movq -0x30(%rbp), %rdi
callq 0x1acaa
movq (%rax), %r14
movq 0x8(%rax), %rbx
cmpq %rbx, %r14
je 0x1d9d0
movq (%r14), %rdi
cmpb $0x0, 0x10(%rdi)
jne 0x1d9c7
testb $0x1, %r15b
je 0x1d958
movq 0xa716(%rip), %rdx      # 0x27fc8
movq (%rdx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rdx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rdx,%rax)
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xa6f4(%rip), %rdi      # 0x27fc8
movq %rax, %rsi
callq 0x50d0
movq %rax, %r12
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2db1(%rip), %rsi      # 0x2069f
callq 0x5250
movq (%r14), %rsi
movq (%rsi), %rax
leaq -0x50(%rbp), %rdi
movl $0x1, %edx
callq *0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x5250
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1d958
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
testb $0x1, %r13b
jne 0x1d9c7
movq (%r14), %rsi
movq (%rsi), %rax
leaq -0x50(%rbp), %rdi
movl $0x1, %edx
callq *0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x260(%rbp), %rdi
callq 0x5250
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1d9c7
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
addq $0x8, %r14
jmp 0x1d88b
testb $0x1, %r13b
je 0x1dccc
movq 0xa5e7(%rip), %rbx      # 0x27fc8
leaq 0x31a0(%rip), %rsi      # 0x20b88
movl $0x18, %edx
movq %rbx, %rdi
callq 0x5250
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0xa5b5(%rip), %rbx      # 0x27fc8
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, %r15b
je 0x1da54
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0xa581(%rip), %rdi      # 0x27fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x8, %edi
callq 0x51f0
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq %rax, %rdi
movl -0x54(%rbp), %esi
callq 0x1a530
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x1ad2c
testb $0x1, %r15b
je 0x1daac
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0xa529(%rip), %rdi      # 0x27fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq 0xa515(%rip), %rbx      # 0x27fc8
leaq 0x305d(%rip), %rsi      # 0x20b17
movl $0xb, %edx
movq %rbx, %rdi
callq 0x5250
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0xa4e3(%rip), %rdi      # 0x27fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, %r15b
je 0x1db68
movq 0xa4c9(%rip), %rcx      # 0x27fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0xa4ab(%rip), %rdi      # 0x27fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq %rax, %rbx
leaq 0x306d(%rip), %rsi      # 0x20ba1
movl $0x17, %edx
movq %rax, %rdi
callq 0x5250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq -0x30(%rbp), %rdi
callq 0x1acaa
movq (%rax), %r12
movq 0x8(%rax), %r14
cmpq %r14, %r12
je 0x1dcc0
leaq -0x50(%rbp), %rbx
movq (%r12), %rdi
cmpb $0x0, 0x10(%rdi)
jne 0x1dcb3
testb $0x1, %r15b
je 0x1dc4a
movq 0xa424(%rip), %rdx      # 0x27fc8
movq (%rdx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rdx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rdx,%rax)
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xa402(%rip), %rdi      # 0x27fc8
movq %rax, %rsi
callq 0x50d0
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2abf(%rip), %rsi      # 0x2069f
callq 0x5250
movq (%r12), %rsi
movq (%rsi), %rax
movq %rbx, %rdi
movl $0x1, %edx
callq *0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r13, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1dc4a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
movq (%r12), %rsi
movq (%rsi), %rax
movq %rbx, %rdi
movl $0x1, %edx
callq *0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x260(%rbp), %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1dcb3
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
addq $0x8, %r12
cmpq %r14, %r12
jne 0x1db85
leaq -0x260(%rbp), %rdi
callq 0x52e0
callq 0x52c0
movq %rax, %rbx
cmpb $0x1, 0xa6d7(%rip)      # 0x283b2
jne 0x1dd6a
movq 0xa2e0(%rip), %rdi      # 0x27fc8
leaq 0x2eca(%rip), %rsi      # 0x20bb9
movl $0x1e, %edx
callq 0x5250
subq -0x60(%rbp), %rbx
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %rbx, %rax
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq 0xa2a6(%rip), %rdi      # 0x27fc8
callq 0x51c0
movq %rax, %rbx
leaq 0x2ea7(%rip), %rsi      # 0x20bd8
movl $0x3, %edx
movq %rax, %rdi
callq 0x5250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
jmp 0x1ddee
movq 0xa257(%rip), %rdi      # 0x27fc8
leaq 0x2e64(%rip), %rsi      # 0x20bdc
movl $0x1d, %edx
callq 0x5250
subq -0x60(%rbp), %rbx
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %rbx, %rax
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq 0xa21d(%rip), %rdi      # 0x27fc8
callq 0x51c0
movq %rax, %rbx
leaq 0x2e1e(%rip), %rsi      # 0x20bd8
movl $0x3, %edx
movq %rax, %rdi
callq 0x5250
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq 0xa1c3(%rip), %rax      # 0x27fb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x258(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x260(%rbp,%rcx)
callq 0x51a0
leaq -0x168(%rbp), %rdi
callq 0x50b0
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x5380
jmp 0x1d1d0
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1dea7
jmp 0x1de6b
movq %rax, %r15
movl $0x38, %esi
movq %rbx, %rdi
jmp 0x1de88
movq %rax, %r15
leaq -0x250(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1de8d
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x5200
movq %r15, %rdi
callq 0x53d0
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1deb1
jmp 0x1deb1
movq %rdx, %rbx
movq %rax, %r15
jmp 0x1dee8
jmp 0x1debd
movq %rdx, %rbx
movq %rax, %r15
jmp 0x1dedc
jmp 0x1debd
jmp 0x1debd
movq %rdx, %rbx
movq %rax, %r15
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1dedc
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
leaq -0x260(%rbp), %rdi
callq 0x5300
cmpl $0x2, %ebx
jne 0x1df9d
movq %r15, %rdi
callq 0x52b0
leaq -0x250(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x260(%rbp), %rdi
callq 0x639e
movq %r15, %rdi
callq 0x50f0
movq 0xa09f(%rip), %rdi      # 0x27fc8
leaq 0x1624(%rip), %rsi      # 0x1f554
movl $0x7, %edx
callq 0x5250
movq -0x260(%rbp), %rsi
movq -0x258(%rbp), %rdx
movq 0xa079(%rip), %rdi      # 0x27fc8
callq 0x5250
movq %rax, %rdi
callq 0x5110
movq 0xa065(%rip), %rdi      # 0x27fc8
leaq 0x15fc(%rip), %rsi      # 0x1f566
movl $0xc, %edx
callq 0x5250
movq 0xa04d(%rip), %rdi      # 0x27fc8
callq 0x5110
movq -0x260(%rbp), %rdi
cmpq %rbx, %rdi
je 0x1e004
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x5200
jmp 0x1e004
cmpl $0x1, %ebx
jne 0x1de8d
movq %r15, %rdi
callq 0x50f0
movq %rax, %rbx
movq 0xa010(%rip), %rdi      # 0x27fc8
leaq 0x1595(%rip), %rsi      # 0x1f554
movl $0x7, %edx
callq 0x5250
movq 0x9ff8(%rip), %rdi      # 0x27fc8
movq %rbx, %rsi
callq 0x51e0
movq %rax, %rdi
callq 0x5110
movq 0x9fe1(%rip), %rdi      # 0x27fc8
leaq 0x1578(%rip), %rsi      # 0x1f566
movl $0xc, %edx
callq 0x5250
movq 0x9fc9(%rip), %rdi      # 0x27fc8
callq 0x5110
callq 0x5350
jmp 0x1d1f7
movq %rax, %r15
callq 0x5350
jmp 0x1de8d
movq %rax, %r15
movq -0x260(%rbp), %rdi
cmpq %rbx, %rdi
je 0x1e039
movq -0x250(%rbp), %rsi
incq %rsi
callq 0x5200
callq 0x5350
jmp 0x1de8d
movq %rax, %rdi
callq 0xec29
nop