// File: /workspace/github_cpp_makefile_star2_O3/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 $0x248, %rsp            # imm = 0x248
movq %rsi, %r14
movl %edi, %r15d
callq 0x52c0
cmpl $0x1, %r15d
jg 0x1cde9
movq 0xa24c(%rip), %rbx      # 0x26ff0
leaq 0x2cb3(%rip), %rsi      # 0x1fa5e
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 0x1d9f6
movq %rax, -0x68(%rbp)
movq 0x8(%r14), %rdi
leaq 0x2795(%rip), %rsi      # 0x1f58d
callq 0x5270
testq %rax, %rax
je 0x1ce88
movq %rax, %rbx
movl %r15d, %eax
movb $0x1, %r15b
xorl %ecx, %ecx
movq $0x0, -0x30(%rbp)
movq (%r14,%rcx,8), %rdx
cmpb $0x2d, (%rdx)
jne 0x1ce40
movb 0x1(%rdx), %dl
cmpb $0x76, %dl
sete %sil
movq -0x30(%rbp), %rdi
orb %sil, %dil
movq %rdi, -0x30(%rbp)
cmpb $0x6f, %dl
setne %dl
andb %dl, %r15b
incq %rcx
cmpq %rcx, %rax
jne 0x1ce19
movq 0xa179(%rip), %r13      # 0x26fc8
leaq 0x2c54(%rip), %rsi      # 0x1faaa
movl $0x13, %edx
movq %r13, %rdi
callq 0x5250
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x1ceca
movq %r12, %rdi
callq 0x5100
movq 0xa14d(%rip), %rdi      # 0x26fc8
movq %r12, %rsi
movq %rax, %rdx
callq 0x5250
jmp 0x1cee3
movq 0xa161(%rip), %rbx      # 0x26ff0
leaq 0x2c04(%rip), %rsi      # 0x1fa9a
movl $0xf, %edx
movq %rbx, %rdi
callq 0x5250
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x1da08
movq %r14, %rdi
callq 0x5100
movq 0xa131(%rip), %rdi      # 0x26ff0
movq %r14, %rsi
movq %rax, %rdx
jmp 0x1cdb3
movq (%r13), %rax
movq -0x18(%rax), %rax
leaq (%rax,%r13), %rdi
movl 0x20(%r13,%rax), %esi
orl $0x1, %esi
callq 0x5380
leaq 0x2bd4(%rip), %rax      # 0x1fabe
leaq 0x2be0(%rip), %rsi      # 0x1fad1
testb $0x1, %r15b
cmovneq %rax, %rsi
movl %r15d, %eax
notb %al
movzbl %al, %eax
andl $0x1, %eax
leaq (%rax,%rax,2), %rdx
addq $0x12, %rdx
movq %r13, %rdi
callq 0x5250
movq (%r13), %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
leaq 0x2ba4(%rip), %rsi      # 0x1fae7
movl $0xf, %edx
movq %r13, %rdi
callq 0x5250
movq (%r13), %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
leaq 0xa329(%rip), %rax      # 0x272a8
movq %rbx, (%rax)
callq 0x587c
leaq 0x2b69(%rip), %rsi      # 0x1faf7
movl $0xb, %edx
movq %r13, %rdi
callq 0x5250
movq (%r13), %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
leaq 0xa2ae(%rip), %r12      # 0x27278
movq (%r12), %rbx
testq %rbx, %rbx
jne 0x1d001
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
leaq 0x9311(%rip), %rax      # 0x262f8
addq $0x10, %rax
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
movq %rbx, (%r12)
leaq 0xa268(%rip), %r12      # 0x27270
movq (%r12), %r13
testq %r13, %r13
jne 0x1d041
movl $0x20, %edi
callq 0x51f0
movq %rax, %r13
leaq 0x95a3(%rip), %rax      # 0x265c8
addq $0x10, %rax
movq %rax, (%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r13)
movq $0x0, 0x18(%r13)
movq %r13, (%r12)
movl $0x18, %edi
callq 0x51f0
movq %rax, %r12
leaq 0xa22b(%rip), %rax      # 0x27280
movq (%rax), %rax
movq %r13, (%r12)
movq %rbx, 0x8(%r12)
movq %rax, 0x10(%r12)
testb $0x1, -0x30(%rbp)
movq 0x9f57(%rip), %r13      # 0x26fc8
je 0x1d11d
leaq 0x2a85(%rip), %rsi      # 0x1fb03
movl $0xd, %edx
movq %r13, %rdi
callq 0x5250
movq (%r13), %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
leaq -0x268(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd0e2
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r13, %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 -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d11d
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x5200
testb $0x1, %r15b
je 0x1d2d8
leaq 0x29e3(%rip), %rsi      # 0x1fb11
movl $0x18, %edx
movq %r13, %rdi
callq 0x5250
movq (%r13), %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
testb $0x1, -0x30(%rbp)
je 0x1d1d5
movq (%r13), %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
movl $0x8, %edi
callq 0x51f0
movq %r12, (%rax)
movq %rax, %rdi
movl $0x1, %esi
callq 0x19974
movq (%r13), %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
jmp 0x1d1ec
movl $0x8, %edi
callq 0x51f0
movq %r12, (%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0x19974
leaq 0x2904(%rip), %rsi      # 0x1faf7
movl $0xb, %edx
movq %r13, %rdi
callq 0x5250
movq (%r13), %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
testb $0x1, -0x30(%rbp)
je 0x1d2d8
leaq 0x28f1(%rip), %rsi      # 0x1fb2a
movl $0x17, %edx
movq %r13, %rdi
callq 0x5250
movq (%r13), %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
leaq -0x268(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd0e2
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r13, %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 -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d2d8
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x5200
movl $0x38, %edi
callq 0x51f0
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x1dc1e
leaq 0x284b(%rip), %rsi      # 0x1fb42
movl $0x11, %edx
movq 0x9cc5(%rip), %rbx      # 0x26fc8
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
testb $0x1, -0x30(%rbp)
je 0x1d35f
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
movzbl -0x30(%rbp), %esi
andl $0x1, %esi
movq %r13, %rdi
movl %esi, -0x5c(%rbp)
callq 0x16214
movq %rax, -0x58(%rbp)
movq 0x9c4c(%rip), %rbx      # 0x26fc8
leaq 0x2774(%rip), %rsi      # 0x1faf7
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 0x9c1a(%rip), %r13      # 0x26fc8
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, -0x30(%rbp)
je 0x1d42e
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0x9be5(%rip), %rdi      # 0x26fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq %rax, %rbx
leaq 0x275a(%rip), %rsi      # 0x1fb54
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 -0x268(%rbp), %rdi
callq 0x5390
movq 0x10(%r14), %rax
testq %rax, %rax
leaq 0x271a(%rip), %rsi      # 0x1fb62
cmovneq %rax, %rsi
leaq -0x268(%rbp), %rdi
movl $0x10, %edx
callq 0x5050
movq -0x58(%rbp), %rdi
callq 0x1a8b0
movq (%rax), %r14
movq 0x8(%rax), %rbx
cmpq %rbx, %r14
je 0x1d5aa
movq (%r14), %rdi
cmpb $0x0, 0x10(%rdi)
jne 0x1d5a1
testb $0x1, -0x30(%rbp)
je 0x1d532
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r13,%rax)
movq (%rdi), %rax
callq *0x8(%rax)
movq %r13, %rdi
movq %rax, %rsi
callq 0x50d0
movq %rax, %r12
movl $0x2, %edx
movq %rax, %rdi
leaq 0x21c7(%rip), %rsi      # 0x1f68f
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 0x1d532
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
testb $0x1, %r15b
jne 0x1d5a1
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 -0x268(%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 0x1d5a1
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
addq $0x8, %r14
jmp 0x1d46d
testb $0x1, %r15b
je 0x1d89c
movq 0x9a0d(%rip), %rbx      # 0x26fc8
leaq 0x25a6(%rip), %rsi      # 0x1fb68
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 0x99db(%rip), %rbx      # 0x26fc8
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, -0x30(%rbp)
je 0x1d62e
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0x99a7(%rip), %rdi      # 0x26fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
movl $0x8, %edi
callq 0x51f0
movq -0x58(%rbp), %rcx
movq %rcx, (%rax)
movq %rax, %rdi
movl -0x5c(%rbp), %esi
callq 0x1a200
movq -0x58(%rbp), %rdi
xorl %esi, %esi
callq 0x1a932
testb $0x1, -0x30(%rbp)
je 0x1d686
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0x994f(%rip), %rdi      # 0x26fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq 0x993b(%rip), %rbx      # 0x26fc8
leaq 0x2463(%rip), %rsi      # 0x1faf7
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 0x9909(%rip), %r14      # 0x26fc8
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5140
testb $0x1, -0x30(%rbp)
je 0x1d73e
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x51d0
movsbl %al, %esi
movq 0x98d5(%rip), %rdi      # 0x26fc8
callq 0x5030
movq %rax, %rdi
callq 0x5140
movq %rax, %rbx
leaq 0x2477(%rip), %rsi      # 0x1fb81
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 -0x58(%rbp), %rdi
callq 0x1a8b0
movq (%rax), %r12
movq 0x8(%rax), %r15
cmpq %r15, %r12
je 0x1d890
leaq -0x50(%rbp), %rbx
movq (%r12), %rsi
cmpb $0x0, 0x10(%rsi)
jne 0x1d883
testb $0x1, -0x30(%rbp)
je 0x1d81e
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r14,%rax)
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x8(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x50d0
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1edf(%rip), %rsi      # 0x1f68f
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 0x1d81a
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 -0x268(%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 0x1d883
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
addq $0x8, %r12
cmpq %r15, %r12
jne 0x1d75b
leaq -0x268(%rbp), %rdi
callq 0x52e0
callq 0x52c0
movq %rax, %rbx
cmpb $0x1, 0x9b07(%rip)      # 0x273b2
jne 0x1d93a
movq 0x9710(%rip), %rdi      # 0x26fc8
leaq 0x22da(%rip), %rsi      # 0x1fb99
movl $0x1e, %edx
callq 0x5250
subq -0x68(%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 0x96d6(%rip), %rdi      # 0x26fc8
callq 0x51c0
movq %rax, %rbx
leaq 0x22b7(%rip), %rsi      # 0x1fbb8
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 0x1d9be
movq 0x9687(%rip), %rdi      # 0x26fc8
leaq 0x2274(%rip), %rsi      # 0x1fbbc
movl $0x1d, %edx
callq 0x5250
subq -0x68(%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 0x964d(%rip), %rdi      # 0x26fc8
callq 0x51c0
movq %rax, %rbx
leaq 0x222e(%rip), %rsi      # 0x1fbb8
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 0x95f3(%rip), %rax      # 0x26fb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x260(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x268(%rbp,%rcx)
callq 0x51a0
leaq -0x170(%rbp), %rdi
callq 0x50b0
xorl %eax, %eax
addq $0x248, %rsp            # imm = 0x248
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 0x1cdb8
jmp 0x1da81
jmp 0x1da81
jmp 0x1da81
jmp 0x1da77
jmp 0x1da3b
movq %rax, %rbx
movl $0x38, %esi
movq %r13, %rdi
jmp 0x1da58
movq %rax, %rbx
leaq -0x258(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1da5d
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x5200
movq %rbx, %rdi
callq 0x53d0
jmp 0x1da81
jmp 0x1da81
jmp 0x1da81
jmp 0x1da81
jmp 0x1da81
jmp 0x1da81
jmp 0x1da81
jmp 0x1da81
jmp 0x1da81
movq %rdx, %r12
movq %rax, %rbx
jmp 0x1dab8
jmp 0x1da8d
movq %rdx, %r12
movq %rax, %rbx
jmp 0x1daac
jmp 0x1da8d
jmp 0x1da8d
movq %rdx, %r12
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1daac
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x5200
leaq -0x268(%rbp), %rdi
callq 0x5300
cmpl $0x2, %r12d
jne 0x1db6e
movq %rbx, %rdi
callq 0x52b0
leaq -0x258(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x268(%rbp), %rdi
callq 0x633e
movq %rbx, %rdi
callq 0x50f0
movq 0x94ce(%rip), %rdi      # 0x26fc8
leaq 0xa53(%rip), %rsi       # 0x1e554
movl $0x7, %edx
callq 0x5250
movq -0x268(%rbp), %rsi
movq -0x260(%rbp), %rdx
movq 0x94a8(%rip), %rdi      # 0x26fc8
callq 0x5250
movq %rax, %rdi
callq 0x5110
movq 0x9494(%rip), %rdi      # 0x26fc8
leaq 0xa2b(%rip), %rsi       # 0x1e566
movl $0xc, %edx
callq 0x5250
movq 0x947c(%rip), %rdi      # 0x26fc8
callq 0x5110
movq -0x268(%rbp), %rdi
cmpq %r14, %rdi
je 0x1dbd6
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x5200
jmp 0x1dbd6
cmpl $0x1, %r12d
jne 0x1da5d
movq %rbx, %rdi
callq 0x50f0
movq %rax, %rbx
movq 0x943e(%rip), %rdi      # 0x26fc8
leaq 0x9c3(%rip), %rsi       # 0x1e554
movl $0x7, %edx
callq 0x5250
movq 0x9426(%rip), %rdi      # 0x26fc8
movq %rbx, %rsi
callq 0x51e0
movq %rax, %rdi
callq 0x5110
movq 0x940f(%rip), %rdi      # 0x26fc8
leaq 0x9a6(%rip), %rsi       # 0x1e566
movl $0xc, %edx
callq 0x5250
movq 0x93f7(%rip), %rdi      # 0x26fc8
callq 0x5110
callq 0x5350
jmp 0x1cddf
movq %rax, %rbx
callq 0x5350
jmp 0x1da5d
movq %rax, %rbx
movq -0x268(%rbp), %rdi
cmpq %r14, %rdi
je 0x1dc0b
movq -0x258(%rbp), %rsi
incq %rsi
callq 0x5200
callq 0x5350
jmp 0x1da5d
movq %rax, %rdi
callq 0xeb19
nop