// File: /workspace/github_cpp_makefile_star2_O3/schneebergerlab[P]DrLink/postprocess_bpPrediction.cpp
// Function: postprocess_bpPrediction(std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::multimap<unsigned long, BPINFO, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, BPINFO>>>, 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, std::multimap<unsigned long, BPINFO, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, BPINFO>>>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool postprocess_bpPrediction(multimap<string, multimap<unsigned long, BPINFO> > rawbpmap, string finalbpfile)
{
    multimap<string, multimap<unsigned long, BPINFO> > tmpmap = rawbpmap;
    // output final clusters
    fstream finfp;
    finfp.open(finalbpfile.c_str(), ios::out);
    if(!finfp.good())
    {
        cout << "   Error: cannot open file " << finalbpfile 
             << " for collecting final break point predictions. " << endl;
        return false;
    }    
    finfp << "#chr\t"
          << "left_pos\t"
          << "right_pos\t"
          << "score\t"
          << "left_alleles\t"
          << "right_alleles\t"
          << "barcode\t"
          << "molecule_len\t"
          << "left_span\t"
          << "right_span\t"
          << "Max_interval_size\t"
          << "Min_interval_size\t"
          << "support\n";
    int groupNum = 0;
    // this function overlaps predicted breakpoints
    multimap<string, multimap<unsigned long, BPINFO> >::iterator chritr;
    multimap<string, multimap<unsigned long, BPINFO> >::iterator chritr_end;
    chritr = rawbpmap.begin();
    chritr_end = rawbpmap.end();
    while(chritr != chritr_end)
    {
        multimap<unsigned long, BPINFO> tmp;
        tmp = (*chritr).second;
        multimap<unsigned long, BPINFO>::iterator litr;
        multimap<unsigned long, BPINFO>::iterator litr_end;
        litr = tmp.begin();
        litr_end = tmp.end();
        // get first break point of current chr
        vector<string>        targcluster;
        vector<string>        targchr;
        vector<unsigned long> targleftp;
        vector<unsigned long> targrightp;
        vector<unsigned long> targrightMax;
        vector<unsigned long> targrightMin;
        vector<unsigned long> targleftMax;
        vector<unsigned long> targleftMin;
        vector<double>        targscore;
        vector<string>        targorder;
        targchr.push_back(((*litr).second).chr);
        targcluster.push_back(((*litr).second).bpline);
        targleftp.push_back(((*litr).second).leftp);
        targrightp.push_back(((*litr).second).rightp);
        targscore.push_back(((*litr).second).score);
        targorder.push_back(((*litr).second).order);        
        targrightMax.push_back(((*litr).second).rightp);
        targrightMin.push_back(((*litr).second).rightp);
        targleftMax.push_back(((*litr).second).leftp);
        targleftMin.push_back(((*litr).second).leftp);
        // next break point
        litr ++;
        while(litr != litr_end)
        {
            // processing here
            unsigned long ileftp  = ((*litr).second).leftp;
            unsigned long irightp = ((*litr).second).rightp; 
            string        iorder  = ((*litr).second).order;     
            
            bool grouped = false;
            for(int vi = 0; vi < targcluster.size(); vi ++)
            {
                if(iorder.compare(targorder[vi])==0 && ileftp < targrightMin[vi])
                {
                    targcluster[vi] += "\n#"+ ( (*litr).second ).bpline;
                    // right max
                    if(irightp > targrightMax[vi])
                    {
                        targrightMax[vi] = irightp;
                    }
                    // right min
                    if(irightp < targrightMin[vi])
                    {
                        targrightMin[vi] = irightp;
                    }
                    // left max
                    if(ileftp > targleftMax[vi])
                    {
                        targleftMax[vi] = ileftp;
                    }  
                    // left min
                    if(ileftp < targleftMin[vi])
                    {
                        targleftMin[vi] = ileftp;
                    }     
                    // sum of score
                    targscore[vi] += ( (*litr).second ).score;                      
                    //
                    grouped = true;
                }
            }
            if(!grouped)
            {
                targchr.push_back(((*litr).second).chr);
                targcluster.push_back(((*litr).second).bpline);
                targleftp.push_back(((*litr).second).leftp);
                targrightp.push_back(((*litr).second).rightp);
                targscore.push_back(((*litr).second).score);
                targorder.push_back(((*litr).second).order);        
                targrightMax.push_back(((*litr).second).rightp);
                targrightMin.push_back(((*litr).second).rightp);
                targleftMax.push_back(((*litr).second).leftp);
                targleftMin.push_back(((*litr).second).leftp);
            }
            
            litr ++;
        }
        // output current chr
        for(int vi = 0; vi < targcluster.size(); vi ++)
        {
            int support = std::count(targcluster[vi].begin(), targcluster[vi].end(), '#') + 1;
            // using intersection (targleftMin, targrightMax) of overlapped predictions as final interval
            finfp << "#." << ++groupNum         << "\n" 
                  << targchr[vi]                << "\t" 
                  << targleftMax[vi]            << "\t" 
                  << targrightMin[vi]           << "\t" << fixed << std::setprecision(2) 
                  << targscore[vi]/support      << "\t"
                  << targorder[vi].substr(0, 1) << "\t" 
                  << targorder[vi].substr(1, 1) << "\tBC\tmLen\tLspan\tRspan\t"
                  << targrightMax[vi] - targleftMin[vi] << "\t"
                  << targrightMin[vi] - targleftMax[vi] << "\t"
                  << support                            << "\tInterSec" << endl;
            // details of predictions      
            finfp << "#" << targcluster[vi] << endl;
            // using union (targleftMax, targrightMin) of overlapped predictions as final interval (backup)
            finfp << "##" 
                  << targchr[vi]                << "\t" 
                  << targleftMin[vi]            << "\t" 
                  << targrightMax[vi]           << "\t" << fixed << std::setprecision(2)                   
                  << targscore[vi]/support      << "\t"
                  << targorder[vi].substr(0, 1) << "\t" 
                  << targorder[vi].substr(1, 1) << "\tBC\tmLen\tLspan\tRspan\t"
                  << targrightMax[vi] - targleftMin[vi] << "\t"
                  << targrightMin[vi] - targleftMax[vi] << "\t"
                  << support                            << "\tUnion\n#" << endl;
        }
        // clear current chr
        targcluster.clear();
        targleftp.clear();
        targrightp.clear();
        targorder.clear();
        targrightMax.clear();
        targrightMin.clear();
        targleftMax.clear();
        
        chritr ++;
    }
    finfp.close();  
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x1c8(%rsp), %rdi
movq %rsi, %r14
callq 0x205da
leaq 0x1f8(%rsp), %rdi
callq 0x43c0
movq (%rbx), %rsi
leaq 0x1f8(%rsp), %rdi
movl $0x10, %edx
callq 0x42d0
movq 0x1f8(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x218(%rsp,%rax), %eax
movl %eax, 0x16c(%rsp)
testl %eax, %eax
je 0x374d9
movq 0x14b56(%rip), %rdi     # 0x4bfc8
leaq 0x36f5(%rip), %rsi      # 0x3ab6e
movl $0x1b, %edx
callq 0x43a0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x14b37(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %rbx
leaq 0x7a98(%rip), %rsi      # 0x3ef38
movl $0x2f, %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
jmp 0x38410
leaq 0x208(%rsp), %rbx
leaq 0x4780(%rip), %rsi      # 0x3bc68
movl $0x5, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x4772(%rip), %rsi      # 0x3bc6e
movl $0x9, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x4768(%rip), %rsi      # 0x3bc78
movl $0xa, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x475f(%rip), %rsi      # 0x3bc83
movl $0x6, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x4752(%rip), %rsi      # 0x3bc8a
movl $0xd, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x474c(%rip), %rsi      # 0x3bc98
movl $0xe, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x4747(%rip), %rsi      # 0x3bca7
movl $0x8, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x79f4(%rip), %rsi      # 0x3ef68
movl $0xd, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x4736(%rip), %rsi      # 0x3bcbe
movl $0xa, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x472d(%rip), %rsi      # 0x3bcc9
movl $0xb, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x79c6(%rip), %rsi      # 0x3ef76
movl $0x12, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x79c5(%rip), %rsi      # 0x3ef89
movl $0x12, %edx
movq %rbx, %rdi
callq 0x43a0
leaq 0x79c4(%rip), %rsi      # 0x3ef9c
movl $0x8, %edx
movq %rbx, %rdi
callq 0x43a0
movq 0x18(%r14), %r15
addq $0x8, %r14
movq %r14, 0x188(%rsp)
cmpq %r14, %r15
je 0x38403
leaq 0xc8(%rsp), %rbp
xorl %r13d, %r13d
leaq 0x198(%rsp), %rbx
movl $0x0, 0xdc(%rsp)
movl $0x0, 0x1a0(%rsp)
movq %r13, 0x1a8(%rsp)
leaq 0x1a0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %rax, 0x1b8(%rsp)
movq %r13, 0x1c0(%rsp)
leaq 0x40(%r15), %rsi
movq %rbx, %rdi
callq 0x3868e
movq 0x1b0(%rsp), %rbx
movq %r13, 0x90(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movq %r13, 0x180(%rsp)
movapd %xmm0, 0x170(%rsp)
movq %r13, 0x130(%rsp)
movapd %xmm0, 0x120(%rsp)
movq %r13, 0x110(%rsp)
movapd %xmm0, 0x100(%rsp)
movq %r13, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
movq %r13, 0x10(%rsp)
movapd %xmm0, (%rsp)
movq %r13, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movq %r13, 0xb0(%rsp)
movapd %xmm0, 0xa0(%rsp)
movq %r13, 0xf0(%rsp)
movapd %xmm0, 0xe0(%rsp)
movq %r13, 0x150(%rsp)
movapd %xmm0, 0x140(%rsp)
leaq 0x28(%rbx), %rsi
leaq 0x170(%rsp), %rdi
callq 0x368c4
leaq 0x90(%rbx), %rsi
leaq 0x80(%rsp), %rdi
callq 0x368c4
leaq 0x48(%rbx), %r14
movq 0x128(%rsp), %rsi
cmpq 0x130(%rsp), %rsi
je 0x3774d
movq (%r14), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x128(%rsp)
jmp 0x3775d
leaq 0x120(%rsp), %rdi
movq %r14, %rdx
callq 0x22150
leaq 0x50(%rbx), %r12
movq 0x108(%rsp), %rsi
cmpq 0x110(%rsp), %rsi
je 0x37788
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x108(%rsp)
jmp 0x37798
leaq 0x100(%rsp), %rdi
movq %r12, %rdx
callq 0x22150
leaq 0x68(%rbx), %rdx
movq 0xe8(%rsp), %rsi
cmpq 0xf0(%rsp), %rsi
je 0x377c4
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xe8(%rsp)
jmp 0x377d1
leaq 0xe0(%rsp), %rdi
callq 0x2b3da
leaq 0x70(%rbx), %rsi
leaq 0x140(%rsp), %rdi
callq 0x368c4
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x37800
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x48(%rsp)
jmp 0x3780d
leaq 0x40(%rsp), %rdi
movq %r12, %rdx
callq 0x22150
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x3782b
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x37836
movq %rsp, %rdi
movq %r12, %rdx
callq 0x22150
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x37853
movq (%r14), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x37860
leaq 0x20(%rsp), %rdi
movq %r14, %rdx
callq 0x22150
movq 0xa8(%rsp), %rsi
cmpq 0xb0(%rsp), %rsi
je 0x37886
movq (%r14), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xa8(%rsp)
jmp 0x37896
leaq 0xa0(%rsp), %rdi
movq %r14, %rdx
callq 0x22150
movq %r15, 0x190(%rsp)
movq %rbx, %rdi
callq 0x4230
movq %rax, %rbx
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rbx
je 0x37c1c
movq 0x48(%rbx), %r13
movq 0x50(%rbx), %r15
movq %rbp, 0xb8(%rsp)
movq 0x70(%rbx), %rsi
movq 0x78(%rbx), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0xd940
movq 0x88(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0x37a4b
leaq 0x90(%rbx), %rax
movq %rax, 0x160(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
leaq 0x1(%r12), %rax
shlq $0x5, %r12
movq %r12, %r14
movq %rax, %r12
movq 0x140(%rsp), %rsi
addq %r14, %rsi
leaq 0xb8(%rsp), %rdi
callq 0x4040
testl %eax, %eax
jne 0x37942
movq (%rsp), %rax
cmpq -0x8(%rax,%r12,8), %r13
jb 0x3796c
movq 0x88(%rsp), %rax
subq 0x80(%rsp), %rax
sarq $0x5, %rax
leaq 0x1(%r12), %rcx
addq $0x20, %r14
cmpq %r12, %rax
movq %rcx, %r12
ja 0x3791b
jmp 0x37a41
leaq 0x60(%rsp), %rdi
leaq 0x7659(%rip), %rsi      # 0x3efd1
movq 0x160(%rsp), %rdx
callq 0x38606
addq 0x80(%rsp), %r14
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq %r14, %rdi
callq 0x4120
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x379bb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x40(%rsp), %rax
cmpq -0x8(%rax,%r12,8), %r15
jbe 0x379cc
movq %r15, -0x8(%rax,%r12,8)
movq (%rsp), %rax
cmpq -0x8(%rax,%r12,8), %r15
jae 0x379dc
movq %r15, -0x8(%rax,%r12,8)
movq 0x20(%rsp), %rax
cmpq -0x8(%rax,%r12,8), %r13
jbe 0x379ed
movq %r13, -0x8(%rax,%r12,8)
movq 0xa0(%rsp), %rax
cmpq -0x8(%rax,%r12,8), %r13
jae 0x37a01
movq %r13, -0x8(%rax,%r12,8)
movsd 0x68(%rbx), %xmm0
movq 0xe0(%rsp), %rax
addsd -0x8(%rax,%r12,8), %xmm0
movsd %xmm0, -0x8(%rax,%r12,8)
movq 0x88(%rsp), %rax
subq 0x80(%rsp), %rax
sarq $0x5, %rax
movb $0x1, %bpl
cmpq %r12, %rax
ja 0x3790c
jmp 0x37be3
testb $0x1, %bpl
jne 0x37be3
leaq 0x28(%rbx), %rsi
leaq 0x170(%rsp), %rdi
callq 0x368c4
leaq 0x90(%rbx), %rsi
leaq 0x80(%rsp), %rdi
callq 0x368c4
leaq 0x48(%rbx), %r12
movq 0x128(%rsp), %rsi
cmpq 0x130(%rsp), %rsi
je 0x37a9b
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x128(%rsp)
jmp 0x37aab
leaq 0x120(%rsp), %rdi
movq %r12, %rdx
callq 0x22150
leaq 0x50(%rbx), %r14
movq 0x108(%rsp), %rsi
cmpq 0x110(%rsp), %rsi
je 0x37ad5
movq (%r14), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x108(%rsp)
jmp 0x37ae5
leaq 0x100(%rsp), %rdi
movq %r14, %rdx
callq 0x22150
leaq 0x68(%rbx), %rdx
movq 0xe8(%rsp), %rsi
cmpq 0xf0(%rsp), %rsi
je 0x37b11
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xe8(%rsp)
jmp 0x37b1e
leaq 0xe0(%rsp), %rdi
callq 0x2b3da
leaq 0x70(%rbx), %rsi
leaq 0x140(%rsp), %rdi
callq 0x368c4
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x37b4c
movq (%r14), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x48(%rsp)
jmp 0x37b59
leaq 0x40(%rsp), %rdi
movq %r14, %rdx
callq 0x22150
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x37b76
movq (%r14), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x37b81
movq %rsp, %rdi
movq %r14, %rdx
callq 0x22150
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x37b9f
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x37bac
leaq 0x20(%rsp), %rdi
movq %r12, %rdx
callq 0x22150
movq 0xa8(%rsp), %rsi
cmpq 0xb0(%rsp), %rsi
je 0x37bd3
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xa8(%rsp)
jmp 0x37be3
leaq 0xa0(%rsp), %rdi
movq %r12, %rdx
callq 0x22150
movq %rbx, %rdi
callq 0x4230
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rbp
cmpq %rbp, %rdi
je 0x378a9
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x378a9
movq 0x80(%rsp), %r14
movq 0x88(%rsp), %rbx
cmpq %r14, %rbx
je 0x3820d
xorl %r13d, %r13d
leaq 0x208(%rsp), %r15
movq %r13, %rbx
shlq $0x5, %rbx
movq 0x8(%r14,%rbx), %rax
testq %rax, %rax
je 0x37c74
movq (%r14,%rbx), %rcx
xorl %edx, %edx
xorl %r12d, %r12d
xorl %esi, %esi
cmpb $0x23, (%rcx,%rdx)
sete %sil
addl %esi, %r12d
incq %rdx
cmpq %rdx, %rax
jne 0x37c5a
incl %r12d
jmp 0x37c7a
movl $0x1, %r12d
movl $0x2, %edx
movq %r15, %rdi
leaq 0x731c(%rip), %rsi      # 0x3efa5
callq 0x43a0
movl 0xdc(%rsp), %esi
incl %esi
movq %r15, %rdi
movl %esi, 0xdc(%rsp)
callq 0x4580
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x61e3(%rip), %rsi      # 0x3de9b
callq 0x43a0
movq 0x170(%rsp), %rax
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6e21(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq 0x20(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6df9(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq (%rsp), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6dd2(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r14,%rcx), %edx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl %esi, %edx
orl $0x4, %edx
movl %edx, 0x18(%r14,%rcx)
movq -0x18(%rax), %rax
movq $0x2, 0x8(%r14,%rax)
movq 0xe0(%rsp), %rax
movsd (%rax,%r13,8), %xmm0
cvtsi2sd %r12d, %xmm1
movsd %xmm1, 0x160(%rsp)
divsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x4510
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6d6b(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq 0x140(%rsp), %rsi
addq %rbx, %rsi
movl $0x1, %ecx
leaq 0xb8(%rsp), %rdi
xorl %edx, %edx
callq 0x4360
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6d1d(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq 0x140(%rsp), %rsi
addq %rbx, %rsi
movl $0x1, %edx
movl $0x1, %ecx
leaq 0x60(%rsp), %rdi
callq 0x4360
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x15, %edx
movq %rax, %rdi
leaq 0x7174(%rip), %rsi      # 0x3efa8
callq 0x43a0
movq 0x40(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq 0xa0(%rsp), %rax
subq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6ca1(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq (%rsp), %rax
movq (%rax,%r13,8), %rsi
movq 0x20(%rsp), %rax
subq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6c71(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq %r14, %rdi
movl %r12d, %esi
callq 0x4580
movq %rax, %r14
movl $0x9, %edx
movq %rax, %rdi
leaq 0x7104(%rip), %rsi      # 0x3efbe
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x37f02
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xb8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x37f1f
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4340
movl $0x1, %edx
movq %r15, %rdi
leaq 0x70a4(%rip), %rsi      # 0x3efd2
callq 0x43a0
movq 0x80(%rsp), %rax
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
movq %r15, %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
movl $0x2, %edx
movq %r15, %rdi
leaq 0x7043(%rip), %rsi      # 0x3efc8
callq 0x43a0
movq 0x170(%rsp), %rax
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
movq %r15, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6b54(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq 0xa0(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6b29(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq 0x40(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x4210
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6b01(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq (%r14), %rax
movq -0x18(%rax), %rcx
movl 0x18(%r14,%rcx), %edx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl %esi, %edx
orl $0x4, %edx
movl %edx, 0x18(%r14,%rcx)
movq -0x18(%rax), %rax
movq $0x2, 0x8(%r14,%rax)
movq 0xe0(%rsp), %rax
movsd (%rax,%r13,8), %xmm0
divsd 0x160(%rsp), %xmm0
movq %r14, %rdi
callq 0x4510
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6aa3(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq 0x140(%rsp), %rsi
addq %rbx, %rsi
movl $0x1, %ecx
leaq 0xb8(%rsp), %rdi
xorl %edx, %edx
callq 0x4360
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6a55(%rip), %rsi      # 0x3eb09
callq 0x43a0
addq 0x140(%rsp), %rbx
movl $0x1, %edx
movl $0x1, %ecx
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x4360
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq %r14, %rdi
callq 0x43a0
movq %rax, %rbx
movl $0x15, %edx
movq %rax, %rdi
leaq 0x6eac(%rip), %rsi      # 0x3efa8
callq 0x43a0
movq 0x40(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq 0xa0(%rsp), %rax
subq (%rax,%r13,8), %rsi
movq %rbx, %rdi
callq 0x4210
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x69d9(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq (%rsp), %rax
movq (%rax,%r13,8), %rsi
movq 0x20(%rsp), %rax
subq (%rax,%r13,8), %rsi
movq %rbx, %rdi
callq 0x4210
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x69a9(%rip), %rsi      # 0x3eb09
callq 0x43a0
movq %rbx, %rdi
movl %r12d, %esi
callq 0x4580
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
leaq 0x6e49(%rip), %rsi      # 0x3efcb
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
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x381ca
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xb8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x381e7
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4340
incq %r13
movq 0x80(%rsp), %r14
movq 0x88(%rsp), %rbx
movq %rbx, %rax
subq %r14, %rax
sarq $0x5, %rax
cmpq %r13, %rax
ja 0x37c40
cmpq %r14, %rbx
movq 0x190(%rsp), %r12
movl $0x0, %r13d
je 0x38250
leaq 0x10(%r14), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x38238
movq (%r15), %rsi
incq %rsi
callq 0x4340
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %rbx, %r15
movq %rax, %r15
jne 0x38224
movq %r14, 0x88(%rsp)
movq 0x120(%rsp), %rax
cmpq %rax, 0x128(%rsp)
je 0x3826a
movq %rax, 0x128(%rsp)
movq 0x100(%rsp), %rax
cmpq %rax, 0x108(%rsp)
je 0x38284
movq %rax, 0x108(%rsp)
movq 0x140(%rsp), %rbx
movq 0x148(%rsp), %r14
cmpq %rbx, %r14
je 0x382c9
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x382b1
movq (%r15), %rsi
incq %rsi
callq 0x4340
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x3829d
movq %rbx, 0x148(%rsp)
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x382da
movq %rax, 0x48(%rsp)
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
leaq 0x198(%rsp), %rbx
je 0x382f2
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
cmpq %rax, 0x28(%rsp)
je 0x38303
movq %rax, 0x28(%rsp)
movq %r12, %rdi
callq 0x4230
movq %rax, %r15
leaq 0x140(%rsp), %rdi
callq 0x6aac
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x38338
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x38355
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3836c
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x38382
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x38399
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x383b6
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x383d3
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
leaq 0x170(%rsp), %rdi
callq 0x6aac
leaq 0x80(%rsp), %rdi
callq 0x6aac
movq %rbx, %rdi
callq 0x20c7c
cmpq 0x188(%rsp), %r15
jne 0x3761c
leaq 0x1f8(%rsp), %rdi
callq 0x4070
cmpl $0x0, 0x16c(%rsp)
sete %bl
leaq 0x1f8(%rsp), %rdi
callq 0x40b0
leaq 0x1c8(%rsp), %rdi
callq 0x20c90
movl %ebx, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3845b
movq %rax, %rbx
jmp 0x385f1
movq %rax, %rbx
jmp 0x385d7
movq %rax, %rbx
jmp 0x385e4
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x384ce
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x384ce
jmp 0x384cb
jmp 0x384f5
jmp 0x38494
jmp 0x384f5
jmp 0x38494
jmp 0x384f5
jmp 0x384f5
jmp 0x38494
movq %rax, %rbx
jmp 0x384bc
jmp 0x384cb
jmp 0x3849d
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x384bc
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xb8(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x384e3
jmp 0x384f8
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x384f8
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x384f8
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x6aac
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x38522
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x3853f
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x38556
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3856c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x38583
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x385a0
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x385bd
movq 0x130(%rsp), %rsi
subq %rdi, %rsi
callq 0x4340
leaq 0x170(%rsp), %rdi
callq 0x6aac
leaq 0x80(%rsp), %rdi
callq 0x6aac
leaq 0x198(%rsp), %rdi
callq 0x20c7c
leaq 0x1f8(%rsp), %rdi
callq 0x40b0
leaq 0x1c8(%rsp), %rdi
callq 0x20c90
movq %rbx, %rdi
callq 0x45a0