// File: /workspace/github_cpp_makefile_star2_O3/schneebergerlab[P]GameteBinning/asPollinator_1.0.cpp
// Function: order_linked_contigs(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, BIPAT, 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, BIPAT>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool order_linked_contigs(map<string, BIPAT> contigPollenGTSeq, string tmpfolder)
{
    /*  contigPollenGTSeq:
	   PMPPMPPPMMPPPPM tig00000013_pilon left  sequence
	   PPPPMPPPMMPPPPM tig00000013_pilon right sequence
	   //
   	   PPPMMPPMPMPPUMM tig00000026_pilon ...
   	   PPPMMPPMPMPMUMM tig00000026_pilon ...  	  
   	   // 
	......
    */
    map<string, int> collected_edge; // if a->b edge exists, then ignore b->a edge
    // prepare dot output file
    string dotinfo = tmpfolder + "/s3_genotype_contig_GT_ordered_LGlike.dot\0"; // 
    ofstream dotofp;
    dotofp.open(dotinfo.c_str(), ios::out);
    if(!dotofp.good())
    {
        cout   << "   Error: cannot open file " << dotinfo << endl;
        return false;
    } 
    dotofp << "/* this graph is translated from similarity of genotype sequences of contigs */" << endl;
    dotofp << "digraph\tGraph_1 {" << endl;
    //
    map<string, BIPAT>::iterator ctgitr;
    map<string, BIPAT>::iterator ctgitr_end;
    ctgitr     = contigPollenGTSeq.begin();
    ctgitr_end = contigPollenGTSeq.end();
    while(ctgitr != ctgitr_end)
    {
        string this_contig_ID = (*ctgitr).first;
        string this_contig_GT = (*ctgitr).second.rightPat; // out vertex
        //
        CTGLG contigBestLods;
        contigBestLods.lod[0] = -1000; // best
        contigBestLods.lod[1] = -1000; // second-best
        contigBestLods.edge1  = "";
        contigBestLods.edge2  = "";
        // second level traverse of contigPollenGTSeq;
        map<string, BIPAT>::iterator ctgitr2;
        map<string, BIPAT>::iterator ctgitr2_end;
        ctgitr2     = contigPollenGTSeq.begin();
        ctgitr2_end = contigPollenGTSeq.end();
        while(ctgitr2 != ctgitr2_end)
        {
            string tmp2_contig_ID = (*ctgitr2).first;
            string tmp2_contig_GT = (*ctgitr2).second.leftPat; // in vertex
            int effectiveMkrNum   = 0;
            effectiveMkrNum      += std::count(tmp2_contig_GT.begin(), tmp2_contig_GT.end(), 'P');
            effectiveMkrNum      += std::count(tmp2_contig_GT.begin(), tmp2_contig_GT.end(), 'M');            
            // IF NEXT CONTIG DOES NOT HAVE ENOUGH PATERNAL/MATERNAL INFORMATION, SKIP IT 
            if(effectiveMkrNum < tmp2_contig_GT.size()/3)
            {
                 ctgitr2 ++;
                 continue;                 
            }
            //
            if(tmp2_contig_ID.compare(this_contig_ID) != 0)
            {
                // reversed edge not in collected list
                string edge1 = this_contig_ID + "->" + tmp2_contig_ID;
                string edge2 = this_contig_ID + "->" + tmp2_contig_ID + "_rev";
                if(collected_edge.find(edge1) == collected_edge.end() &&
                   collected_edge.find(edge2) == collected_edge.end() )
                {
                    /*
                    // original
                    int score1 = 0;
                    if(!get_match_score(this_contig_GT,        tmp2_contig_GT,       &score1) ) return false;
                    // reversed
                    string tmp2_contig_GT_reversed = "";
                    if(!reverse_contig_GT(tmp2_contig_GT, &tmp2_contig_GT_reversed) )           return false;
                    int score2 = 0;
                    if(!get_match_score(this_contig_GT,    tmp2_contig_GT_reversed,  &score2) ) return false;
                    // output as dot
                    if(score1 >= score2)
                    {
                        if(score1 >= this_contig_GT.size()*0.90 )
                        {
                            // select original: 	100052 -> 358538 [color=aquamarine, penwidth=1, arrowsize=1, label=45];
                            dotofp << "\t"   << this_contig_ID 
                                   << " -> " << tmp2_contig_ID
                                   << " "    << "[color=black, penwidth=1, arrowsize=1, label=" << score1 << "];"    
                                   << endl;
                            // collect edge
                            collected_edge.insert(std::pair<string, int>(this_contig_ID + "->" + tmp2_contig_ID, 1));       
                        }                    
                    }else
                    {
                        if(score2 >= this_contig_GT.size()*0.90 )
                        {                
                            // select reversed    
                            dotofp << "\t"   << this_contig_ID 
                                   << " -> " << tmp2_contig_ID << "_rev"
                                   << " "    << "[color=red, penwidth=1, arrowsize=1, label=" << score2 << "];"
                                   << endl;  
                            // collect edge
                            collected_edge.insert(std::pair<string, int>(this_contig_ID + "->" + tmp2_contig_ID + "_rev", 1));                                                               
                        }
                    }
                    */
                    double this_lod = calculate_lod(this_contig_GT, tmp2_contig_GT);
                    /*
                    if(this_lod>=40)
                    {
                        // select original: 	100052 -> 358538 [color=aquamarine, penwidth=1, arrowsize=1, label=45];
                        dotofp << "\t"   << this_contig_ID 
                               << " -> " << tmp2_contig_ID
                               << " "    << "[color=red, penwidth=1, arrowsize=1, label=" << this_lod << "];"    
                               << endl;
                        // collect edge
                        collected_edge.insert(std::pair<string, int>(this_contig_ID + "->" + tmp2_contig_ID, 1));                               
                    }
                    */
                    if(this_lod > contigBestLods.lod[0]) // best
                    {
                        contigBestLods.lod[0] = this_lod;
                        std::stringstream sstmp;
                        sstmp.str("");
                        sstmp << "\t"   << this_contig_ID 
                              << " -> " << tmp2_contig_ID
                              << " "    << "[color=red, penwidth=1, arrowsize=1, label=" << this_lod << "];";
                        contigBestLods.edge1  = sstmp.str();
                        // collect edge
                        collected_edge.insert(std::pair<string, int>(this_contig_ID + "->" + tmp2_contig_ID, 1));                                                       
                    }else
                    if(this_lod > contigBestLods.lod[1]) // second-best
                    {
                        //// contigBestLods.lod[1] = this_lod;
                        //// std::stringstream sstmp;
                        //// sstmp.str("");
                        //// sstmp << "\t"   << this_contig_ID 
                        ////      << " -> " << tmp2_contig_ID
                        ////      << " "    << "[color=red, penwidth=1, arrowsize=1, label=" << this_lod << "];";
                        //// contigBestLods.edge2  = sstmp.str(); 
                        //// // collect edge                        
                        //// collected_edge.insert(std::pair<string, int>(this_contig_ID + "->" + tmp2_contig_ID, 1));
                    } else;
                }
            }        
            ctgitr2 ++;
        }
        //
        if(contigBestLods.lod[0] > 0) // best
        {
            dotofp << contigBestLods.edge1 << endl;
        }
        if(contigBestLods.lod[1] > 0) // second-best
        {
            //// dotofp << contigBestLods.edge2 << endl;         
        }
        //
        ctgitr ++;
    }
    // end of dot file
    dotofp << "}" << endl;
    dotofp.close();
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5c8, %rsp            # imm = 0x5C8
movq %rdi, 0x100(%rsp)
leaq 0x218(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x164ba
leaq 0x8363(%rip), %rsi      # 0x1a632
leaq 0x50(%rsp), %rdi
callq 0x3490
leaq 0x3c8(%rsp), %rdi
callq 0x3420
movq 0x50(%rsp), %rsi
leaq 0x3c8(%rsp), %rdi
movl $0x10, %edx
callq 0x3060
movq 0x3c8(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x3e8(%rsp,%rax), %ebp
testl %ebp, %ebp
je 0x12371
movq 0xecbd(%rip), %rdi      # 0x20fd8
leaq 0x71fe(%rip), %rsi      # 0x19520
movl $0x1b, %edx
callq 0x32f0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0xec9b(%rip), %rdi      # 0x20fd8
callq 0x32f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
jmp 0x12e7e
leaq 0x7bdf(%rip), %rsi      # 0x19f57
leaq 0x3c8(%rsp), %rbx
movl $0x4f, %edx
movq %rbx, %rdi
callq 0x32f0
movq 0x3c8(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
leaq 0x3c8(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq 0x7be2(%rip), %rsi      # 0x19fa7
leaq 0x3c8(%rsp), %rbx
movl $0x11, %edx
movq %rbx, %rdi
callq 0x32f0
movq 0x3c8(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
leaq 0x3c8(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl %ebp, 0xfc(%rsp)
movq 0x100(%rsp), %rax
movq 0x18(%rax), %r15
addq $0x8, %rax
movq %rax, 0xd0(%rsp)
cmpq %rax, %r15
je 0x12e18
leaq 0x18(%rsp), %r12
leaq 0x80(%rsp), %r13
leaq 0x7a82(%rip), %r14      # 0x19ec9
leaq 0x1e8(%rsp), %rbp
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0x164ba
leaq 0x160(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x60(%r15), %rsi
movq 0x68(%r15), %rdx
addq %rsi, %rdx
leaq 0x150(%rsp), %rdi
callq 0x164ba
leaq 0x190(%rsp), %rax
movq %rax, 0x180(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x188(%rsp)
movb %cl, 0x190(%rsp)
leaq 0x1b0(%rsp), %rax
movq %rax, 0x1a0(%rsp)
movq %rcx, 0x1a8(%rsp)
movb %cl, 0x1b0(%rsp)
movapd 0x6b99(%rip), %xmm0     # 0x19080
movapd %xmm0, 0x170(%rsp)
leaq 0x180(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x33a0
movq 0x1a8(%rsp), %rdx
leaq 0x1a0(%rsp), %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x33a0
movq 0x100(%rsp), %rax
movq 0x18(%rax), %rbx
cmpq 0xd0(%rsp), %rbx
je 0x12d11
movq %r15, 0x208(%rsp)
movq %r12, 0x8(%rsp)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x164ba
movq %r13, 0x70(%rsp)
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0x164ba
movq 0x70(%rsp), %r15
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x125c4
xorl %edx, %edx
xorl %ecx, %ecx
xorl %esi, %esi
cmpb $0x50, (%r15,%rdx)
sete %sil
addq %rsi, %rcx
incq %rdx
cmpq %rdx, %rax
jne 0x1258d
xorl %esi, %esi
xorl %edx, %edx
xorl %edi, %edi
cmpb $0x4d, (%r15,%rsi)
sete %dil
addq %rdi, %rdx
incq %rsi
cmpq %rsi, %rax
jne 0x125a7
addl %ecx, %edx
movslq %edx, %rcx
jmp 0x125c6
xorl %ecx, %ecx
movq %rbp, %r14
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rdx
shrq %rdx
cmpq %rdx, %rcx
jb 0x12caf
movq 0x10(%rsp), %r12
movq 0x98(%rsp), %r13
cmpq %r12, %r13
movq %r12, %rdx
cmovbq %r13, %rdx
testq %rdx, %rdx
je 0x12627
movq 0x90(%rsp), %rbp
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x32a0
cmpq %r13, %r12
jne 0x1263f
testl %eax, %eax
leaq 0x18(%rsp), %r12
je 0x12caf
jmp 0x12644
cmpq %r13, %r12
leaq 0x18(%rsp), %r12
je 0x12caf
movq 0x90(%rsp), %rbp
jmp 0x12644
leaq 0x18(%rsp), %r12
leaq 0x250(%rsp), %rax
movq %rax, 0x240(%rsp)
addq %rbp, %r13
leaq 0x240(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x164ba
movq %r15, %rdi
leaq 0x7942(%rip), %rsi      # 0x19fb9
callq 0x3490
leaq 0xe8(%rsp), %r13
leaq 0x28(%rsp), %rbp
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x30c0
movq %r13, 0xd8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x126c7
movq %rdx, 0xd8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe8(%rsp)
jmp 0x126d1
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0xe0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x12711
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x164ba
movq %rbp, %rdi
leaq 0x7879(%rip), %rsi      # 0x19fb9
callq 0x3490
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rdi
callq 0x30c0
leaq 0x250(%rsp), %rsi
movq %rsi, 0x240(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x240(%rsp), %rdi
je 0x12793
movq %rdx, 0x240(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x250(%rsp)
jmp 0x1279b
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x248(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x77ff(%rip), %rsi      # 0x19fbc
callq 0x3490
leaq 0x140(%rsp), %rsi
movq %rsi, 0x130(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x127f6
movq %rdx, 0x130(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x140(%rsp)
jmp 0x127fe
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x138(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x1283e
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1285a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x210(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x17b12
leaq 0x218(%rsp), %rcx
cmpq %rcx, %rax
jne 0x12c68
leaq 0x210(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x17b12
leaq 0x218(%rsp), %rcx
cmpq %rcx, %rax
jne 0x12c68
leaq 0x1d8(%rsp), %rax
movq %rax, 0x1c8(%rsp)
movq 0x150(%rsp), %rsi
movq 0x158(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1c8(%rsp), %rdi
callq 0x164ba
leaq 0x1f8(%rsp), %rax
movq %rax, 0x1e8(%rsp)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
movq %r14, %r15
movq %r14, %rdi
callq 0x164ba
leaq 0x1c8(%rsp), %rdi
movq %r15, %rsi
callq 0x13f8f
movsd %xmm0, 0x108(%rsp)
movq 0x1e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rax
cmpq %rax, %rdi
je 0x1293c
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x1c8(%rsp), %rdi
leaq 0x1d8(%rsp), %rax
cmpq %rax, %rdi
je 0x12961
movq 0x1d8(%rsp), %rsi
incq %rsi
callq 0x3290
movsd 0x108(%rsp), %xmm0
ucomisd 0x170(%rsp), %xmm0
jbe 0x12c68
movsd %xmm0, 0x170(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x31d0
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %rbp, %rdi
leaq 0x7526(%rip), %rdx      # 0x19ec9
movq %rdx, %rsi
callq 0x16550
leaq 0x258(%rsp), %rdi
movq %rbp, %rsi
callq 0x3370
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x129d7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
movl $0x1, %edx
leaq 0x250(%rsp), %rdi
leaq 0x74dd(%rip), %rsi      # 0x19ec8
callq 0x32f0
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
leaq 0x250(%rsp), %rdi
callq 0x32f0
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x75a2(%rip), %rsi      # 0x19fc1
callq 0x32f0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x32f0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x71ea(%rip), %rsi      # 0x19c32
callq 0x32f0
movl $0x2b, %edx
movq %r15, %rdi
leaq 0x756a(%rip), %rsi      # 0x19fc6
callq 0x32f0
movq %r15, %rdi
movsd 0x108(%rsp), %xmm0
callq 0x33e0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x7571(%rip), %rsi      # 0x19ff2
callq 0x32f0
movq %rbp, %rdi
leaq 0x258(%rsp), %rsi
callq 0x33c0
leaq 0x180(%rsp), %rdi
movq %rbp, %rsi
callq 0x3310
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x12ac2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x120(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %r15
movq %r15, %rdi
callq 0x164ba
movq %r15, %rdi
leaq 0x74ba(%rip), %rsi      # 0x19fb9
callq 0x3490
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x30c0
leaq 0xc0(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x38(%rsp), %rsi
je 0x12b4f
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x12b57
movupd (%rcx), %xmm0
movupd %xmm0, (%rdi)
movq 0x8(%rax), %rdx
movq %rdx, 0xb8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rsi, 0x28(%rsp)
movq 0xb0(%rsp), %rax
cmpq %rdi, %rax
je 0x12b98
movq %rax, 0x28(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0x12ba0
movupd (%rdi), %xmm0
movupd %xmm0, (%rsi)
movq 0xb8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0xb0(%rsp)
movq $0x0, 0xb8(%rsp)
movb $0x0, 0xc0(%rsp)
movl $0x1, 0x48(%rsp)
leaq 0x210(%rsp), %rdi
movq %rbp, %rsi
callq 0x17b9c
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x12bfd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x12c22
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x12c47
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x240(%rsp), %rdi
movq 0xe362(%rip), %rsi      # 0x20fb8
callq 0x31f0
leaq 0x2c0(%rsp), %rdi
callq 0x30e0
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x12c8d
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0xd8(%rsp), %rdi
cmpq %r13, %rdi
je 0x12caa
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x70(%rsp), %r15
movq %rbx, %rdi
callq 0x31c0
movq %rax, %rbx
leaq 0x80(%rsp), %r13
cmpq %r13, %r15
je 0x12cda
movq 0x80(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x3290
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
movq %r14, %rbp
je 0x12cf4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
cmpq 0xd0(%rsp), %rbx
movq 0x208(%rsp), %r15
leaq 0x71be(%rip), %r14      # 0x19ec9
jne 0x12546
movsd 0x170(%rsp), %xmm0
ucomisd 0x639e(%rip), %xmm0     # 0x190c0
jbe 0x12d6b
movq 0x180(%rsp), %rsi
movq 0x188(%rsp), %rdx
leaq 0x3c8(%rsp), %rdi
callq 0x32f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq %r15, %rdi
callq 0x31c0
movq %rax, %r15
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x12d9b
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x12dc0
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x12de5
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x12e0a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3290
cmpq 0xd0(%rsp), %r15
jne 0x1244f
leaq 0x71d6(%rip), %rsi      # 0x19ff5
leaq 0x3c8(%rsp), %rbx
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x60(%rsp), %r14
callq 0x32f0
movl 0xfc(%rsp), %ebp
movq 0x3c8(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
leaq 0x3c8(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq 0x3c8(%rsp), %rdi
callq 0x3340
movq 0xe14b(%rip), %rax      # 0x20fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x3d0(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x3c8(%rsp,%rcx)
callq 0x3220
leaq 0x4c0(%rsp), %rdi
callq 0x30e0
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x12ecd
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3290
testl %ebp, %ebp
sete %bl
leaq 0x210(%rsp), %rdi
callq 0x15efc
movl %ebx, %eax
addq $0x5c8, %rsp            # imm = 0x5C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12ef5
movq %rax, %rbx
jmp 0x13216
movq %rax, %rbx
jmp 0x1322d
jmp 0x13014
jmp 0x13045
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x12f2e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x12f7c
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x12f7c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x13048
movq 0x38(%rsp), %rsi
jmp 0x12f9d
jmp 0x12f79
jmp 0x13045
movq %rax, %rbx
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0x13048
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x13048
jmp 0x130d0
jmp 0x13045
movq %rax, %rbx
movq 0x1e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rax
cmpq %rax, %rdi
je 0x12fe6
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x12fe6
jmp 0x130d0
movq %rax, %rbx
movq 0x1c8(%rsp), %rdi
leaq 0x1d8(%rsp), %rax
cmpq %rax, %rdi
je 0x130d3
movq 0x1d8(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x130d3
movq %rax, %rbx
jmp 0x13209
movq %rax, %rbx
leaq 0x60(%rsp), %r14
jmp 0x13209
movq %rax, %rbx
leaq 0x60(%rsp), %r14
jmp 0x131e4
jmp 0x130d0
jmp 0x13189
jmp 0x13189
movq %rax, %rbx
movq 0xdf69(%rip), %rsi      # 0x20fb8
leaq 0x240(%rsp), %rdi
callq 0x31f0
leaq 0x2c0(%rsp), %rdi
callq 0x30e0
jmp 0x130d3
jmp 0x1306d
movq %rax, %rbx
jmp 0x1311a
movq %rax, %rbx
leaq 0x60(%rsp), %r14
leaq 0x80(%rsp), %r15
jmp 0x13150
jmp 0x1308c
movq %rax, %rbx
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x130b4
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x18(%rsp), %r12
jmp 0x130be
movq %rax, %rbx
leaq 0x60(%rsp), %r14
leaq 0x80(%rsp), %r15
jmp 0x1316d
movq %rax, %rbx
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x13136
movq 0x140(%rsp), %rsi
jmp 0x1312e
movq %rax, %rbx
movq 0x240(%rsp), %rdi
leaq 0x250(%rsp), %rax
cmpq %rax, %rdi
je 0x1311a
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x13136
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x60(%rsp), %r14
leaq 0x18(%rsp), %r12
leaq 0x80(%rsp), %r15
leaq 0xe8(%rsp), %r13
movq 0xd8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1316d
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x1319b
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x1319b
movq %rax, %rbx
leaq 0x60(%rsp), %r14
jmp 0x131b2
movq %rax, %rbx
leaq 0x60(%rsp), %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x131b2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x170(%rsp), %rdi
callq 0x14b6e
movq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %rax
cmpq %rax, %rdi
je 0x131e4
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x13209
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x3c8(%rsp), %rdi
callq 0x3360
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1322d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x210(%rsp), %rdi
callq 0x15efc
movq %rbx, %rdi
callq 0x3460