// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10e8, %rsp           # imm = 0x10E8
movq %r9, %rbx
movq %r8, %r12
movq %rcx, %r13
movq %rdx, 0x188(%rsp)
movq %rsi, %r14
movsd %xmm0, 0x190(%rsp)
movq %rdi, %r15
leaq 0x9b0(%rsp), %rbp
movq %rbp, %rdi
callq 0xcb3a
movq (%r15), %rsi
movq %rbp, 0x148(%rsp)
movq %rbp, %rdi
movl $0x8, %edx
callq 0x39022
movq 0x9b0(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x9d0(%rsp,%rax)
je 0x2802c
movq 0x23ff1(%rip), %rdi     # 0x4bfc8
leaq 0x163f0(%rip), %rsi     # 0x3e3ce
movl $0x27, %edx
callq 0x43a0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x23fd2(%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
xorl %ebp, %ebp
jmp 0x2832f
leaq 0xc8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0xd940
leaq 0x163a0(%rip), %rsi     # 0x3e3f6
leaq 0xb8(%rsp), %rdi
callq 0x45e0
leaq 0xe50(%rsp), %rdi
callq 0x69ce
movq 0xb8(%rsp), %rsi
leaq 0xe50(%rsp), %rdi
movq %rdi, 0x140(%rsp)
movl $0x10, %edx
callq 0x39022
movq 0xe50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xe70(%rsp,%rax)
je 0x28121
movq 0x23f19(%rip), %rdi     # 0x4bfc8
leaq 0x12ab8(%rip), %rsi     # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq 0x23ef1(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %rbx
leaq 0x16341(%rip), %rsi     # 0x3e427
movl $0x20, %edx
movq %rax, %rdi
callq 0x43a0
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
xorl %ebp, %ebp
jmp 0x282f1
movq %r12, 0x138(%rsp)
leaq 0xa8(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0xd940
leaq 0x162f4(%rip), %rsi     # 0x3e448
leaq 0x98(%rsp), %rdi
callq 0x45e0
leaq 0xc50(%rsp), %rdi
callq 0x4570
movq 0x98(%rsp), %rsi
leaq 0xc50(%rsp), %rdi
movl $0x10, %edx
callq 0x4060
leaq 0xcc0(%rsp), %rdi
callq 0x40c0
movl %eax, %ebp
testb %al, %al
je 0x2823e
movq 0x23e22(%rip), %r14     # 0x4bfc8
leaq 0x162ca(%rip), %rsi     # 0x3e477
movl $0x1e, %edx
movq %r14, %rdi
callq 0x43a0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq 0x23df0(%rip), %rdi     # 0x4bfc8
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq %rbx, 0x110(%rsp)
xorl %edi, %edi
callq 0x42e0
movl %eax, %edi
callq 0x4300
movq 0x9b0(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x9d0(%rsp,%rax)
je 0x28384
leaq 0x9b0(%rsp), %rdi
callq 0x392ca
leaq 0xe50(%rsp), %rdi
callq 0x392ca
leaq 0xc50(%rsp), %rdi
callq 0x4440
jmp 0x2829c
movq 0x23d83(%rip), %rdi     # 0x4bfc8
leaq 0x12922(%rip), %rsi     # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x23d5b(%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 0x23d1d(%rip), %rax     # 0x4bfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0xc58(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0xc50(%rsp,%rcx)
callq 0x42a0
leaq 0xd48(%rsp), %rdi
callq 0x4140
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0x282f1
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x23728(%rip), %rsi     # 0x4ba20
leaq 0xe50(%rsp), %rdi
callq 0x38fcc
leaq 0xfe0(%rsp), %rdi
callq 0x4140
movq 0xb8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2832f
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x2390a(%rip), %rax     # 0x4bc40
leaq 0xb48(%rsp), %rbx
movq %rax, -0x10(%rbx)
leaq 0x2391f(%rip), %rax     # 0x4bc68
movq %rax, (%rbx)
movq $0x0, -0x8(%rbx)
leaq 0x2384d(%rip), %rsi     # 0x4bba8
leaq 0x9b0(%rsp), %rdi
callq 0x38fcc
movq %rbx, %rdi
callq 0x4140
movl %ebp, %eax
addq $0x10e8, %rsp           # imm = 0x10E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1130(%rsp), %rdx
movq 0x1120(%rsp), %rsi
leaq 0xe8(%rsp), %rbx
movl $0x188, %eax            # imm = 0x188
addq %rax, 0x148(%rsp)
addq %rax, 0x140(%rsp)
movl $0x80, %eax
leaq 0x1b0(%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0xf8(%rsp)
leaq 0x518(%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0x118(%rsp)
leaq 0x6a0(%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0x120(%rsp)
leaq 0x828(%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0x128(%rsp)
leaq 0x390(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x130(%rsp)
leaq 0x8(%r13), %rax
movq %rax, 0x178(%rsp)
movq 0x138(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x108(%rsp)
leaq 0x8(%rsi), %rax
movq %rax, 0x100(%rsp)
leaq 0x8(%rdx), %rax
movq %rax, 0x170(%rsp)
movl %ebp, 0x7c(%rsp)
movq %r13, 0x180(%rsp)
movq %rbx, 0xd8(%rsp)
leaq 0xd8(%rsp), %rdi
leaq 0x1669a(%rip), %rdx     # 0x3eb0a
movq %rdx, %rsi
callq 0x5384
movq 0xb38(%rsp), %rax
movq -0x18(%rax), %rdi
movq 0x148(%rsp), %r14
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %edx
movq %r14, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x45c0
cmpq $0x0, 0xe0(%rsp)
movq 0xd8(%rsp), %rdi
je 0x29282
cmpb $0x23, (%rdi)
je 0x29282
movb $0x9, 0x390(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0x390(%rsp), %rdx
callq 0x367c0
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rax
subq %rsi, %rax
cmpq $0x180, %rax            # imm = 0x180
jb 0x2926d
addq $0x100, %rsi            # imm = 0x100
movb $0x3b, 0x390(%rsp)
leaq 0x198(%rsp), %rdi
leaq 0x390(%rsp), %r14
movq %r14, %rdx
callq 0x367c0
movq 0x80(%rsp), %rsi
movl $0x120, %eax            # imm = 0x120
addq %rax, %rsi
movb $0x2c, 0x390(%rsp)
leaq 0x368(%rsp), %rdi
movq %r14, %rdx
callq 0x367c0
leaq 0x1b0(%rsp), %rbx
movq 0x80(%rsp), %rsi
movl $0x140, %eax            # imm = 0x140
addq %rax, %rsi
movb $0x2c, 0x390(%rsp)
leaq 0x350(%rsp), %rdi
movq %r14, %rdx
callq 0x367c0
movq 0x80(%rsp), %rsi
movl $0x160, %eax            # imm = 0x160
addq %rax, %rsi
movb $0x2c, 0x390(%rsp)
leaq 0x338(%rsp), %rdi
movq %r14, %rdx
callq 0x367c0
movl $0x0, 0x4(%rsp)
movq %r14, %rdi
callq 0x4240
leaq 0x828(%rsp), %rdi
callq 0x4240
leaq 0x6a0(%rsp), %rdi
callq 0x4240
leaq 0x518(%rsp), %rdi
callq 0x4240
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %rbx, %rdi
leaq 0x16502(%rip), %rdx     # 0x3eb0a
movq %rdx, %rsi
callq 0x5384
leaq 0x3a8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4490
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x28645
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %rbx, %rdi
leaq 0x164ab(%rip), %rdx     # 0x3eb0a
movq %rdx, %rsi
callq 0x5384
leaq 0x840(%rsp), %rdi
movq %rbx, %rsi
callq 0x4490
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x2869c
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %rbx, %rdi
leaq 0x16454(%rip), %rdx     # 0x3eb0a
movq %rdx, %rsi
callq 0x5384
leaq 0x6b8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4490
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x286f3
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %rbx, %rdi
leaq 0x163fd(%rip), %rdx     # 0x3eb0a
movq %rdx, %rsi
callq 0x5384
leaq 0x530(%rsp), %rdi
movq %rbx, %rsi
callq 0x4490
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x2874a
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x198(%rsp), %rbp
movq 0x1a0(%rsp), %r12
cmpq %r12, %rbp
je 0x28a56
xorl %r13d, %r13d
movq $0x0, 0x60(%rsp)
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %ebx, %ebx
movq %r12, 0x58(%rsp)
callq 0x40e0
cltq
imulq $0x44b82fa1, %rax, %rcx # imm = 0x44B82FA1
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x3c, %rcx
addl %edx, %ecx
imull $0x3b9aca00, %ecx, %ecx # imm = 0x3B9ACA00
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x15812(%rip), %xmm0    # 0x3dfc0
movsd 0x190(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x28a3c
movq %rbp, %rsi
addq %r13, %rsi
movb $0x2c, 0x1b0(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x1b0(%rsp), %rdx
callq 0x367c0
cmpq $0x0, 0x60(%rsp)
jne 0x287ff
movq 0x8(%rsp), %rax
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, 0x60(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, %r12
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, %r15
incl 0x4(%rsp)
leaq 0x1b0(%rsp), %rdi
leaq 0x3a8(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %r14
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x2886e
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
testq %r14, %r14
je 0x2888c
movl $0x1, %edx
leaq 0x3a0(%rsp), %rdi
leaq 0x13b53(%rip), %rsi     # 0x3c3da
callq 0x43a0
movq 0x198(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
leaq 0x3a0(%rsp), %rdi
callq 0x43a0
leaq 0x1b0(%rsp), %rdi
leaq 0x840(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %r14
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x288ec
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
testq %r14, %r14
je 0x2890a
movl $0x1, %edx
leaq 0x838(%rsp), %rdi
leaq 0x125b3(%rip), %rsi     # 0x3aeb8
callq 0x43a0
movq 0x368(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
leaq 0x838(%rsp), %rdi
callq 0x43a0
leaq 0x1b0(%rsp), %rdi
leaq 0x6b8(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %r14
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x2896a
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
testq %r14, %r14
je 0x28988
movl $0x1, %edx
leaq 0x6b0(%rsp), %rdi
leaq 0x12535(%rip), %rsi     # 0x3aeb8
callq 0x43a0
movq 0x350(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
leaq 0x6b0(%rsp), %rdi
callq 0x43a0
leaq 0x1b0(%rsp), %rdi
leaq 0x530(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %r14
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x289e8
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
testq %r14, %r14
je 0x28a06
movl $0x1, %edx
leaq 0x528(%rsp), %rdi
leaq 0x124b7(%rip), %rsi     # 0x3aeb8
callq 0x43a0
movq 0x338(%rsp), %rax
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
leaq 0x528(%rsp), %rdi
callq 0x43a0
movq %r12, %r14
subq %r12, %rbx
addq %r15, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6aac
movq 0x58(%rsp), %r12
leaq 0x20(,%r13), %rax
addq %rbp, %rax
addq $0x20, %r13
cmpq %r12, %rax
jne 0x2877c
jmp 0x28a67
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r14d, %r14d
movq $0x0, 0x60(%rsp)
movq %r15, %rax
subq 0x60(%rsp), %rax
incq %rax
cmpq $0x3e8, %rax            # imm = 0x3E8
movq 0x180(%rsp), %r13
jb 0x291a2
movq %r14, %rbp
movq %r15, %r12
movq %rbx, 0x58(%rsp)
movq %rax, %rbx
movq %rax, %xmm0
punpckldq 0x1263f(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x12647(%rip), %xmm0    # 0x3b0f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x380(%rsp)
movapd %xmm1, %xmm0
divsd 0x11e06(%rip), %xmm0    # 0x3a8d0
callq 0x4170
cvttsd2si %xmm0, %eax
movl %eax, 0x34(%rsp)
callq 0x40e0
movl %eax, %r15d
movq 0x188(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x2a8d6
movslq %r15d, %rcx
imulq $0x44b82fa1, %rcx, %rdx # imm = 0x44B82FA1
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x3c, %rdx
addl %esi, %edx
imull $0x3b9aca00, %edx, %edx # imm = 0x3B9ACA00
subl %edx, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
divsd 0x154a1(%rip), %xmm0    # 0x3dfc0
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0x291a2
movq 0x80(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x140(%rsp), %rdi
callq 0x43a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15fae(%rip), %rsi     # 0x3eb09
callq 0x43a0
movq %r15, %rdi
movq 0x60(%rsp), %rsi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15f8a(%rip), %rsi     # 0x3eb09
callq 0x43a0
movq %r14, %rdi
movq %rbp, %rsi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15f68(%rip), %rsi     # 0x3eb09
callq 0x43a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15f46(%rip), %rsi     # 0x3eb09
callq 0x43a0
movsd 0x58(%rsp), %xmm1
unpcklps 0x1250b(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x12513(%rip), %xmm1    # 0x3b0f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x380(%rsp), %xmm0
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x2, 0x8(%r14,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl %edx, %ecx
orl $0x4, %ecx
movl %ecx, 0x18(%r14,%rax)
movq %r14, %rdi
movapd %xmm0, 0x60(%rsp)
callq 0x4510
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15ecf(%rip), %rsi     # 0x3eb09
callq 0x43a0
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0x4580
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15eac(%rip), %rsi     # 0x3eb09
callq 0x43a0
movq 0x80(%rsp), %rax
movq 0xc0(%rax), %rsi
movq 0xc8(%rax), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15e77(%rip), %rsi     # 0x3eb09
callq 0x43a0
movq %r14, %rdi
movq %r12, %rsi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15e55(%rip), %rsi     # 0x3eb09
callq 0x43a0
leaq 0x1b0(%rsp), %rdi
leaq 0x3a8(%rsp), %rsi
callq 0x44f0
leaq 0x1c8(%rsp), %rbp
movq 0x1b0(%rsp), %rsi
movq 0x1b8(%rsp), %rdx
movq %r14, %rdi
callq 0x43a0
movq 0x138(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15dfc(%rip), %rsi     # 0x3eb09
callq 0x43a0
leaq 0x8(%rsp), %rdi
leaq 0x840(%rsp), %rsi
callq 0x44f0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15dc1(%rip), %rsi     # 0x3eb09
callq 0x43a0
leaq 0x38(%rsp), %rdi
leaq 0x6b8(%rsp), %rsi
callq 0x44f0
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15d86(%rip), %rsi     # 0x3eb09
callq 0x43a0
leaq 0x150(%rsp), %rdi
leaq 0x530(%rsp), %rsi
callq 0x44f0
movq 0x150(%rsp), %rsi
movq 0x158(%rsp), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %r14
movq (%rax), %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
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x28e04
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x28e20
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x28e37
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x28e5c
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1b0(%rsp), %rdi
callq 0x4240
movq %r12, 0x8(%rsp)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
leaq 0x15c8d(%rip), %rdx     # 0x3eb0a
movq %rdx, %rsi
callq 0x5384
movq %rbp, %rdi
movq %r14, %rsi
callq 0x4490
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x28ea7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1c0(%rsp), %rax
movq -0x18(%rax), %rcx
movq $0x2, 0x1c8(%rsp,%rcx)
movq -0x18(%rax), %rax
movl 0x1d8(%rsp,%rax), %ecx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl %edx, %ecx
orl $0x4, %ecx
movl %ecx, 0x1d8(%rsp,%rax)
leaq 0x1c0(%rsp), %rdi
movapd 0x60(%rsp), %xmm0
callq 0x4510
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
callq 0x44f0
movq %r13, %rdi
movq %r14, %rsi
callq 0xdd92
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x28f23
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
cmpq 0x178(%rsp), %r14
je 0x28f36
incq 0x40(%r14)
jmp 0x28fd8
leaq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x44f0
movq %r12, 0x8(%rsp)
movq 0x38(%rsp), %rax
leaq 0x48(%rsp), %rcx
cmpq %rcx, %rax
je 0x28f68
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x28f72
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rcx, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
movq $0x1, 0x28(%rsp)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0xde1c
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x28fbc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x28fd8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x10(%r15), %rdx
movl 0x34(%rsp), %eax
testq %rdx, %rdx
je 0x29017
movq 0x108(%rsp), %rcx
xorl %esi, %esi
cmpl %eax, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x28fed
cmpq 0x108(%rsp), %rcx
je 0x29017
cmpl 0x20(%rcx), %eax
jge 0x292b6
movl %eax, 0x8(%rsp)
movq $0x1, 0x10(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xdfe8
movl 0x34(%rsp), %eax
movl %eax, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq 0x110(%rsp), %rdi
movq %r14, %rsi
callq 0xdfe8
leaq 0x4(%rsp), %r15
movq 0x1120(%rsp), %rdi
leaq 0x1b0(%rsp), %rbx
movq 0x10(%rdi), %rcx
movl 0x4(%rsp), %eax
testq %rcx, %rcx
je 0x290a5
movq 0x100(%rsp), %rdx
xorl %esi, %esi
cmpl %eax, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x2907b
cmpq 0x100(%rsp), %rdx
je 0x290a5
cmpl 0x20(%rdx), %eax
jge 0x292ee
movl %eax, 0x8(%rsp)
movq $0x1, 0x10(%rsp)
movq %r14, %rsi
callq 0xdfe8
movl 0x4(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x1128(%rsp), %rdi
movq %r14, %rsi
callq 0xdfe8
movq 0x80(%rsp), %rsi
movb $0x23, 0x8(%rsp)
leaq 0x38(%rsp), %rdi
movq %r14, %rdx
callq 0x367c0
movq 0x38(%rsp), %rsi
addq $0x20, %rsi
movq 0x1130(%rsp), %rdi
callq 0xe288
cmpq 0x170(%rsp), %rax
je 0x29130
movq 0x38(%rsp), %rsi
addq $0x20, %rsi
movq 0x1130(%rsp), %rdi
callq 0xce80
incl (%rax)
jmp 0x2917c
movq 0x38(%rsp), %rax
movq %r12, 0x8(%rsp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xd940
movl $0x1, 0x28(%rsp)
movq 0x1130(%rsp), %rdi
movq %r14, %rsi
callq 0xe312
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2917c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x38(%rsp), %rdi
callq 0x6aac
movq %rbx, %rdi
movq 0x22e08(%rip), %rsi     # 0x4bf98
callq 0x4260
movq 0xf8(%rsp), %rdi
callq 0x4140
leaq 0x518(%rsp), %rdi
movq 0x22de7(%rip), %rbx     # 0x4bf98
movq %rbx, %rsi
callq 0x4260
movq 0x118(%rsp), %rdi
callq 0x4140
leaq 0x6a0(%rsp), %rdi
movq %rbx, %rsi
callq 0x4260
movq 0x120(%rsp), %rdi
callq 0x4140
leaq 0x828(%rsp), %rdi
movq %rbx, %rsi
callq 0x4260
movq 0x128(%rsp), %rdi
callq 0x4140
leaq 0x390(%rsp), %rdi
movq %rbx, %rsi
callq 0x4260
movq 0x130(%rsp), %rdi
callq 0x4140
leaq 0x338(%rsp), %rdi
callq 0x6aac
leaq 0x350(%rsp), %rdi
callq 0x6aac
leaq 0x368(%rsp), %rdi
callq 0x6aac
leaq 0x198(%rsp), %rdi
callq 0x6aac
leaq 0xc8(%rsp), %r15
leaq 0xa8(%rsp), %r12
leaq 0xe8(%rsp), %rbx
movl 0x7c(%rsp), %ebp
leaq 0x80(%rsp), %rdi
callq 0x6aac
movq 0xd8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x29297
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x9b0(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x9d0(%rsp,%rax)
je 0x28459
jmp 0x28215
incq 0x28(%rcx)
movq 0x110(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0xce1a
addq %rbx, (%rax)
movq 0x1120(%rsp), %rdi
leaq 0x1b0(%rsp), %rbx
leaq 0x8(%rsp), %r14
leaq 0x4(%rsp), %r15
jmp 0x29066
movq %r15, %rsi
callq 0xce1a
incq (%rax)
movq 0x1128(%rsp), %rdi
movq %r15, %rsi
callq 0xce1a
movq 0x58(%rsp), %rcx
addq %rcx, (%rax)
jmp 0x290dc
jmp 0x293aa
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2937a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2937a
jmp 0x29377
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x29353
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x293ad
movq 0x48(%rsp), %rsi
jmp 0x293a0
jmp 0x293aa
jmp 0x293aa
jmp 0x29377
jmp 0x293aa
jmp 0x293aa
jmp 0x293aa
jmp 0x293aa
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x6aac
jmp 0x293ad
jmp 0x293aa
jmp 0x2938e
jmp 0x293aa
jmp 0x293aa
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x293ad
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x293ad
movq %rax, %rbx
movq 0x22be4(%rip), %rsi     # 0x4bf98
leaq 0x1b0(%rsp), %rdi
callq 0x4260
movq 0xf8(%rsp), %rdi
callq 0x4140
jmp 0x29565
jmp 0x29537
jmp 0x293e6
jmp 0x293eb
jmp 0x29494
jmp 0x29537
movq %rax, %rbx
jmp 0x2941d
movq %rax, %rbx
jmp 0x29439
jmp 0x29494
movq %rax, %rbx
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x2941d
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x29439
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x29497
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x29497
movq %rax, %rbx
jmp 0x295e9
movq %rax, %rbx
jmp 0x295f6
movq %rax, %rbx
jmp 0x29603
movq %rax, %rbx
jmp 0x29610
movq %rax, %rbx
jmp 0x2961d
jmp 0x29494
jmp 0x29537
jmp 0x29494
jmp 0x29537
jmp 0x29494
jmp 0x29537
movq %rax, %rbx
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x29565
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x29565
jmp 0x29537
movq %rax, %rbx
jmp 0x29586
movq %rax, %rbx
jmp 0x295a7
movq %rax, %rbx
jmp 0x295c8
movq %rax, %rbx
jmp 0x2965c
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
jne 0x29671
jmp 0x29681
jmp 0x29548
jmp 0x29540
movq %rax, %rbx
jmp 0x296a2
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x296b7
jmp 0x296c7
jmp 0x29550
jmp 0x29537
jmp 0x2952b
movq %rax, %rbx
jmp 0x2964f
jmp 0x29558
jmp 0x29558
movq %rax, %rbx
jmp 0x29565
jmp 0x29558
jmp 0x29558
movq %rax, %rbx
jmp 0x2962a
movq %rax, %rbx
jmp 0x29681
movq %rax, %rbx
jmp 0x296c7
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6aac
movq 0x22a2c(%rip), %rsi     # 0x4bf98
leaq 0x518(%rsp), %rdi
callq 0x4260
movq 0x118(%rsp), %rdi
callq 0x4140
movq 0x22a0b(%rip), %rsi     # 0x4bf98
leaq 0x6a0(%rsp), %rdi
callq 0x4260
movq 0x120(%rsp), %rdi
callq 0x4140
movq 0x229ea(%rip), %rsi     # 0x4bf98
leaq 0x828(%rsp), %rdi
callq 0x4260
movq 0x128(%rsp), %rdi
callq 0x4140
movq 0x229c9(%rip), %rsi     # 0x4bf98
leaq 0x390(%rsp), %rdi
callq 0x4260
movq 0x130(%rsp), %rdi
callq 0x4140
leaq 0x338(%rsp), %rdi
callq 0x6aac
leaq 0x350(%rsp), %rdi
callq 0x6aac
leaq 0x368(%rsp), %rdi
callq 0x6aac
leaq 0x198(%rsp), %rdi
callq 0x6aac
leaq 0x80(%rsp), %rdi
callq 0x6aac
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x2964f
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xc50(%rsp), %rdi
callq 0x4480
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x29681
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x22398(%rip), %rsi     # 0x4ba20
leaq 0xe50(%rsp), %rdi
callq 0x38fcc
leaq 0xfe0(%rsp), %rdi
callq 0x4140
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x296c7
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x9b0(%rsp), %rdi
callq 0xcdd6
movq %rbx, %rdi
callq 0x45a0