// File: /workspace/github_cpp_makefile_star2_O2/canzarlab[P]Trajan/src/main.cpp
// Function: main
int main(int argc, char** argv)
{
    if (argc < 9 || argc > 14)
    {
        cout << "tree usage: " << argv[0] << " <filename.newick> <filename.newick> <align> <constraints> <weightfunc> <k> <vareps> <coneps> <solver>" << endl;
        cout << "dag usage: " << argv[0] << " <yeastnet> <mapping> <go> <align> <constraints> <weightfunc> <k> <solver>" << endl;
        cout << "tree usage (2): " << argv[0] << " <tree> <map> <tree> <map> <align> <constraints> <weightfunc> <k> <vareps> <coneps> <solver>" << endl;
        return EXIT_FAILURE;
    }
    // change the parser for cell hali inputs.
    if (argc == 14){
        costMatrixFileName = argv[5];
        outScoreFile = argv[6];
        argc = argc-2;
        for (int i = 5; i < 15; ++i){
            argv[i] = argv[i+2];
        }
    }
    if (argc == 13){
        costMatrixFileName = argv[5];
        argc = argc-1;
        for (int i = 5; i < 14; ++i){
            argv[i] = argv[i+1];
        }
    }

    Timer T;
    T.start();
    Graph *t1, *t2;
    if (stoi(argv[argc - 1]) == 2){
        // create two new tree.
        string t1fName   = argv[1];
        string t1MapfName = argv[2];
        string t2fName   = argv[3];
        string t2MapfName = argv[4];
        CSVReader t1_treeReader(t1fName, " ");
        vector<vector<string>> t1_tree = t1_treeReader.getStringData();
        CSVReader t1_mapReader(t1MapfName, " ");
        vector<vector<string>> t1_map = t1_mapReader.getStringData();
        
        CSVReader t2_treeReader(t2fName, " ");
        vector<vector<string>> t2_tree = t2_treeReader.getStringData();
        CSVReader t2_mapReader(t2MapfName, " ");
        vector<vector<string>> t2_map = t2_mapReader.getStringData();
        
        std::map<string, string> t1Node2Label;
        std::map<string, string> t1Label2Node;
        std::map<string, string> t2Node2Label;
        std::map<string, string> t2Label2Node;
        for (const auto &u: t1_map){
            t1Label2Node[u[0]] = u[1];
            t1Node2Label[u[1]] = u[0];
        }
        for (const auto &u: t2_map){
            t2Label2Node[u[0]] = u[1];
            t2Node2Label[u[1]] = u[0];
        }
        // change the nodes for tree.
        for (auto & u: t1_tree){
            u[0] = t1Node2Label[u[0]];
            u[1] = t1Node2Label[u[1]];
        }
        for (auto & u: t2_tree){
            u[0] = t2Node2Label[u[0]];
            u[1] = t2Node2Label[u[1]];
        }
        
        srand (time(NULL));
        string outDist = argv[5];
        // string redundantT1 = "redundant" + to_string(rand()) + outScoreFile+argv[5]+"doNotDeleteT1.ooo";
        // string redundantT2 = "redundant"+ to_string(rand()) + outScoreFile+argv[5]+"doNotDeleteT2.ooo";
        string redundantT1 = "redundant" + to_string(rand()) + SplitFilename(outScoreFile) + SplitFilename(outDist) +"doNotDeleteT1.ooo";
        string redundantT2 = "redundant"+ to_string(rand()) +  SplitFilename(outScoreFile) + SplitFilename(outDist) +"doNotDeleteT2.ooo";
        ofstream t1NewTree(redundantT1);
        for (auto & u: t1_tree){
            for (auto & v: u){
                t1NewTree << v << " ";
            }
            t1NewTree << endl;
        }
        t1NewTree.close();
        
        ofstream t2NewTree(redundantT2);
        for (auto & u: t2_tree){
            for (auto & v: u){
                t2NewTree << v << " ";
            }
            t2NewTree << endl;
        }
        t2NewTree.close();
        
        // argv[1] = const_cast<char*>(redundantT1);
        // argv[3] = const_cast<char*>(redundantT2);
        cout << redundantT1 << ", " << redundantT2 << endl;
        argv[1] = const_cast<char*>(redundantT1.c_str());
        argv[3] = const_cast<char*>(redundantT2.c_str());
        tie(t1, t2) = MakeGraphs(argc, argv);
        // remove files 
        // remove(redundantT1);
        // remove(redundantT2);
        Solver* solver = MakeSolver(*t1, *t2, argc, argv, t1Label2Node, t2Label2Node);
        if (solver) solver->Solve(argv[3 + (argc == 9) + 2 * (argc == 12)]);
        delete solver;
        delete t1;
        delete t2;
    }
    else
    {
        tie(t1, t2) = MakeGraphs(argc, argv);
        if (stoi(argv[argc - 1]) > 9)
        {
            int s = stoi(argv[argc - 1]);
            Solver::cf = stoi(argv[4 + (argc == 9) + 2 * (argc == 12)]);
            Solver::tt = argc == 12;
            string d = argv[5 + (argc == 9) + 2 * (argc == 12)];
            double k = stod(argv[6 + (argc == 9) + 2 * (argc == 12)]);
            double c = (s != 2) ? 0 : stod(argv[8 + 2 * (argc == 12)]);
            var_eps = (argc == 9) ? 0 : stod(argv[7 + 2 * (argc == 12)]);

            assert(LP::cf >= 0 && LP::cf <= 2);
            assert(d == "j" || d == "s" || d == "e");
            ParallelSolver(*t1, *t2, d, k, argc == 9, s - 9).Solve(argv[3 + (argc == 9) + 2 * (argc == 12)], outScoreFile);
        }
        else
        {
            std::map<string, string> redundantMap;
            Solver* solver = MakeSolver(*t1, *t2, argc, argv, redundantMap, redundantMap);
            if (solver) solver->Solve(argv[3 + (argc == 9) + 2 * (argc == 12)], outScoreFile);
            delete solver;
            delete t1;
            delete t2;
        }
    }
    
    T.stop();
    clog << "TIME: " << T.secs() << " secs" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9c8, %rsp            # imm = 0x9C8
movq %rsi, %rbx
movl %edi, %r14d
leal -0xf(%r14), %eax
cmpl $-0x7, %eax
ja 0xa3f1
movq 0x8cc5a(%rip), %r14     # 0x96fb0
leaq 0x46d9d(%rip), %rsi     # 0x510fa
movq %r14, %rdi
callq 0x9330
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x9330
leaq 0x46d90(%rip), %rsi     # 0x51107
movq %rax, %rdi
callq 0x9330
movq %rax, %rdi
callq 0x9170
leaq 0x46de0(%rip), %rsi     # 0x5116e
movq %r14, %rdi
callq 0x9330
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x9330
leaq 0x46dd2(%rip), %rsi     # 0x5117a
movq %rax, %rdi
callq 0x9330
movq %rax, %rdi
callq 0x9170
leaq 0x46e06(%rip), %rsi     # 0x511c5
movq %r14, %rdi
callq 0x9330
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x9330
leaq 0x46dfd(%rip), %rsi     # 0x511d6
movq %rax, %rdi
callq 0x9330
movq %rax, %rdi
callq 0x9170
pushq $0x1
popq %rax
jmp 0xb30a
movq %rbx, (%rsp)
pushq $0xc
popq %rbp
cmpl $0xd, %r14d
je 0xa43f
cmpl $0xe, %r14d
jne 0xa46d
movq (%rsp), %rbx
movq 0x28(%rbx), %rsi
leaq 0x8cf9d(%rip), %rdi     # 0x973b0
callq 0x96d0
movq 0x30(%rbx), %rsi
leaq 0x8cfad(%rip), %rdi     # 0x973d0
callq 0x96d0
xorl %eax, %eax
cmpq $0xa, %rax
je 0xa46a
movq 0x38(%rbx,%rax,8), %rcx
movq %rcx, 0x28(%rbx,%rax,8)
incq %rax
jmp 0xa42a
movq (%rsp), %rbx
movq 0x28(%rbx), %rsi
leaq 0x8cf62(%rip), %rdi     # 0x973b0
callq 0x96d0
pushq $0x6
popq %rax
cmpq $0xf, %rax
je 0xa46a
movq (%rbx,%rax,8), %rcx
movq %rcx, -0x8(%rbx,%rax,8)
incq %rax
jmp 0xa456
movl %ebp, %r14d
leaq 0x980(%rsp), %rdi
movb $0x0, 0x38(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
callq 0xb808
movl %r14d, %ebx
movq (%rsp), %r14
movq -0x8(%r14,%rbx,8), %rsi
leaq 0x400(%rsp), %rdi
leaq 0x780(%rsp), %rdx
callq 0xb7a6
leaq 0x400(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0xb789
movl %eax, %ebp
leaq 0x400(%rsp), %rdi
callq 0x9708
cmpl $0x2, %ebp
jne 0xa817
movq 0x8(%r14), %rsi
leaq 0x3e0(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
movq 0x10(%r14), %rsi
leaq 0x3c0(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
movq 0x18(%r14), %rsi
leaq 0x3a0(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
movq 0x20(%r14), %rsi
leaq 0x380(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
leaq 0x320(%rsp), %rdi
leaq 0x3e0(%rsp), %rsi
callq 0x9470
leaq 0x46d13(%rip), %rsi     # 0x51262
leaq 0x300(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
leaq 0x340(%rsp), %rdi
leaq 0x320(%rsp), %rsi
leaq 0x300(%rsp), %rdx
callq 0xb826
leaq 0x300(%rsp), %rdi
callq 0x9708
leaq 0x320(%rsp), %rdi
callq 0x9708
leaq 0x48(%rsp), %rdi
leaq 0x340(%rsp), %rsi
xorl %edx, %edx
movl $0xf4240, %ecx          # imm = 0xF4240
callq 0x4e878
leaq 0x2e0(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
callq 0x9470
leaq 0x46c92(%rip), %rsi     # 0x51262
leaq 0x2c0(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
leaq 0x740(%rsp), %rdi
leaq 0x2e0(%rsp), %rsi
leaq 0x2c0(%rsp), %rdx
callq 0xb826
leaq 0x2c0(%rsp), %rdi
callq 0x9708
leaq 0x2e0(%rsp), %rdi
callq 0x9708
leaq 0xe8(%rsp), %rdi
leaq 0x740(%rsp), %rsi
xorl %edx, %edx
movl $0xf4240, %ecx          # imm = 0xF4240
callq 0x4e878
leaq 0x2a0(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
callq 0x9470
leaq 0x46c0e(%rip), %rsi     # 0x51262
leaq 0x280(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
leaq 0x700(%rsp), %rdi
leaq 0x2a0(%rsp), %rsi
leaq 0x280(%rsp), %rdx
callq 0xb826
leaq 0x280(%rsp), %rdi
callq 0x9708
leaq 0x2a0(%rsp), %rdi
callq 0x9708
leaq 0x30(%rsp), %rdi
leaq 0x700(%rsp), %rsi
xorl %edx, %edx
movl $0xf4240, %ecx          # imm = 0xF4240
callq 0x4e878
leaq 0x260(%rsp), %rdi
leaq 0x380(%rsp), %rsi
callq 0x9470
leaq 0x46b8d(%rip), %rsi     # 0x51262
leaq 0x240(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
leaq 0x6c0(%rsp), %rdi
leaq 0x260(%rsp), %rsi
leaq 0x240(%rsp), %rdx
callq 0xb826
leaq 0x240(%rsp), %rdi
callq 0x9708
leaq 0x260(%rsp), %rdi
callq 0x9708
leaq 0xd0(%rsp), %rdi
leaq 0x6c0(%rsp), %rsi
xorl %edx, %edx
movl $0xf4240, %ecx          # imm = 0xF4240
callq 0x4e878
leaq 0x698(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x668(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x638(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x608(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0xe8(%rsp), %r14
movq 0xf0(%rsp), %rbp
leaq 0x660(%rsp), %r15
leaq 0x690(%rsp), %r12
cmpq %rbp, %r14
je 0xa9f3
movq (%r14), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0xb85c
addq $0x20, %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x91c0
movq (%r14), %r13
leaq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0xb85c
movq %rax, %rdi
movq %r13, %rsi
callq 0x91c0
addq $0x18, %r14
jmp 0xa7d1
movl %ebx, %edi
movq %r14, %rsi
callq 0xa1ff
movq %rax, %r12
movq %rdx, %r15
movq -0x8(%r14,%rbx,8), %rsi
leaq 0x400(%rsp), %rdi
leaq 0x780(%rsp), %rdx
callq 0xb7a6
leaq 0x400(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0xb789
movl %eax, %ebp
leaq 0x400(%rsp), %rdi
callq 0x9708
cmpl $0xa, %ebp
jl 0xb03a
movq -0x8(%r14,%rbx,8), %rsi
leaq 0x400(%rsp), %rdi
leaq 0x780(%rsp), %rdx
callq 0xb7a6
movq %r12, 0xa8(%rsp)
leaq 0x400(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0xb789
movl %eax, %ebp
leaq 0x400(%rsp), %rdi
callq 0x9708
xorl %eax, %eax
cmpq $0x9, %rbx
sete %al
xorl %r13d, %r13d
cmpq $0xc, %rbx
sete %r13b
leal (%rax,%r13,2), %eax
movq 0x20(%r14,%rax,8), %rsi
leaq 0x400(%rsp), %rdi
leaq 0x780(%rsp), %rdx
callq 0xb7a6
movq %r15, %r12
movq %rbx, 0x8(%rsp)
leaq 0x400(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0xb789
addl %r13d, %r13d
xorl %ebx, %ebx
movq 0x8(%rsp), %r15
cmpq $0x9, %r15
sete %bl
movl %eax, 0x8cadf(%rip)     # 0x973f0
leaq 0x400(%rsp), %rdi
callq 0x9708
cmpq $0xc, %r15
sete 0x8cacb(%rip)           # 0x973f4
addl %r13d, %ebx
movq 0x28(%r14,%rbx,8), %rsi
leaq 0x780(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
xorl %eax, %eax
cmpl $0x9, %r15d
sete %al
addl %r13d, %eax
movq 0x30(%r14,%rax,8), %rsi
leaq 0x400(%rsp), %rdi
leaq 0x340(%rsp), %rdx
callq 0xb7a6
movq %r15, %rbx
leaq 0x400(%rsp), %rdi
xorl %esi, %esi
callq 0xb7e1
movsd %xmm0, 0xa0(%rsp)
leaq 0x400(%rsp), %rdi
callq 0x9708
movl %r13d, %r14d
cmpl $0x2, %ebp
jne 0xa9d6
movq (%rsp), %rax
movq 0x40(%rax,%r14,8), %rsi
leaq 0x400(%rsp), %rdi
leaq 0x340(%rsp), %rdx
callq 0xb7a6
leaq 0x400(%rsp), %rdi
xorl %esi, %esi
callq 0xb7e1
leaq 0x400(%rsp), %rdi
callq 0x9708
cmpl $0x9, %ebx
jne 0xb12b
leaq 0x8ca6a(%rip), %rax     # 0x97450
andq $0x0, (%rax)
movq (%rsp), %rbx
jmp 0xb170
movq 0xd0(%rsp), %rbp
movq 0xd8(%rsp), %r14
leaq 0x600(%rsp), %r15
leaq 0x630(%rsp), %r12
cmpq %r14, %rbp
je 0xaa57
movq (%rbp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0xb85c
addq $0x20, %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x91c0
movq (%rbp), %r13
leaq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0xb85c
movq %rax, %rdi
movq %r13, %rsi
callq 0x91c0
addq $0x18, %rbp
jmp 0xaa13
movq %rbx, 0x8(%rsp)
movq 0x48(%rsp), %r12
movq 0x50(%rsp), %r13
leaq 0x690(%rsp), %r15
movq (%rsp), %rbx
cmpq %r13, %r12
je 0xaab5
movq (%r12), %rsi
movq %r15, %rdi
callq 0xb85c
movq (%r12), %rdi
movq %rax, %rsi
callq 0x91c0
movq (%r12), %rsi
addq $0x20, %rsi
movq %r15, %rdi
callq 0xb85c
movq (%r12), %rdi
addq $0x20, %rdi
movq %rax, %rsi
callq 0x91c0
addq $0x18, %r12
jmp 0xaa72
movq 0x30(%rsp), %r12
movq 0x38(%rsp), %r13
leaq 0x630(%rsp), %r15
cmpq %r13, %r12
je 0xab0a
movq (%r12), %rsi
movq %r15, %rdi
callq 0xb85c
movq (%r12), %rdi
movq %rax, %rsi
callq 0x91c0
movq (%r12), %rsi
addq $0x20, %rsi
movq %r15, %rdi
callq 0xb85c
movq (%r12), %rdi
addq $0x20, %rdi
movq %rax, %rsi
callq 0x91c0
addq $0x18, %r12
jmp 0xaac7
xorl %edi, %edi
callq 0x9300
movl %eax, %edi
callq 0x9320
movq 0x28(%rbx), %rsi
leaq 0x120(%rsp), %rdi
leaq 0x400(%rsp), %rdx
callq 0xb7a6
callq 0x90d0
leaq 0x80(%rsp), %rdi
movl %eax, %esi
callq 0xb96c
leaq 0x466e7(%rip), %rsi     # 0x51233
leaq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0xb948
leaq 0x8c86b(%rip), %rsi     # 0x973d0
leaq 0x60(%rsp), %rdi
callq 0x9b0c
leaq 0x780(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xb8e1
leaq 0xb0(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x9b0c
leaq 0x400(%rsp), %rdi
leaq 0x780(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0xb8e1
leaq 0x4667e(%rip), %rdx     # 0x5123d
leaq 0x100(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0xb8c2
leaq 0x400(%rsp), %rdi
callq 0x9708
leaq 0xb0(%rsp), %rdi
callq 0x9708
leaq 0x780(%rsp), %rdi
callq 0x9708
leaq 0x60(%rsp), %rdi
callq 0x9708
leaq 0x10(%rsp), %rdi
callq 0x9708
leaq 0x80(%rsp), %rdi
callq 0x9708
callq 0x90d0
leaq 0x60(%rsp), %rdi
movl %eax, %esi
callq 0xb96c
leaq 0x465ff(%rip), %rsi     # 0x51233
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0xb948
leaq 0x8c783(%rip), %rsi     # 0x973d0
leaq 0xb0(%rsp), %rdi
callq 0x9b0c
leaq 0x780(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0xb8e1
leaq 0x220(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x9b0c
leaq 0x400(%rsp), %rdi
leaq 0x780(%rsp), %rsi
leaq 0x220(%rsp), %rdx
callq 0xb8e1
leaq 0x4659f(%rip), %rdx     # 0x5124f
leaq 0x10(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0xb8c2
leaq 0x400(%rsp), %rdi
callq 0x9708
leaq 0x220(%rsp), %rdi
callq 0x9708
leaq 0x780(%rsp), %rdi
callq 0x9708
leaq 0xb0(%rsp), %rdi
callq 0x9708
leaq 0x80(%rsp), %rdi
callq 0x9708
leaq 0x60(%rsp), %rdi
callq 0x9708
leaq 0x400(%rsp), %rdi
leaq 0x100(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x96e0
movq 0x48(%rsp), %r14
movq 0x50(%rsp), %rbp
leaq 0x400(%rsp), %r15
leaq 0x46524(%rip), %r12     # 0x51262
cmpq %rbp, %r14
je 0xad79
movq (%r14), %r13
movq 0x8(%r14), %rbx
cmpq %rbx, %r13
je 0xad6b
movq %r15, %rdi
movq %r13, %rsi
callq 0x92d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x9330
addq $0x20, %r13
jmp 0xad4a
movq %r15, %rdi
callq 0x9170
addq $0x18, %r14
jmp 0xad3e
leaq 0x400(%rsp), %rdi
callq 0x94a0
leaq 0x780(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x96e0
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %rbp
leaq 0x780(%rsp), %r15
leaq 0x464ae(%rip), %r12     # 0x51262
cmpq %rbp, %r14
je 0xadef
movq (%r14), %r13
movq 0x8(%r14), %rbx
cmpq %rbx, %r13
je 0xade1
movq %r15, %rdi
movq %r13, %rsi
callq 0x92d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x9330
addq $0x20, %r13
jmp 0xadc0
movq %r15, %rdi
callq 0x9170
addq $0x18, %r14
jmp 0xadb4
leaq 0x780(%rsp), %rdi
callq 0x94a0
movq 0x8c1ad(%rip), %rdi     # 0x96fb0
leaq 0x100(%rsp), %rsi
callq 0x92d0
leaq 0x4644a(%rip), %rsi     # 0x51261
movq %rax, %rdi
callq 0x9330
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x92d0
movq %rax, %rdi
callq 0x9170
movq 0x100(%rsp), %rax
movq (%rsp), %rbx
movq %rax, 0x8(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rbx)
movq 0x8(%rsp), %r14
movl %r14d, %edi
movq %rbx, %rsi
callq 0xa1ff
movq %rax, %r12
movq %rdx, %r15
leaq 0x660(%rsp), %r8
leaq 0x600(%rsp), %r9
movq %rax, %rdi
movq %rdx, %rsi
movl %r14d, %edx
movq %rbx, %rcx
callq 0x9b48
movq %rax, %r13
testq %rax, %rax
je 0xaf1f
xorl %eax, %eax
movq 0x8(%rsp), %rdx
cmpq $0x9, %rdx
sete %al
xorl %ecx, %ecx
cmpq $0xc, %rdx
sete %cl
leaq (%rbx,%rax,8), %rax
shll $0x4, %ecx
movq 0x18(%rcx,%rax), %rsi
leaq 0x200(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0xb7a6
leaq 0x46395(%rip), %rsi     # 0x51264
leaq 0x1e0(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0xb7a6
movq (%r13), %rax
leaq 0x200(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
movq %r13, %rdi
callq *0x10(%rax)
leaq 0x1e0(%rsp), %rdi
callq 0x9708
leaq 0x200(%rsp), %rdi
callq 0x9708
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
movq (%r12), %rax
movq %r12, %rdi
callq *0x8(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
leaq 0x780(%rsp), %rdi
callq 0x94f0
leaq 0x400(%rsp), %rdi
callq 0x94f0
leaq 0x10(%rsp), %rdi
callq 0x9708
leaq 0x100(%rsp), %rdi
callq 0x9708
leaq 0x120(%rsp), %rdi
callq 0x9708
leaq 0x600(%rsp), %rdi
callq 0xbc84
leaq 0x630(%rsp), %rdi
callq 0xbc84
leaq 0x660(%rsp), %rdi
callq 0xbc84
leaq 0x690(%rsp), %rdi
callq 0xbc84
leaq 0xd0(%rsp), %rdi
callq 0xb9c6
leaq 0x6c0(%rsp), %rdi
callq 0xb9e8
leaq 0x30(%rsp), %rdi
callq 0xb9c6
leaq 0x700(%rsp), %rdi
callq 0xb9e8
leaq 0xe8(%rsp), %rdi
callq 0xb9c6
leaq 0x740(%rsp), %rdi
callq 0xb9e8
leaq 0x48(%rsp), %rdi
callq 0xb9c6
leaq 0x340(%rsp), %rdi
callq 0xb9e8
leaq 0x380(%rsp), %rdi
callq 0x9708
leaq 0x3a0(%rsp), %rdi
callq 0x9708
leaq 0x3c0(%rsp), %rdi
callq 0x9708
leaq 0x3e0(%rsp), %rdi
jmp 0xb2b0
leaq 0x408(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x400(%rsp), %r8
movq %r12, %rbp
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
movq %r14, %rcx
movq %r8, %r9
callq 0x9b48
movq %rax, %r13
testq %rax, %rax
je 0xb106
xorl %eax, %eax
cmpq $0x9, %rbx
sete %al
xorl %ecx, %ecx
cmpq $0xc, %rbx
sete %cl
leaq (%r14,%rax,8), %rax
shll $0x4, %ecx
movq 0x18(%rcx,%rax), %rsi
leaq 0x160(%rsp), %rdi
leaq 0x780(%rsp), %rdx
callq 0xb7a6
leaq 0x8c315(%rip), %rsi     # 0x973d0
leaq 0x140(%rsp), %rdi
callq 0x9470
movq (%r13), %rax
leaq 0x160(%rsp), %rsi
leaq 0x140(%rsp), %rdx
movq %r13, %rdi
callq *0x10(%rax)
leaq 0x140(%rsp), %rdi
callq 0x9708
leaq 0x160(%rsp), %rdi
callq 0x9708
movq (%r13), %rax
movq %r13, %rdi
callq *0x8(%rax)
movq %rbp, %rdi
movq (%rbp), %rax
callq *0x8(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
leaq 0x400(%rsp), %rdi
callq 0xbc84
jmp 0xb2b5
movq (%rsp), %rbx
movq 0x38(%rbx,%r14,8), %rsi
leaq 0x400(%rsp), %rdi
leaq 0x340(%rsp), %rdx
callq 0xb7a6
leaq 0x400(%rsp), %rdi
xorl %esi, %esi
callq 0xb7e1
leaq 0x8c2f1(%rip), %rax     # 0x97450
movsd %xmm0, (%rax)
leaq 0x400(%rsp), %rdi
callq 0x9708
cmpl $0x3, 0x8c279(%rip)     # 0x973f0
jae 0xb31c
leaq 0x45f42(%rip), %rsi     # 0x510c6
leaq 0x780(%rsp), %rdi
callq 0xb7fa
testb %al, %al
jne 0xb1c9
leaq 0x460f4(%rip), %rsi     # 0x51290
leaq 0x780(%rsp), %rdi
callq 0xb7fa
testb %al, %al
jne 0xb1c9
leaq 0x62e5f(%rip), %rsi     # 0x6e013
leaq 0x780(%rsp), %rdi
callq 0xb7fa
testb %al, %al
je 0xb33b
leaq 0x1c0(%rsp), %rdi
leaq 0x780(%rsp), %rsi
callq 0x9470
xorl %r8d, %r8d
movq 0x8(%rsp), %r14
cmpl $0x9, %r14d
sete %r8b
addl $-0x9, %ebp
leaq 0x400(%rsp), %rdi
leaq 0x1c0(%rsp), %rcx
movq 0xa8(%rsp), %rsi
movq %r12, %rdx
movsd 0xa0(%rsp), %xmm0
movl %ebp, %r9d
callq 0x4473e
xorl %eax, %eax
cmpl $0x9, %r14d
sete %al
addl %r13d, %eax
movq 0x18(%rbx,%rax,8), %rsi
leaq 0x1a0(%rsp), %rdi
leaq 0x340(%rsp), %rdx
callq 0xb7a6
leaq 0x8c186(%rip), %rsi     # 0x973d0
leaq 0x180(%rsp), %rdi
callq 0x9470
leaq 0x400(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
leaq 0x180(%rsp), %rdx
callq 0x44a2e
leaq 0x180(%rsp), %rdi
callq 0x9708
leaq 0x1a0(%rsp), %rdi
callq 0x9708
leaq 0x400(%rsp), %rdi
callq 0xb9fe
leaq 0x1c0(%rsp), %rdi
callq 0x9708
leaq 0x780(%rsp), %rdi
callq 0x9708
leaq 0x980(%rsp), %rbx
movq %rbx, %rdi
callq 0xba34
movq 0x8bca4(%rip), %rdi     # 0x96f70
leaq 0x45fb2(%rip), %rsi     # 0x51285
callq 0x9330
cvtsi2sdq (%rbx), %xmm0
divsd 0x45d43(%rip), %xmm0    # 0x51028
cvtsd2ss %xmm0, %xmm0
movq %rax, %rdi
callq 0x9270
leaq 0x45f94(%rip), %rsi     # 0x5128c
movq %rax, %rdi
callq 0x9330
movq %rax, %rdi
callq 0x9170
xorl %eax, %eax
addq $0x9c8, %rsp            # imm = 0x9C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x45d10(%rip), %rdi     # 0x51033
leaq 0x45d24(%rip), %rsi     # 0x5104e
leaq 0x45f3d(%rip), %rcx     # 0x5126e
movl $0xd8, %edx
callq 0x9210
leaq 0x45d86(%rip), %rdi     # 0x510c8
leaq 0x45d05(%rip), %rsi     # 0x5104e
leaq 0x45f1e(%rip), %rcx     # 0x5126e
movl $0xd9, %edx
callq 0x9210
jmp 0xb3d6
jmp 0xb3e8
jmp 0xb3d6
jmp 0xb3e8
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x9708
jmp 0xb37d
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x9708
jmp 0xb40f
jmp 0xb40c
movq %rax, %rbx
leaq 0x180(%rsp), %rdi
callq 0x9708
jmp 0xb3a6
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
callq 0x9708
jmp 0xb3b8
movq %rax, %rbx
leaq 0x400(%rsp), %rdi
callq 0xb9fe
jmp 0xb3ca
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
jmp 0xb3e1
jmp 0xb3e8
movq %rax, %rbx
leaq 0x400(%rsp), %rdi
callq 0x9708
jmp 0xb3eb
movq %rax, %rbx
leaq 0x780(%rsp), %rdi
jmp 0xb77c
jmp 0xb658
jmp 0xb648
jmp 0xb658
jmp 0xb648
movq %rax, %rbx
leaq 0x400(%rsp), %rdi
callq 0xbc84
jmp 0xb781
jmp 0xb658
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x9708
jmp 0xb43b
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0x9708
jmp 0xb674
jmp 0xb671
jmp 0xb671
jmp 0xb671
jmp 0xb683
jmp 0xb683
movq %rax, %rbx
jmp 0xb693
movq %rax, %rbx
leaq 0x400(%rsp), %rdi
callq 0x9708
jmp 0xb483
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x9708
jmp 0xb495
movq %rax, %rbx
leaq 0x780(%rsp), %rdi
callq 0x9708
jmp 0xb4a7
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x9708
jmp 0xb4b9
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x9708
leaq 0x60(%rsp), %rdi
jmp 0xb698
movq %rax, %rbx
jmp 0xb4c6
movq %rax, %rbx
jmp 0xb69d
movq %rax, %rbx
leaq 0x400(%rsp), %rdi
callq 0x9708
jmp 0xb4f2
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x9708
jmp 0xb504
movq %rax, %rbx
leaq 0x780(%rsp), %rdi
callq 0x9708
jmp 0xb516
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x9708
jmp 0xb525
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9708
leaq 0x80(%rsp), %rdi
jmp 0xb6a5
movq %rax, %rbx
jmp 0xb52f
movq %rax, %rbx
jmp 0xb6aa
jmp 0xb66c
movq %rax, %rbx
jmp 0xb6f8
movq %rax, %rbx
leaq 0x240(%rsp), %rdi
callq 0x9708
jmp 0xb56b
movq %rax, %rbx
leaq 0x260(%rsp), %rdi
callq 0x9708
jmp 0xb705
movq %rax, %rbx
jmp 0xb705
movq %rax, %rbx
jmp 0xb70f
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
callq 0x9708
jmp 0xb5a2
movq %rax, %rbx
leaq 0x2a0(%rsp), %rdi
callq 0x9708
jmp 0xb71c
movq %rax, %rbx
jmp 0xb71c
movq %rax, %rbx
jmp 0xb729
movq %rax, %rbx
leaq 0x2c0(%rsp), %rdi
callq 0x9708
jmp 0xb5d9
movq %rax, %rbx
leaq 0x2e0(%rsp), %rdi
callq 0x9708
jmp 0xb736
movq %rax, %rbx
jmp 0xb736
movq %rax, %rbx
jmp 0xb740
movq %rax, %rbx
leaq 0x300(%rsp), %rdi
callq 0x9708
jmp 0xb610
movq %rax, %rbx
leaq 0x320(%rsp), %rdi
callq 0x9708
jmp 0xb74d
movq %rax, %rbx
jmp 0xb74d
movq %rax, %rbx
jmp 0xb75a
movq %rax, %rbx
jmp 0xb767
jmp 0xb648
movq %rax, %rbx
jmp 0xb774
jmp 0xb658
jmp 0xb658
movq %rax, %rbx
leaq 0x400(%rsp), %rdi
jmp 0xb77c
movq %rax, %rbx
jmp 0xb781
jmp 0xb671
jmp 0xb671
jmp 0xb683
jmp 0xb66c
jmp 0xb66c
jmp 0xb66c
movq %rax, %rbx
jmp 0xb6b7
movq %rax, %rbx
leaq 0x780(%rsp), %rdi
callq 0x94f0
jmp 0xb686
movq %rax, %rbx
leaq 0x400(%rsp), %rdi
callq 0x94f0
leaq 0x10(%rsp), %rdi
callq 0x9708
leaq 0x100(%rsp), %rdi
callq 0x9708
leaq 0x120(%rsp), %rdi
callq 0x9708
leaq 0x600(%rsp), %rdi
callq 0xbc84
leaq 0x630(%rsp), %rdi
callq 0xbc84
leaq 0x660(%rsp), %rdi
callq 0xbc84
leaq 0x690(%rsp), %rdi
callq 0xbc84
leaq 0xd0(%rsp), %rdi
callq 0xb9c6
leaq 0x6c0(%rsp), %rdi
callq 0xb9e8
leaq 0x30(%rsp), %rdi
callq 0xb9c6
leaq 0x700(%rsp), %rdi
callq 0xb9e8
leaq 0xe8(%rsp), %rdi
callq 0xb9c6
leaq 0x740(%rsp), %rdi
callq 0xb9e8
leaq 0x48(%rsp), %rdi
callq 0xb9c6
leaq 0x340(%rsp), %rdi
callq 0xb9e8
leaq 0x380(%rsp), %rdi
callq 0x9708
leaq 0x3a0(%rsp), %rdi
callq 0x9708
leaq 0x3c0(%rsp), %rdi
callq 0x9708
leaq 0x3e0(%rsp), %rdi
callq 0x9708
movq %rbx, %rdi
callq 0x9640