// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/analyze_molecule.cpp
// Function: analyze_molecule(int, char**)
bool analyze_molecule(int argc, char* argv[])
{
    if(argc != 6)
    {
        cout << "\n   Usage: DrLink molecule preprocessed_bamInfo.gz max_inter_read_dist min_molecule_size out_prefix_str "               << endl;
        cout << "     max_inter_read_dist\tINT\tbp: reads with same barcode but distance >= value will be separated into sub-molecules. " << endl;
        cout << "                             \tThis depends on sequencing library design: if expected mean size of molecules is EXP kp, we can use 1.5*EXP bp." << endl;   
        cout << "     min_molecule_size\tINT\tbp: size of molecules <= value will not contribute to final statistics, e.g., 1000 bp. "    << endl;
        return false;
    }
    clock_t tbeg;
    tbeg = clock();
    bool verbose = true;            // TODO: add option
    unsigned long winsize = 100000; // same barcode in chr with distance>100kb => two molecules; note this depends on sequencing library design
    // input file
    string procbamfile("");    
    int minMoleSize = 1000;
    std::stringstream minMsize;
    minMsize.str("");
    minMsize << minMoleSize;    
    string out_prefix("");
    if(argc == 6)
    {
        procbamfile = (string)argv[2];
        winsize     = strtoul(argv[3], NULL, 0); 
        minMoleSize = atoi(argv[4]);
        out_prefix  = (string)argv[5]; 
        minMsize.str("");
        minMsize << minMoleSize;       
    }
    // step 1. read chr size info
    /*
    map<string, string> chrSizes;
    if(!read_chrsize(chrsizefile.c_str(), &chrSizes))
    {
        cout << "   Error: reading chr size failed (analyze_molecule.cpp). " << endl;
        return false;
    }
    */
    // step 2.
    cout << "   Info: analyzing molecules started..." << endl;
    // open converted file.gz.
    if(procbamfile.find(".gz")==std::string::npos)
    {
        cout << "   Error: current version only supported gzipped file. " << endl;
        return false;
    }
    igzstream alifp;
    alifp.open(procbamfile.c_str());
    if(!alifp.good())
    {
        cout << "   Error: cannot open " << procbamfile << endl;
        return false;
    }
    // 2.1 prepare variable for analyzing/outputing alignments/clusters
    string ofilename = out_prefix + "_min" + minMsize.str() + "bp_molecule_table_trashme.txt.gz";
    ogzstream moutfp;
    moutfp.open(ofilename.c_str(), ios::out);
    if(!moutfp)
    {
        cout << "    Error: cannot open file " << ofilename << " for writing. " << endl;
        return false;
    }
    moutfp << "#chr#barcode\tfirst_aligned\tlast_aligned\tmolecule_len\tmolecule_cov\tread_num\tUni_flag\tlast_aligned_end\treads_region\tR1R2\treads_id" << endl;
    map<string,  unsigned long> molecule_cov;          // key: 0.01x, 0.02x,0.03x, ...,    val: number of molecules
    map<int,     unsigned long> molecule_len;          // key: 0kb, 1kb, 2kb,...           val: number of molecules.
    map<int,     unsigned long> molecule_len_sum;      // key: 0kb, 1kb, 2kb,...           val: total length of molecules in bin 
    map<int,     unsigned long> molecule_read_num;     // key: 1,2,3...                    val: number of molecules
    map<int,     unsigned long> molecule_read_num_sum; // key: 1,2,3...                    val: total length of reads in bin
    // note that below is a statistic of the read-distances within the same chr#barcode (but possibly several molecules).
    map<int,     unsigned long> molecule_read_interval;// key: 200,201,...                 val: total number of cases with that inter-read-distance-given-by-key
    map<string,            int> barcode_molecule_cnt;  // key: barcode1, barcode2,...      val: number of molecules
    multimap<string, ALIGNINFO> bcPosQueue; // from barcode find read-aligning (sta, end)-positions
    // 2.2 cluster existing alignments in queue and output molecule info -- caution in RAM
    string lastChr("");
    string currentChr("");
    unsigned long lineNum = 0;
    while(alifp.good())
    {
        string line("");
        getline(alifp, line);
        if(line.size()==0 || line[0]=='#' || line[0]=='*') continue;
        
        lineNum ++;
        if(lineNum%10000000 == 0) cout << "    " << lineNum << "th aligm..." << endl;
        
        // chr pos inbamCIGAR barcode MI read-ordering:inbamFLAG reversed-align read-id
        // 1	125	128M	TTTCCTCAGGGTTTCT	0	R1:99 rc        idddddd
        vector<string> lineinfo = split_string(line, '\t');
        if(lineinfo.size() < 6) continue;        
        if(lastChr.size() == 0)
        {
            lastChr    = lineinfo[0];
        }
        currentChr = lineinfo[0];        
        
        if(currentChr.compare(lastChr)!=0 && bcPosQueue.size()>0)
        {
            // output alignments for last chr and record statistics
            write_chr_alignment(moutfp,
                                &bcPosQueue, 
                                &molecule_cov,
                                &molecule_len,
                                &molecule_len_sum,
                                &molecule_read_num,
                                &molecule_read_num_sum,
                                &molecule_read_interval,
                                &barcode_molecule_cnt,
                                lastChr,
                                winsize,
                                minMoleSize);
            // clean info for last Chr
            bcPosQueue.clear();
            lastChr = currentChr;
        }
        unsigned long stapos = strtoul(lineinfo[1].c_str(), NULL, 0); // alignment start position
        int covlen = 0;
        covlen = decipher_cigar(lineinfo[2]);                         // covered len by alignment
        string key("");
        key    = lineinfo[0] + "#" + lineinfo[3];                     // chr+"#"+barcode            
        ALIGNINFO span;
        span.first  = stapos;
        span.second = stapos+covlen-1;                                //
        if(lineinfo[5].find("R1") != std::string::npos)
        {
            span.rorder = "1";
        }
        else
        if(lineinfo[5].find("R2") != std::string::npos)
        {
            span.rorder = "2";
        }  
        else
        {
            span.rorder = "x";
        }      
        span.readid = lineinfo[7];
        span.rcigar = lineinfo[2];
        // chr+"#"+barcode => (sta, end) : allow multi-aligns with the same barcode.
        bcPosQueue.insert(std::pair<string, ALIGNINFO>(key, span));
    }
    // output alignments for last chr record statistics
    if(bcPosQueue.size()>0)
    {
        // output alignments for last chr and record statistics
        write_chr_alignment(moutfp,
                            &bcPosQueue, 
                            &molecule_cov,
                            &molecule_len,
                            &molecule_len_sum,
                            &molecule_read_num,       
                            &molecule_read_num_sum, 
                            &molecule_read_interval,                    
                            &barcode_molecule_cnt,
                            lastChr,
                            winsize,
                            minMoleSize);
        // clean info for last Chr
        bcPosQueue.clear();
    }
    //
    alifp.close();
    moutfp.close();    
    // output statistics
    if(!write_molecule_stat(molecule_cov, 
                            molecule_len, 
                            molecule_len_sum,
                            molecule_read_num,
                            molecule_read_num_sum,
                            molecule_read_interval,
                            barcode_molecule_cnt, 
                            out_prefix, 
                            minMoleSize))
    {
        return false;
    }
    //
    cout << "   Info: molecule raw info    collected in " << ofilename << endl;
    cout << "   Info: molecule coverage    collected in"  << out_prefix + "_min" + minMsize.str() + "bp_moleCov_stat.txt" << endl;
    cout << "   Info: molecule length      collected in"  << out_prefix + "_min" + minMsize.str() + "bp_moleLen_stat.txt" << endl;  
    cout << "   Info: molecule read number collected in"  << out_prefix + "_min" + minMsize.str() + "bp_readNum_stat.txt" << endl;  
    cout << "   Info: reads' distances     collected in " << out_prefix + "_min" + minMsize.str() + "bp_readDist_stat.txt" << endl;
    cout << "   Info: time on analyzing molecules: "      << (float)(clock()-tbeg)/CLOCKS_PER_SEC << " seconds.\n" << endl;        
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc28, %rsp            # imm = 0xC28
cmpl $0x6, %edi
jne 0x60f4
movq %rsi, %rbx
callq 0x4220
movq %rax, %r12
leaq 0x27c3a(%rip), %rsi     # 0x2db1a
leaq 0x128(%rsp), %rdi
leaq 0x568(%rsp), %rdx
callq 0x4d3e
leaq 0xaa0(%rsp), %rdi
callq 0x4250
leaq 0x27c11(%rip), %rsi     # 0x2db1a
leaq 0x568(%rsp), %rdi
leaq 0x808(%rsp), %rdx
callq 0x4d3e
leaq 0xab8(%rsp), %r13
leaq 0x568(%rsp), %rsi
movq %r13, %rdi
callq 0x4490
leaq 0x568(%rsp), %rdi
callq 0x4638
leaq 0xab0(%rsp), %r14
movq %r14, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x4580
leaq 0x27bbb(%rip), %rsi     # 0x2db1a
leaq 0xd8(%rsp), %rdi
leaq 0x568(%rsp), %rdx
callq 0x4d3e
movq 0x10(%rbx), %rsi
leaq 0x568(%rsp), %rdi
leaq 0x808(%rsp), %rdx
callq 0x4d3e
leaq 0x128(%rsp), %rdi
leaq 0x568(%rsp), %r15
movq %r15, %rsi
callq 0x43c0
movq %r15, %rdi
callq 0x4638
movq 0x18(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, 0x60(%rsp)
movq 0x20(%rbx), %rdi
callq 0x44c0
movl %eax, %r15d
movq 0x28(%rbx), %rsi
leaq 0x568(%rsp), %rdi
leaq 0x808(%rsp), %rdx
callq 0x4d3e
leaq 0xd8(%rsp), %rdi
leaq 0x568(%rsp), %rbx
movq %rbx, %rsi
callq 0x43c0
movq %rbx, %rdi
callq 0x4638
leaq 0x27b0f(%rip), %rsi     # 0x2db1a
leaq 0x568(%rsp), %rdi
leaq 0x808(%rsp), %rdx
callq 0x4d3e
leaq 0x568(%rsp), %rsi
movq %r13, %rdi
callq 0x4490
leaq 0x568(%rsp), %rdi
callq 0x4638
movq %r14, %rdi
movl %r15d, %esi
callq 0x4580
movq 0x36f79(%rip), %rdi     # 0x3cfc8
leaq 0x23a62(%rip), %rsi     # 0x29ab8
callq 0x4330
movq %rax, %rdi
callq 0x41c0
leaq 0x233cd(%rip), %rsi     # 0x29437
leaq 0x128(%rsp), %rdi
xorl %edx, %edx
callq 0x4600
cmpq $-0x1, %rax
je 0x615e
leaq 0x568(%rsp), %rdi
callq 0x94d2
movq 0x128(%rsp), %rsi
leaq 0x568(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x27e38
movq 0x568(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x588(%rsp,%rax)
je 0x6180
movq 0x36eff(%rip), %rdi     # 0x3cfc8
leaq 0x23a48(%rip), %rsi     # 0x29b18
callq 0x4330
leaq 0x128(%rsp), %rsi
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x41c0
xorl %ebp, %ebp
jmp 0x6dab
movq 0x36ecd(%rip), %rbx     # 0x3cfc8
leaq 0x237d6(%rip), %rsi     # 0x298d8
movq %rbx, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
leaq 0x23828(%rip), %rsi     # 0x29941
movq %rbx, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
leaq 0x23887(%rip), %rsi     # 0x299b7
movq %rbx, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
leaq 0x238fe(%rip), %rsi     # 0x29a45
movq %rbx, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
xorl %ebp, %ebp
jmp 0x6ddf
movq 0x36e63(%rip), %rdi     # 0x3cfc8
leaq 0x23974(%rip), %rsi     # 0x29ae0
callq 0x4330
movq %rax, %rdi
callq 0x41c0
xorl %ebp, %ebp
jmp 0x6db8
leaq 0x239a8(%rip), %rdx     # 0x29b2f
leaq 0x188(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x95e2
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
callq 0x44e0
leaq 0x808(%rsp), %rdi
leaq 0x188(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x957b
leaq 0x2396a(%rip), %rdx     # 0x29b34
leaq 0x168(%rsp), %rdi
leaq 0x808(%rsp), %rsi
callq 0x5c38
leaq 0x808(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x808(%rsp), %rdi
callq 0x5c58
movq 0x168(%rsp), %rsi
leaq 0x808(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x27e38
movq 0x808(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x828(%rsp,%rax)
je 0x627f
movq 0x36d83(%rip), %rdi     # 0x3cfc8
leaq 0x23909(%rip), %rsi     # 0x29b55
callq 0x4330
leaq 0x168(%rsp), %rsi
movq %rax, %rdi
callq 0x42e0
leaq 0x2390a(%rip), %rsi     # 0x29b72
movq %rax, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
xorl %ebp, %ebp
jmp 0x6d91
leaq 0x990(%rsp), %rdi
leaq 0x238f3(%rip), %rsi     # 0x29b81
callq 0x4330
movq %rax, %rdi
callq 0x41c0
leaq 0x370(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x340(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x310(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x2e0(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x2b0(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x280(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x250(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x220(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x27790(%rip), %rsi     # 0x2db1a
leaq 0xf8(%rsp), %rdi
leaq 0x188(%rsp), %rdx
callq 0x4d3e
movq %r12, 0x118(%rsp)
leaq 0x2776c(%rip), %rsi     # 0x2db1a
leaq 0x148(%rsp), %rdi
leaq 0x188(%rsp), %rdx
callq 0x4d3e
leaq 0x188(%rsp), %r14
leaq 0x3d8(%rsp), %r13
leaq 0x218(%rsp), %rbp
movq $0x0, 0x58(%rsp)
movq %r15, 0x120(%rsp)
movq 0x568(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x588(%rsp,%rax)
jne 0x67d0
movq %rsp, %rbx
movq %rbx, %rdi
leaq 0x27707(%rip), %rsi     # 0x2db1a
movq %r14, %rdx
callq 0x4d3e
leaq 0x6f0(%rsp), %rdi
movq %rbx, %rsi
callq 0x4090
cmpq $0x0, 0x8(%rsp)
je 0x67c3
movq (%rsp), %rax
movzbl (%rax), %eax
cmpl $0x23, %eax
movq %rsp, %rdi
je 0x67c6
cmpl $0x2a, %eax
je 0x67c6
movq 0x58(%rsp), %rax
incq %rax
movq %rax, 0x58(%rsp)
xorl %edx, %edx
movl $0x989680, %ecx         # imm = 0x989680
divq %rcx
testq %rdx, %rdx
jne 0x64a6
movq 0x36b52(%rip), %rdi     # 0x3cfc8
leaq 0x24eec(%rip), %rsi     # 0x2b369
callq 0x4330
movq %rax, %rdi
movq 0x58(%rsp), %rsi
callq 0x4230
movq %rax, %rdi
leaq 0x23028(%rip), %rsi     # 0x294c1
callq 0x4330
movq %rax, %rdi
callq 0x41c0
movb $0x9, 0x188(%rsp)
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
movq %r14, %rdx
callq 0x26120
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rax
subq %rsi, %rax
cmpq $0xc0, %rax
jb 0x67b9
cmpq $0x0, 0x100(%rsp)
jne 0x64f4
leaq 0xf8(%rsp), %rdi
callq 0x41e0
movq 0x40(%rsp), %rsi
leaq 0x148(%rsp), %rdi
callq 0x41e0
leaq 0x148(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x4030
testl %eax, %eax
je 0x65c5
cmpq $0x0, 0x240(%rsp)
je 0x65c5
leaq 0x3f8(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x4400
leaq 0x808(%rsp), %rdi
movq %rbp, %rsi
leaq 0x368(%rsp), %rdx
leaq 0x338(%rsp), %rcx
leaq 0x308(%rsp), %r8
leaq 0x2d8(%rsp), %r9
pushq %r15
pushq 0x68(%rsp)
leaq 0x408(%rsp), %rbx
pushq %rbx
leaq 0x260(%rsp), %rax
pushq %rax
leaq 0x298(%rsp), %rax
pushq %rax
leaq 0x2d0(%rsp), %rax
pushq %rax
callq 0x717f
addq $0x30, %rsp
movq %rbx, %rdi
callq 0x4638
movq %rbp, %rdi
callq 0xa140
leaq 0xf8(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x41e0
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4130
movq %rax, %r15
movq 0x40(%rsp), %rsi
addq $0x40, %rsi
movq %r13, %rdi
callq 0x4400
movq %r13, %rdi
callq 0x881d
movq %r13, %rdi
movl %eax, %r13d
callq 0x4638
leaq 0x20(%rsp), %rdi
leaq 0x27510(%rip), %rsi     # 0x2db1a
movq %r14, %r12
movq %r14, %rdx
callq 0x4d3e
movq %rbp, %rbx
movq 0x40(%rsp), %rsi
leaq 0x68(%rsp), %r14
movq %r14, %rdi
leaq 0x279b6(%rip), %rdx     # 0x2dfe2
callq 0x95e2
movq 0x40(%rsp), %rdx
addq $0x60, %rdx
movq %r12, %rbp
movq %r12, %rdi
movq %r14, %rsi
callq 0x961a
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x43c0
movq %rbp, %rdi
callq 0x4638
movq %r14, %rdi
callq 0x4638
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
andq $0x0, 0x80(%rsp)
xorl %ecx, %ecx
movb %cl, 0x88(%rsp)
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
andq $0x0, 0xa0(%rsp)
movb %cl, 0xa8(%rsp)
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
andq $0x0, 0xc0(%rsp)
movb %cl, 0xc8(%rsp)
movq %r15, 0x68(%rsp)
movslq %r13d, %rax
addq %r15, %rax
decq %rax
movq %rax, 0x70(%rsp)
movq 0x40(%rsp), %rdi
movl $0xa0, %eax
addq %rax, %rdi
leaq 0x22fc1(%rip), %rsi     # 0x296ac
xorl %edx, %edx
callq 0x4600
leaq 0x22f48(%rip), %rsi     # 0x29641
cmpq $-0x1, %rax
jne 0x6730
movq 0x40(%rsp), %rdi
movl $0xa0, %eax
addq %rax, %rdi
leaq 0x22f9c(%rip), %rsi     # 0x296af
xorl %edx, %edx
callq 0x4600
cmpq $-0x1, %rax
leaq 0x277e8(%rip), %rsi     # 0x2df0d
leaq 0x27566(%rip), %rax     # 0x2dc92
cmoveq %rax, %rsi
leaq 0x78(%rsp), %rdi
callq 0x45e0
movq 0x120(%rsp), %r15
leaq 0x3d8(%rsp), %r13
movq %rbx, %rbp
movq 0x40(%rsp), %rsi
movl $0xe0, %eax
addq %rax, %rsi
leaq 0x98(%rsp), %rdi
callq 0x41e0
movq 0x40(%rsp), %rsi
addq $0x40, %rsi
leaq 0xb8(%rsp), %rdi
callq 0x41e0
movq %r12, %r14
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x963a
movq %rbp, %rdi
movq %r14, %rsi
callq 0xa16e
movq %r14, %rdi
callq 0x9670
leaq 0x68(%rsp), %rdi
callq 0x9686
leaq 0x20(%rsp), %rdi
callq 0x4638
leaq 0x40(%rsp), %rdi
callq 0x5d02
movq %rsp, %rdi
callq 0x4638
jmp 0x63ec
cmpq $0x0, 0x240(%rsp)
je 0x686c
leaq 0x3b8(%rsp), %rbx
leaq 0xf8(%rsp), %rsi
movq %rbx, %rdi
callq 0x4400
leaq 0x808(%rsp), %rdi
leaq 0x218(%rsp), %rsi
leaq 0x368(%rsp), %rdx
leaq 0x338(%rsp), %rcx
leaq 0x308(%rsp), %r8
leaq 0x2d8(%rsp), %r9
pushq %r15
pushq 0x68(%rsp)
pushq %rbx
leaq 0x260(%rsp), %rax
pushq %rax
leaq 0x298(%rsp), %rax
pushq %rax
leaq 0x2d0(%rsp), %rax
pushq %rax
callq 0x717f
addq $0x30, %rsp
leaq 0x3b8(%rsp), %rdi
callq 0x4638
leaq 0x218(%rsp), %rdi
callq 0xa140
leaq 0x568(%rsp), %rdi
callq 0x280e0
leaq 0x808(%rsp), %rdi
callq 0x280e0
leaq 0x508(%rsp), %rdi
leaq 0x368(%rsp), %rsi
callq 0x9888
leaq 0x4d8(%rsp), %rdi
leaq 0x338(%rsp), %rsi
callq 0x9b48
leaq 0x4a8(%rsp), %rdi
leaq 0x308(%rsp), %rsi
callq 0x9b48
leaq 0x478(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x9b48
leaq 0x448(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
callq 0x9b48
leaq 0x418(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x9b48
leaq 0x538(%rsp), %rbx
leaq 0x248(%rsp), %rsi
movq %rbx, %rdi
callq 0x9d62
leaq 0x398(%rsp), %r14
leaq 0xd8(%rsp), %rsi
movq %r14, %rdi
callq 0x4400
subq $0x8, %rsp
leaq 0x510(%rsp), %rdi
leaq 0x4e0(%rsp), %rsi
leaq 0x4b0(%rsp), %rdx
leaq 0x480(%rsp), %rcx
leaq 0x450(%rsp), %r8
leaq 0x420(%rsp), %r9
pushq %r15
pushq %r14
pushq %rbx
callq 0x88dc
addq $0x20, %rsp
movl %eax, %ebp
leaq 0x398(%rsp), %rdi
callq 0x4638
leaq 0x538(%rsp), %rdi
callq 0xa004
leaq 0x418(%rsp), %rdi
callq 0xa018
leaq 0x448(%rsp), %rdi
callq 0xa018
leaq 0x478(%rsp), %rdi
callq 0xa018
leaq 0x4a8(%rsp), %rdi
callq 0xa018
leaq 0x4d8(%rsp), %rdi
callq 0xa018
leaq 0x508(%rsp), %rdi
callq 0xa02c
testb %bpl, %bpl
je 0x6d0f
movq 0x365d8(%rip), %rdi     # 0x3cfc8
leaq 0x2320a(%rip), %rsi     # 0x29c01
callq 0x4330
leaq 0x168(%rsp), %rsi
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x41c0
movq 0x365ad(%rip), %rdi     # 0x3cfc8
leaq 0x2320b(%rip), %rsi     # 0x29c2d
callq 0x4330
movq %rax, %rbx
leaq 0x230fe(%rip), %rdx     # 0x29b2f
movq %rsp, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x95e2
leaq 0x20(%rsp), %rdi
leaq 0xab8(%rsp), %rsi
callq 0x44e0
leaq 0x68(%rsp), %rdi
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
callq 0x957b
leaq 0x231ec(%rip), %rdx     # 0x29c58
leaq 0x188(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x5c38
leaq 0x188(%rsp), %rsi
movq %rbx, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x41c0
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
leaq 0x20(%rsp), %rdi
callq 0x4638
movq %rsp, %rdi
callq 0x4638
movq 0x36502(%rip), %rdi     # 0x3cfc8
leaq 0x2319f(%rip), %rsi     # 0x29c6c
callq 0x4330
movq %rax, %rbx
leaq 0x23053(%rip), %rdx     # 0x29b2f
movq %rsp, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x95e2
leaq 0x20(%rsp), %rdi
leaq 0xab8(%rsp), %rsi
callq 0x44e0
leaq 0x68(%rsp), %rdi
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
callq 0x957b
leaq 0x23180(%rip), %rdx     # 0x29c97
leaq 0x188(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x5c38
leaq 0x188(%rsp), %rsi
movq %rbx, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x41c0
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
leaq 0x20(%rsp), %rdi
callq 0x4638
movq %rsp, %rdi
callq 0x4638
movq 0x36457(%rip), %rdi     # 0x3cfc8
leaq 0x23133(%rip), %rsi     # 0x29cab
callq 0x4330
movq %rax, %rbx
leaq 0x22fa8(%rip), %rdx     # 0x29b2f
movq %rsp, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x95e2
leaq 0x20(%rsp), %rdi
leaq 0xab8(%rsp), %rsi
callq 0x44e0
leaq 0x68(%rsp), %rdi
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
callq 0x957b
leaq 0x23114(%rip), %rdx     # 0x29cd6
leaq 0x188(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x5c38
leaq 0x188(%rsp), %rsi
movq %rbx, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x41c0
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
leaq 0x20(%rsp), %rdi
callq 0x4638
movq %rsp, %rdi
callq 0x4638
movq 0x363ac(%rip), %rdi     # 0x3cfc8
leaq 0x230c7(%rip), %rsi     # 0x29cea
callq 0x4330
movq %rax, %rbx
leaq 0x22efd(%rip), %rdx     # 0x29b2f
movq %rsp, %rdi
leaq 0xd8(%rsp), %rsi
callq 0x95e2
leaq 0x20(%rsp), %rdi
leaq 0xab8(%rsp), %rsi
callq 0x44e0
leaq 0x68(%rsp), %rdi
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
callq 0x957b
leaq 0x230a9(%rip), %rdx     # 0x29d16
leaq 0x188(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x5c38
leaq 0x188(%rsp), %rsi
movq %rbx, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x41c0
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
leaq 0x20(%rsp), %rdi
callq 0x4638
movq %rsp, %rdi
callq 0x4638
movq 0x36301(%rip), %rdi     # 0x3cfc8
leaq 0x2305d(%rip), %rsi     # 0x29d2b
callq 0x4330
movq %rax, %rbx
callq 0x4220
subq 0x118(%rsp), %rax
cvtsi2ss %rax, %xmm0
divss 0x2269c(%rip), %xmm0    # 0x2938c
movq %rbx, %rdi
callq 0x4270
leaq 0x22bb8(%rip), %rsi     # 0x298b7
movq %rax, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
leaq 0x148(%rsp), %rdi
callq 0x4638
leaq 0xf8(%rsp), %rdi
callq 0x4638
leaq 0x218(%rsp), %rdi
callq 0xa040
leaq 0x248(%rsp), %rdi
callq 0xa004
leaq 0x278(%rsp), %rdi
callq 0xa018
leaq 0x2a8(%rsp), %rdi
callq 0xa018
leaq 0x2d8(%rsp), %rdi
callq 0xa018
leaq 0x308(%rsp), %rdi
callq 0xa018
leaq 0x338(%rsp), %rdi
callq 0xa018
leaq 0x368(%rsp), %rdi
callq 0xa02c
leaq 0x808(%rsp), %rdi
callq 0x5d24
leaq 0x168(%rsp), %rdi
callq 0x4638
leaq 0x568(%rsp), %rdi
callq 0x96aa
leaq 0xd8(%rsp), %rdi
callq 0x4638
leaq 0xaa0(%rsp), %rdi
callq 0x4280
leaq 0x128(%rsp), %rdi
callq 0x4638
movl %ebp, %eax
addq $0xc28, %rsp            # imm = 0xC28
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x6e6c
movq %rax, %rbx
jmp 0x6e76
jmp 0x6e3f
jmp 0x7092
movq %rax, %rbx
jmp 0x6e88
movq %rax, %rbx
jmp 0x6e92
jmp 0x6e3f
jmp 0x7092
movq %rax, %rbx
jmp 0x6ea4
movq %rax, %rbx
jmp 0x6eae
jmp 0x6e3f
jmp 0x7092
movq %rax, %rbx
jmp 0x6ec0
movq %rax, %rbx
jmp 0x6eca
movq %rax, %rbx
jmp 0x709a
jmp 0x7092
movq %rax, %rbx
leaq 0x3b8(%rsp), %rdi
jmp 0x709d
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
jmp 0x6eca
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
jmp 0x6eca
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
jmp 0x6eca
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
callq 0x4638
leaq 0x68(%rsp), %rdi
callq 0x4638
leaq 0x20(%rsp), %rdi
callq 0x4638
jmp 0x709a
movq %rax, %rbx
leaq 0x398(%rsp), %rdi
callq 0x4638
jmp 0x6eee
movq %rax, %rbx
leaq 0x538(%rsp), %rdi
callq 0xa004
jmp 0x6f00
movq %rax, %rbx
leaq 0x418(%rsp), %rdi
callq 0xa018
jmp 0x6f12
movq %rax, %rbx
leaq 0x448(%rsp), %rdi
callq 0xa018
jmp 0x6f24
movq %rax, %rbx
leaq 0x478(%rsp), %rdi
callq 0xa018
leaq 0x4a8(%rsp), %rdi
callq 0xa018
leaq 0x4d8(%rsp), %rdi
callq 0xa018
leaq 0x508(%rsp), %rdi
callq 0xa02c
jmp 0x70a2
movq %rax, %rbx
jmp 0x6f31
movq %rax, %rbx
jmp 0x6f3e
movq %rax, %rbx
jmp 0x6f4b
movq %rax, %rbx
jmp 0x70af
movq %rax, %rbx
jmp 0x70bc
movq %rax, %rbx
leaq 0x3f8(%rsp), %rdi
jmp 0x7024
movq %rax, %rbx
jmp 0x7131
movq %rax, %rbx
leaq 0x808(%rsp), %rdi
callq 0x4638
jmp 0x6fa9
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4638
jmp 0x6fb8
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
jmp 0x7139
jmp 0x708a
movq %rax, %rbx
leaq 0x3d8(%rsp), %rdi
jmp 0x7024
movq %rax, %rbx
jmp 0x701f
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4638
jmp 0x701f
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
callq 0x9670
jmp 0x7015
jmp 0x7012
jmp 0x702b
jmp 0x702b
jmp 0x7097
jmp 0x714d
jmp 0x7092
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x9686
leaq 0x20(%rsp), %rdi
callq 0x4638
jmp 0x702e
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5d02
jmp 0x709a
movq %rax, %rbx
jmp 0x7124
movq %rax, %rbx
leaq 0x568(%rsp), %rdi
callq 0x4638
jmp 0x7150
jmp 0x714d
jmp 0x714d
jmp 0x714d
jmp 0x707a
jmp 0x707a
movq %rax, %rbx
leaq 0x568(%rsp), %rdi
jmp 0x7158
movq %rax, %rbx
jmp 0x715d
movq %rax, %rbx
jmp 0x716a
movq %rax, %rbx
jmp 0x713e
movq %rax, %rbx
jmp 0x70a2
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4638
leaq 0x148(%rsp), %rdi
callq 0x4638
leaq 0xf8(%rsp), %rdi
callq 0x4638
leaq 0x218(%rsp), %rdi
callq 0xa040
leaq 0x248(%rsp), %rdi
callq 0xa004
leaq 0x278(%rsp), %rdi
callq 0xa018
leaq 0x2a8(%rsp), %rdi
callq 0xa018
leaq 0x2d8(%rsp), %rdi
callq 0xa018
leaq 0x308(%rsp), %rdi
callq 0xa018
leaq 0x338(%rsp), %rdi
callq 0xa018
leaq 0x368(%rsp), %rdi
callq 0xa02c
leaq 0x808(%rsp), %rdi
callq 0x5d24
leaq 0x168(%rsp), %rdi
callq 0x4638
leaq 0x568(%rsp), %rdi
callq 0x96aa
jmp 0x7150
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x4638
leaq 0xaa0(%rsp), %rdi
callq 0x4280
leaq 0x128(%rsp), %rdi
callq 0x4638
movq %rbx, %rdi
callq 0x45a0