// File: conp-solutions[P]cnfmiter/Main.cc
// Function: main
int main(int argc, char **argv)
{
    int opt;
    int tseitin = 0;
    int randmom_drop = 0;
    std::cerr << "c CNFmiter generates a CNF formula " << std::endl
              << "c which is unsatisfiable, if the given 2 formulas are equivalent" << std::endl;


    // Retrieve the options:
    while ((opt = getopt(argc, argv, "r:t:")) != -1) { // for each option...
        switch (opt) {
        case 'r':
            randmom_drop = atoi(optarg);
            std::cerr << "c randomly drop " << randmom_drop << " clauses from first formula" << std::endl;
            break;
        case 't':
            tseitin = atoi(optarg);
            std::cerr << "c set tseitin variable to " << tseitin << std::endl;
            break;
        case '?': // unknown option...
            std::cerr << "c unknown option: '" << char(optopt) << "'!" << std::endl;
            exit(1);
            break;
        }
    }

    if (optind + 2 != argc) {
        std::cerr << "not enough parameters, abort!" << std::endl;
        return 1;
    }

    std::string fn1 = (argv[optind + 0]);
    std::string fn2 = (argv[optind + 1]);
    gzFile in1 = gzopen(fn1.c_str(), "rb");
    gzFile in2 = gzopen(fn2.c_str(), "rb");

    if (!in1) {
        std::cerr << "failed to open first file, abort!" << std::endl;
        return 1;
    }
    if (!in2) {
        std::cerr << "failed to open second file, abort!" << std::endl;
        return 1;
    }
    if (tseitin < 0) {
        std::cerr << "tseitin variable negative, abort" << std::endl;
        return 1;
    }
    if (randmom_drop < 0) {
        std::cerr << "random_drop value negative, abort" << std::endl;
        return 1;
    }

    Formula f1, f2;

    parse_DIMACS(in1, f1);
    gzclose(in1);

    parse_DIMACS(in2, f2);
    gzclose(in2);

    std::cerr << "c Parsed formulas 1 with " << f1.nVars() << " vars and " << f1.clauses.size()
              << " and formulas 2 with " << f2.nVars() << " vars and " << f2.clauses.size() << std::endl;

    if (randmom_drop > 0) {
        srand(1234);
        for (int i = 0; i < randmom_drop && f1.clauses.size() > 0; ++i) {
            size_t p = rand() % f1.clauses.size();
            f1.clauses[p] = f1.clauses.back();
            f1.clauses.pop_back();
        }
    }

    Formula miter;

    Var maxV = f1.nVars() > f2.nVars() ? f1.nVars() : f2.nVars();
    if (tseitin > 0) {
        int offset = tseitin;
        offset = maxV > tseitin ? maxV - tseitin : 0;
        std::cerr << "c offset " << offset << " tseitin: " << tseitin << " maxV: " << maxV << std::endl;
        assert(offset == 0 || f2.nVars() <= tseitin || f2.nVars() + offset > f1.nVars());

        rewrite_variable_range(f2, tseitin, offset);

        maxV = f1.nVars() > f2.nVars() ? f1.nVars() : f2.nVars();

        while (f1.nVars() < maxV) f1.newVar();
        while (f2.nVars() < maxV) f2.newVar();

        exchange_definition_clauses(f1, f2, tseitin);
    }

    maxV = f1.nVars() > f2.nVars() ? f1.nVars() : f2.nVars();
    while (miter.nVars() < maxV) miter.newVar();

    std::cerr << "c Miter base formulas reserved " << miter.nVars() << " variables" << std::endl;

    generate_formula_miter(miter, f1, f2);

    std::size_t found = fn1.rfind("/");
    if (found != std::string::npos) fn1 = fn1.erase(0, found + 1);
    found = fn2.rfind("/");
    if (found != std::string::npos) fn2 = fn2.erase(0, found + 1);

    std::stringstream s;
    s << fn1 << " and " << fn2;
    if (tseitin != 0) s << " with tseitin base variable " << tseitin;
    if (randmom_drop) s << " with randomly dropping " << randmom_drop;
    print_formula(miter, s.str());

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq 0x8e02(%rip), %rdi      # 0xbff0
leaq 0x4ef9(%rip), %rsi      # 0x80ee
callq 0x2190
movq %rax, %rdi
movq 0x8d94(%rip), %rsi      # 0xbf98
callq 0x21b0
movq %rax, %rdi
leaq 0x4eff(%rip), %rsi      # 0x8112
callq 0x2190
movq %rax, %rdi
movq 0x8d76(%rip), %rsi      # 0xbf98
callq 0x21b0
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x4f1e(%rip), %rdx      # 0x8153
callq 0x2050
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0x335f
movl -0x14(%rbp), %eax
movl %eax, -0x2c4(%rbp)
subl $0x3f, %eax
je 0x330b
jmp 0x325a
movl -0x2c4(%rbp), %eax
subl $0x72, %eax
je 0x3277
jmp 0x3267
movl -0x2c4(%rbp), %eax
subl $0x74, %eax
je 0x32ca
jmp 0x335a
movq 0x8d22(%rip), %rax      # 0xbfa0
movq (%rax), %rdi
callq 0x2240
movl %eax, -0x1c(%rbp)
movq 0x8d60(%rip), %rdi      # 0xbff0
leaq 0x4ec1(%rip), %rsi      # 0x8158
callq 0x2190
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x22a0
movq %rax, %rdi
leaq 0x4eb8(%rip), %rsi      # 0x8169
callq 0x2190
movq %rax, %rdi
movq 0x8cd8(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x335a
movq 0x8ccf(%rip), %rax      # 0xbfa0
movq (%rax), %rdi
callq 0x2240
movl %eax, -0x18(%rbp)
movq 0x8d0d(%rip), %rdi      # 0xbff0
leaq 0x4e9b(%rip), %rsi      # 0x8185
callq 0x2190
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x22a0
movq %rax, %rdi
movq 0x8c94(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x335a
movq 0x8cde(%rip), %rdi      # 0xbff0
leaq 0x4e87(%rip), %rsi      # 0x81a0
callq 0x2190
movq %rax, %rdi
movq 0x8c88(%rip), %rax      # 0xbfb0
movl (%rax), %eax
movsbl %al, %esi
callq 0x21d0
movq %rax, %rdi
leaq 0x4e78(%rip), %rsi      # 0x81b4
callq 0x2190
movq %rax, %rdi
movq 0x8c4d(%rip), %rsi      # 0xbf98
callq 0x21b0
movl $0x1, %edi
callq 0x21e0
jmp 0x3227
movq 0x8c6a(%rip), %rax      # 0xbfd0
movl (%rax), %eax
addl $0x2, %eax
cmpl -0x8(%rbp), %eax
je 0x339e
movq 0x8c79(%rip), %rdi      # 0xbff0
leaq 0x4e39(%rip), %rsi      # 0x81b7
callq 0x2190
movq %rax, %rdi
movq 0x8c0b(%rip), %rsi      # 0xbf98
callq 0x21b0
movl $0x1, -0x4(%rbp)
jmp 0x4007
movq -0x10(%rbp), %rax
movq 0x8c27(%rip), %rcx      # 0xbfd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x22c0
movq -0x2d8(%rbp), %rsi
movq -0x2d0(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x21f0
jmp 0x33e0
leaq -0x41(%rbp), %rdi
callq 0x21c0
movq -0x10(%rbp), %rax
movq 0x8bdc(%rip), %rcx      # 0xbfd0
movslq (%rcx), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x22c0
movq -0x2e8(%rbp), %rsi
movq -0x2e0(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x21f0
jmp 0x342c
leaq -0x79(%rbp), %rdi
callq 0x21c0
leaq -0x40(%rbp), %rdi
callq 0x20c0
movq %rax, %rdi
leaq 0x4d8d(%rip), %rsi      # 0x81d5
callq 0x2220
movq %rax, -0x2f0(%rbp)
jmp 0x3456
movq -0x2f0(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x20c0
movq %rax, %rdi
leaq 0x4d5e(%rip), %rsi      # 0x81d5
callq 0x2220
movq %rax, -0x2f8(%rbp)
jmp 0x3485
movq -0x2f8(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x88(%rbp)
jne 0x352d
movq 0x8b48(%rip), %rdi      # 0xbff0
leaq 0x4d29(%rip), %rsi      # 0x81d8
callq 0x2190
movq %rax, -0x300(%rbp)
jmp 0x34bd
movq -0x300(%rbp), %rdi
movq 0x8acd(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x34d2
movl $0x1, -0x4(%rbp)
movl $0x1, -0x94(%rbp)
jmp 0x3fdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x21c0
jmp 0x4013
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x21c0
jmp 0x3ffc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3ff3
cmpq $0x0, -0x90(%rbp)
jne 0x357e
movq 0x8ab2(%rip), %rdi      # 0xbff0
leaq 0x4cb5(%rip), %rsi      # 0x81fa
callq 0x2190
movq %rax, -0x308(%rbp)
jmp 0x3553
movq -0x308(%rbp), %rdi
movq 0x8a37(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x3568
movl $0x1, -0x4(%rbp)
movl $0x1, -0x94(%rbp)
jmp 0x3fdf
cmpl $0x0, -0x18(%rbp)
jge 0x35cb
movq 0x8a65(%rip), %rdi      # 0xbff0
leaq 0x4c8b(%rip), %rsi      # 0x821d
callq 0x2190
movq %rax, -0x310(%rbp)
jmp 0x35a0
movq -0x310(%rbp), %rdi
movq 0x89ea(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x35b5
movl $0x1, -0x4(%rbp)
movl $0x1, -0x94(%rbp)
jmp 0x3fdf
cmpl $0x0, -0x1c(%rbp)
jge 0x3618
movq 0x8a18(%rip), %rdi      # 0xbff0
leaq 0x4c5f(%rip), %rsi      # 0x823e
callq 0x2190
movq %rax, -0x318(%rbp)
jmp 0x35ed
movq -0x318(%rbp), %rdi
movq 0x899d(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x3602
movl $0x1, -0x4(%rbp)
movl $0x1, -0x94(%rbp)
jmp 0x3fdf
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x4ec0
leaq -0xd8(%rbp), %rdi
callq 0x4ec0
movq -0x320(%rbp), %rsi
movq -0x88(%rbp), %rdi
callq 0x4020
jmp 0x364c
movq -0x88(%rbp), %rdi
callq 0x2290
jmp 0x365a
movq -0x90(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4020
jmp 0x366f
movq -0x90(%rbp), %rdi
callq 0x2290
jmp 0x367d
movq 0x896c(%rip), %rdi      # 0xbff0
leaq 0x4bd5(%rip), %rsi      # 0x8260
callq 0x2190
movq %rax, -0x328(%rbp)
jmp 0x3699
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x32c(%rbp)
jmp 0x36ad
movl -0x32c(%rbp), %esi
movq -0x328(%rbp), %rdi
callq 0x22a0
movq %rax, -0x338(%rbp)
jmp 0x36c8
movq -0x338(%rbp), %rdi
leaq 0x4ba4(%rip), %rsi      # 0x827a
callq 0x2190
movq %rax, -0x340(%rbp)
jmp 0x36e4
leaq -0xb0(%rbp), %rdi
callq 0x4bc0
movq -0x340(%rbp), %rdi
movq %rax, %rsi
callq 0x2070
movq %rax, -0x348(%rbp)
jmp 0x3708
movq -0x348(%rbp), %rdi
leaq 0x4b6f(%rip), %rsi      # 0x8285
callq 0x2190
movq %rax, -0x350(%rbp)
jmp 0x3724
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x354(%rbp)
jmp 0x3738
movl -0x354(%rbp), %esi
movq -0x350(%rbp), %rdi
callq 0x22a0
movq %rax, -0x360(%rbp)
jmp 0x3753
movq -0x360(%rbp), %rdi
leaq 0x4b19(%rip), %rsi      # 0x827a
callq 0x2190
movq %rax, -0x368(%rbp)
jmp 0x376f
leaq -0xd0(%rbp), %rdi
callq 0x4bc0
movq -0x368(%rbp), %rdi
movq %rax, %rsi
callq 0x2070
movq %rax, -0x370(%rbp)
jmp 0x3793
movq -0x370(%rbp), %rdi
movq 0x87f7(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x37a8
cmpl $0x0, -0x1c(%rbp)
jle 0x38aa
movl $0x4d2, %edi            # imm = 0x4D2
callq 0x2170
movl $0x0, -0xdc(%rbp)
movl -0xdc(%rbp), %ecx
xorl %eax, %eax
cmpl -0x1c(%rbp), %ecx
movb %al, -0x371(%rbp)
jge 0x37f6
leaq -0xb8(%rbp), %rdi
addq $0x8, %rdi
callq 0x4bc0
cmpq $0x0, %rax
seta %al
movb %al, -0x371(%rbp)
movb -0x371(%rbp), %al
testb $0x1, %al
jne 0x3805
jmp 0x38a8
callq 0x2080
cltq
movq %rax, -0x390(%rbp)
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x388(%rbp)
callq 0x4bc0
movq -0x388(%rbp), %rdi
movq %rax, %rcx
movq -0x390(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, -0xe8(%rbp)
callq 0x4ef0
movq -0x388(%rbp), %rdi
movq %rax, -0x380(%rbp)
movq -0xe8(%rbp), %rsi
callq 0x4f30
movq -0x380(%rbp), %rsi
movq %rax, %rdi
callq 0x4600
jmp 0x3873
leaq -0xb8(%rbp), %rdi
addq $0x8, %rdi
callq 0x4f50
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0x37c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3fc5
jmp 0x38aa
leaq -0x108(%rbp), %rdi
callq 0x4ec0
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x394(%rbp)
jmp 0x38ca
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x398(%rbp)
jmp 0x38de
movl -0x394(%rbp), %eax
movl -0x398(%rbp), %ecx
cmpl %ecx, %eax
jle 0x3910
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x39c(%rbp)
jmp 0x3902
movl -0x39c(%rbp), %eax
movl %eax, -0x3a0(%rbp)
jmp 0x3932
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x3a4(%rbp)
jmp 0x3924
movl -0x3a4(%rbp), %eax
movl %eax, -0x3a0(%rbp)
jmp 0x3932
movl -0x3a0(%rbp), %eax
movl %eax, -0x10c(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0x3c22
movl -0x18(%rbp), %eax
movl %eax, -0x110(%rbp)
movl -0x10c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x396d
movl -0x10c(%rbp), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x3a8(%rbp)
jmp 0x3977
xorl %eax, %eax
movl %eax, -0x3a8(%rbp)
jmp 0x3977
movl -0x3a8(%rbp), %eax
movl %eax, -0x110(%rbp)
movq 0x8666(%rip), %rdi      # 0xbff0
leaq 0x490a(%rip), %rsi      # 0x829b
callq 0x2190
movq %rax, -0x3b0(%rbp)
jmp 0x399f
movq -0x3b0(%rbp), %rdi
movl -0x110(%rbp), %esi
callq 0x22a0
movq %rax, -0x3b8(%rbp)
jmp 0x39ba
movq -0x3b8(%rbp), %rdi
leaq 0x48dd(%rip), %rsi      # 0x82a5
callq 0x2190
movq %rax, -0x3c0(%rbp)
jmp 0x39d6
movq -0x3c0(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x22a0
movq %rax, -0x3c8(%rbp)
jmp 0x39ee
movq -0x3c8(%rbp), %rdi
leaq 0x48b4(%rip), %rsi      # 0x82b0
callq 0x2190
movq %rax, -0x3d0(%rbp)
jmp 0x3a0a
movq -0x3d0(%rbp), %rdi
movl -0x10c(%rbp), %esi
callq 0x22a0
movq %rax, -0x3d8(%rbp)
jmp 0x3a25
movq -0x3d8(%rbp), %rdi
movq 0x8565(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x3a3a
movb $0x1, %al
cmpl $0x0, -0x110(%rbp)
movb %al, -0x3d9(%rbp)
je 0x3ac5
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x3e0(%rbp)
jmp 0x3a5f
movl -0x3e0(%rbp), %ecx
movb $0x1, %al
cmpl -0x18(%rbp), %ecx
movb %al, -0x3d9(%rbp)
jle 0x3ac5
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x3e4(%rbp)
jmp 0x3a86
movl -0x3e4(%rbp), %eax
movl -0x110(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x3ec(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x3e8(%rbp)
jmp 0x3aae
movl -0x3ec(%rbp), %eax
movl -0x3e8(%rbp), %ecx
cmpl %ecx, %eax
setg %al
movb %al, -0x3d9(%rbp)
movb -0x3d9(%rbp), %al
testb $0x1, %al
jne 0x3ad1
jmp 0x3ad3
jmp 0x3b03
leaq 0x47de(%rip), %rdi      # 0x82b8
leaq 0x4820(%rip), %rsi      # 0x8301
movl $0xdc, %edx
leaq 0x481c(%rip), %rcx      # 0x8309
callq 0x2100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3fb9
movl -0x18(%rbp), %esi
movl -0x110(%rbp), %edx
leaq -0xd8(%rbp), %rdi
callq 0x2a10
jmp 0x3b1a
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x3f0(%rbp)
jmp 0x3b2e
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x3f4(%rbp)
jmp 0x3b42
movl -0x3f0(%rbp), %eax
movl -0x3f4(%rbp), %ecx
cmpl %ecx, %eax
jle 0x3b74
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x3f8(%rbp)
jmp 0x3b66
movl -0x3f8(%rbp), %eax
movl %eax, -0x3fc(%rbp)
jmp 0x3b96
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x400(%rbp)
jmp 0x3b88
movl -0x400(%rbp), %eax
movl %eax, -0x3fc(%rbp)
jmp 0x3b96
movl -0x3fc(%rbp), %eax
movl %eax, -0x10c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x404(%rbp)
jmp 0x3bb6
movl -0x404(%rbp), %eax
cmpl -0x10c(%rbp), %eax
jge 0x3bd4
leaq -0xb8(%rbp), %rdi
callq 0x4b30
jmp 0x3bd2
jmp 0x3ba2
jmp 0x3bd6
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x408(%rbp)
jmp 0x3bea
movl -0x408(%rbp), %eax
cmpl -0x10c(%rbp), %eax
jge 0x3c08
leaq -0xd8(%rbp), %rdi
callq 0x4b30
jmp 0x3c06
jmp 0x3bd6
movl -0x18(%rbp), %edx
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2cd0
jmp 0x3c20
jmp 0x3c22
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x40c(%rbp)
jmp 0x3c36
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x410(%rbp)
jmp 0x3c4a
movl -0x40c(%rbp), %eax
movl -0x410(%rbp), %ecx
cmpl %ecx, %eax
jle 0x3c7c
leaq -0xb8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x414(%rbp)
jmp 0x3c6e
movl -0x414(%rbp), %eax
movl %eax, -0x418(%rbp)
jmp 0x3c9e
leaq -0xd8(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x41c(%rbp)
jmp 0x3c90
movl -0x41c(%rbp), %eax
movl %eax, -0x418(%rbp)
jmp 0x3c9e
movl -0x418(%rbp), %eax
movl %eax, -0x10c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x420(%rbp)
jmp 0x3cbe
movl -0x420(%rbp), %eax
cmpl -0x10c(%rbp), %eax
jge 0x3cdc
leaq -0x108(%rbp), %rdi
callq 0x4b30
jmp 0x3cda
jmp 0x3caa
movq 0x830d(%rip), %rdi      # 0xbff0
leaq 0x4636(%rip), %rsi      # 0x8320
callq 0x2190
movq %rax, -0x428(%rbp)
jmp 0x3cf8
leaq -0x108(%rbp), %rdi
callq 0x4bb0
movl %eax, -0x42c(%rbp)
jmp 0x3d0c
movl -0x42c(%rbp), %esi
movq -0x428(%rbp), %rdi
callq 0x22a0
movq %rax, -0x438(%rbp)
jmp 0x3d27
movq -0x438(%rbp), %rdi
leaq 0x42fb(%rip), %rsi      # 0x8030
callq 0x2190
movq %rax, -0x440(%rbp)
jmp 0x3d43
movq -0x440(%rbp), %rdi
movq 0x8247(%rip), %rsi      # 0xbf98
callq 0x21b0
jmp 0x3d58
leaq -0x108(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
callq 0x2790
jmp 0x3d74
leaq 0x45c5(%rip), %rsi      # 0x8340
leaq -0x40(%rbp), %rdi
movq $-0x1, %rdx
callq 0x2280
movq %rax, -0x448(%rbp)
jmp 0x3d94
movq -0x448(%rbp), %rax
movq %rax, -0x118(%rbp)
cmpq $-0x1, -0x118(%rbp)
je 0x3de0
movq -0x118(%rbp), %rdx
incq %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x2060
movq %rax, -0x450(%rbp)
jmp 0x3dcc
movq -0x450(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2030
jmp 0x3dde
jmp 0x3de0
leaq 0x4559(%rip), %rsi      # 0x8340
leaq -0x78(%rbp), %rdi
movq $-0x1, %rdx
callq 0x2280
movq %rax, -0x458(%rbp)
jmp 0x3e00
movq -0x458(%rbp), %rax
movq %rax, -0x118(%rbp)
cmpq $-0x1, -0x118(%rbp)
je 0x3e4c
movq -0x118(%rbp), %rdx
incq %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x78(%rbp), %rdi
callq 0x2060
movq %rax, -0x460(%rbp)
jmp 0x3e38
movq -0x460(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x2030
jmp 0x3e4a
jmp 0x3e4c
leaq -0x2a0(%rbp), %rdi
callq 0x2110
jmp 0x3e5a
leaq -0x290(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x2150
movq %rax, -0x468(%rbp)
jmp 0x3e73
movq -0x468(%rbp), %rdi
leaq 0x41fd(%rip), %rsi      # 0x807e
callq 0x2190
movq %rax, -0x470(%rbp)
jmp 0x3e8f
movq -0x470(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2150
jmp 0x3ea1
cmpl $0x0, -0x18(%rbp)
je 0x3ee7
leaq -0x290(%rbp), %rdi
leaq 0x448d(%rip), %rsi      # 0x8342
callq 0x2190
movq %rax, -0x478(%rbp)
jmp 0x3ec3
movq -0x478(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x22a0
jmp 0x3ed4
jmp 0x3ee7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3fad
cmpl $0x0, -0x1c(%rbp)
je 0x3f1c
leaq -0x290(%rbp), %rdi
leaq 0x4464(%rip), %rsi      # 0x835f
callq 0x2190
movq %rax, -0x480(%rbp)
jmp 0x3f09
movq -0x480(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x22a0
jmp 0x3f1a
jmp 0x3f1c
leaq -0x2c0(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x2180
jmp 0x3f31
leaq -0x108(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x2f90
jmp 0x3f46
leaq -0x2c0(%rbp), %rdi
callq 0x20e0
movl $0x0, -0x4(%rbp)
movl $0x1, -0x94(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x2120
leaq -0x108(%rbp), %rdi
callq 0x4f80
leaq -0xd8(%rbp), %rdi
callq 0x4f80
leaq -0xb8(%rbp), %rdi
callq 0x4f80
jmp 0x3fdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x20e0
leaq -0x2a0(%rbp), %rdi
callq 0x2120
leaq -0x108(%rbp), %rdi
callq 0x4f80
leaq -0xd8(%rbp), %rdi
callq 0x4f80
leaq -0xb8(%rbp), %rdi
callq 0x4f80
jmp 0x3ff3
leaq -0x78(%rbp), %rdi
callq 0x20e0
leaq -0x40(%rbp), %rdi
callq 0x20e0
jmp 0x4007
leaq -0x78(%rbp), %rdi
callq 0x20e0
leaq -0x40(%rbp), %rdi
callq 0x20e0
jmp 0x4013
movl -0x4(%rbp), %eax
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x22b0
nopl (%rax)