// File: /workspace/github_cpp_makefile_star2_O3/schneebergerlab[P]DrLink/sample_molecule.cpp
// Function: sample_molecule(int, char**)
bool sample_molecule(int argc, char* argv[])
{
    std::stringstream usage;
    usage.str("");
    if(argc < 8)
    {
        usage << endl;
        usage << "   Given sets of molecule size distributions and molecule info, "                         
              << endl;
        usage << "   this function samples molecules according to intersection of molecule sizes"           
              << endl;        
        const char *buildString = __DATE__", " __TIME__;
        usage << "   (compiled on " << buildString << ")"                                                   
              << endl << endl;
        usage << "   Usage: DrLink resample msize1.txt,msize2.txt[,...] mole1.gz,mole2.gz[,...] read1,read2[,...] labels outprefix srand-sleep-int" 
              << endl << endl;
        usage << "\twhere "                                                         << endl;
        usage << "\tmsize*.txt:   molecule size distribution of pools"              << endl;
        usage << "\tmole*.gz  :   molecule meta info corresponding to molecule size of pools from DrLink molecule"  
              << endl;
        usage << "\tread*     :   mean molecule read coverage in raw data"          << endl;
        usage << "\tlabels    :   sample-specific label of output files"            << endl;
        usage << "\toutprefix :   general label of output files"                    << endl;
        cout  << usage.str() << endl;
        return false;
    }
    double startT   = clock(); 
    int srandsleep  = atoi(argv[7]); 
    cout << "   Info: sleeping " << srandsleep << " seconds to get various srand seeds. " << endl;
    sleep(srandsleep);
    string lenfiles = (string)argv[2];
    vector<string> lenfileinfo = split_string(lenfiles, ',');
    if(lenfileinfo.size()<2)
    {
        cout << "   Error: only one file given. No need to sample!" << endl;
        return false;
    }
    string molfiles = (string)argv[3];
    vector<string> molfileinfo = split_string(molfiles, ',');
    if(molfileinfo.size()<2)
    {
        cout << "   Error: only one file given. No need to sample!" << endl;
        return false;
    }    
    if(lenfileinfo.size() != molfileinfo.size())
    {
        cout << "   Error: molecule-size file-number does not matach molecule-meta-info file-number. " << endl;
        return false;
    }
    //
    vector<string> labels = split_string((string)argv[5], ',');
    string out_prefix     = string(argv[6]);       
    // 1. read number of molecule-size distributions in pools
    map<int, unsigned long> mNum_intersec;
    map<int, map<int, unsigned long> > mNum_individ;
    vector<string>::iterator lfitr;
    vector<string>::iterator lfitr_end;
    lfitr     = lenfileinfo.begin();
    lfitr_end = lenfileinfo.end();
    int i = -1;
    while(lfitr != lfitr_end)
    {
        string msfile = *lfitr;
        map<int, unsigned long> mNum;
        if(!(read_msize_dist(msfile, &mNum, &mNum_intersec)))
        {
            cout << "   Error: failed in reading molecule size distribution. " << endl;
            return false;
        }
        i ++;
        //
        mNum_individ.insert(std::pair<int, map<int, unsigned long> >(i, mNum) );
        //
        lfitr ++;
    }
    // 2. get sampling ratio with respecitve to a specific molecule size for each pool
    map<int, map<int, double> > mNum_individ_sratio;
    lfitr     = lenfileinfo.begin();
    lfitr_end = lenfileinfo.end();
    i = -1;
    while(lfitr != lfitr_end)
    {
        map<int, double> msratio;
        //
        i ++;
        map<int, unsigned long> mNum = mNum_individ[i];
        map<int, unsigned long>::iterator lenitr;
        map<int, unsigned long>::iterator lenitr_end;
        lenitr     = mNum.begin();
        lenitr_end = mNum.end();
        while(lenitr != lenitr_end)
        {
            int key           = (*lenitr).first;
            unsigned long num = (*lenitr).second;
            assert( mNum_intersec.find(key) != mNum_intersec.end() );
            if(num == 0) num  = 1;
            double sratio     = mNum_intersec[key]*1.0/num;
            sratio = sratio*0.96;
            
            // scaling - 2018-09-25: to get C substantially sampled while keeping around 6 million molecules
            if(labels[i].compare("B") == 0) 
            {
                sratio = sratio*(6000000.0/7016664.0);
            }else
            if(labels[i].compare("C") == 0)
            {
                sratio = sratio*(6000000.0/6949772.0);
            }else
            if(labels[i].compare("D") == 0) 
            {
                sratio = sratio*(6000000.0/7273738.0);
            }else
            if(labels[i].compare("E") == 0) 
            {
                sratio = sratio*(6000000.0/7101105.0);
            }else
            if(labels[i].compare("P") == 0) 
            {
                sratio = sratio*(6000000.0/6682080.0); // 6882080
            }else ;
            //
               
            msratio.insert(std::pair<int, double>(key, sratio)); // to make D sampled
            lenitr ++;
        }
        //
        mNum_individ_sratio.insert(std::pair<int, map<int, double> >(i, msratio));      
        //
        lfitr ++; 
    }
    // check
    if(true)
    {
        lfitr     = lenfileinfo.begin();
        lfitr_end = lenfileinfo.end();
        i = -1;   
        while(lfitr != lfitr_end)     
        {
            i ++;
            map<int, unsigned long> mNum = mNum_individ[i];
            map<int, double>     msratio = mNum_individ_sratio[i];
            cout << "   Check: file " << lenfileinfo[i] << endl << endl;
            if(labels[i].compare("D") == 0) 
            {
                cout << "   Info: all length ratio decreased by 0.04 to get D a random molecule number. " << endl;
            }
            map<int, double>::iterator sritr;
            map<int, double>::iterator sritr_end;
            sritr     = msratio.begin();
            sritr_end = msratio.end();
            while(sritr != sritr_end)
            {
                int key = (*sritr).first;
                cout << "      " 
                     << (*sritr).first 
                     << "\t" << (*sritr).second 
                     << " from " 
                     << mNum_intersec[key] 
                     << "/" 
                     << mNum[key] 
                     << endl;
                sritr ++;
            }
            lfitr ++;
        }
    }
    // 3. get sampling ratio with respecitve to a specific molecule base coverage for each pool
    
    // 4. sample molecules
    // read ratio
    vector<string> readratiostr = split_string((string)argv[4], ',');
    vector<double> readratio; // ratio of reads to keep
    double minmrc = 1;
    vector<string>::iterator rritr;
    vector<string>::iterator rritr_end;
    rritr     = readratiostr.begin();
    rritr_end = readratiostr.end();
    while(rritr != rritr_end)
    {
        double rr = atof((*rritr).c_str());
        readratio.push_back(rr);
        if(minmrc > rr) minmrc = rr;
        rritr ++;
    }
    vector<double>::iterator rr2itr     = readratio.begin();
    vector<double>::iterator rr2itr_end = readratio.end();
    while(rr2itr != rr2itr_end)
    {
        (*rr2itr) = 1.0 - ((*rr2itr) - minmrc)/(*rr2itr);
        rr2itr ++;
    }
    // molecule
    vector<string>::iterator mfitr;
    vector<string>::iterator mfitr_end;
    mfitr     = molfileinfo.begin();
    mfitr_end = molfileinfo.end();
    i = -1;
    while(mfitr != mfitr_end)
    {
        i ++;
        double this_readratio       = readratio[i];
            // special - caution!
            if(labels[i].compare("B") == 0) 
            {
                this_readratio = this_readratio*0.95*0.83643;
            }else
            if(labels[i].compare("C") == 0)
            {
                this_readratio = this_readratio*1.00*0.788091;
            }else
            if(labels[i].compare("D") == 0) 
            {
                this_readratio = this_readratio*0.92*44.0/49.0;
            }else
            if(labels[i].compare("E") == 0) 
            {
                this_readratio = this_readratio*1.00;
            }else
            if(labels[i].compare("P") == 0) 
            {
                this_readratio = this_readratio*0.92*44.0/49.0;
            }else ;
        string molfile              = molfileinfo[i];
        string ilabel               = labels[i];
        map<int,    double> msratio = mNum_individ_sratio[i];    
        //    
        map<string, unsigned long> molecule_cov;
        map<int,    unsigned long> molecule_len;
        map<int,    unsigned long> molecule_len_sum;                 
        map<int,    unsigned long> molecule_read_num;
        map<int,    unsigned long> molecule_read_num_sum;
        map<string,           int> barcode_molecule_cnt;
        if(molfile.compare("skip") != 0)
        {
            if(!sampling_molecule(molfile, 
                                this_readratio,
                                out_prefix + "_" + ilabel, 
                                msratio, 
                                &molecule_cov,
                                &molecule_len,
                                &molecule_len_sum,                      
                                &molecule_read_num,
                                &molecule_read_num_sum,
                                &barcode_molecule_cnt))
            {
                return false;
            }  
            if(!write_sampled_molecule_stat(molecule_cov, 
                                            molecule_len, 
                                            molecule_len_sum, 
                                            molecule_read_num,
                                            molecule_read_num_sum,
                                            barcode_molecule_cnt,
                                            out_prefix + "_" + ilabel))
            {
                return false;
            }
        }
        mfitr ++;  
    }  
        
    double finishT= clock();
    cout << "   Time consumed: " << (finishT-startT)/1000000 << " seconds" << endl << endl;    
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6b8, %rsp            # imm = 0x6B8
movq %rsi, %r15
movl %edi, %ebx
leaq 0x500(%rsp), %rdi
callq 0x4240
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18c8a(%rip), %rdx     # 0x3eb0a
leaq 0x20(%rsp), %rdi
movq %rdx, %rsi
callq 0x5384
leaq 0x518(%rsp), %r14
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x4490
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x25eb9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4340
cmpl $0x7, %ebx
jg 0x26258
leaq 0x510(%rsp), %rbx
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x180d0(%rip), %rsi     # 0x3dfc8
movl $0x40, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x180d1(%rip), %rsi     # 0x3e009
movl $0x4e, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x17d53(%rip), %rsi     # 0x3dccb
movl $0x10, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x17d29(%rip), %rsi     # 0x3dcb5
movl $0x15, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x1838a(%rip), %rsi     # 0x3e32a
movl $0x1, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x1804e(%rip), %rsi     # 0x3e058
movl $0x80, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x17cb9(%rip), %rsi     # 0x3dd2d
movl $0x7, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x18025(%rip), %rsi     # 0x3e0d9
movl $0x32, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x18018(%rip), %rsi     # 0x3e10c
movl $0x5e, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x18037(%rip), %rsi     # 0x3e16b
movl $0x36, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x1802e(%rip), %rsi     # 0x3e1a2
movl $0x34, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x18023(%rip), %rsi     # 0x3e1d7
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x510(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x44f0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x25dbd(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x26251
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4340
xorl %ebx, %ebx
jmp 0x2767a
callq 0x4200
movq %rax, %rbx
movq 0x38(%r15), %rdi
callq 0x44d0
movl %eax, %ebp
movq 0x25d56(%rip), %rdi     # 0x4bfc8
leaq 0x17f8b(%rip), %rsi     # 0x3e204
movl $0x12, %edx
callq 0x43a0
movq 0x25d3e(%rip), %rdi     # 0x4bfc8
movl %ebp, %esi
callq 0x4580
movq %rax, %r14
leaq 0x17f7c(%rip), %rsi     # 0x3e217
movl $0x25, %edx
movq %rax, %rdi
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movl %ebp, %edi
callq 0x4270
movq 0x10(%r15), %rsi
leaq 0x360(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x5346
leaq 0x20(%rsp), %rdx
movb $0x2c, (%rdx)
leaq 0xc8(%rsp), %rdi
leaq 0x360(%rsp), %rsi
callq 0x367c0
movq 0xd0(%rsp), %rax
subq 0xc8(%rsp), %rax
cmpq $0x20, %rax
ja 0x2636c
movq 0x25ca2(%rip), %rbx     # 0x4bfc8
leaq 0x17f10(%rip), %rsi     # 0x3e23d
movl $0x31, %edx
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq 0x25c70(%rip), %rdi     # 0x4bfc8
callq 0x4030
movq %rax, %rdi
callq 0x4220
xorl %ebx, %ebx
jmp 0x2764c
movq 0x18(%r15), %rsi
leaq 0x340(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x5346
leaq 0x20(%rsp), %rdx
movb $0x2c, (%rdx)
leaq 0x1a0(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x367c0
movq 0x1a8(%rsp), %rax
subq 0x1a0(%rsp), %rax
cmpq $0x21, %rax
jae 0x263c6
movl $0x31, %edx
leaq 0x17e7c(%rip), %rsi     # 0x3e23d
jmp 0x2663d
movq 0xd0(%rsp), %rcx
subq 0xc8(%rsp), %rcx
cmpq %rax, %rcx
jne 0x26631
movq 0x28(%r15), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x380(%rsp), %rdx
callq 0x5346
leaq 0x3b0(%rsp), %rdx
movb $0x2c, (%rdx)
leaq 0xb0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x367c0
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x26429
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r15, 0x290(%rsp)
movq 0x30(%r15), %rsi
leaq 0x238(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x5346
cvtsi2sd %rbx, %xmm0
movsd %xmm0, 0x288(%rsp)
leaq 0x388(%rsp), %r15
xorl %r13d, %r13d
movl %r13d, (%r15)
movq %r13, 0x8(%r15)
movq %r15, 0x10(%r15)
movq %r15, 0x18(%r15)
movq %r13, 0x20(%r15)
leaq 0x3b8(%rsp), %rax
movl %r13d, (%rax)
movq %r13, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %r13, 0x20(%rax)
movq 0xc8(%rsp), %rbx
movq 0xd0(%rsp), %r14
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
leaq 0x150(%rsp), %r12
cmpq %r14, %rbx
je 0x2667e
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0xd940
movl $0x0, 0x158(%rsp)
movq %r13, 0x160(%rsp)
leaq 0x158(%rsp), %rax
movq %rax, 0x168(%rsp)
movq %rax, 0x170(%rsp)
movq %r13, 0x178(%rsp)
leaq 0x228(%rsp), %rax
movq %rax, 0x218(%rsp)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x218(%rsp), %rdi
callq 0xd940
leaq 0x218(%rsp), %rdi
movq %r12, %rsi
leaq 0x380(%rsp), %rdx
callq 0x27b75
movl %eax, %ebp
movq 0x218(%rsp), %rdi
leaq 0x228(%rsp), %rax
cmpq %rax, %rdi
je 0x26571
movq 0x228(%rsp), %rsi
incq %rsi
callq 0x4340
testb %bpl, %bpl
je 0x265b3
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0xd390
leaq 0x3b0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x2ac4c
leaq 0x28(%rsp), %rdi
callq 0xd802
addq $0x20, %rbx
jmp 0x265fd
movl $0x38, %edx
movq 0x25a09(%rip), %rdi     # 0x4bfc8
leaq 0x17cfe(%rip), %rsi     # 0x3e2c4
callq 0x43a0
movq 0x259f6(%rip), %rcx     # 0x4bfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq 0x259d8(%rip), %rdi     # 0x4bfc8
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq %r12, %rdi
callq 0xd802
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x26621
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
testb %bpl, %bpl
jne 0x264ae
xorl %ebx, %ebx
jmp 0x275d6
movl $0x54, %edx
leaq 0x17c32(%rip), %rsi     # 0x3e26f
movq 0x25984(%rip), %rbx     # 0x4bfc8
movq %rbx, %rdi
callq 0x43a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq 0x2595e(%rip), %rdi     # 0x4bfc8
callq 0x4030
movq %rax, %rdi
callq 0x4220
xorl %ebx, %ebx
jmp 0x2761e
movl $0x0, 0x158(%rsp)
xorl %eax, %eax
movq %rax, 0x160(%rsp)
leaq 0x158(%rsp), %rcx
movq %rcx, 0x168(%rsp)
movq %rcx, 0x170(%rsp)
movq %rax, 0x178(%rsp)
movq 0xc8(%rsp), %r12
movq 0xd0(%rsp), %rax
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movq %rax, 0xf8(%rsp)
cmpq %rax, %r12
je 0x26c58
leaq 0x60(%rsp), %r13
leaq 0x20(%rsp), %rbx
leaq 0x17c76(%rip), %r14     # 0x3e363
movq %r12, 0x58(%rsp)
movl $0x0, 0x68(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x70(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, 0x78(%rsp)
movq %rax, 0x80(%rsp)
movq %rcx, 0x88(%rsp)
incl 0xc(%rsp)
leaq 0x3b0(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2a80a
leaq 0x120(%rsp), %rdi
movq %rax, %rsi
callq 0xd390
movq 0x138(%rsp), %r12
leaq 0x128(%rsp), %rax
cmpq %rax, %r12
je 0x2694f
movl 0x20(%r12), %eax
movl %eax, 0x258(%rsp)
movq 0x390(%rsp), %rdi
testq %rdi, %rdi
je 0x276af
movq 0x28(%r12), %rbp
movq %r15, %r8
movq %r8, %rcx
movq %rdi, %rdx
movl 0x20(%rdi), %esi
xorl %edi, %edi
cmpl %eax, %esi
setl %dil
movq %rdx, %r8
cmovlq %rcx, %r8
movq 0x10(%rdx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0x2677f
cmpq %r15, %r8
je 0x276af
cmpl %eax, %esi
cmovlq %rcx, %rdx
cmpl 0x20(%rdx), %eax
jl 0x276af
leaq 0x380(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0xce1a
cmpq $0x1, %rbp
adcq $0x0, %rbp
movsd (%rax), %xmm0
movsd 0x148fe(%rip), %xmm1    # 0x3b0e0
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x14903(%rip), %xmm2    # 0x3b0f0
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq %rbp, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm3
mulsd 0x17736(%rip), %xmm3    # 0x3df58
movapd %xmm3, 0x10(%rsp)
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
movq %r14, %rsi
callq 0x4100
testl %eax, %eax
je 0x268d5
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x15385(%rip), %rsi     # 0x3bbe6
callq 0x4100
testl %eax, %eax
je 0x268e5
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x17ae3(%rip), %rsi     # 0x3e365
callq 0x4100
testl %eax, %eax
je 0x268f5
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x17ac4(%rip), %rsi     # 0x3e367
callq 0x4100
testl %eax, %eax
je 0x26905
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x17f2f(%rip), %rsi     # 0x3e7f3
callq 0x4100
testl %eax, %eax
je 0x26915
movapd 0x10(%rsp), %xmm0
jmp 0x26923
movapd 0x10(%rsp), %xmm0
mulsd 0x1769d(%rip), %xmm0    # 0x3df80
jmp 0x26923
movapd 0x10(%rsp), %xmm0
mulsd 0x17685(%rip), %xmm0    # 0x3df78
jmp 0x26923
movapd 0x10(%rsp), %xmm0
mulsd 0x1766d(%rip), %xmm0    # 0x3df70
jmp 0x26923
movapd 0x10(%rsp), %xmm0
mulsd 0x17655(%rip), %xmm0    # 0x3df68
jmp 0x26923
movapd 0x10(%rsp), %xmm0
mulsd 0x1763d(%rip), %xmm0    # 0x3df60
movl 0x258(%rsp), %eax
movl %eax, 0x20(%rsp)
movsd %xmm0, 0x28(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2af9c
movq %r12, %rdi
callq 0x4230
movq %rax, %r12
jmp 0x26749
movl 0xc(%rsp), %eax
movl %eax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0x2aa04
movq 0x58(%rsp), %r12
leaq 0x150(%rsp), %rdi
movq %rbx, %rsi
callq 0x2b0e4
leaq 0x28(%rsp), %rdi
callq 0x2a9b4
addq $0x20, %r12
leaq 0x120(%rsp), %rdi
callq 0xd802
movq %r13, %rdi
callq 0x2a9b4
cmpq 0xf8(%rsp), %r12
jne 0x266ed
movq 0xc8(%rsp), %r15
movq 0xd0(%rsp), %rax
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movq %rax, 0x58(%rsp)
cmpq %rax, %r15
je 0x26c58
leaq 0xc(%rsp), %r12
leaq 0x20(%rsp), %r13
leaq 0x380(%rsp), %rbx
leaq 0x120(%rsp), %r14
leaq 0x18369(%rip), %rbp     # 0x3ed5a
incl 0xc(%rsp)
leaq 0x3b0(%rsp), %rdi
movq %r12, %rsi
callq 0x2a80a
movq %r13, %rdi
movq %rax, %rsi
callq 0xd390
leaq 0x150(%rsp), %rdi
movq %r12, %rsi
callq 0x2a870
leaq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x2aa04
movq %r15, 0x10(%rsp)
movl $0xf, %edx
movq 0x2558a(%rip), %rdi     # 0x4bfc8
leaq 0x17924(%rip), %rsi     # 0x3e369
callq 0x43a0
movslq 0xc(%rsp), %rax
movq 0xc8(%rsp), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq 0x2555d(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x17889(%rip), %rsi     # 0x3e365
callq 0x4100
testl %eax, %eax
jne 0x26b2f
movl $0x4f, %edx
movq 0x254d7(%rip), %rdi     # 0x4bfc8
leaq 0x17881(%rip), %rsi     # 0x3e379
callq 0x43a0
movq 0x254c4(%rip), %rcx     # 0x4bfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq 0x254a6(%rip), %rdi     # 0x4bfc8
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq 0x78(%rsp), %r12
leaq 0x68(%rsp), %rax
cmpq %rax, %r12
je 0x26c2d
movl 0x20(%r12), %eax
movl %eax, 0x120(%rsp)
movl $0x6, %edx
movq 0x2546e(%rip), %rdi     # 0x4bfc8
leaq 0x15826(%rip), %rsi     # 0x3c387
callq 0x43a0
movl 0x20(%r12), %esi
movq 0x25456(%rip), %rdi     # 0x4bfc8
callq 0x4580
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x17f80(%rip), %rsi     # 0x3eb09
callq 0x43a0
movsd 0x28(%r12), %xmm0
movq %r15, %rdi
callq 0x4510
movq %rax, %r15
movl $0x6, %edx
movq %rax, %rdi
leaq 0x17a21(%rip), %rsi     # 0x3e5d0
callq 0x43a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xce1a
movq (%rax), %rsi
movq %r15, %rdi
callq 0x4210
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x43a0
movq %r13, %rdi
movq %r14, %rsi
callq 0xce1a
movq (%rax), %rsi
movq %r15, %rdi
callq 0x4210
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq %r12, %rdi
callq 0x4230
movq %rax, %r12
jmp 0x26b34
movq 0x10(%rsp), %r15
addq $0x20, %r15
leaq 0x60(%rsp), %rdi
callq 0x2a9b4
movq %r13, %rdi
callq 0xd802
cmpq 0x58(%rsp), %r15
leaq 0xc(%rsp), %r12
jne 0x269f1
movq 0x290(%rsp), %rax
movq 0x20(%rax), %rsi
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x5346
leaq 0x120(%rsp), %rdx
movb $0x2c, (%rdx)
leaq 0x328(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rbx
callq 0x367c0
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x26cac
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4340
xorpd %xmm0, %xmm0
movapd %xmm0, 0xe0(%rsp)
movq $0x0, 0xf0(%rsp)
movq 0x328(%rsp), %r15
movq 0x330(%rsp), %r12
cmpq %r12, %r15
je 0x26d93
movsd 0x172a2(%rip), %xmm0    # 0x3df88
movsd %xmm0, 0x10(%rsp)
leaq 0xe0(%rsp), %rbx
leaq 0x20(%rsp), %r14
movq (%r15), %rdi
callq 0x43f0
movsd %xmm0, 0x20(%rsp)
movq 0xe8(%rsp), %rsi
cmpq 0xf0(%rsp), %rsi
je 0x26d2b
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xe8(%rsp)
jmp 0x26d36
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2b3da
movsd 0x20(%rsp), %xmm0
minsd 0x10(%rsp), %xmm0
addq $0x20, %r15
movsd %xmm0, 0x10(%rsp)
cmpq %r12, %r15
jne 0x26cf9
movq 0xe0(%rsp), %rax
movq 0xe8(%rsp), %rcx
cmpq %rcx, %rax
je 0x26d93
movsd 0x1721a(%rip), %xmm1    # 0x3df88
movsd (%rax), %xmm2
movapd %xmm2, %xmm3
subsd %xmm0, %xmm3
divsd %xmm2, %xmm3
movapd %xmm1, %xmm2
subsd %xmm3, %xmm2
movsd %xmm2, (%rax)
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x26d6e
movq 0x1a0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x1a8(%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0xc(%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x1e8(%rsp), %r14
leaq 0x1c8(%rsp), %r13
xorl %r12d, %r12d
leaq 0x90(%rsp), %r15
movq 0x58(%rsp), %rax
cmpq 0xf8(%rsp), %rax
sete %bl
je 0x27533
movslq 0xc(%rsp), %rax
leaq 0x1(%rax), %rdi
movl %edi, 0xc(%rsp)
movq 0xe0(%rsp), %rcx
movsd 0x8(%rcx,%rax,8), %xmm0
movsd %xmm0, 0x10(%rsp)
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x17543(%rip), %rsi     # 0x3e363
callq 0x4100
testl %eax, %eax
je 0x26ed5
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x14da1(%rip), %rsi     # 0x3bbe6
callq 0x4100
testl %eax, %eax
je 0x26eed
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x174fb(%rip), %rsi     # 0x3e365
callq 0x4100
testl %eax, %eax
je 0x26eb5
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x174dc(%rip), %rsi     # 0x3e367
callq 0x4100
testl %eax, %eax
je 0x26f01
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0xb0(%rsp), %rdi
leaq 0x17947(%rip), %rsi     # 0x3e7f3
callq 0x4100
testl %eax, %eax
jne 0x26f01
movsd 0x10(%rsp), %xmm0
mulsd 0x170cd(%rip), %xmm0    # 0x3df90
mulsd 0x170cd(%rip), %xmm0    # 0x3df98
divsd 0x170cd(%rip), %xmm0    # 0x3dfa0
jmp 0x26efb
movsd 0x10(%rsp), %xmm0
mulsd 0x170cd(%rip), %xmm0    # 0x3dfb0
mulsd 0x170cd(%rip), %xmm0    # 0x3dfb8
jmp 0x26efb
movsd 0x10(%rsp), %xmm0
mulsd 0x170ad(%rip), %xmm0    # 0x3dfa8
movsd %xmm0, 0x10(%rsp)
movslq 0xc(%rsp), %rax
movq 0x1a0(%rsp), %rcx
shlq $0x5, %rax
leaq 0x190(%rsp), %rdx
movq %rdx, 0x180(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x180(%rsp), %rdi
callq 0xd940
movslq 0xc(%rsp), %rax
movq 0xb0(%rsp), %rcx
shlq $0x5, %rax
leaq 0x110(%rsp), %rdx
movq %rdx, 0x100(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x100(%rsp), %rdi
callq 0xd940
leaq 0x150(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2a870
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x2aa04
movl %r12d, 0x68(%rsp)
movq %r12, 0x70(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, 0x78(%rsp)
movq %rax, 0x80(%rsp)
movq %r12, 0x88(%rsp)
movl %r12d, 0x128(%rsp)
movq %r12, 0x130(%rsp)
leaq 0x128(%rsp), %rax
movq %rax, 0x138(%rsp)
movq %rax, 0x140(%rsp)
movq %r12, 0x148(%rsp)
movl %r12d, 0x260(%rsp)
movq %r12, 0x268(%rsp)
leaq 0x260(%rsp), %rax
movq %rax, 0x270(%rsp)
movq %rax, 0x278(%rsp)
movq %r12, 0x280(%rsp)
movl %r12d, 0x300(%rsp)
movq %r12, 0x308(%rsp)
leaq 0x300(%rsp), %rax
movq %rax, 0x310(%rsp)
movq %rax, 0x318(%rsp)
movq %r12, 0x320(%rsp)
movl %r12d, 0x2d0(%rsp)
movq %r12, 0x2d8(%rsp)
leaq 0x2d0(%rsp), %rax
movq %rax, 0x2e0(%rsp)
movq %rax, 0x2e8(%rsp)
movq %r12, 0x2f0(%rsp)
movl %r12d, 0x2a0(%rsp)
movq %r12, 0x2a8(%rsp)
leaq 0x2a0(%rsp), %rax
movq %rax, 0x2b0(%rsp)
movq %rax, 0x2b8(%rsp)
movq %r12, 0x2c0(%rsp)
leaq 0x180(%rsp), %rdi
leaq 0x17312(%rip), %rsi     # 0x3e3c9
callq 0x4100
testl %eax, %eax
je 0x2747c
leaq 0x208(%rsp), %rax
movq %rax, 0x1f8(%rsp)
movq 0x180(%rsp), %rsi
movq 0x188(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1f8(%rsp), %rdi
callq 0xd940
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x238(%rsp), %rsi
movq 0x240(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rbp
movq %r15, %rdi
callq 0xd940
movq %rbp, %rdi
leaq 0x149ab(%rip), %rsi     # 0x3bad7
callq 0x45e0
movq 0x100(%rsp), %rsi
movq 0x108(%rsp), %rdx
movq %rbp, %rdi
callq 0x4120
movq %r14, 0x1d8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x688(%rsp), %rbp
je 0x2717d
movq %rdx, 0x1d8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1e8(%rsp)
jmp 0x27186
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x1e0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x2aa04
subq $0x8, %rsp
leaq 0x200(%rsp), %rdi
movsd 0x18(%rsp), %xmm0
leaq 0x1e0(%rsp), %rsi
movq %rbp, %rdx
leaq 0x68(%rsp), %rcx
leaq 0x128(%rsp), %r8
leaq 0x260(%rsp), %r9
leaq 0x2a0(%rsp), %rax
pushq %rax
leaq 0x2d8(%rsp), %rax
pushq %rax
leaq 0x310(%rsp), %rax
pushq %rax
callq 0x27f61
addq $0x20, %rsp
movq %rbp, %rdi
movl %eax, %ebp
callq 0x2a9b4
movq 0x1d8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2722b
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x27250
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1f8(%rsp), %rdi
leaq 0x208(%rsp), %rax
cmpq %rax, %rdi
je 0x27275
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x4340
testb %bpl, %bpl
je 0x27487
leaq 0x4d0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xd104
leaq 0x4a0(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0xd390
leaq 0x470(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0xd390
leaq 0x440(%rsp), %rdi
leaq 0x2f8(%rsp), %rsi
callq 0xd390
leaq 0x410(%rsp), %rdi
leaq 0x2c8(%rsp), %rsi
callq 0xd390
leaq 0x3e0(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0xd564
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x238(%rsp), %rsi
movq 0x240(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rbp
movq %r15, %rdi
callq 0xd940
movq %rbp, %rdi
leaq 0x147a6(%rip), %rsi     # 0x3bad7
callq 0x45e0
movq 0x100(%rsp), %rsi
movq 0x108(%rsp), %rdx
movq %rbp, %rdi
callq 0x4120
movq %r13, 0x1b8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2737a
movq %rdx, 0x1b8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1c8(%rsp)
jmp 0x27384
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x1c0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
subq $0x8, %rsp
leaq 0x4d8(%rsp), %rdi
leaq 0x4a8(%rsp), %rsi
leaq 0x478(%rsp), %rdx
leaq 0x448(%rsp), %rcx
leaq 0x418(%rsp), %r8
leaq 0x3e8(%rsp), %r9
leaq 0x1c0(%rsp), %rax
pushq %rax
callq 0x296dc
addq $0x10, %rsp
movl %eax, %ebp
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x27404
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x27429
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x3e0(%rsp), %rdi
callq 0xd7ee
leaq 0x410(%rsp), %rdi
callq 0xd802
leaq 0x440(%rsp), %rdi
callq 0xd802
leaq 0x470(%rsp), %rdi
callq 0xd802
leaq 0x4a0(%rsp), %rdi
callq 0xd802
leaq 0x4d0(%rsp), %rdi
callq 0xd816
testb %bpl, %bpl
je 0x27487
addq $0x20, 0x58(%rsp)
movb $0x1, %bpl
jmp 0x27489
xorl %ebp, %ebp
leaq 0x298(%rsp), %rdi
callq 0xd7ee
leaq 0x2c8(%rsp), %rdi
callq 0xd802
leaq 0x2f8(%rsp), %rdi
callq 0xd802
leaq 0x258(%rsp), %rdi
callq 0xd802
leaq 0x120(%rsp), %rdi
callq 0xd802
leaq 0x60(%rsp), %rdi
callq 0xd816
leaq 0x20(%rsp), %rdi
callq 0x2a9b4
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x27503
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x27528
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4340
testb %bpl, %bpl
jne 0x26dd6
jmp 0x2759f
callq 0x4200
movq %rax, %r14
movq 0x24a86(%rip), %rdi     # 0x4bfc8
leaq 0x12dfc(%rip), %rsi     # 0x3a345
movl $0x12, %edx
callq 0x43a0
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
subsd 0x288(%rsp), %xmm0
divsd 0x12a9c(%rip), %xmm0    # 0x3a008
movq 0x24a55(%rip), %rdi     # 0x4bfc8
callq 0x4510
movq %rax, %r14
leaq 0x12dd6(%rip), %rsi     # 0x3a358
movl $0x8, %edx
movq %rax, %rdi
callq 0x43a0
movq %r14, %rdi
callq 0x41a0
movq %rax, %rdi
callq 0x41a0
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x275bc
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
leaq 0x328(%rsp), %rdi
callq 0x6aac
leaq 0x150(%rsp), %rdi
callq 0x2ab9c
leaq 0x3b0(%rsp), %rdi
callq 0x2abf4
leaq 0x380(%rsp), %rdi
callq 0xd802
leaq 0x248(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27611
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xb0(%rsp), %rdi
callq 0x6aac
leaq 0x1a0(%rsp), %rdi
callq 0x6aac
leaq 0x350(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2764c
movq 0x350(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xc8(%rsp), %rdi
callq 0x6aac
leaq 0x370(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2767a
movq 0x370(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x24917(%rip), %rsi     # 0x4bf98
leaq 0x500(%rsp), %rdi
callq 0x4260
leaq 0x580(%rsp), %rdi
callq 0x4140
movl %ebx, %eax
addq $0x6b8, %rsp            # imm = 0x6B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16c47(%rip), %rdi     # 0x3e2fd
leaq 0x16c6f(%rip), %rsi     # 0x3e32c
leaq 0x16c7c(%rip), %rcx     # 0x3e340
movl $0xa1, %edx
callq 0x41f0
movq %rax, %r15
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x27a9b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x27a9b
jmp 0x27939
movq %rax, %r15
jmp 0x27ae3
movq %rax, %r15
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x27af0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x27af0
jmp 0x27931
jmp 0x27900
movq %rax, %r15
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x27752
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x27752
jmp 0x2774f
movq %rax, %r15
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2777c
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2777c
movq %rax, %r15
leaq 0x3e0(%rsp), %rdi
callq 0xd7ee
jmp 0x2778e
movq %rax, %r15
leaq 0x410(%rsp), %rdi
callq 0xd802
leaq 0x440(%rsp), %rdi
callq 0xd802
leaq 0x470(%rsp), %rdi
callq 0xd802
leaq 0x4a0(%rsp), %rdi
callq 0xd802
leaq 0x4d0(%rsp), %rdi
callq 0xd816
jmp 0x27887
movq %rax, %r15
jmp 0x2779b
movq %rax, %r15
jmp 0x277a8
movq %rax, %r15
jmp 0x277b5
movq %rax, %r15
jmp 0x277c2
jmp 0x27900
movq %rax, %r15
jmp 0x27afd
jmp 0x279fe
jmp 0x277fc
movq %rax, %r15
jmp 0x27838
movq %rax, %r15
jmp 0x2785d
movq %rax, %r15
leaq 0x688(%rsp), %rdi
callq 0x2a9b4
jmp 0x2781b
movq %rax, %r15
movq 0x1d8(%rsp), %rdi
cmpq %r14, %rdi
je 0x27838
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2785d
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1f8(%rsp), %rdi
leaq 0x208(%rsp), %rax
cmpq %rax, %rdi
je 0x27887
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x27887
movq %rax, %r15
leaq 0x298(%rsp), %rdi
callq 0xd7ee
leaq 0x2c8(%rsp), %rdi
callq 0xd802
leaq 0x2f8(%rsp), %rdi
callq 0xd802
leaq 0x258(%rsp), %rdi
callq 0xd802
leaq 0x120(%rsp), %rdi
callq 0xd802
leaq 0x60(%rsp), %rdi
callq 0xd816
leaq 0x20(%rsp), %rdi
callq 0x2a9b4
jmp 0x27985
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0xd802
jmp 0x27a2d
jmp 0x27a2a
movq %rax, %r15
jmp 0x279aa
movq %rax, %r15
jmp 0x279cf
jmp 0x27a7c
movq %rax, %r15
jmp 0x27b2b
jmp 0x27a7c
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x2a9b4
jmp 0x27a63
jmp 0x27a60
movq %rax, %r15
jmp 0x27af0
movq %rax, %r15
jmp 0x27a9b
movq %rax, %r15
jmp 0x27a91
movq %rax, %r15
jmp 0x27aa8
movq %rax, %r15
movq 0x218(%rsp), %rdi
leaq 0x228(%rsp), %rax
cmpq %rax, %rdi
je 0x27a2d
movq 0x228(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x27a2d
movq %rax, %r15
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x279aa
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x279cf
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x279ec
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
leaq 0x328(%rsp), %rdi
callq 0x6aac
jmp 0x27a9b
movq %rax, %r15
jmp 0x27b1e
jmp 0x27a0f
jmp 0x27a7c
movq %rax, %r15
jmp 0x27a70
movq %rax, %r15
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x27b4c
movq 0x30(%rsp), %rsi
jmp 0x27b44
movq %rax, %r15
leaq 0x150(%rsp), %rdi
callq 0xd802
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x27aa8
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x27aa8
jmp 0x27a7c
jmp 0x27a84
jmp 0x27a7c
jmp 0x27a60
movq %rax, %r15
leaq 0x120(%rsp), %rdi
callq 0xd802
leaq 0x60(%rsp), %rdi
callq 0x2a9b4
jmp 0x27a9b
movq %rax, %r15
jmp 0x27b4c
movq %rax, %r15
leaq 0x60(%rsp), %rdi
callq 0x2a9b4
leaq 0x20(%rsp), %rdi
callq 0xd802
leaq 0x150(%rsp), %rdi
callq 0x2ab9c
leaq 0x3b0(%rsp), %rdi
callq 0x2abf4
leaq 0x380(%rsp), %rdi
callq 0xd802
leaq 0x248(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27ae3
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xb0(%rsp), %rdi
callq 0x6aac
leaq 0x1a0(%rsp), %rdi
callq 0x6aac
leaq 0x350(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27b1e
movq 0x350(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xc8(%rsp), %rdi
callq 0x6aac
leaq 0x370(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27b4c
movq 0x370(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x24445(%rip), %rsi     # 0x4bf98
leaq 0x500(%rsp), %rdi
callq 0x4260
leaq 0x580(%rsp), %rdi
callq 0x4140
movq %r15, %rdi
callq 0x45a0