// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]GameteBinning/asPollinator_1.0.cpp
// Function: get_break_pos(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, unsigned long*, double*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<unsigned long, ALLELE, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, ALLELE>>>)
string get_break_pos(string           poPat, 
                     string          pmflag,
                     int           pollenid,
                     unsigned long*   leftp, 
                     double*          score,
                     string                     contigname,
                     map<unsigned long, ALLELE> contigmarker)
{
    // used after 20191101
    // poPat: is the pollen PM pattern sequence
    // leftp : would be the i-th   marker position along the contig
    // rightp: would be the i+1-th marker position along the contig
    // score : would be score for the reported co
    // minimum number of markers hard-coded: at least 3
    //
    string pmstring = "";
    string poPatbk  = poPat;
    poPatbk.erase(std::remove(poPatbk.begin(), poPatbk.end(), 'u'), poPatbk.end()); // remove non-effective marekers with value: 'u'
    if(poPatbk.size()==0) 
    {
        pmstring = "UU";                // not sure on co
        *leftp   = 0;
        *score   = 0;
        cout << "   Check2rm: " << poPat << " ---- determined as "  << pmstring << " for pollen " << pollenid << "_x\t0_" << pmflag 
             << " (no effective markers) "                          << endl; 
        return pmstring;
    }
    if(poPatbk.size()==1)
    {
        if(poPatbk.compare("M")==0)
        {
            pmstring = "MM";
        }else
        if(poPatbk.compare("P")==0)
        {
            pmstring = "PP";
        }else ;
        *leftp   = 0; // no co
        *score   = 0; // no co     
        cout << "   Check2rm: " << poPat  << " ---- determined as "  << pmstring << " for pollen " << pollenid << "_x\t0_" << pmflag 
             << " ( 1 effective marker) "                            << endl; 
        return pmstring;  
    }
    //
    *score        = 0.0;
    size_t c1Lef  = 0;   // Left  P cnt for highest score
    size_t c2Lef  = 0;   // Left  M cnt for highest score
    size_t c1Rig  = 0;   // right P cnt for highest score
    size_t c2Rig  = 0;   // right M cnt for highest score
    for(size_t mi = 1; mi <= poPat.size()-1; mi ++) // later control on number of markers, and no need checking all pos.
    {
        string strLef = poPat.substr(0, mi); // val @ pos of 0,...,mi-1
        string strRig = poPat.substr(mi);    // val @ pos of mi,mi+1,...
        // current break point: note: 'u' excluded from consideration
        size_t c1Leftmp  = std::count(strLef.begin(), strLef.end(), 'P'); // Left  P
        size_t c2Leftmp  = std::count(strLef.begin(), strLef.end(), 'M'); // Left  M
        size_t c1Rigtmp  = std::count(strRig.begin(), strRig.end(), 'P'); // Right P
        size_t c2Rigtmp  = std::count(strRig.begin(), strRig.end(), 'M'); // Right M
        //
        double af1Leftmp = (double)c1Leftmp*1.0/(c1Leftmp+c2Leftmp);
        double af2Leftmp = (double)c2Leftmp*1.0/(c1Leftmp+c2Leftmp);        
        double af1Rigtmp = (double)c1Rigtmp*1.0/(c1Rigtmp+c2Rigtmp);
        double af2Rigtmp = (double)c2Rigtmp*1.0/(c1Rigtmp+c2Rigtmp);
        //
        double score1 = af1Leftmp * af2Rigtmp; // left as P right as M
        double score2 = af2Leftmp * af1Rigtmp; // left as M right as P
        double scotmp = score1>score2?score1:score2;   
        if(scotmp >= *score)
        {
            *score  = scotmp;
            *leftp  = mi;  // (*leftp)-th marker is the left break marker, (*leftp+1) is the right break marker; 1-based positioning
            if(score1>score2)
            { 
                pmstring  = "PM";
            }else
            {
                pmstring  = "MP";
            }  
            //
            c1Lef  = c1Leftmp;
            c2Lef  = c2Leftmp;
            c1Rig  = c1Rigtmp;
            c2Rig  = c2Rigtmp;                     
        }
    }
    // 
    string checkfrom = "";
    // control on marker number: MuMMMMuuuuuuPuPPPu
    if(*score > 0 && poPatbk.size()<10)
    {
        // from cluster "M"; 
        if(pmflag.compare("M")    == 0)
        {
            // found "P" on left end;            
            if(pmstring.compare("PM") == 0)
            { 
               // at least 1 effective "P"; at least 1/3 "P"; first position was "P"
               if((poPatbk.substr(0, 1)).compare("P") == 0 && 
                  c1Lef > 0 && c1Lef >= poPatbk.size()/3.0)
                {
                    checkfrom = "1";
                }else
                {
                    pmstring  = "MM";
                    *leftp    = 0; // no co    
                    //*score  = 0; // no co   
                    checkfrom = "2";
                }
            }
            // found "P" on right end
            if(pmstring.compare("MP") == 0)
            {
               // at least 1 effective "P"; at least 1/3 "P"; last position was "P"                
                if((poPatbk.substr(poPatbk.size()-1, 1)).compare("P") == 0 && 
                   c1Rig > 0 && c1Rig >= poPatbk.size()/3.0)
                {
                    checkfrom = "3";
                }else
                {
                    pmstring = "MM";
                    *leftp   = 0; // no co
                    //*score  = 0; // no co 
                    checkfrom = "4";
                }
            }
        }
        // from cluster "P" 
        if(pmflag.compare("P")    == 0)
        {
            // but found "M" on left end
            if(pmstring.compare("MP") == 0 )
            {            
               // at least 1 effective "M"; at least 1/3 "M"; first position was "M"
                if((poPatbk.substr(0, 1)).compare("M") == 0 && 
                   c2Lef > 0 && c2Lef >= poPatbk.size()/3.0)
                {
                    checkfrom = "5";
                }else
                {
                    pmstring = "PP";
                    *leftp   = 0; // no co
                    //*score  = 0; // no co    
                    checkfrom = "6";
                }
            }
            // but found "M" on right end
            if(pmstring.compare("PM") == 0)
            {            
               // at least 1 effective "M"; at least 1/3 "M"; last position was "M"
                if((poPatbk.substr(poPatbk.size()-1, 1)).compare("M") == 0 &&     
                   c2Rig > 0 && c2Rig >= poPatbk.size()/3.0)
                {
                    checkfrom = "7";
                }else
                {
                    pmstring = "PP";
                    *leftp   = 0; // no co
                    //*score  = 0; // no co 
                    checkfrom = "8";
                }
            }
        }                
        //
    }else
    if(*score>=minCOscore && poPatbk.size()>10)
    {
        // from cluster "M" 
        if(pmflag.compare("M")    == 0)
        {        
            // but found "P" on left end 
            if(pmstring.compare("PM") == 0)
            {            
                // and at least 5 effective "P" and first position was "P"
                if((poPatbk.substr(0, 1)).compare("P") == 0 && c1Lef >= 5 )
                {
                    checkfrom = "9";
                }else
                {
                    pmstring = "MM";
                    *leftp   = 0;  // no co
                    //*score  = 0; // no co
                    checkfrom = "10";
                }
            }
            // but found "P" on right end
            if(pmstring.compare("MP") == 0)
            {
                // and at least 5 effective "P" and last position was "P"
                if((poPatbk.substr(poPatbk.size()-1, 1)).compare("P") == 0 && c1Rig >= 5 )
                {
                    checkfrom = "11";
                }else
                {
                    pmstring = "MM";
                    *leftp   = 0;  // no co
                    //*score  = 0; // no co 
                    checkfrom = "12";
                }
            }
        }
        // from cluster "P"
        if(pmflag.compare("P")    == 0)
        {        
            // but found "M" on left end 
            if(pmstring.compare("MP") == 0)
            {            
                // and at least 5 effective "M" and first position was "M"
                if((poPatbk.substr(0, 1)).compare("M") == 0 && c2Lef >= 5)
                {
                    checkfrom = "13";
                }else
                {
                    pmstring = "PP";
                    *leftp   = 0; // no co
                    //*score  = 0; // no co
                    checkfrom = "14";
                }
            }
            // from cluster "P" but found "M" on left end and effective last  position was "M"
            if(pmstring.compare("PM") == 0)
            {            
                if((poPatbk.substr(poPatbk.size()-1, 1)).compare("M") == 0 && c2Rig >= 5)
                {
                    ;
                }else
                {
                    pmstring = "PP";
                    *leftp   = 0; // no co
                    //*score  = 0; // no co
                    checkfrom = "15";
                }
            }
        }       
    }else
    {
        if(pmflag.compare("M") == 0)
        {
            pmstring     = "MM";
            checkfrom = "16";
        }else
        if(pmflag.compare("P") == 0)
        {
            pmstring     = "PP";
            checkfrom = "17";
        }
        *leftp   = 0; // no co
        //*score = 0; // no co  
    }
    //
    cout << "   Check2rm: " << poPat  << " ---- determined as "  << pmstring << " for pollen " << pollenid << "_x\t0_" << pmflag 
         << " (CO after "   << *leftp << "th marker: score "     << *score   << " - case "     << checkfrom << " ) "; // *** 
    // output co interval
    if(*leftp != 0)
    {
        int leftindex  = *leftp-1;
        while(leftindex>0)
        {
            if(poPat.substr(leftindex, 1).compare("u") == 0)
            {
                leftindex --;
            }else
            {
                break;
            }
        }
        int rightindex = *leftp;
        while(rightindex<poPat.size()-1)
        {
            if(poPat.substr(rightindex, 1).compare("u") == 0)
            {
                rightindex ++;
            }else
            {
                break;
            }
        }
        // output CO real positions of markers: increase to 1-based positioning <= leftindex+1; real position in poPat
        unsigned long leftmarker  = recover_real_marker_pos(leftindex+1,  contigmarker);
        unsigned long rightmarker = recover_real_marker_pos(rightindex+1, contigmarker);
        cout << " (CO interval " 
             << contigname 
             << " "
             << leftindex+1  << "th.mkr=" << leftmarker 
             << "-"
             << rightindex+1 << "th.mkr=" << rightmarker
             << ", size="
             << rightmarker - leftmarker + 1 << ")"
             << endl;
    }else
    {
        cout <<  endl; // to end ***
    }
    return pmstring;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %r9, 0x48(%rsp)
movq %r8, 0x18(%rsp)
movl %ecx, 0x54(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, %r14
leaq 0x8ace(%rip), %rsi      # 0x13ec7
leaq 0x58(%rsp), %rdx
movq %rdi, 0x10(%rsp)
callq 0xe174
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0x3300
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
addq %rdi, %rsi
leaq 0x80(%rsp), %rdx
movb $0x75, (%rdx)
callq 0x10e57
leaq 0x58(%rsp), %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rax, %rsi
callq 0x3090
movq 0x60(%rsp), %rax
cmpq $0x1, %rax
je 0xb4fe
testq %rax, %rax
jne 0xb53c
leaq 0x8650(%rip), %rsi      # 0x13ab5
movq 0x10(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
movq 0x48(%rsp), %rax
andq $0x0, (%rax)
movq 0x10b50(%rip), %rdi     # 0x1bfd8
leaq 0x86b9(%rip), %rsi      # 0x13b48
callq 0x3260
movq %rax, %rdi
movq %r14, %rsi
callq 0x3240
leaq 0x86b0(%rip), %rsi      # 0x13b56
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x3240
leaq 0x86db(%rip), %rsi      # 0x13b9d
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movl 0x54(%rsp), %esi
callq 0x33f0
leaq 0x86cd(%rip), %rsi      # 0x13baa
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x3240
leaq 0x86b7(%rip), %rsi      # 0x13bb0
jmp 0xba1e
leaq 0x8696(%rip), %rsi      # 0x13b9b
leaq 0x58(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
je 0xb983
leaq 0x8664(%rip), %rsi      # 0x13b82
leaq 0x58(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xb994
leaq 0x8695(%rip), %rsi      # 0x13bcc
jmp 0xb98a
movq 0x48(%rsp), %rax
andq $0x0, (%rax)
pushq $0x1
popq %r13
movq $0x0, 0xd0(%rsp)
leaq 0x80(%rsp), %rbx
leaq 0x28(%rsp), %r15
leaq 0xf(%rsp), %rbp
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xa0(%rsp)
movq %r14, 0x78(%rsp)
movq 0x8(%r14), %rax
decq %rax
cmpq %rax, %r13
ja 0xb7a0
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x3290
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
pushq $-0x1
popq %rcx
callq 0x3290
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
addq %rdi, %rsi
movb $0x50, 0xf(%rsp)
movq %rbp, %rdx
callq 0x106c9
movq %rax, %r12
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
addq %rdi, %rsi
movb $0x4d, 0xf(%rsp)
movq %rbp, %rdx
callq 0x106c9
movq %rax, %r14
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
movb $0x50, 0xf(%rsp)
movq %rbp, %rdx
callq 0x106c9
movq %rax, %r15
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
movb $0x4d, 0xf(%rsp)
movq %rbp, %rdx
callq 0x106c9
movq %rax, %rbx
movq %rax, %xmm0
movq %r12, %xmm1
movdqa %xmm1, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
movdqa %xmm2, %xmm0
movq %r14, %xmm3
shufps $0xe4, %xmm2, %xmm3     # xmm3 = xmm3[0,1],xmm2[2,3]
movdqa 0x79d8(%rip), %xmm5     # 0x13040
pand %xmm5, %xmm2
movdqa 0x79dc(%rip), %xmm6     # 0x13050
por %xmm6, %xmm2
psrlq $0x20, %xmm0
movdqa 0x79db(%rip), %xmm7     # 0x13060
por %xmm7, %xmm0
movapd 0x79de(%rip), %xmm8     # 0x13070
subpd %xmm8, %xmm0
addpd %xmm2, %xmm0
movq %r14, %xmm2
movq %r15, %xmm4
punpcklqdq %xmm4, %xmm1    # xmm1 = xmm1[0],xmm4[0]
paddq %xmm3, %xmm1
punpcklqdq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0]
movdqa %xmm2, %xmm3
pand %xmm5, %xmm3
por %xmm6, %xmm3
psrlq $0x20, %xmm2
por %xmm7, %xmm2
subpd %xmm8, %xmm2
addpd %xmm3, %xmm2
movdqa %xmm1, %xmm3
pand %xmm5, %xmm3
por %xmm6, %xmm3
psrlq $0x20, %xmm1
por %xmm7, %xmm1
subpd %xmm8, %xmm1
addpd %xmm3, %xmm1
divpd %xmm1, %xmm2
divpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpcklpd %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
mulpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
movapd %xmm0, %xmm2
maxsd %xmm1, %xmm2
movq 0x48(%rsp), %rax
ucomisd (%rax), %xmm2
jb 0xb771
ucomisd %xmm1, %xmm0
movq 0x48(%rsp), %rax
movsd %xmm2, (%rax)
movq 0x18(%rsp), %rax
movq %r13, (%rax)
leaq 0x84ae(%rip), %rsi      # 0x13bea
leaq 0x84a4(%rip), %rax      # 0x13be7
cmovaq %rax, %rsi
movq 0x10(%rsp), %rdi
callq 0x3440
movq %rbx, 0xd0(%rsp)
movq %r15, 0xb0(%rsp)
movq %r14, 0xc0(%rsp)
movq %r12, 0xa0(%rsp)
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x3120
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0x3120
incq %r13
movq 0x78(%rsp), %r14
leaq 0xf(%rsp), %rbp
jmp 0xb590
leaq 0x8720(%rip), %rsi      # 0x13ec7
leaq 0x80(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0xe174
movq 0x48(%rsp), %rax
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
seta %cl
movq 0x60(%rsp), %rax
cmpq $0xa, %rax
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xb8df
leaq 0x83b0(%rip), %rsi      # 0x13b9b
movq 0x20(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xbbe9
leaq 0x83e3(%rip), %rsi      # 0x13be7
movq 0x10(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xbad1
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rcx
xorl %edx, %edx
callq 0x3290
leaq 0x8351(%rip), %rsi      # 0x13b82
leaq 0x28(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
movq 0xa0(%rsp), %rax
jne 0xba99
testq %rax, %rax
je 0xba99
movq %rax, %xmm0
movq 0x77af(%rip), %xmm1     # 0x13010
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x77b3(%rip), %xmm2     # 0x13020
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, 0xa0(%rsp)
movq 0x60(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x7808(%rip), %xmm1     # 0x130b0
movapd %xmm1, 0xe0(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x3120
movapd 0xa0(%rsp), %xmm0
ucomisd 0xe0(%rsp), %xmm0
jb 0xbaa3
leaq 0x8319(%rip), %rsi      # 0x13bf3
jmp 0xbac4
ucomisd 0x10969(%rip), %xmm0    # 0x1c250
setae %cl
cmpq $0xb, %rax
setae %bl
andb %cl, %bl
leaq 0x82a1(%rip), %rsi      # 0x13b9b
movq 0x20(%rsp), %rdi
callq 0x30c0
cmpb $0x1, %bl
jne 0xba33
testl %eax, %eax
jne 0xbedf
leaq 0x82cb(%rip), %rsi      # 0x13be7
movq 0x10(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xbe4d
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rcx
xorl %edx, %edx
callq 0x3290
leaq 0x8239(%rip), %rsi      # 0x13b82
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x30c0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3120
testl %ebp, %ebp
jne 0xbe1f
cmpq $0x4, 0xa0(%rsp)
jbe 0xbe1f
leaq 0x826f(%rip), %rsi      # 0x13bed
jmp 0xbe40
leaq 0x823f(%rip), %rsi      # 0x13bc9
movq 0x10(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
movq 0x48(%rsp), %rax
andq $0x0, (%rax)
movq 0x1062b(%rip), %rdi     # 0x1bfd8
leaq 0x8194(%rip), %rsi      # 0x13b48
callq 0x3260
movq %rax, %rdi
movq %r14, %rsi
callq 0x3240
leaq 0x818b(%rip), %rsi      # 0x13b56
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x3240
leaq 0x81b6(%rip), %rsi      # 0x13b9d
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movl 0x54(%rsp), %esi
callq 0x33f0
leaq 0x81a8(%rip), %rsi      # 0x13baa
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x3240
leaq 0x81b1(%rip), %rsi      # 0x13bcf
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x3140
jmp 0xc2f5
testl %eax, %eax
je 0xba66
leaq 0x8144(%rip), %rsi      # 0x13b82
movq 0x20(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xba8b
leaq 0x8179(%rip), %rsi      # 0x13bcc
movq 0x10(%rsp), %rdi
callq 0x3440
leaq 0x81a0(%rip), %rsi      # 0x13c04
jmp 0xba7e
leaq 0x815c(%rip), %rsi      # 0x13bc9
movq 0x10(%rsp), %rdi
callq 0x3440
leaq 0x8183(%rip), %rsi      # 0x13c01
leaq 0x80(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
jmp 0xc00e
leaq 0x28(%rsp), %rdi
callq 0x3120
leaq 0x811f(%rip), %rsi      # 0x13bc9
movq 0x10(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
leaq 0x8132(%rip), %rsi      # 0x13bf6
leaq 0x80(%rsp), %rdi
callq 0x3440
leaq 0x8112(%rip), %rsi      # 0x13bea
movq 0x10(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xbbe9
leaq 0x58(%rsp), %rsi
movq 0x8(%rsi), %rdx
decq %rdx
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rcx
callq 0x3290
leaq 0x8078(%rip), %rsi      # 0x13b82
leaq 0x28(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
movq 0xb0(%rsp), %rax
jne 0xbbb1
testq %rax, %rax
je 0xbbb1
movq %rax, %xmm0
movq 0x74d6(%rip), %xmm1     # 0x13010
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x74da(%rip), %xmm2     # 0x13020
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, 0xb0(%rsp)
movq 0x60(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x752f(%rip), %xmm1     # 0x130b0
movapd %xmm1, 0xa0(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x3120
movapd 0xb0(%rsp), %xmm0
ucomisd 0xa0(%rsp), %xmm0
jb 0xbbbb
leaq 0x804a(%rip), %rsi      # 0x13bf9
jmp 0xbbdc
leaq 0x28(%rsp), %rdi
callq 0x3120
leaq 0x8007(%rip), %rsi      # 0x13bc9
movq 0x10(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
leaq 0x8020(%rip), %rsi      # 0x13bfc
leaq 0x80(%rsp), %rdi
callq 0x3440
leaq 0x7f92(%rip), %rsi      # 0x13b82
movq 0x20(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xc00e
leaq 0x7fe1(%rip), %rsi      # 0x13bea
movq 0x10(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xbd15
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rcx
xorl %edx, %edx
callq 0x3290
leaq 0x7f65(%rip), %rsi      # 0x13b9b
leaq 0x28(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
movq 0xc0(%rsp), %rax
jne 0xbcdd
testq %rax, %rax
je 0xbcdd
movq %rax, %xmm0
movq 0x73aa(%rip), %xmm1     # 0x13010
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x73ae(%rip), %xmm2     # 0x13020
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, 0xc0(%rsp)
movq 0x60(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x7403(%rip), %xmm1     # 0x130b0
movapd %xmm1, 0xb0(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x3120
movapd 0xc0(%rsp), %xmm0
ucomisd 0xb0(%rsp), %xmm0
jb 0xbce7
leaq 0x7f24(%rip), %rsi      # 0x13bff
jmp 0xbd08
leaq 0x28(%rsp), %rdi
callq 0x3120
leaq 0x7ede(%rip), %rsi      # 0x13bcc
movq 0x10(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
leaq 0x7efa(%rip), %rsi      # 0x13c02
leaq 0x80(%rsp), %rdi
callq 0x3440
leaq 0x7ecb(%rip), %rsi      # 0x13be7
movq 0x10(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xc00e
leaq 0x58(%rsp), %rsi
movq 0x8(%rsi), %rdx
decq %rdx
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rcx
callq 0x3290
leaq 0x7e4d(%rip), %rsi      # 0x13b9b
leaq 0x28(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xbdf8
cmpq $0x0, 0xd0(%rsp)
je 0xbdf8
movsd 0xd0(%rsp), %xmm0
movsd 0x7290(%rip), %xmm1     # 0x13010
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x7295(%rip), %xmm2     # 0x13020
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, 0xd0(%rsp)
movsd 0x60(%rsp), %xmm0
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd 0x72eb(%rip), %xmm1     # 0x130b0
movapd %xmm1, 0xc0(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x3120
movapd 0xd0(%rsp), %xmm0
ucomisd 0xc0(%rsp), %xmm0
jb 0xbe02
leaq 0x7e12(%rip), %rsi      # 0x13c05
jmp 0xc001
leaq 0x28(%rsp), %rdi
callq 0x3120
leaq 0x7dc3(%rip), %rsi      # 0x13bcc
movq 0x10(%rsp), %rdi
callq 0x3440
leaq 0x7389(%rip), %rsi      # 0x131a3
jmp 0xbff8
leaq 0x7da3(%rip), %rsi      # 0x13bc9
movq 0x10(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
leaq 0x7daf(%rip), %rsi      # 0x13bef
leaq 0x80(%rsp), %rdi
callq 0x3440
leaq 0x7d96(%rip), %rsi      # 0x13bea
movq 0x10(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xbedf
leaq 0x58(%rsp), %rsi
movq 0x8(%rsi), %rdx
decq %rdx
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rcx
callq 0x3290
leaq 0x7d00(%rip), %rsi      # 0x13b82
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x30c0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3120
testl %ebp, %ebp
jne 0xbeb1
cmpq $0x4, 0xb0(%rsp)
jbe 0xbeb1
leaq 0x7d43(%rip), %rsi      # 0x13bf2
jmp 0xbed2
leaq 0x7d11(%rip), %rsi      # 0x13bc9
movq 0x10(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
leaq 0x7d23(%rip), %rsi      # 0x13bf5
leaq 0x80(%rsp), %rdi
callq 0x3440
leaq 0x7c9c(%rip), %rsi      # 0x13b82
movq 0x20(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xc00e
leaq 0x7ceb(%rip), %rsi      # 0x13bea
movq 0x10(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xbf85
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rcx
xorl %edx, %edx
callq 0x3290
leaq 0x7c73(%rip), %rsi      # 0x13b9b
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x30c0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3120
testl %ebp, %ebp
jne 0xbf57
cmpq $0x4, 0xc0(%rsp)
jbe 0xbf57
leaq 0x7ca3(%rip), %rsi      # 0x13bf8
jmp 0xbf78
leaq 0x7c6e(%rip), %rsi      # 0x13bcc
movq 0x10(%rsp), %rdi
callq 0x3440
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
leaq 0x7c83(%rip), %rsi      # 0x13bfb
leaq 0x80(%rsp), %rdi
callq 0x3440
leaq 0x7c5b(%rip), %rsi      # 0x13be7
movq 0x10(%rsp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xc00e
leaq 0x58(%rsp), %rsi
movq 0x8(%rsi), %rdx
decq %rdx
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rcx
callq 0x3290
leaq 0x7be1(%rip), %rsi      # 0x13b9b
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x30c0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3120
testl %ebp, %ebp
jne 0xbfe0
cmpq $0x4, 0xd0(%rsp)
ja 0xc00e
leaq 0x7be5(%rip), %rsi      # 0x13bcc
movq 0x10(%rsp), %rdi
callq 0x3440
leaq 0x7c06(%rip), %rsi      # 0x13bfe
movq 0x18(%rsp), %rax
andq $0x0, (%rax)
leaq 0x80(%rsp), %rdi
callq 0x3440
movq 0xffc3(%rip), %rdi      # 0x1bfd8
leaq 0x7b2c(%rip), %rsi      # 0x13b48
callq 0x3260
movq %rax, %rdi
movq %r14, %rsi
callq 0x3240
leaq 0x7b23(%rip), %rsi      # 0x13b56
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x3240
leaq 0x7b4e(%rip), %rsi      # 0x13b9d
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movl 0x54(%rsp), %esi
callq 0x33f0
leaq 0x7b40(%rip), %rsi      # 0x13baa
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x3240
leaq 0x7b81(%rip), %rsi      # 0x13c07
movq %rax, %rdi
callq 0x3260
movq 0x18(%rsp), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x7b6e(%rip), %rsi      # 0x13c13
movq %rax, %rdi
callq 0x3260
movq 0x48(%rsp), %rcx
movsd (%rcx), %xmm0
movq %rax, %rdi
callq 0x33b0
leaq 0x7b60(%rip), %rsi      # 0x13c25
movq %rax, %rdi
callq 0x3260
leaq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x3240
leaq 0x7b4a(%rip), %rsi      # 0x13c2e
movq %rax, %rdi
callq 0x3260
movq 0x18(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xc2dc
movl %eax, %r13d
leaq 0x28(%rsp), %rbx
pushq $0x1
popq %r14
leaq 0x79a3(%rip), %r12      # 0x13ab3
movq %r13, %r15
decq %r13
testl %r13d, %r13d
jle 0xc14d
movl %r13d, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rbx, %rdi
movq 0x78(%rsp), %rsi
movq %r14, %rcx
callq 0x3290
movq %rbx, %rdi
movq %r12, %rsi
callq 0x30c0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3120
testl %ebp, %ebp
je 0xc110
movq 0x18(%rsp), %rax
movq (%rax), %rax
movslq %eax, %r14
leal 0x1(%r14), %ebx
leaq 0x28(%rsp), %r12
leaq 0x794b(%rip), %rbp      # 0x13ab3
movq 0x198(%rsp), %r13
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rax
decq %rax
cmpq %r14, %rax
jbe 0xc1be
movq %r12, %rdi
movq 0x78(%rsp), %rsi
movq %r14, %rdx
pushq $0x1
popq %rcx
callq 0x3290
movq %r12, %rdi
movq %rbp, %rsi
callq 0x30c0
movl %eax, %r13d
movq %r12, %rdi
callq 0x3120
testl %r13d, %r13d
movq 0x198(%rsp), %r13
jne 0xc1be
incq %r14
incl %ebx
jmp 0xc170
leaq 0x128(%rsp), %rdi
movq %r13, %rsi
callq 0xe740
leaq 0x128(%rsp), %r12
movl %r15d, %edi
movq %r12, %rsi
callq 0xca6f
movq %rax, %r14
movq %r12, %rdi
callq 0xef26
leaq 0xf8(%rsp), %rdi
movq %r13, %rsi
callq 0xe740
leaq 0xf8(%rsp), %r13
movl %ebx, %edi
movq %r13, %rsi
callq 0xca6f
movq %rax, %r12
movq %r13, %rdi
callq 0xef26
movq 0xfdb8(%rip), %rdi      # 0x1bfd8
leaq 0x7a0b(%rip), %rsi      # 0x13c32
callq 0x3260
movq %rax, %rdi
movq 0x190(%rsp), %rsi
callq 0x3240
leaq 0x79ed(%rip), %rsi      # 0x13c30
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movl %r15d, %esi
callq 0x33f0
leaq 0x79e4(%rip), %rsi      # 0x13c41
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq %r14, %rsi
callq 0x31b0
leaq 0x79d2(%rip), %rsi      # 0x13c49
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movl %ebx, %esi
callq 0x33f0
leaq 0x79b1(%rip), %rsi      # 0x13c41
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
movq %r12, %rsi
callq 0x31b0
leaq 0x79a1(%rip), %rsi      # 0x13c4b
movq %rax, %rdi
callq 0x3260
subq %r14, %r12
incq %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x31b0
leaq 0x7d91(%rip), %rsi      # 0x1405b
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x3140
jmp 0xc2e8
movq 0xfcf5(%rip), %rdi      # 0x1bfd8
callq 0x3140
leaq 0x80(%rsp), %rdi
callq 0x3120
leaq 0x58(%rsp), %rdi
callq 0x3120
movq 0x10(%rsp), %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc34a
jmp 0xc34a
jmp 0xc34a
jmp 0xc34a
jmp 0xc34a
jmp 0xc34a
jmp 0xc34a
jmp 0xc34a
jmp 0xc34a
jmp 0xc345
jmp 0xc345
jmp 0xc345
movq %rax, %rbx
jmp 0xc373
jmp 0xc34a
jmp 0xc34a
jmp 0xc34a
jmp 0xc34f
jmp 0xc34a
jmp 0xc345
jmp 0xc34f
jmp 0xc34f
jmp 0xc34f
movq %rax, %rbx
jmp 0xc369
movq %rax, %rbx
jmp 0xc35c
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3120
leaq 0x80(%rsp), %rdi
callq 0x3120
leaq 0x58(%rsp), %rdi
callq 0x3120
movq 0x10(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3410