// File: /workspace/github_cpp_makefile_star2_O1/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 $0x5b8, %rsp            # imm = 0x5B8
movq %rdi, 0xf0(%rsp)
leaq 0x208(%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 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x16592
leaq 0x823c(%rip), %rsi      # 0x1a632
leaq 0x28(%rsp), %rdi
callq 0x3490
leaq 0x3b8(%rsp), %rdi
callq 0x3420
movq 0x28(%rsp), %rsi
leaq 0x3b8(%rsp), %rdi
movl $0x10, %edx
callq 0x3060
movq 0x3b8(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x3d8(%rsp,%rax), %ebp
testl %ebp, %ebp
je 0x12498
movq 0xeb96(%rip), %rdi      # 0x20fd8
leaq 0x70d7(%rip), %rsi      # 0x19520
movl $0x1b, %edx
callq 0x32f0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0xeb74(%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 0x12f63
leaq 0x7ab8(%rip), %rsi      # 0x19f57
leaq 0x3b8(%rsp), %rbx
movl $0x4f, %edx
movq %rbx, %rdi
callq 0x32f0
movq 0x3b8(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
leaq 0x3b8(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq 0x7abb(%rip), %rsi      # 0x19fa7
leaq 0x3b8(%rsp), %rbx
movl $0x11, %edx
movq %rbx, %rdi
callq 0x32f0
movq 0x3b8(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
leaq 0x3b8(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movl %ebp, 0xcc(%rsp)
movq 0xf0(%rsp), %rax
movq 0x18(%rax), %r14
leaq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x12efd
leaq 0x58(%rsp), %r12
leaq 0x796b(%rip), %r13      # 0x19ec9
leaq 0x1d8(%rsp), %rbp
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x16592
leaq 0x150(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x60(%r14), %rsi
movq 0x68(%r14), %rdx
addq %rsi, %rdx
leaq 0x140(%rsp), %rdi
callq 0x16592
leaq 0x180(%rsp), %rax
movq %rax, 0x170(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x178(%rsp)
movb %cl, 0x180(%rsp)
leaq 0x1a0(%rsp), %rax
movq %rax, 0x190(%rsp)
movq %rcx, 0x198(%rsp)
movb %cl, 0x1a0(%rsp)
movapd 0x6a8b(%rip), %xmm0     # 0x19080
movapd %xmm0, 0x160(%rsp)
leaq 0x170(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x33a0
movq 0x198(%rsp), %rdx
leaq 0x190(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x33a0
movq 0xf0(%rsp), %rax
movq 0x18(%rax), %rbx
cmpq %r15, %rbx
je 0x12e04
movq %r14, 0x1f8(%rsp)
movq %r12, 0x48(%rsp)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x16592
leaq 0xe0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0x16592
movq 0xd0(%rsp), %rcx
movq 0xd8(%rsp), %rax
testq %rax, %rax
je 0x126c1
xorl %esi, %esi
xorl %edx, %edx
xorl %edi, %edi
cmpb $0x50, (%rcx,%rsi)
sete %dil
addq %rdi, %rdx
incq %rsi
cmpq %rsi, %rax
jne 0x126aa
jmp 0x126c3
xorl %edx, %edx
movq %rbp, %r13
testq %rax, %rax
je 0x126e7
xorl %edi, %edi
xorl %esi, %esi
xorl %r8d, %r8d
cmpb $0x4d, (%rcx,%rdi)
sete %r8b
addq %r8, %rsi
incq %rdi
cmpq %rdi, %rax
jne 0x126cf
jmp 0x126e9
xorl %esi, %esi
addl %edx, %esi
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
movslq %esi, %rax
shrq %rdx
cmpq %rdx, %rax
jb 0x12d9d
movq 0x50(%rsp), %rbp
movq 0x70(%rsp), %r14
cmpq %rbp, %r14
movq %rbp, %rdx
cmovbq %r14, %rdx
testq %rdx, %rdx
je 0x12736
movq 0x68(%rsp), %rsi
movq 0x48(%rsp), %rdi
callq 0x32a0
testl %eax, %eax
sete %al
jmp 0x12738
movb $0x1, %al
cmpq %r14, %rbp
sete %cl
testb %cl, %al
leaq 0xb8(%rsp), %rbp
jne 0x12d9d
movq %r15, %r12
leaq 0x240(%rsp), %rax
movq %rax, 0x230(%rsp)
movq 0x68(%rsp), %rsi
addq %rsi, %r14
leaq 0x230(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x16592
movq %r15, %rdi
leaq 0x7833(%rip), %rsi      # 0x19fb9
callq 0x3490
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r15, %rdi
callq 0x30c0
movq %rbp, 0xa8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %r12, %r15
je 0x127cc
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x127d5
movupd (%rcx), %xmm0
movupd %xmm0, (%rbp)
movq %rsp, %r12
movq 0x8(%rax), %rdx
movq %rdx, 0xb0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x12818
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x16592
movq %r12, %rdi
leaq 0x7779(%rip), %rsi      # 0x19fb9
callq 0x3490
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r12, %rdi
callq 0x30c0
leaq 0x240(%rsp), %rsi
movq %rsi, 0x230(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x230(%rsp), %rdi
je 0x12893
movq %rdx, 0x230(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x240(%rsp)
jmp 0x1289b
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x238(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x76ff(%rip), %rsi      # 0x19fbc
callq 0x3490
leaq 0x130(%rsp), %rsi
movq %rsi, 0x120(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x128f6
movq %rdx, 0x120(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x130(%rsp)
jmp 0x128fe
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x128(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x1293e
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3290
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x12959
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x200(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x17bf4
leaq 0x208(%rsp), %rcx
cmpq %rcx, %rax
jne 0x12d5b
leaq 0x200(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x17bf4
leaq 0x208(%rsp), %rcx
cmpq %rcx, %rax
jne 0x12d5b
leaq 0x1c8(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movq 0x140(%rsp), %rsi
movq 0x148(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1b8(%rsp), %rdi
callq 0x16592
leaq 0x1e8(%rsp), %rax
movq %rax, 0x1d8(%rsp)
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %r14
movq %r13, %rdi
callq 0x16592
leaq 0x1b8(%rsp), %rdi
movq %r14, %rsi
callq 0x14078
movsd %xmm0, 0xf8(%rsp)
movq 0x1d8(%rsp), %rdi
leaq 0x1e8(%rsp), %rax
cmpq %rax, %rdi
je 0x12a41
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x12a66
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x3290
movsd 0xf8(%rsp), %xmm0
ucomisd 0x160(%rsp), %xmm0
jbe 0x12d5b
movsd %xmm0, 0x160(%rsp)
leaq 0x230(%rsp), %rdi
callq 0x31d0
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
leaq 0x7422(%rip), %rdx      # 0x19ec9
movq %rdx, %rsi
callq 0x16622
leaq 0x248(%rsp), %rdi
movq %r12, %rsi
callq 0x3370
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x12ada
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
movl $0x1, %edx
leaq 0x240(%rsp), %rdi
leaq 0x73da(%rip), %rsi      # 0x19ec8
callq 0x32f0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x240(%rsp), %rdi
callq 0x32f0
movq %rax, %r14
movl $0x4, %edx
movq %rax, %rdi
leaq 0x74a5(%rip), %rsi      # 0x19fc1
callq 0x32f0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r14, %rdi
callq 0x32f0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x70ed(%rip), %rsi      # 0x19c32
callq 0x32f0
movl $0x2b, %edx
movq %r14, %rdi
leaq 0x746d(%rip), %rsi      # 0x19fc6
callq 0x32f0
movq %r14, %rdi
movsd 0xf8(%rsp), %xmm0
callq 0x33e0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x7474(%rip), %rsi      # 0x19ff2
callq 0x32f0
movq %r12, %rdi
leaq 0x248(%rsp), %rsi
callq 0x33c0
leaq 0x170(%rsp), %rdi
movq %r12, %rsi
callq 0x3310
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x12bbe
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x100(%rsp), %r14
movq %r14, %rdi
callq 0x16592
movq %r14, %rdi
leaq 0x73c4(%rip), %rsi      # 0x19fb9
callq 0x3490
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %r14, %rdi
callq 0x30c0
leaq 0x98(%rsp), %rdi
movq %rdi, 0x88(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x10(%rsp), %rsi
je 0x12c45
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x12c4d
movupd (%rcx), %xmm0
movupd %xmm0, (%rdi)
movq 0x8(%rax), %rdx
movq %rdx, 0x90(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rsi, (%rsp)
movq 0x88(%rsp), %rax
cmpq %rdi, %rax
je 0x12c8c
movq %rax, (%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x12c94
movupd (%rdi), %xmm0
movupd %xmm0, (%rsi)
movq 0x90(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movb $0x0, 0x98(%rsp)
movl $0x1, 0x20(%rsp)
leaq 0x200(%rsp), %rdi
movq %r12, %rsi
callq 0x17c7e
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x12cf0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x12d15
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x12d3a
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x230(%rsp), %rdi
movq 0xe26f(%rip), %rsi      # 0x20fb8
callq 0x31f0
leaq 0x2b0(%rsp), %rdi
callq 0x30e0
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x12d80
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x12d9d
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x31c0
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x12dcd
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %r12
cmpq %r12, %rdi
movq 0x1f8(%rsp), %r14
movq %r13, %rbp
je 0x12df4
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
cmpq %r15, %rbx
leaq 0x70cb(%rip), %r13      # 0x19ec9
jne 0x1264f
movsd 0x160(%rsp), %xmm0
ucomisd 0x62ab(%rip), %xmm0     # 0x190c0
jbe 0x12e5e
movq 0x170(%rsp), %rsi
movq 0x178(%rsp), %rdx
leaq 0x3b8(%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 %r14, %rdi
callq 0x31c0
movq %rax, %r14
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x12e8e
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x12eb3
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x12ed8
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x12ef4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
cmpq %r15, %r14
jne 0x12566
leaq 0x70f1(%rip), %rsi      # 0x19ff5
leaq 0x3b8(%rsp), %rbx
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x38(%rsp), %r14
callq 0x32f0
movl 0xcc(%rsp), %ebp
movq 0x3b8(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
leaq 0x3b8(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq 0x3b8(%rsp), %rdi
callq 0x3340
movq 0xe066(%rip), %rax      # 0x20fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x3c0(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x3b8(%rsp,%rcx)
callq 0x3220
leaq 0x4b0(%rsp), %rdi
callq 0x30e0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x12fb2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
testl %ebp, %ebp
sete %bl
leaq 0x200(%rsp), %rdi
callq 0x15fd2
movl %ebx, %eax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12fda
movq %rax, %rbx
jmp 0x132e2
movq %rax, %rbx
jmp 0x132f9
jmp 0x130f7
jmp 0x13128
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x13012
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1305f
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x1305f
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1312b
movq 0x10(%rsp), %rsi
jmp 0x13080
jmp 0x1305c
jmp 0x13128
movq %rax, %rbx
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x1312b
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x1312b
jmp 0x131a3
jmp 0x13128
movq %rax, %rbx
movq 0x1d8(%rsp), %rdi
leaq 0x1e8(%rsp), %rax
cmpq %rax, %rdi
je 0x130c9
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x130c9
jmp 0x131a3
movq %rax, %rbx
movq 0x1b8(%rsp), %rdi
leaq 0x1c8(%rsp), %rax
cmpq %rax, %rdi
je 0x131a6
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x131a6
movq %rax, %rbx
jmp 0x132d5
movq %rax, %rbx
leaq 0x38(%rsp), %r14
jmp 0x132d5
movq %rax, %rbx
leaq 0x38(%rsp), %r14
jmp 0x132b9
jmp 0x131a3
jmp 0x1325e
jmp 0x1325e
movq %rax, %rbx
movq 0xde86(%rip), %rsi      # 0x20fb8
leaq 0x230(%rsp), %rdi
callq 0x31f0
leaq 0x2b0(%rsp), %rdi
callq 0x30e0
jmp 0x131a6
jmp 0x13150
movq %rax, %rbx
jmp 0x131ed
movq %rax, %rbx
leaq 0x38(%rsp), %r14
jmp 0x13215
jmp 0x13167
movq %rax, %rbx
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x13194
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x13194
movq %rax, %rbx
leaq 0x38(%rsp), %r14
leaq 0x58(%rsp), %r12
jmp 0x13237
movq %rax, %rbx
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x13208
movq 0x130(%rsp), %rsi
jmp 0x13200
movq %rax, %rbx
movq 0x230(%rsp), %rdi
leaq 0x240(%rsp), %rax
cmpq %rax, %rdi
je 0x131ed
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x3290
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x13208
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x38(%rsp), %r14
leaq 0xb8(%rsp), %rbp
leaq 0x58(%rsp), %r12
movq 0xa8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x13237
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x13270
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x13270
movq %rax, %rbx
leaq 0x38(%rsp), %r14
jmp 0x13287
movq %rax, %rbx
leaq 0x38(%rsp), %r14
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x13287
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x160(%rsp), %rdi
callq 0x14c42
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x132b9
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x132d5
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x3b8(%rsp), %rdi
callq 0x3360
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x132f9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x200(%rsp), %rdi
callq 0x15fd2
movq %rbx, %rdi
callq 0x3460