// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq %r8, %r12
movq %rcx, %r13
movq %rdx, 0x188(%rsp)
movq %rsi, %rbx
movsd %xmm0, 0x190(%rsp)
movq %rdi, %r14
leaq 0x9b0(%rsp), %rbp
movq %rbp, %rdi
callq 0xcc30
movq (%r14), %rsi
movq %rbp, 0x110(%rsp)
movq %rbp, %rdi
movl $0x8, %edx
callq 0x39386
movq 0x9b0(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x9d0(%rsp,%rax)
je 0x281b9
movq 0x23e64(%rip), %rdi     # 0x4bfc8
leaq 0x16279(%rip), %rsi     # 0x3e3e4
movl $0x27, %edx
callq 0x43a0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x23e45(%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 0x29470
leaq 0xd0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0xc0(%rsp), %rdi
callq 0xda32
leaq 0x16229(%rip), %rsi     # 0x3e40c
leaq 0xc0(%rsp), %rdi
callq 0x45e0
leaq 0xe50(%rsp), %rdi
callq 0x69c4
movq 0xc0(%rsp), %rsi
leaq 0xe50(%rsp), %rdi
movq %rdi, 0x108(%rsp)
movl $0x10, %edx
callq 0x39386
movq 0xe50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xe70(%rsp,%rax)
je 0x282ae
movq 0x23d8c(%rip), %rdi     # 0x4bfc8
leaq 0x1292b(%rip), %rsi     # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
movq 0x23d64(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %rbx
leaq 0x161ca(%rip), %rsi     # 0x3e43d
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 0x29432
movq %r15, 0x180(%rsp)
leaq 0xb0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0xda32
leaq 0x1617e(%rip), %rsi     # 0x3e45e
leaq 0xa0(%rsp), %rdi
callq 0x45e0
leaq 0xc50(%rsp), %rdi
callq 0x4570
movq 0xa0(%rsp), %rsi
leaq 0xc50(%rsp), %rdi
movl $0x10, %edx
callq 0x4060
leaq 0xcc0(%rsp), %rdi
callq 0x40c0
movl %eax, %ebp
testb %al, %al
je 0x2937f
movq 0x23c96(%rip), %rbx     # 0x4bfc8
leaq 0x16154(%rip), %rsi     # 0x3e48d
movl $0x1e, %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 0x23c64(%rip), %rdi     # 0x4bfc8
callq 0x4030
movq %rax, %rdi
callq 0x4220
xorl %edi, %edi
callq 0x42e0
movl %eax, %edi
callq 0x4300
movq 0x9b0(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x9d0(%rsp,%rax)
jne 0x2934e
movq 0x1130(%rsp), %rcx
movq 0x1120(%rsp), %rdx
leaq 0xf0(%rsp), %rbx
movl $0x188, %eax            # imm = 0x188
addq %rax, 0x110(%rsp)
addq %rax, 0x108(%rsp)
movl $0x80, %eax
leaq 0x1b0(%rsp), %rsi
addq %rax, %rsi
movq %rsi, 0x138(%rsp)
leaq 0x518(%rsp), %rsi
addq %rax, %rsi
movq %rsi, 0x170(%rsp)
leaq 0x6a0(%rsp), %rsi
addq %rax, %rsi
movq %rsi, 0x168(%rsp)
leaq 0x828(%rsp), %rsi
addq %rax, %rsi
movq %rsi, 0x160(%rsp)
leaq 0x390(%rsp), %rsi
addq %rsi, %rax
movq %rax, 0x178(%rsp)
leaq 0x8(%r13), %rax
movq %rax, 0x148(%rsp)
leaq 0x8(%r12), %r15
leaq 0x8(%rdx), %rax
movq %rax, 0x100(%rsp)
leaq 0x8(%rcx), %rax
movq %rax, 0x140(%rsp)
movl %ebp, 0x84(%rsp)
movq %r12, 0x158(%rsp)
movq %r13, 0x150(%rsp)
movq %r15, 0x70(%rsp)
movq %rbx, 0xe0(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0x1669c(%rip), %rdx     # 0x3eb22
movq %rdx, %rsi
callq 0x5384
movq 0xb38(%rsp), %rax
movq -0x18(%rax), %rdi
movq 0x110(%rsp), %r15
addq %r15, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %edx
movq %r15, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x45c0
cmpq $0x0, 0xe8(%rsp)
je 0x29317
movq 0xe0(%rsp), %rax
cmpb $0x23, (%rax)
je 0x29317
movb $0x9, 0x390(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x390(%rsp), %rdx
callq 0x36b7c
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rax
subq %rsi, %rax
cmpq $0x180, %rax            # imm = 0x180
jb 0x2930a
addq $0x100, %rsi            # imm = 0x100
movb $0x3b, 0x390(%rsp)
leaq 0x198(%rsp), %rdi
leaq 0x390(%rsp), %r14
movq %r14, %rdx
callq 0x36b7c
movq 0x88(%rsp), %rsi
movl $0x120, %eax            # imm = 0x120
addq %rax, %rsi
movb $0x2c, 0x390(%rsp)
leaq 0x368(%rsp), %rdi
movq %r14, %rdx
callq 0x36b7c
leaq 0x1b0(%rsp), %rbx
movq 0x88(%rsp), %rsi
movl $0x140, %eax            # imm = 0x140
addq %rax, %rsi
movb $0x2c, 0x390(%rsp)
leaq 0x350(%rsp), %rdi
movq %r14, %rdx
callq 0x36b7c
movq 0x88(%rsp), %rsi
movl $0x160, %eax            # imm = 0x160
addq %rax, %rsi
movb $0x2c, 0x390(%rsp)
leaq 0x338(%rsp), %rdi
movq %r14, %rdx
callq 0x36b7c
movl $0x0, 0x8(%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 0x16504(%rip), %rdx     # 0x3eb22
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 0x2865b
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %rbx, %rdi
leaq 0x164ad(%rip), %rdx     # 0x3eb22
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 0x286b2
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %rbx, %rdi
leaq 0x16456(%rip), %rdx     # 0x3eb22
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 0x28709
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %rbx, %rdi
leaq 0x163ff(%rip), %rdx     # 0x3eb22
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 0x28760
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x198(%rsp), %r15
movq 0x1a0(%rsp), %rbp
cmpq %rbp, %r15
je 0x28a6a
xorl %r14d, %r14d
movq $0x0, 0x60(%rsp)
xorl %ebx, %ebx
xorl %r13d, %r13d
movq $0x0, 0x38(%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 0x157fb(%rip), %xmm0    # 0x3dfc0
movsd 0x190(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x28a53
leaq (%r15,%r14), %rsi
movb $0x2c, 0x1b0(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x1b0(%rsp), %rdx
callq 0x36b7c
cmpq $0x0, 0x60(%rsp)
jne 0x28814
movq 0x10(%rsp), %rax
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, 0x60(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, %rbx
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, %r13
incl 0x8(%rsp)
leaq 0x1b0(%rsp), %rdi
leaq 0x3a8(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %r12
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x28883
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
testq %r12, %r12
je 0x288a1
movl $0x1, %edx
leaq 0x3a0(%rsp), %rdi
leaq 0x13b3e(%rip), %rsi     # 0x3c3da
callq 0x43a0
movq 0x198(%rsp), %rax
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
leaq 0x3a0(%rsp), %rdi
callq 0x43a0
leaq 0x1b0(%rsp), %rdi
leaq 0x840(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %r12
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x28901
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
testq %r12, %r12
je 0x2891f
movl $0x1, %edx
leaq 0x838(%rsp), %rdi
leaq 0x1259e(%rip), %rsi     # 0x3aeb8
callq 0x43a0
movq 0x368(%rsp), %rax
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
leaq 0x838(%rsp), %rdi
callq 0x43a0
leaq 0x1b0(%rsp), %rdi
leaq 0x6b8(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %r12
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x2897f
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
testq %r12, %r12
je 0x2899d
movl $0x1, %edx
leaq 0x6b0(%rsp), %rdi
leaq 0x12520(%rip), %rsi     # 0x3aeb8
callq 0x43a0
movq 0x350(%rsp), %rax
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
leaq 0x6b0(%rsp), %rdi
callq 0x43a0
leaq 0x1b0(%rsp), %rdi
leaq 0x530(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rdi
movq 0x1b8(%rsp), %r12
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x289fd
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
testq %r12, %r12
je 0x28a1b
movl $0x1, %edx
leaq 0x528(%rsp), %rdi
leaq 0x124a2(%rip), %rsi     # 0x3aeb8
callq 0x43a0
movq 0x338(%rsp), %rax
movq (%rax,%r14), %rsi
movq 0x8(%rax,%r14), %rdx
leaq 0x528(%rsp), %rdi
callq 0x43a0
movq 0x38(%rsp), %rax
subq %rbx, %rax
addq %r13, %rax
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x6aa2
leaq (%r15,%r14), %rax
addq $0x20, %rax
addq $0x20, %r14
cmpq %rbp, %rax
jne 0x28793
jmp 0x28a81
movq $0x0, 0x38(%rsp)
xorl %r13d, %r13d
xorl %ebx, %ebx
movq $0x0, 0x60(%rsp)
movq %r13, %rax
subq 0x60(%rsp), %rax
incq %rax
cmpq $0x3e8, %rax            # imm = 0x3E8
jb 0x29244
movq %rax, 0x78(%rsp)
movq %rax, %xmm0
punpckldq 0x12636(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1263e(%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 0x11dfd(%rip), %xmm0    # 0x3a8d0
callq 0x4170
cvttsd2si %xmm0, %eax
movl %eax, 0xc(%rsp)
callq 0x40e0
movl %eax, %r15d
movq 0x188(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2aa7c
leaq 0x50(%rsp), %rbp
leaq 0x1b0(%rsp), %r14
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 0x1548b(%rip), %xmm0    # 0x3dfc0
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0x29244
movq 0x88(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x108(%rsp), %rdi
callq 0x43a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15fb0(%rip), %rsi     # 0x3eb21
callq 0x43a0
movq %r15, %rdi
movq 0x60(%rsp), %rsi
callq 0x4210
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15f8c(%rip), %rsi     # 0x3eb21
callq 0x43a0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4210
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15f6a(%rip), %rsi     # 0x3eb21
callq 0x43a0
movq %rbx, %rdi
movq 0x78(%rsp), %rsi
callq 0x4210
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15f46(%rip), %rsi     # 0x3eb21
callq 0x43a0
movsd 0x38(%rsp), %xmm1
unpcklps 0x124f3(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x124fb(%rip), %xmm1    # 0x3b0f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x380(%rsp), %xmm0
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movq $0x2, 0x8(%rbx,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl %edx, %ecx
orl $0x4, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq %rbx, %rdi
movapd %xmm0, 0x60(%rsp)
callq 0x4510
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15ed1(%rip), %rsi     # 0x3eb21
callq 0x43a0
movl 0x8(%rsp), %esi
movq %rbx, %rdi
callq 0x4580
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15eae(%rip), %rsi     # 0x3eb21
callq 0x43a0
movq 0x88(%rsp), %rax
movq 0xc0(%rax), %rsi
movq 0xc8(%rax), %rdx
movq %rbx, %rdi
callq 0x43a0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15e79(%rip), %rsi     # 0x3eb21
callq 0x43a0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4210
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15e57(%rip), %rsi     # 0x3eb21
callq 0x43a0
movq %r14, %rdi
leaq 0x3a8(%rsp), %rsi
callq 0x44f0
movq 0x1b0(%rsp), %rsi
movq 0x1b8(%rsp), %rdx
movq %rbx, %rdi
callq 0x43a0
movq 0x180(%rsp), %r14
movq 0x158(%rsp), %r15
movq 0x150(%rsp), %r12
leaq 0x20(%rsp), %r13
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15dfb(%rip), %rsi     # 0x3eb21
callq 0x43a0
leaq 0x10(%rsp), %rdi
leaq 0x840(%rsp), %rsi
callq 0x44f0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x43a0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15dc0(%rip), %rsi     # 0x3eb21
callq 0x43a0
leaq 0x40(%rsp), %rdi
leaq 0x6b8(%rsp), %rsi
callq 0x44f0
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq %rbx, %rdi
callq 0x43a0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x15d85(%rip), %rsi     # 0x3eb21
callq 0x43a0
leaq 0x118(%rsp), %rdi
leaq 0x530(%rsp), %rsi
callq 0x44f0
movq 0x118(%rsp), %rsi
movq 0x120(%rsp), %rdx
movq %rbx, %rdi
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 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x28e1d
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x28e34
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x28e4b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x28e70
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1b0(%rsp), %rdi
callq 0x4240
movq %r13, 0x10(%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
leaq 0x15c91(%rip), %rdx     # 0x3eb22
movq %rdx, %rsi
callq 0x5384
leaq 0x1c8(%rsp), %rdi
movq %rbx, %rsi
callq 0x4490
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x28ec0
movq 0x20(%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 0x10(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x44f0
movq %r12, %rdi
movq %rbx, %rsi
callq 0xde70
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x28f41
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
cmpq 0x148(%rsp), %rbx
je 0x28f5c
incq 0x40(%rbx)
movq 0x1120(%rsp), %rbx
jmp 0x29002
leaq 0x40(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x44f0
movq %r13, 0x10(%rsp)
movq 0x40(%rsp), %rax
cmpq %rbp, %rax
movq 0x1120(%rsp), %rbx
je 0x28f96
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x28fa1
movupd (%rbp), %xmm0
movupd %xmm0, (%r13)
movq 0x48(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rbp, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movb $0x0, 0x50(%rsp)
movq $0x1, 0x30(%rsp)
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0xdefa
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x28feb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x29002
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x10(%r15), %rcx
movq 0x70(%rsp), %rax
testq %rcx, %rcx
je 0x29030
movl 0xc(%rsp), %edx
movq 0x70(%rsp), %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x29019
movq 0x70(%rsp), %rdx
movq %rdx, %rcx
cmpq %rdx, %rax
je 0x2904b
movl 0xc(%rsp), %ecx
cmpl 0x20(%rax), %ecx
cmovlq %rdx, %rax
movq %rax, %rcx
cmpq %rdx, %rcx
je 0x29080
incq 0x28(%rcx)
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0xcf10
movq 0x78(%rsp), %rcx
addq %rcx, (%rax)
leaq 0x1b0(%rsp), %r14
movq 0x100(%rsp), %rdi
leaq 0x10(%rsp), %r15
jmp 0x290ce
movl 0xc(%rsp), %eax
movl %eax, 0x10(%rsp)
movq $0x1, 0x18(%rsp)
movq %r15, %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0xe0c6
movl 0xc(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xe0c6
movq 0x100(%rsp), %rdi
leaq 0x1b0(%rsp), %r14
movq 0x10(%rbx), %rcx
movq %rdi, %rax
testq %rcx, %rcx
je 0x290f8
movl 0x8(%rsp), %edx
movq %rdi, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x290e1
movq %rdi, %rcx
cmpq %rdi, %rax
je 0x2910e
movl 0x8(%rsp), %ecx
cmpl 0x20(%rax), %ecx
cmovlq %rdi, %rax
movq %rax, %rcx
cmpq %rdi, %rcx
je 0x29140
movq %rbx, %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0xcf10
incq (%rax)
movq 0x1128(%rsp), %rdi
movq %rbx, %rsi
callq 0xcf10
movq 0x38(%rsp), %rcx
addq %rcx, (%rax)
jmp 0x2917e
movl 0x8(%rsp), %eax
movl %eax, 0x10(%rsp)
movq $0x1, 0x18(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe0c6
movl 0x8(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x1128(%rsp), %rdi
movq %r15, %rsi
callq 0xe0c6
movq 0x88(%rsp), %rsi
movb $0x23, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
movq %r15, %rdx
callq 0x36b7c
movq 0x40(%rsp), %rsi
addq $0x20, %rsi
movq 0x1130(%rsp), %rdi
callq 0xe368
cmpq 0x140(%rsp), %rax
je 0x291d2
movq 0x40(%rsp), %rsi
addq $0x20, %rsi
movq 0x1130(%rsp), %rdi
callq 0xcf74
incl (%rax)
jmp 0x2921e
movq 0x40(%rsp), %rax
movq %r13, 0x10(%rsp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xda32
movl $0x1, 0x30(%rsp)
movq 0x1130(%rsp), %rdi
movq %r15, %rsi
callq 0xe3f2
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x2921e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x40(%rsp), %rdi
callq 0x6aa2
movq %r14, %rdi
movq 0x22d66(%rip), %rsi     # 0x4bf98
callq 0x4260
movq 0x138(%rsp), %rdi
callq 0x4140
leaq 0x518(%rsp), %rdi
movq 0x22d45(%rip), %rbx     # 0x4bf98
movq %rbx, %rsi
callq 0x4260
movq 0x170(%rsp), %rdi
callq 0x4140
leaq 0x6a0(%rsp), %rdi
movq %rbx, %rsi
callq 0x4260
movq 0x168(%rsp), %rdi
callq 0x4140
leaq 0x828(%rsp), %rdi
movq %rbx, %rsi
callq 0x4260
movq 0x160(%rsp), %rdi
callq 0x4140
leaq 0x390(%rsp), %rdi
movq %rbx, %rsi
callq 0x4260
movq 0x178(%rsp), %rdi
callq 0x4140
leaq 0x338(%rsp), %rdi
callq 0x6aa2
leaq 0x350(%rsp), %rdi
callq 0x6aa2
leaq 0x368(%rsp), %rdi
callq 0x6aa2
leaq 0x198(%rsp), %rdi
callq 0x6aa2
leaq 0xd0(%rsp), %r14
leaq 0xf0(%rsp), %rbx
movl 0x84(%rsp), %ebp
leaq 0x88(%rsp), %rdi
callq 0x6aa2
movq 0xe0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x29334
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x9b0(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x9d0(%rsp,%rax)
je 0x2846f
leaq 0x9b0(%rsp), %rdi
callq 0x3962e
leaq 0xb0(%rsp), %r15
leaq 0xe50(%rsp), %rdi
callq 0x3962e
leaq 0xc50(%rsp), %rdi
callq 0x4440
jmp 0x293dd
movq 0x22c42(%rip), %rdi     # 0x4bfc8
leaq 0x117e1(%rip), %rsi     # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0x22c1a(%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 0x22bdc(%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 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x29432
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x225e7(%rip), %rsi     # 0x4ba20
leaq 0xe50(%rsp), %rdi
callq 0x39330
leaq 0xfe0(%rsp), %rdi
callq 0x4140
movq 0xc0(%rsp), %rdi
cmpq %r14, %rdi
je 0x29470
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x227c9(%rip), %rax     # 0x4bc40
leaq 0xb48(%rsp), %rbx
movq %rax, -0x10(%rbx)
leaq 0x227de(%rip), %rax     # 0x4bc68
movq %rax, (%rbx)
movq $0x0, -0x8(%rbx)
leaq 0x2270c(%rip), %rsi     # 0x4bba8
leaq 0x9b0(%rsp), %rdi
callq 0x39330
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 %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x2952d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2952d
jmp 0x2952a
jmp 0x29572
jmp 0x29572
jmp 0x29572
jmp 0x29572
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x2950e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x29575
movq 0x50(%rsp), %rsi
jmp 0x29553
jmp 0x29572
jmp 0x2952a
jmp 0x29572
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6aa2
jmp 0x29575
jmp 0x29572
jmp 0x29541
jmp 0x29572
jmp 0x29572
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x29575
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x29575
jmp 0x29572
jmp 0x296ec
jmp 0x2959b
jmp 0x295a0
jmp 0x29649
jmp 0x296ec
movq %rax, %rbx
movq 0x22a1c(%rip), %rsi     # 0x4bf98
leaq 0x1b0(%rsp), %rdi
callq 0x4260
leaq 0x230(%rsp), %rdi
callq 0x4140
jmp 0x2971a
movq %rax, %rbx
jmp 0x295d2
movq %rax, %rbx
jmp 0x295ee
jmp 0x29649
movq %rax, %rbx
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x295d2
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x295ee
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2964c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2964c
movq %rax, %rbx
jmp 0x2979e
movq %rax, %rbx
jmp 0x297ab
movq %rax, %rbx
jmp 0x297b8
movq %rax, %rbx
jmp 0x297c5
movq %rax, %rbx
jmp 0x297d2
jmp 0x29649
jmp 0x296ec
jmp 0x29649
jmp 0x296ec
jmp 0x29649
jmp 0x296ec
movq %rax, %rbx
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x2971a
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2971a
jmp 0x296ec
movq %rax, %rbx
jmp 0x2973b
movq %rax, %rbx
jmp 0x2975c
movq %rax, %rbx
jmp 0x2977d
movq %rax, %rbx
jmp 0x29811
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
jne 0x29826
jmp 0x29836
jmp 0x296fd
jmp 0x296f5
movq %rax, %rbx
jmp 0x29857
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r14, %rdi
jne 0x2986c
jmp 0x2987c
jmp 0x29705
jmp 0x296ec
jmp 0x296e0
movq %rax, %rbx
jmp 0x29804
jmp 0x2970d
jmp 0x2970d
movq %rax, %rbx
jmp 0x2971a
jmp 0x2970d
jmp 0x2970d
movq %rax, %rbx
jmp 0x297df
movq %rax, %rbx
jmp 0x29836
movq %rax, %rbx
jmp 0x2987c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6aa2
movq 0x22877(%rip), %rsi     # 0x4bf98
leaq 0x518(%rsp), %rdi
callq 0x4260
leaq 0x598(%rsp), %rdi
callq 0x4140
movq 0x22856(%rip), %rsi     # 0x4bf98
leaq 0x6a0(%rsp), %rdi
callq 0x4260
leaq 0x720(%rsp), %rdi
callq 0x4140
movq 0x22835(%rip), %rsi     # 0x4bf98
leaq 0x828(%rsp), %rdi
callq 0x4260
leaq 0x8a8(%rsp), %rdi
callq 0x4140
movq 0x22814(%rip), %rsi     # 0x4bf98
leaq 0x390(%rsp), %rdi
callq 0x4260
leaq 0x410(%rsp), %rdi
callq 0x4140
leaq 0x338(%rsp), %rdi
callq 0x6aa2
leaq 0x350(%rsp), %rdi
callq 0x6aa2
leaq 0x368(%rsp), %rdi
callq 0x6aa2
leaq 0x198(%rsp), %rdi
callq 0x6aa2
leaq 0x88(%rsp), %rdi
callq 0x6aa2
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x29804
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xc50(%rsp), %rdi
callq 0x4480
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x29836
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x221e3(%rip), %rsi     # 0x4ba20
leaq 0xe50(%rsp), %rdi
callq 0x39330
leaq 0xfe0(%rsp), %rdi
callq 0x4140
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x2987c
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x9b0(%rsp), %rdi
callq 0xcecc
movq %rbx, %rdi
callq 0x45a0