// File: schneebergerlab[P]DrLink/sample_molecule.cpp
// Function: sampling_molecule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<int, double, std::less<int>, std::allocator<std::pair<int const, double>>>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, unsigned long>>>*, std::map<int, unsigned long, std::less<int>, std::allocator<std::pair<int const, unsigned long>>>*, std::map<int, unsigned long, std::less<int>, std::allocator<std::pair<int const, unsigned long>>>*, std::map<int, unsigned long, std::less<int>, std::allocator<std::pair<int const, unsigned long>>>*, std::map<int, unsigned long, std::less<int>, std::allocator<std::pair<int const, unsigned long>>>*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>*)
bool sampling_molecule(string molfile, 
                       double readratio,
                       string outprefix, 
                       map<int,           double>  msratio, 
                       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)
{
    // open for reading
    igzstream molfp;
    molfp.open(molfile.c_str());
    if(!molfp.good())
    {
        cout << "   Error: cannot file of raw molecule: " << molfile << endl;
        return false;
    }
    // open for writing
    // molecule info
    string ofilename = outprefix + "_min1000bp_sampled_molecule_table_trashme.txt.gz";
    ogzstream moutfp;
    moutfp.open(ofilename.c_str(), ios::out);
    if(!moutfp)
    {
        cout << "   Error: cannot open file " << ofilename << " for writing sampled molecules. " << endl;
        return false;
    }
    // read ids in selected molecules
    string oIDfilename = outprefix + "_min1000bp_sampled_molecule_readIDs_not_on.txt";    
    ofstream ridoutfp;
    ridoutfp.open(oIDfilename.c_str(), ios::out);
    if(!ridoutfp.is_open())
    {
        cout << "   Error: cannot open file " << oIDfilename << endl;
        return false;
    }
    //
    cout << "   Info: sampling molecules..."   << endl;
    // make sure this is out of the loop
    srand (time(NULL)); 
    while(molfp.good())
    {
        string line("");
        getline(molfp, line);
        if(line.size()==0 || line[0]=='#') continue;
        /* get info for current molecule - 11 columns:
                   0.chr#barcode 		1#AAACACCAGAACTCGG
                   1.first_aligned 		15095089
                   2.last_aligned 		15102519
                   3.molecule_len 		7580
                   4.molecule_cov 		0.04
                   5.read_num  		 	2
                   6.Uni_flag  		 	U
                   7.last_aligned_end  		15102668
                   8.all_reads_aligned_at  	15095089,15095230;15102519,15102668
                   9.R1R2  		 	1,2
                  10.read_id 		 	rid1,rid2 
                  11.read_cigar	                cig1,cig2
        */
        vector<string> lineinfo = split_string(line, '\t');
        if(lineinfo.size() < 12) continue; 
        
        // stage 1. sample reads first 
        vector<string> readPos = split_string(lineinfo[8],  ';');
        vector<string> readR12 = split_string(lineinfo[9],  ',');
        vector<string> readID  = split_string(lineinfo[10], ',');
        vector<string> readCIG = split_string(lineinfo[11], ',');
        
        unsigned long first_aligned    = 0;
        unsigned long last_aligned     = 0;
        unsigned long mole_len         = 0;
        unsigned long mole_covered_len = 0;        
        double        mole_base_cov    = 0;
        int           read_num         = 0;
        unsigned long last_aligned_end = 0;
        std::stringstream all_reads_aligned_at;
        std::stringstream R1R2;
        std::stringstream read_id;
        std::stringstream read_cigar;
        //
        all_reads_aligned_at.str("");   
        R1R2.str("");
        read_id.str("");
        read_cigar.str("");
        //
        vector<string>::iterator samread_itr;
        vector<string>::iterator samread_itr_end;
        samread_itr     = readPos.begin();
        samread_itr_end = readPos.end();    
        int iii = -1;
        while(samread_itr != samread_itr_end)
        {
            iii ++;
            // double myrand = ((double) rand() / (RAND_MAX)); 
            double myrand = rand()%1000000000*1.0 / 1000000000.0; 
            //if(myrand <= readratio || iii==0 || iii==readPos.size()-1) // try keeping length of molecules
            if(myrand <= readratio) // try keeping length of molecules
            {
                if(false && myrand <= readratio)
                {
                    cout << "   check: read " 
                         << *samread_itr 
                         << " selected, because myrand " 
                         << myrand 
                         << " < readratio " 
                         << readratio << endl; 
                } 
                if(false && iii==0)
                {
                    cout << "   check: read " 
                         << *samread_itr 
                         << " selected, because iii == 0 " 
                         << endl;                 
                }    
                if(false && iii==readPos.size()-1)
                {
                    cout << "   check: read " 
                         << *samread_itr 
                         << " selected, because iii ==  "  << iii << " == readPos.size()-1 == " << readPos.size()-1
                         << endl;                 
                } 
                vector<string> readspan = split_string(*samread_itr, ',');                      
                if(first_aligned == 0)
                {
                    first_aligned =  strtoul(readspan[0].c_str(), NULL, 0);
                }
                last_aligned      = strtoul(readspan[0].c_str(), NULL, 0);
                last_aligned_end  = strtoul(readspan[1].c_str(), NULL, 0);             
                mole_covered_len += (last_aligned_end - last_aligned);                   
                //
                read_num ++;
                //
                if(all_reads_aligned_at.str().size() > 0)
                all_reads_aligned_at << ";";
                all_reads_aligned_at << readPos[iii];
                //
                if(R1R2.str().size()>0)
                R1R2                 << ",";
                R1R2                 << readR12[iii];
                //
                if(read_id.str().size()>0)
                read_id              << ",";
                read_id              << readID[iii];
                //
                if(read_cigar.str().size()>0)
                read_cigar           << ",";
                read_cigar           << readCIG[iii];
            }
            else
            {
                if(false)
                cout << "   check: read " 
                     << *samread_itr 
                     << " not selected, because myrand " 
                     << myrand 
                     << " > readratio " 
                     << readratio << endl;
            }
            samread_itr ++;
        }
        mole_len      = last_aligned_end - first_aligned + 1;
        if(mole_len < 1000) continue;
        mole_base_cov = 1.0*mole_covered_len / mole_len;
        // stage 2. sample molecule 
        
        int    key    = (int)round((double)mole_len/1000);
        // double randra = ((double) rand() / (RAND_MAX)); 
        double randra = rand()%1000000000*1.0 / 1000000000.0;         
        if(randra <= msratio[key])
        {
            // collect this molecule
            moutfp << lineinfo[0]                << "\t"
                   << first_aligned              << "\t"
                   << last_aligned               << "\t"
                   << mole_len                   << "\t"
                   << setprecision(2)            << fixed 
                   << mole_base_cov              << "\t"
                   << read_num                   << "\t"
                   << lineinfo[6]                << "\t"
                   << last_aligned_end           << "\t"
                   << all_reads_aligned_at.str() << "\t"
                   << R1R2.str()                 << "\t"
                   << read_id.str()              << "\t"
                   << read_cigar.str()           << endl;
            // collect molecule cov
            std::stringstream mckey;
            mckey.str("");
            mckey << setprecision(2) << fixed << mole_base_cov;            
            map<string, unsigned long>::iterator mcitr = (*molecule_cov).find(mckey.str());
            if(mcitr == (*molecule_cov).end())
            {
                (*molecule_cov).insert(std::pair<string, unsigned long>(mckey.str(), 1));
            }
            else
            {
                (*mcitr).second += 1;
            }
            // collect molecule len
            map<int, unsigned long>::iterator mlitr = (*molecule_len).find(key);
            if(mlitr == (*molecule_len).end())
            {
                (*molecule_len).insert(std::pair<int, unsigned long>(key, 1));
                (*molecule_len_sum).insert(std::pair<int, unsigned long>(key,  mole_len));
            }
            else
            {
                (*mlitr).second += 1;
                (*molecule_len_sum)[key] += mole_len;
            }
            // collect molecule read number
            map<int,    unsigned long>::iterator readitr;
            readitr     = (*molecule_read_num).find(read_num);
            if(readitr == (*molecule_read_num).end())
            {
                (*molecule_read_num).insert(std::pair<int, unsigned long>(read_num, 1));
                (*molecule_read_num_sum).insert(std::pair<int, unsigned long>(read_num, mole_covered_len));
            }
            else
            {
                (*molecule_read_num)[read_num] += 1;
                (*molecule_read_num_sum)[read_num] += mole_covered_len;
            }
            // molecules per barcode
            vector<string> chrbc = split_string(lineinfo[0], '#'); // get [0]:chr, [1]:barcode/partition
            map<string, int>::iterator bcitr;
            bcitr = (*barcode_molecule_cnt).find(chrbc[1]);
            if(bcitr == (*barcode_molecule_cnt).end())
            {
                (*barcode_molecule_cnt).insert(std::pair<string, int>(chrbc[1], 1));
            }
            else
            {
                (*barcode_molecule_cnt)[chrbc[1]] +=1;
            }     
            // read ids
            if(false)
            {
                vector<string> readids = split_string(read_id.str(), ',');
                map<string, int> checkreads;
                vector<string>::iterator iditr;
                vector<string>::iterator iditr_end;
                iditr     = readids.begin();
                iditr_end = readids.end();
                while(iditr != iditr_end)
                {
                    string this_id = *iditr;
                    if(checkreads.find(this_id) == checkreads.end() )
                    {
                        checkreads.insert(std::pair<string, int>(this_id, 1) );
                        ridoutfp << this_id << endl;
                    }
                    iditr ++;
                }
                checkreads.clear();
            }
        }
    }
    molfp.close();  
    moutfp.close();    
    ridoutfp.close();  
    return true;
}

// Assembly:
subq $0x1778, %rsp           # imm = 0x1778
movq %rdx, 0x2f0(%rsp)
movq %rsi, 0x2f8(%rsp)
movq %rdi, 0x300(%rsp)
movq 0x1790(%rsp), %rax
movq 0x1788(%rsp), %rax
movq 0x1780(%rsp), %rax
movq %rdi, 0x1768(%rsp)
movsd %xmm0, 0x1760(%rsp)
movq %rsi, 0x1758(%rsp)
movq %rdx, 0x1750(%rsp)
movq %rcx, 0x1748(%rsp)
movq %r8, 0x1740(%rsp)
movq %r9, 0x1738(%rsp)
leaq 0x1498(%rsp), %rdi
movq %rdi, 0x308(%rsp)
callq 0xf8b0
movq 0x300(%rsp), %rdi
callq 0x51d0
movq 0x308(%rsp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0xf9c0
jmp 0x41b29
movq 0x1498(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x1498(%rsp,%rax), %rdi
callq 0x5760
movb %al, 0x2ef(%rsp)
jmp 0x41b4b
movb 0x2ef(%rsp), %al
testb $0x1, %al
jne 0x41bdf
jmp 0x41b5c
movq 0x43465(%rip), %rdi     # 0x84fc8
leaq 0x2890a(%rip), %rsi     # 0x6a474
callq 0x5460
movq %rax, 0x2e0(%rsp)
jmp 0x41b79
movq 0x300(%rsp), %rsi
movq 0x2e0(%rsp), %rdi
callq 0x53e0
movq %rax, 0x2d8(%rsp)
jmp 0x41b98
movq 0x2d8(%rsp), %rdi
movq 0x43409(%rip), %rsi     # 0x84fb0
callq 0x54b0
jmp 0x41bae
movb $0x0, 0x1777(%rsp)
movl $0x1, 0x1488(%rsp)
jmp 0x439bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x439db
movq 0x2f8(%rsp), %rsi
leaq 0x288ae(%rip), %rdx     # 0x6a49c
leaq 0x1468(%rsp), %rdi
callq 0xfae0
jmp 0x41bfd
leaq 0x11d0(%rsp), %rdi
callq 0x87b0
jmp 0x41c0c
leaq 0x1468(%rsp), %rdi
callq 0x51d0
movq %rax, %rsi
leaq 0x11d0(%rsp), %rdi
movl $0x10, %edx
callq 0x88c0
jmp 0x41c30
movq 0x11d0(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x11d0(%rsp,%rax), %rdi
callq 0x5220
movb %al, 0x2d7(%rsp)
jmp 0x41c52
movb 0x2d7(%rsp), %al
testb $0x1, %al
jne 0x41c62
jmp 0x41d1c
movq 0x4335f(%rip), %rdi     # 0x84fc8
leaq 0x24ee6(%rip), %rsi     # 0x66b56
callq 0x5460
movq %rax, 0x2c8(%rsp)
jmp 0x41c7f
movq 0x2c8(%rsp), %rdi
leaq 0x1468(%rsp), %rsi
callq 0x53e0
movq %rax, 0x2c0(%rsp)
jmp 0x41c9e
movq 0x2c0(%rsp), %rdi
leaq 0x28820(%rip), %rsi     # 0x6a4cd
callq 0x5460
movq %rax, 0x2b8(%rsp)
jmp 0x41cbc
movq 0x2b8(%rsp), %rdi
movq 0x432e5(%rip), %rsi     # 0x84fb0
callq 0x54b0
jmp 0x41cd2
movb $0x0, 0x1777(%rsp)
movl $0x1, 0x1488(%rsp)
jmp 0x43985
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x439ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x439a1
movq 0x2f8(%rsp), %rsi
leaq 0x287c3(%rip), %rdx     # 0x6a4ee
leaq 0x11b0(%rsp), %rdi
callq 0xfae0
jmp 0x41d3a
leaq 0xfb0(%rsp), %rdi
callq 0x5770
jmp 0x41d49
leaq 0x11b0(%rsp), %rdi
callq 0x51d0
movq %rax, %rsi
leaq 0xfb0(%rsp), %rdi
movl $0x10, %edx
callq 0x5070
jmp 0x41d6d
leaq 0xfb0(%rsp), %rdi
callq 0x5370
movb %al, 0x2b7(%rsp)
jmp 0x41d83
movb 0x2b7(%rsp), %al
testb $0x1, %al
jne 0x41e30
jmp 0x41d94
movq 0x4322d(%rip), %rdi     # 0x84fc8
leaq 0x24db4(%rip), %rsi     # 0x66b56
callq 0x5460
movq %rax, 0x2a8(%rsp)
jmp 0x41db1
movq 0x2a8(%rsp), %rdi
leaq 0x11b0(%rsp), %rsi
callq 0x53e0
movq %rax, 0x2a0(%rsp)
jmp 0x41dd0
movq 0x2a0(%rsp), %rdi
movq 0x431d1(%rip), %rsi     # 0x84fb0
callq 0x54b0
jmp 0x41de6
movb $0x0, 0x1777(%rsp)
movl $0x1, 0x1488(%rsp)
jmp 0x4394d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x43976
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x43969
movq 0x43191(%rip), %rdi     # 0x84fc8
leaq 0x286df(%rip), %rsi     # 0x6a51d
callq 0x5460
movq %rax, 0x298(%rsp)
jmp 0x41e4d
movq 0x298(%rsp), %rdi
movq 0x43154(%rip), %rsi     # 0x84fb0
callq 0x54b0
jmp 0x41e63
xorl %eax, %eax
movl %eax, %edi
callq 0x5400
movl %eax, %edi
callq 0x5430
movq 0x1498(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x1498(%rsp,%rax), %rdi
callq 0x5760
movb %al, 0x297(%rsp)
jmp 0x41e95
movb 0x297(%rsp), %al
testb $0x1, %al
jne 0x41ea5
jmp 0x4390d
leaq 0xf8f(%rsp), %rdi
movq %rdi, 0x288(%rsp)
callq 0x57c0
movq 0x288(%rsp), %rdx
leaq 0x28ccb(%rip), %rsi     # 0x6ab94
leaq 0xf90(%rsp), %rdi
callq 0x6880
jmp 0x41ed8
leaq 0xf8f(%rsp), %rdi
callq 0x54d0
leaq 0x1620(%rsp), %rdi
leaq 0xf90(%rsp), %rsi
callq 0x50c0
jmp 0x41efc
leaq 0xf90(%rsp), %rdi
callq 0x5310
cmpq $0x0, %rax
je 0x41f3a
xorl %eax, %eax
movl %eax, %esi
leaq 0xf90(%rsp), %rdi
callq 0x5880
movq %rax, 0x280(%rsp)
jmp 0x41f2a
movq 0x280(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x41f89
movl $0x2, 0x1488(%rsp)
jmp 0x43865
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0xf8f(%rsp), %rdi
callq 0x54d0
jmp 0x43969
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x438fe
movb $0x9, 0xf6f(%rsp)
leaq 0xf70(%rsp), %rdi
leaq 0xf90(%rsp), %rsi
leaq 0xf6f(%rsp), %rdx
callq 0x60790
jmp 0x41fb0
leaq 0xf70(%rsp), %rdi
callq 0xfbb0
cmpq $0xc, %rax
jae 0x41fd3
movl $0x2, 0x1488(%rsp)
jmp 0x43858
leaq 0xf70(%rsp), %rdi
movl $0x8, %esi
callq 0x88f0
movq %rax, %rsi
movb $0x3b, 0xf4f(%rsp)
leaq 0xf50(%rsp), %rdi
leaq 0xf4f(%rsp), %rdx
callq 0x60790
jmp 0x42007
leaq 0xf70(%rsp), %rdi
movl $0x9, %esi
callq 0x88f0
movq %rax, %rsi
movb $0x2c, 0xf2f(%rsp)
leaq 0xf30(%rsp), %rdi
leaq 0xf2f(%rsp), %rdx
callq 0x60790
jmp 0x4203b
leaq 0xf70(%rsp), %rdi
movl $0xa, %esi
callq 0x88f0
movq %rax, %rsi
movb $0x2c, 0xf0f(%rsp)
leaq 0xf10(%rsp), %rdi
leaq 0xf0f(%rsp), %rdx
callq 0x60790
jmp 0x4206f
leaq 0xf70(%rsp), %rdi
movl $0xb, %esi
callq 0x88f0
movq %rax, %rsi
movb $0x2c, 0xeef(%rsp)
leaq 0xef0(%rsp), %rdi
leaq 0xeef(%rsp), %rdx
callq 0x60790
jmp 0x420a3
movq $0x0, 0xee0(%rsp)
movq $0x0, 0xed8(%rsp)
movq $0x0, 0xed0(%rsp)
movq $0x0, 0xec8(%rsp)
movq $0x0, 0xec0(%rsp)
movl $0x0, 0xebc(%rsp)
movq $0x0, 0xeb0(%rsp)
leaq 0xd28(%rsp), %rdi
callq 0x5320
jmp 0x42105
leaq 0xba0(%rsp), %rdi
callq 0x5320
jmp 0x42114
leaq 0xa18(%rsp), %rdi
callq 0x5320
jmp 0x42123
leaq 0x890(%rsp), %rdi
callq 0x5320
jmp 0x42132
leaq 0x86f(%rsp), %rdi
movq %rdi, 0x278(%rsp)
callq 0x57c0
movq 0x278(%rsp), %rdx
leaq 0x28a3e(%rip), %rsi     # 0x6ab94
leaq 0x870(%rsp), %rdi
callq 0x6880
jmp 0x42165
leaq 0xd28(%rsp), %rdi
leaq 0x870(%rsp), %rsi
callq 0x5510
jmp 0x4217c
leaq 0x870(%rsp), %rdi
callq 0x58b8
leaq 0x86f(%rsp), %rdi
callq 0x54d0
leaq 0x847(%rsp), %rdi
movq %rdi, 0x270(%rsp)
callq 0x57c0
movq 0x270(%rsp), %rdx
leaq 0x289da(%rip), %rsi     # 0x6ab94
leaq 0x848(%rsp), %rdi
callq 0x6880
jmp 0x421c9
leaq 0xba0(%rsp), %rdi
leaq 0x848(%rsp), %rsi
callq 0x5510
jmp 0x421e0
leaq 0x848(%rsp), %rdi
callq 0x58b8
leaq 0x847(%rsp), %rdi
callq 0x54d0
leaq 0x81f(%rsp), %rdi
movq %rdi, 0x268(%rsp)
callq 0x57c0
movq 0x268(%rsp), %rdx
leaq 0x28976(%rip), %rsi     # 0x6ab94
leaq 0x820(%rsp), %rdi
callq 0x6880
jmp 0x4222d
leaq 0xa18(%rsp), %rdi
leaq 0x820(%rsp), %rsi
callq 0x5510
jmp 0x42244
leaq 0x820(%rsp), %rdi
callq 0x58b8
leaq 0x81f(%rsp), %rdi
callq 0x54d0
leaq 0x7f7(%rsp), %rdi
movq %rdi, 0x260(%rsp)
callq 0x57c0
movq 0x260(%rsp), %rdx
leaq 0x28912(%rip), %rsi     # 0x6ab94
leaq 0x7f8(%rsp), %rdi
callq 0x6880
jmp 0x42291
leaq 0x890(%rsp), %rdi
leaq 0x7f8(%rsp), %rsi
callq 0x5510
jmp 0x422a8
leaq 0x7f8(%rsp), %rdi
callq 0x58b8
leaq 0x7f7(%rsp), %rdi
callq 0x54d0
leaq 0x7e8(%rsp), %rdi
callq 0x2de30
leaq 0x7e0(%rsp), %rdi
callq 0x2de30
leaq 0xf50(%rsp), %rdi
callq 0x2d110
movq %rax, 0x7d8(%rsp)
movq 0x7d8(%rsp), %rax
movq %rax, 0x7e8(%rsp)
leaq 0xf50(%rsp), %rdi
callq 0x2d140
movq %rax, 0x7d0(%rsp)
movq 0x7d0(%rsp), %rax
movq %rax, 0x7e0(%rsp)
movl $0xffffffff, 0x7cc(%rsp) # imm = 0xFFFFFFFF
leaq 0x7e8(%rsp), %rdi
leaq 0x7e0(%rsp), %rsi
callq 0x2d170
testb $0x1, %al
jne 0x4234f
jmp 0x4298e
movl 0x7cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7cc(%rsp)
callq 0x5120
movl $0x3b9aca00, %ecx       # imm = 0x3B9ACA00
cltd
idivl %ecx
cvtsi2sd %edx, %xmm0
movsd 0x24d37(%rip), %xmm1    # 0x670b0
mulsd %xmm1, %xmm0
movsd 0x27ccb(%rip), %xmm1    # 0x6a050
divsd %xmm1, %xmm0
movsd %xmm0, 0x7c0(%rsp)
movsd 0x7c0(%rsp), %xmm1
movsd 0x1760(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x42970
leaq 0x7e8(%rsp), %rdi
callq 0x2d1b0
movq %rax, %rsi
movb $0x2c, 0x7a7(%rsp)
leaq 0x7a8(%rsp), %rdi
leaq 0x7a7(%rsp), %rdx
callq 0x60790
jmp 0x423dd
cmpq $0x0, 0xee0(%rsp)
jne 0x42625
leaq 0x7a8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x88f0
movq %rax, %rdi
callq 0x51d0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x5160
movq %rax, 0xee0(%rsp)
jmp 0x42625
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x438f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x438e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x438d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x438ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x438bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x438b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x438a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x43896
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x4251f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x870(%rsp), %rdi
callq 0x58b8
leaq 0x86f(%rsp), %rdi
callq 0x54d0
jmp 0x43889
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x42568
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x848(%rsp), %rdi
callq 0x58b8
leaq 0x847(%rsp), %rdi
callq 0x54d0
jmp 0x43889
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x425b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x820(%rsp), %rdi
callq 0x58b8
leaq 0x81f(%rsp), %rdi
callq 0x54d0
jmp 0x43889
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x425fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x7f8(%rsp), %rdi
callq 0x58b8
leaq 0x7f7(%rsp), %rdi
callq 0x54d0
jmp 0x43889
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x43889
xorl %eax, %eax
movl %eax, 0x25c(%rsp)
movl %eax, %esi
movq %rsi, 0x250(%rsp)
leaq 0x7a8(%rsp), %rdi
movq %rdi, 0x248(%rsp)
callq 0x88f0
movq %rax, %rdi
callq 0x51d0
movq 0x250(%rsp), %rsi
movl 0x25c(%rsp), %edx
movq %rax, %rdi
callq 0x5160
movq 0x248(%rsp), %rdi
movq %rax, 0xed8(%rsp)
movl $0x1, %esi
callq 0x88f0
movq %rax, %rdi
callq 0x51d0
movq 0x250(%rsp), %rsi
movl 0x25c(%rsp), %edx
movq %rax, %rdi
callq 0x5160
movq %rax, 0xeb0(%rsp)
movq 0xeb0(%rsp), %rcx
movq 0xed8(%rsp), %rax
subq %rax, %rcx
movq 0xec8(%rsp), %rax
addq %rcx, %rax
movq %rax, 0xec8(%rsp)
movl 0xebc(%rsp), %eax
incl %eax
movl %eax, 0xebc(%rsp)
leaq 0x780(%rsp), %rdi
leaq 0xd28(%rsp), %rsi
callq 0x5440
jmp 0x426fa
leaq 0x780(%rsp), %rdi
callq 0x5310
movq %rax, 0x240(%rsp)
leaq 0x780(%rsp), %rdi
callq 0x58b8
movq 0x240(%rsp), %rax
cmpq $0x0, %rax
jbe 0x42768
leaq 0xd38(%rsp), %rdi
leaq 0x25d38(%rip), %rsi     # 0x68471
callq 0x5460
jmp 0x42740
jmp 0x42768
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x7a8(%rsp), %rdi
callq 0x8910
jmp 0x43889
leaq 0xd38(%rsp), %rax
movq %rax, 0x238(%rsp)
movslq 0x7cc(%rsp), %rsi
leaq 0xf50(%rsp), %rdi
callq 0x88f0
movq 0x238(%rsp), %rdi
movq %rax, %rsi
callq 0x53e0
jmp 0x4279f
leaq 0x760(%rsp), %rdi
leaq 0xba0(%rsp), %rsi
callq 0x5440
jmp 0x427b6
leaq 0x760(%rsp), %rdi
callq 0x5310
movq %rax, 0x230(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x58b8
movq 0x230(%rsp), %rax
cmpq $0x0, %rax
jbe 0x427fe
leaq 0xbb0(%rsp), %rdi
leaq 0x246ab(%rip), %rsi     # 0x66ea0
callq 0x5460
jmp 0x427fc
jmp 0x427fe
leaq 0xbb0(%rsp), %rax
movq %rax, 0x228(%rsp)
movslq 0x7cc(%rsp), %rsi
leaq 0xf30(%rsp), %rdi
callq 0x88f0
movq 0x228(%rsp), %rdi
movq %rax, %rsi
callq 0x53e0
jmp 0x42835
leaq 0x740(%rsp), %rdi
leaq 0xa18(%rsp), %rsi
callq 0x5440
jmp 0x4284c
leaq 0x740(%rsp), %rdi
callq 0x5310
movq %rax, 0x220(%rsp)
leaq 0x740(%rsp), %rdi
callq 0x58b8
movq 0x220(%rsp), %rax
cmpq $0x0, %rax
jbe 0x42894
leaq 0xa28(%rsp), %rdi
leaq 0x24615(%rip), %rsi     # 0x66ea0
callq 0x5460
jmp 0x42892
jmp 0x42894
leaq 0xa28(%rsp), %rax
movq %rax, 0x218(%rsp)
movslq 0x7cc(%rsp), %rsi
leaq 0xf10(%rsp), %rdi
callq 0x88f0
movq 0x218(%rsp), %rdi
movq %rax, %rsi
callq 0x53e0
jmp 0x428cb
leaq 0x720(%rsp), %rdi
leaq 0x890(%rsp), %rsi
callq 0x5440
jmp 0x428e2
leaq 0x720(%rsp), %rdi
callq 0x5310
movq %rax, 0x210(%rsp)
leaq 0x720(%rsp), %rdi
callq 0x58b8
movq 0x210(%rsp), %rax
cmpq $0x0, %rax
jbe 0x4292a
leaq 0x8a0(%rsp), %rdi
leaq 0x2457f(%rip), %rsi     # 0x66ea0
callq 0x5460
jmp 0x42928
jmp 0x4292a
leaq 0x8a0(%rsp), %rax
movq %rax, 0x208(%rsp)
movslq 0x7cc(%rsp), %rsi
leaq 0xef0(%rsp), %rdi
callq 0x88f0
movq 0x208(%rsp), %rdi
movq %rax, %rsi
callq 0x53e0
jmp 0x42961
leaq 0x7a8(%rsp), %rdi
callq 0x8910
jmp 0x42972
jmp 0x42972
leaq 0x7e8(%rsp), %rdi
xorl %esi, %esi
callq 0x2d340
movq %rax, 0x718(%rsp)
jmp 0x42331
movq 0xeb0(%rsp), %rax
subq 0xee0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xed0(%rsp)
cmpq $0x3e8, 0xed0(%rsp) # imm = 0x3E8
jae 0x429c8
movl $0x2, 0x1488(%rsp)
jmp 0x437f0
movq 0xec8(%rsp), %xmm0
movaps 0x246f8(%rip), %xmm2    # 0x670d0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x246fc(%rip), %xmm1    # 0x670e0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm3, %xmm0
movq 0xed0(%rsp), %xmm3
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
subpd %xmm1, %xmm3
movaps %xmm3, %xmm4
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
addsd %xmm4, %xmm3
divsd %xmm3, %xmm0
movsd %xmm0, 0xec0(%rsp)
movq 0xed0(%rsp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x23e90(%rip), %xmm1    # 0x668d0
divsd %xmm1, %xmm0
callq 0x51e0
cvttsd2si %xmm0, %eax
movl %eax, 0x714(%rsp)
callq 0x5120
movq 0x2f0(%rsp), %rdi
movslq %eax, %rcx
imulq $0x44b82fa1, %rcx, %rcx # imm = 0x44B82FA1
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x3c, %rcx
addl %edx, %ecx
imull $0x3b9aca00, %ecx, %ecx # imm = 0x3B9ACA00
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0x275c4(%rip), %xmm1    # 0x6a050
divsd %xmm1, %xmm0
movsd %xmm0, 0x708(%rsp)
movsd 0x708(%rsp), %xmm0
movsd %xmm0, 0x1f8(%rsp)
leaq 0x714(%rsp), %rsi
callq 0x457e0
movq %rax, 0x200(%rsp)
jmp 0x42ac2
movsd 0x1f8(%rsp), %xmm1
movq 0x200(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x437e5
leaq 0x1358(%rsp), %rax
movq %rax, 0x1e8(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0xf70(%rsp), %rdi
callq 0x88f0
movq 0x1e8(%rsp), %rdi
movq %rax, %rsi
callq 0x53e0
movq %rax, 0x1f0(%rsp)
jmp 0x42b1c
movq 0x1f0(%rsp), %rdi
leaq 0x28068(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x1e0(%rsp)
jmp 0x42b3a
movq 0x1e0(%rsp), %rdi
movq 0xee0(%rsp), %rsi
callq 0x50f0
movq %rax, 0x1d8(%rsp)
jmp 0x42b59
movq 0x1d8(%rsp), %rdi
leaq 0x2802b(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x1d0(%rsp)
jmp 0x42b77
movq 0x1d0(%rsp), %rdi
movq 0xed8(%rsp), %rsi
callq 0x50f0
movq %rax, 0x1c8(%rsp)
jmp 0x42b96
movq 0x1c8(%rsp), %rdi
leaq 0x27fee(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x1c0(%rsp)
jmp 0x42bb4
movq 0x1c0(%rsp), %rdi
movq 0xed0(%rsp), %rsi
callq 0x50f0
movq %rax, 0x1b8(%rsp)
jmp 0x42bd3
movq 0x1b8(%rsp), %rdi
leaq 0x27fb1(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x1b0(%rsp)
jmp 0x42bf1
movl $0x2, %edi
callq 0x100d0
movl %eax, 0x1ac(%rsp)
jmp 0x42c04
movq 0x1b0(%rsp), %rdi
movl 0x1ac(%rsp), %eax
movl %eax, 0x704(%rsp)
movl 0x704(%rsp), %esi
callq 0x56d0
movq %rax, 0x1a0(%rsp)
jmp 0x42c30
movq 0x1a0(%rsp), %rdi
leaq -0x32b4f(%rip), %rsi    # 0x100f0
callq 0x5180
movq %rax, 0x198(%rsp)
jmp 0x42c4e
movq 0x198(%rsp), %rdi
movsd 0xec0(%rsp), %xmm0
callq 0x5830
movq %rax, 0x190(%rsp)
jmp 0x42c6e
movq 0x190(%rsp), %rdi
leaq 0x27f16(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x188(%rsp)
jmp 0x42c8c
movq 0x188(%rsp), %rdi
movl 0xebc(%rsp), %esi
callq 0x5790
movq %rax, 0x180(%rsp)
jmp 0x42caa
movq 0x180(%rsp), %rdi
leaq 0x27eda(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x178(%rsp)
jmp 0x42cc8
leaq 0xf70(%rsp), %rdi
movl $0x6, %esi
callq 0x88f0
movq 0x178(%rsp), %rdi
movq %rax, %rsi
callq 0x53e0
movq %rax, 0x170(%rsp)
jmp 0x42cf4
movq 0x170(%rsp), %rdi
leaq 0x27e90(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x168(%rsp)
jmp 0x42d12
movq 0x168(%rsp), %rdi
movq 0xeb0(%rsp), %rsi
callq 0x50f0
movq %rax, 0x160(%rsp)
jmp 0x42d31
movq 0x160(%rsp), %rdi
leaq 0x27e53(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x158(%rsp)
jmp 0x42d4f
leaq 0x6e0(%rsp), %rdi
leaq 0xd28(%rsp), %rsi
callq 0x5440
jmp 0x42d66
movq 0x158(%rsp), %rdi
leaq 0x6e0(%rsp), %rsi
callq 0x53e0
movq %rax, 0x150(%rsp)
jmp 0x42d85
movq 0x150(%rsp), %rdi
leaq 0x27dff(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x148(%rsp)
jmp 0x42da3
leaq 0x6c0(%rsp), %rdi
leaq 0xba0(%rsp), %rsi
callq 0x5440
jmp 0x42dba
movq 0x148(%rsp), %rdi
leaq 0x6c0(%rsp), %rsi
callq 0x53e0
movq %rax, 0x140(%rsp)
jmp 0x42dd9
movq 0x140(%rsp), %rdi
leaq 0x27dab(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x138(%rsp)
jmp 0x42df7
leaq 0x6a0(%rsp), %rdi
leaq 0xa18(%rsp), %rsi
callq 0x5440
jmp 0x42e0e
movq 0x138(%rsp), %rdi
leaq 0x6a0(%rsp), %rsi
callq 0x53e0
movq %rax, 0x130(%rsp)
jmp 0x42e2d
movq 0x130(%rsp), %rdi
leaq 0x27d57(%rip), %rsi     # 0x6ab93
callq 0x5460
movq %rax, 0x128(%rsp)
jmp 0x42e4b
leaq 0x680(%rsp), %rdi
leaq 0x890(%rsp), %rsi
callq 0x5440
jmp 0x42e62
movq 0x128(%rsp), %rdi
leaq 0x680(%rsp), %rsi
callq 0x53e0
movq %rax, 0x120(%rsp)
jmp 0x42e81
movq 0x120(%rsp), %rdi
movq 0x42120(%rip), %rsi     # 0x84fb0
callq 0x54b0
jmp 0x42e97
leaq 0x680(%rsp), %rdi
callq 0x58b8
leaq 0x6a0(%rsp), %rdi
callq 0x58b8
leaq 0x6c0(%rsp), %rdi
callq 0x58b8
leaq 0x6e0(%rsp), %rdi
callq 0x58b8
leaq 0x4f8(%rsp), %rdi
callq 0x5320
jmp 0x42eda
leaq 0x4d7(%rsp), %rdi
movq %rdi, 0x118(%rsp)
callq 0x57c0
movq 0x118(%rsp), %rdx
leaq 0x27c96(%rip), %rsi     # 0x6ab94
leaq 0x4d8(%rsp), %rdi
callq 0x6880
jmp 0x42f0d
leaq 0x4f8(%rsp), %rdi
leaq 0x4d8(%rsp), %rsi
callq 0x5510
jmp 0x42f24
leaq 0x4d8(%rsp), %rdi
callq 0x58b8
leaq 0x4d7(%rsp), %rdi
callq 0x54d0
leaq 0x508(%rsp), %rax
movq %rax, 0x108(%rsp)
movl $0x2, %edi
callq 0x100d0
movl %eax, 0x114(%rsp)
jmp 0x42f61
movq 0x108(%rsp), %rdi
movl 0x114(%rsp), %eax
movl %eax, 0x4d0(%rsp)
movl 0x4d0(%rsp), %esi
callq 0x56d0
movq %rax, 0x100(%rsp)
jmp 0x42f8d
movq 0x100(%rsp), %rdi
leaq -0x32eac(%rip), %rsi    # 0x100f0
callq 0x5180
movq %rax, 0xf8(%rsp)
jmp 0x42fab
movq 0xf8(%rsp), %rdi
movsd 0xec0(%rsp), %xmm0
callq 0x5830
jmp 0x42fc3
movq 0x1748(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0x4a8(%rsp), %rdi
leaq 0x4f8(%rsp), %rsi
callq 0x5440
jmp 0x42fea
movq 0xf0(%rsp), %rdi
leaq 0x4a8(%rsp), %rsi
callq 0x10110
movq %rax, 0xe8(%rsp)
jmp 0x43009
movq 0xe8(%rsp), %rax
movq %rax, 0x4c8(%rsp)
leaq 0x4a8(%rsp), %rdi
callq 0x58b8
movq 0x1748(%rsp), %rdi
callq 0x10160
movq %rax, 0x4a0(%rsp)
leaq 0x4c8(%rsp), %rdi
leaq 0x4a0(%rsp), %rsi
callq 0x10140
testb $0x1, %al
jne 0x43059
jmp 0x4326d
movq 0x1748(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0x458(%rsp), %rdi
leaq 0x4f8(%rsp), %rsi
callq 0x5440
jmp 0x43080
movl $0x1, 0x454(%rsp)
leaq 0x478(%rsp), %rdi
leaq 0x458(%rsp), %rsi
leaq 0x454(%rsp), %rdx
callq 0x101e0
jmp 0x430aa
movq 0xe0(%rsp), %rdi
leaq 0x478(%rsp), %rsi
callq 0x10190
movb %dl, 0xd7(%rsp)
movq %rax, 0xd8(%rsp)
jmp 0x430d0
movb 0xd7(%rsp), %al
movq 0xd8(%rsp), %rcx
movq %rcx, 0x440(%rsp)
movb %al, 0x448(%rsp)
leaq 0x478(%rsp), %rdi
callq 0x10220
leaq 0x458(%rsp), %rdi
callq 0x58b8
jmp 0x43286
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x4318a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x4317d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x43170
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x680(%rsp), %rdi
callq 0x58b8
leaq 0x6a0(%rsp), %rdi
callq 0x58b8
leaq 0x6c0(%rsp), %rdi
callq 0x58b8
leaq 0x6e0(%rsp), %rdi
callq 0x58b8
jmp 0x43889
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x431d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x4d8(%rsp), %rdi
callq 0x58b8
leaq 0x4d7(%rsp), %rdi
callq 0x54d0
jmp 0x437d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x437d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x4a8(%rsp), %rdi
callq 0x58b8
jmp 0x437d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x4325b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x478(%rsp), %rdi
callq 0x10220
leaq 0x458(%rsp), %rdi
callq 0x58b8
jmp 0x437d3
leaq 0x4c8(%rsp), %rdi
callq 0x10230
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movq 0x1740(%rsp), %rdi
leaq 0x714(%rsp), %rsi
callq 0x10250
movq %rax, 0xc8(%rsp)
jmp 0x432a5
movq 0xc8(%rsp), %rax
movq %rax, 0x438(%rsp)
movq 0x1740(%rsp), %rdi
callq 0x102a0
movq %rax, 0x430(%rsp)
leaq 0x438(%rsp), %rdi
leaq 0x430(%rsp), %rsi
callq 0x10280
testb $0x1, %al
jne 0x432e8
jmp 0x433db
movq 0x1740(%rsp), %rax
movq %rax, 0xc0(%rsp)
movl $0x1, 0x41c(%rsp)
leaq 0x420(%rsp), %rdi
leaq 0x714(%rsp), %rsi
leaq 0x41c(%rsp), %rdx
callq 0x10320
jmp 0x43322
movq 0xc0(%rsp), %rdi
leaq 0x420(%rsp), %rsi
callq 0x102d0
movb %dl, 0xb7(%rsp)
movq %rax, 0xb8(%rsp)
jmp 0x43348
movb 0xb7(%rsp), %al
movq 0xb8(%rsp), %rcx
movq %rcx, 0x408(%rsp)
movb %al, 0x410(%rsp)
movq 0x1738(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0x3f8(%rsp), %rdi
leaq 0x714(%rsp), %rsi
leaq 0xed0(%rsp), %rdx
callq 0x458d0
jmp 0x43395
movq 0xa8(%rsp), %rdi
leaq 0x3f8(%rsp), %rsi
callq 0x102d0
movb %dl, 0x9f(%rsp)
movq %rax, 0xa0(%rsp)
jmp 0x433bb
movb 0x9f(%rsp), %al
movq 0xa0(%rsp), %rcx
movq %rcx, 0x3e8(%rsp)
movb %al, 0x3f0(%rsp)
jmp 0x43438
leaq 0x438(%rsp), %rdi
callq 0x10380
movq 0x8(%rax), %rcx
incq %rcx
movq %rcx, 0x8(%rax)
movq 0xed0(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x1738(%rsp), %rdi
leaq 0x714(%rsp), %rsi
callq 0x103a0
movq %rax, 0x90(%rsp)
jmp 0x43422
movq 0x90(%rsp), %rax
movq 0x88(%rsp), %rcx
addq (%rax), %rcx
movq %rcx, (%rax)
leaq 0x3e0(%rsp), %rdi
callq 0x106c0
movq 0x1780(%rsp), %rdi
leaq 0xebc(%rsp), %rsi
callq 0x10250
movq %rax, 0x80(%rsp)
jmp 0x43464
movq 0x80(%rsp), %rax
movq %rax, 0x3d8(%rsp)
movq 0x3d8(%rsp), %rax
movq %rax, 0x3e0(%rsp)
movq 0x1780(%rsp), %rdi
callq 0x102a0
movq %rax, 0x3d0(%rsp)
leaq 0x3e0(%rsp), %rdi
leaq 0x3d0(%rsp), %rsi
callq 0x10280
testb $0x1, %al
jne 0x434b7
jmp 0x43586
movq 0x1780(%rsp), %rax
movq %rax, 0x78(%rsp)
movl $0x1, 0x3bc(%rsp)
leaq 0x3c0(%rsp), %rdi
leaq 0xebc(%rsp), %rsi
leaq 0x3bc(%rsp), %rdx
callq 0x10320
jmp 0x434ee
movq 0x78(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
callq 0x102d0
movb %dl, 0x6f(%rsp)
movq %rax, 0x70(%rsp)
jmp 0x4350b
movb 0x6f(%rsp), %al
movq 0x70(%rsp), %rcx
movq %rcx, 0x3a8(%rsp)
movb %al, 0x3b0(%rsp)
movq 0x1788(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x398(%rsp), %rdi
leaq 0xebc(%rsp), %rsi
leaq 0xec8(%rsp), %rdx
callq 0x458d0
jmp 0x4354f
movq 0x60(%rsp), %rdi
leaq 0x398(%rsp), %rsi
callq 0x102d0
movb %dl, 0x57(%rsp)
movq %rax, 0x58(%rsp)
jmp 0x4356c
movb 0x57(%rsp), %al
movq 0x58(%rsp), %rcx
movq %rcx, 0x388(%rsp)
movb %al, 0x390(%rsp)
jmp 0x435e9
movq 0x1780(%rsp), %rdi
leaq 0xebc(%rsp), %rsi
callq 0x103a0
movq %rax, 0x48(%rsp)
jmp 0x435a2
movq 0x48(%rsp), %rax
movq (%rax), %rcx
incq %rcx
movq %rcx, (%rax)
movq 0xec8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x1788(%rsp), %rdi
leaq 0xebc(%rsp), %rsi
callq 0x103a0
movq %rax, 0x40(%rsp)
jmp 0x435d9
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rcx
addq (%rax), %rcx
movq %rcx, (%rax)
xorl %eax, %eax
movl %eax, %esi
leaq 0xf70(%rsp), %rdi
callq 0x88f0
movq %rax, %rsi
movb $0x23, 0x36f(%rsp)
leaq 0x370(%rsp), %rdi
leaq 0x36f(%rsp), %rdx
callq 0x60790
jmp 0x4361c
leaq 0x360(%rsp), %rdi
callq 0x10490
movq 0x1790(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x370(%rsp), %rdi
movl $0x1, %esi
callq 0x88f0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x104b0
movq %rax, 0x30(%rsp)
jmp 0x4365c
movq 0x30(%rsp), %rax
movq %rax, 0x358(%rsp)
movq 0x358(%rsp), %rax
movq %rax, 0x360(%rsp)
movq 0x1790(%rsp), %rdi
callq 0x10500
movq %rax, 0x350(%rsp)
leaq 0x360(%rsp), %rdi
leaq 0x350(%rsp), %rsi
callq 0x104e0
testb $0x1, %al
jne 0x436ac
jmp 0x4376d
movq 0x1790(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x370(%rsp), %rdi
movl $0x1, %esi
callq 0x88f0
movq %rax, %rsi
movl $0x1, 0x324(%rsp)
leaq 0x328(%rsp), %rdi
leaq 0x324(%rsp), %rdx
callq 0x10580
jmp 0x436f0
movq 0x20(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x10530
movb %dl, 0x17(%rsp)
movq %rax, 0x18(%rsp)
jmp 0x4370d
movb 0x17(%rsp), %al
movq 0x18(%rsp), %rcx
movq %rcx, 0x310(%rsp)
movb %al, 0x318(%rsp)
leaq 0x328(%rsp), %rdi
callq 0x105c0
jmp 0x437aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
jmp 0x437c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1490(%rsp)
movl %eax, 0x148c(%rsp)
leaq 0x328(%rsp), %rdi
callq 0x105c0
jmp 0x437c6
movq 0x1790(%rsp), %rax
movq %rax, (%rsp)
leaq 0x370(%rsp), %rdi
movl $0x1, %esi
callq 0x88f0
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x105d0
movq %rax, 0x8(%rsp)
jmp 0x4379e
movq 0x8(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x370(%rsp), %rdi
callq 0x8910
leaq 0x4f8(%rsp), %rdi
callq 0x5350
jmp 0x437e5
leaq 0x370(%rsp), %rdi
callq 0x8910
leaq 0x4f8(%rsp), %rdi
callq 0x5350
jmp 0x43889
movl $0x0, 0x1488(%rsp)
leaq 0x890(%rsp), %rdi
callq 0x5350
leaq 0xa18(%rsp), %rdi
callq 0x5350
leaq 0xba0(%rsp), %rdi
callq 0x5350
leaq 0xd28(%rsp), %rdi
callq 0x5350
leaq 0xef0(%rsp), %rdi
callq 0x8910
leaq 0xf10(%rsp), %rdi
callq 0x8910
leaq 0xf30(%rsp), %rdi
callq 0x8910
leaq 0xf50(%rsp), %rdi
callq 0x8910
leaq 0xf70(%rsp), %rdi
callq 0x8910
leaq 0xf90(%rsp), %rdi
callq 0x58b8
movl 0x1488(%rsp), %eax
testl %eax, %eax
je 0x43884
jmp 0x4387f
jmp 0x41e73
jmp 0x41e73
leaq 0x890(%rsp), %rdi
callq 0x5350
leaq 0xa18(%rsp), %rdi
callq 0x5350
leaq 0xba0(%rsp), %rdi
callq 0x5350
leaq 0xd28(%rsp), %rdi
callq 0x5350
leaq 0xef0(%rsp), %rdi
callq 0x8910
leaq 0xf10(%rsp), %rdi
callq 0x8910
leaq 0xf30(%rsp), %rdi
callq 0x8910
leaq 0xf50(%rsp), %rdi
callq 0x8910
leaq 0xf70(%rsp), %rdi
callq 0x8910
leaq 0xf90(%rsp), %rdi
callq 0x58b8
jmp 0x43969
leaq 0x1498(%rsp), %rdi
callq 0x65264
jmp 0x4391c
leaq 0x11d0(%rsp), %rdi
callq 0x65264
jmp 0x4392b
leaq 0xfb0(%rsp), %rdi
callq 0x5610
jmp 0x4393a
movb $0x1, 0x1777(%rsp)
movl $0x1, 0x1488(%rsp)
leaq 0xfb0(%rsp), %rdi
callq 0x5670
leaq 0x11b0(%rsp), %rdi
callq 0x58b8
jmp 0x43985
leaq 0xfb0(%rsp), %rdi
callq 0x5670
leaq 0x11b0(%rsp), %rdi
callq 0x58b8
jmp 0x439a1
leaq 0x11d0(%rsp), %rdi
callq 0x8970
leaq 0x1468(%rsp), %rdi
callq 0x58b8
jmp 0x439bd
leaq 0x11d0(%rsp), %rdi
callq 0x8970
leaq 0x1468(%rsp), %rdi
callq 0x58b8
jmp 0x439db
leaq 0x1498(%rsp), %rdi
callq 0xfe60
movb 0x1777(%rsp), %al
andb $0x1, %al
addq $0x1778, %rsp           # imm = 0x1778
retq
leaq 0x1498(%rsp), %rdi
callq 0xfe60
movq 0x1490(%rsp), %rdi
callq 0x57b0
nopw %cs:(%rax,%rax)