// File: /workspace/github_cpp_makefile_star2_O3/readmapping[P]alfalfa/src/mapper.cpp
// Function: pairedMatch3(sparseSA const&, read_t&, read_t&, align_opt const&, paired_opt const&)
void pairedMatch3(const sparseSA& sa, read_t & mate1, read_t & mate2, const align_opt & alnOptions, const paired_opt & pairedOpt){
    int editDist1 = (int)(alnOptions.errorPercent*mate1.sequence.length())+1;
    int editDist2 = (int)(alnOptions.errorPercent*mate2.sequence.length())+1;
    //FIND CANDIDATE REGIONS FOR BOTH MATES
    vector<lis_t>  lisIntervals1;
    vector<lis_t>  lisIntervals2;
    if(alnOptions.print >= 3) cerr << "calculate LIS of both mates"  << endl;
    calculateCandRegions(sa, mate1, alnOptions, lisIntervals1, alnOptions.errorPercent);
    calculateCandRegions(sa, mate2, alnOptions, lisIntervals2, alnOptions.errorPercent);
    //FILTER LIS: ONLY THOSE THAT PAIR   
    vector<lis_t>  lisIntervals1Filtered;
    vector<lis_t>  lisIntervals2Filtered;
    if(alnOptions.print >= 3) cerr << "filter LIS of both mates using pairing"  << endl;
    for(size_t i = 0; i < lisIntervals1.size(); i++){
        for(size_t j = 0; j < lisIntervals2.size(); j++){
            if(!(lisIntervals1[i].extended && lisIntervals2[j].extended) && isConcordantLIS(lisIntervals1[i], lisIntervals2[j], editDist1, editDist2, pairedOpt, alnOptions.print)){
                if(!lisIntervals1[i].extended){
                    lisIntervals1Filtered.push_back(lisIntervals1[i]);
                    lisIntervals1[i].extended = true;
                }
                if(!lisIntervals2[j].extended){
                    lisIntervals2Filtered.push_back(lisIntervals2[j]);
                    lisIntervals2[j].extended = true;
                }
            }
        }
    }
    if(alnOptions.print >= 3) cerr << "number of paired LIS in mate1 " << lisIntervals1Filtered.size()  << endl;
    if(alnOptions.print >= 3) cerr << "number of paired LIS in mate2 " << lisIntervals2Filtered.size()  << endl;
    //RESCUE IF NO PAIRED LIS WERE FOUND
    if(lisIntervals1Filtered.empty() && lisIntervals2Filtered.empty()){
        if(alnOptions.print >= 2) cerr << "#EMPTYFILTEREDLIST"  << endl;
        pairedMatch1(sa, mate1, mate2, alnOptions, pairedOpt);
    }
    else{
        //FIND ALIGNMENTS FOR FILTERED LIST OF ALIGNMENTS
        //BE NICE AND GIVE THE OPTION OF LOWER MINSCORE
        int minScore1 = (int) (mate1.sequence.length()*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*(editDist1*1.5));
        int minScore2 = (int) (mate2.sequence.length()*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*(editDist2*1.5));
        processLisIntervals(sa, mate1, alnOptions, lisIntervals1Filtered, editDist1, alnOptions.maxAlnCount, 0, minScore1);
        processLisIntervals(sa, mate2, alnOptions, lisIntervals2Filtered, editDist2, alnOptions.maxAlnCount, 0, minScore2);
        if(alnOptions.print >= 3) cerr << "first  mate resulted in " << mate1.alignments.size() << " alignments" << endl;
        if(alnOptions.print >= 3) cerr << "second mate resulted in " << mate2.alignments.size() << " alignments" << endl;
        //RESCUE
        if(mate1.alignments.empty() && alnOptions.rescue){
            if(alnOptions.print >= 2) cerr << "#RESCUE" << endl;
            minScore1 = max(0,(int)(mate1.sequence.length()*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*0.2*mate1.sequence.length()));
            processLisIntervals(sa, mate1, alnOptions, lisIntervals1Filtered, editDist1, alnOptions.maxAlnCount, 0, minScore1);
        }
        if(mate2.alignments.empty() && alnOptions.rescue){
            if(alnOptions.print >= 2) cerr << "#RESCUE" << endl;
            minScore2 = max(0,(int)(mate2.sequence.length()*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*0.2*mate2.sequence.length()));
            processLisIntervals(sa, mate2, alnOptions, lisIntervals2Filtered, editDist2, alnOptions.maxAlnCount, 0, minScore2);
        }
        //TRY AND PAIR THE ALIGNMENTS
        int alnCount = 0;
        int maxPairedAlignments = alnOptions.alignmentCount+1;
        int alnCount1 = mate1.alignmentCount();
        int alnCount2 = mate2.alignmentCount();
        //ORDER ALIGNMENTS ACCORDING TO SCORE
        vector<alnScoreInfo_t> pairedOrder;
        pairedOrder.reserve(alnCount1+alnCount2);
        for(size_t i = 0; i < mate1.alignments.size(); i++)
            pairedOrder.push_back(alnScoreInfo_t(true, i,mate1.alignments[i]->alignmentScore ));
        for(size_t i = 0; i < mate2.alignments.size(); i++)
            pairedOrder.push_back(alnScoreInfo_t(false, i,mate2.alignments[i]->alignmentScore ));
        sort(pairedOrder.begin(),pairedOrder.end(),compAlnScorePaired);
        //TRY AND PAIR THE ALIGNMENTS
        if(alnCount1>0 && alnCount2>0){
            if(alnOptions.print >= 3) cerr << "search concordant alignments" << endl;
            pairAlignmentsOrdered(sa, mate1, mate2, alnOptions, pairedOpt, 
            pairedOrder, alnCount, maxPairedAlignments);
        }
        //FIND DISCORDANT ALIGNMENTS AMONGST HIGHEST SCORING UNPAIRED ALIGNMENTS
        int pairedAlignments = mate1.pairedAlignmentCount;
        if(alnOptions.print >= 2) cerr << "#CONCORDANTCOUNT " << pairedAlignments << endl;
        if(pairedOpt.discordant && alnCount < maxPairedAlignments){
            if(alnOptions.print >= 3) cerr << "search discordant alignments" << endl;
            calculateDiscordantAlignments(sa, mate1, mate2);
        }
        if(alnOptions.print >= 2) cerr << "#DISCORDANTCOUNT " << mate1.pairedAlignmentCount-pairedAlignments << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %r8, 0x48(%rsp)
movq %rcx, %r14
movq %rsi, %r13
movq %rdi, 0x10(%rsp)
movsd 0x30(%rcx), %xmm1
movsd 0x28(%rsi), %xmm0
movaps %xmm0, 0xf0(%rsp)
movq %rdx, 0x8(%rsp)
movsd 0x28(%rdx), %xmm0
movaps %xmm0, 0xd0(%rsp)
xorl %eax, %eax
movq %rax, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq %rax, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
cmpl $0x3, 0x78(%rcx)
movsd %xmm1, 0x18(%rsp)
movapd %xmm1, %xmm0
jl 0x27806
movq 0x2c827(%rip), %rbx     # 0x53fe8
leaq 0x1de01(%rip), %rsi     # 0x455c9
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x7340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2c7f5(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movsd 0x30(%r14), %xmm0
leaq 0x50(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x24d8b
movsd 0x30(%r14), %xmm0
leaq 0xb0(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x24d8b
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movq %rax, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
movq %r14, (%rsp)
cmpl $0x3, 0x78(%r14)
jl 0x278b1
movq 0x2c776(%rip), %rbx     # 0x53fe8
leaq 0x1dd6c(%rip), %rsi     # 0x455e5
movl $0x26, %edx
movq %rbx, %rdi
callq 0x7340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2c744(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movsd 0x1d457(%rip), %xmm1    # 0x44d10
movapd 0xf0(%rsp), %xmm3
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movapd 0x1d453(%rip), %xmm2    # 0x44d20
subpd %xmm2, %xmm3
movapd %xmm3, %xmm0
unpckhpd %xmm3, %xmm0            # xmm0 = xmm0[1],xmm3[1]
addsd %xmm3, %xmm0
movsd 0x18(%rsp), %xmm3
mulsd %xmm3, %xmm0
cvttsd2si %xmm0, %r12d
incl %r12d
movapd 0xd0(%rsp), %xmm4
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
subpd %xmm2, %xmm4
movapd %xmm4, %xmm0
unpckhpd %xmm4, %xmm0            # xmm0 = xmm0[1],xmm4[1]
addsd %xmm4, %xmm0
mulsd %xmm3, %xmm0
cvttsd2si %xmm0, %eax
incl %eax
movl %eax, 0x18(%rsp)
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rdx
movabsq $0x6db6db6db6db6db7, %r15 # imm = 0x6DB6DB6DB6DB6DB7
cmpq %rcx, %rdx
je 0x27a52
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rax
xorl %ebx, %ebx
movq %r13, 0xe8(%rsp)
cmpq %rsi, %rax
je 0x27a35
imulq $0x38, %rbx, %r13
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x50(%rsp), %rdi
cmpb $0x1, 0x18(%rdi,%r13)
jne 0x2797b
cmpb $0x0, 0x18(%rsi,%r14)
jne 0x279fb
addq %r13, %rdi
addq %r14, %rsi
movq (%rsp), %rax
movl 0x78(%rax), %r9d
movl %r12d, %edx
movl 0x18(%rsp), %ecx
movq 0x48(%rsp), %r8
callq 0x27401
testb %al, %al
je 0x279f3
movq 0x50(%rsp), %rsi
cmpb $0x0, 0x18(%rsi,%r13)
jne 0x279c6
addq %r13, %rsi
leaq 0x90(%rsp), %rdi
callq 0x2c74a
movq 0x50(%rsp), %rax
movb $0x1, 0x18(%rax,%r13)
movq 0xb0(%rsp), %rsi
cmpb $0x0, 0x18(%rsi,%r14)
jne 0x279fb
addq %r14, %rsi
leaq 0x70(%rsp), %rdi
callq 0x2c74a
movq 0xb0(%rsp), %rsi
movb $0x1, 0x18(%rsi,%r14)
jmp 0x279fb
movq 0xb0(%rsp), %rsi
incq %rbp
movq 0xb8(%rsp), %rax
movq %rax, %rcx
subq %rsi, %rcx
sarq $0x3, %rcx
imulq %r15, %rcx
addq $0x38, %r14
cmpq %rcx, %rbp
jb 0x27962
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rdx
movq 0xe8(%rsp), %r13
jmp 0x27a38
movq %rsi, %rax
incq %rbx
movq %rdx, %rdi
subq %rcx, %rdi
sarq $0x3, %rdi
imulq %r15, %rdi
cmpq %rdi, %rbx
jb 0x27950
movq (%rsp), %rax
cmpl $0x2, 0x78(%rax)
jle 0x27b30
movq 0x2c581(%rip), %rdi     # 0x53fe8
leaq 0x1db9e(%rip), %rsi     # 0x4560c
movl $0x1e, %edx
callq 0x7340
movq 0x98(%rsp), %rsi
subq 0x90(%rsp), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
movq 0x2c551(%rip), %rdi     # 0x53fe8
callq 0x71c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq (%rsp), %rax
cmpl $0x3, 0x78(%rax)
jl 0x27b30
movq 0x2c511(%rip), %rdi     # 0x53fe8
leaq 0x1db4d(%rip), %rsi     # 0x4562b
movl $0x1e, %edx
callq 0x7340
movq 0x78(%rsp), %rsi
subq 0x70(%rsp), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
movq 0x2c4e7(%rip), %rdi     # 0x53fe8
callq 0x71c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x90(%rsp), %rax
cmpq 0x98(%rsp), %rax
jne 0x27b52
movq 0x70(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x28325
movq (%rsp), %rdx
movslq (%rdx), %rbx
movq 0x28(%r13), %rax
imulq %rbx, %rax
movq %rax, %xmm0
punpckldq 0x1d1a2(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1d1aa(%rip), %xmm0    # 0x44d20
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movl 0x4(%rdx), %eax
subl %ebx, %eax
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movl 0x60(%rdx), %r9d
mulsd 0x1cfee(%rip), %xmm0    # 0x44b90
movsd %xmm2, 0xd0(%rsp)
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movq 0x8(%rsp), %rcx
movq 0x28(%rcx), %r14
leaq 0x90(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movl %r12d, %r8d
pushq %rax
pushq $0x0
callq 0x24297
addq $0x10, %rsp
movl 0x18(%rsp), %r8d
xorps %xmm0, %xmm0
cvtsi2sd %r8d, %xmm0
mulsd 0x1cf9c(%rip), %xmm0    # 0x44b90
imulq %rbx, %r14
movq %r14, %xmm1
punpckldq 0x1d10b(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1d113(%rip), %xmm1    # 0x44d20
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movsd 0xd0(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
cvttsd2si %xmm1, %eax
movq (%rsp), %rdx
movl 0x60(%rdx), %r9d
leaq 0x70(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
pushq %rax
pushq $0x0
callq 0x24297
addq $0x10, %rsp
movq (%rsp), %rax
cmpl $0x3, 0x78(%rax)
jl 0x27d56
movq 0x2c382(%rip), %rdi     # 0x53fe8
leaq 0x1d9f0(%rip), %rsi     # 0x4565d
movl $0x18, %edx
callq 0x7340
movq 0xb8(%r13), %rsi
subq 0xb0(%r13), %rsi
sarq $0x3, %rsi
movq 0x2c358(%rip), %rdi     # 0x53fe8
callq 0x71c0
movq %rax, %rbx
leaq 0x1d9e8(%rip), %rsi     # 0x45687
movl $0xb, %edx
movq %rax, %rdi
callq 0x7340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq (%rsp), %rax
cmpl $0x3, 0x78(%rax)
jl 0x27d56
movq 0x2c304(%rip), %rdi     # 0x53fe8
leaq 0x1d7d5(%rip), %rsi     # 0x454c0
movl $0x18, %edx
callq 0x7340
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %rsi
subq 0xb0(%rax), %rsi
sarq $0x3, %rsi
movq 0x2c2d5(%rip), %rdi     # 0x53fe8
callq 0x71c0
movq %rax, %rbx
leaq 0x1d965(%rip), %rsi     # 0x45687
movl $0xb, %edx
movq %rax, %rdi
callq 0x7340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0xb0(%r13), %rax
cmpq 0xb8(%r13), %rax
jne 0x27e65
movq (%rsp), %rax
cmpb $0x1, 0x71(%rax)
jne 0x27e65
movq (%rsp), %rax
cmpl $0x2, 0x78(%rax)
jl 0x27dc8
movq 0x2c25f(%rip), %rbx     # 0x53fe8
leaq 0x1d4a6(%rip), %rsi     # 0x45236
movl $0x7, %edx
movq %rbx, %rdi
callq 0x7340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2c22d(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x28(%r13), %rax
movq (%rsp), %rdx
movslq (%rdx), %rcx
movl 0x4(%rdx), %esi
subl %ecx, %esi
imulq %rax, %rcx
movq %rcx, %xmm0
movq 0x1cf27(%rip), %xmm3    # 0x44d10
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x1cf2b(%rip), %xmm4    # 0x44d20
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movl 0x60(%rdx), %r9d
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
mulsd 0x1cd70(%rip), %xmm0    # 0x44b88
movq %rax, %xmm2
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
subpd %xmm4, %xmm2
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm1, %xmm3
cvttsd2si %xmm3, %eax
xorl %r10d, %r10d
testl %eax, %eax
cmovlel %r10d, %eax
leaq 0x90(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movl %r12d, %r8d
pushq %rax
pushq %r10
callq 0x24297
addq $0x10, %rsp
movq 0x8(%rsp), %rcx
movq 0xb0(%rcx), %rax
movq 0xb8(%rcx), %r12
cmpq %r12, %rax
jne 0x27f93
movq (%rsp), %rcx
cmpb $0x1, 0x71(%rcx)
movq %rax, %r12
jne 0x27f93
movq (%rsp), %rax
cmpl $0x2, 0x78(%rax)
jl 0x27ee2
movq 0x2c145(%rip), %rbx     # 0x53fe8
leaq 0x1d38c(%rip), %rsi     # 0x45236
movl $0x7, %edx
movq %rbx, %rdi
callq 0x7340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2c113(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x8(%rsp), %rsi
movq 0x28(%rsi), %rax
movq (%rsp), %rdx
movslq (%rdx), %rcx
movl 0x4(%rdx), %edi
subl %ecx, %edi
imulq %rax, %rcx
movq %rcx, %xmm0
movq 0x1ce08(%rip), %xmm3    # 0x44d10
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x1ce0c(%rip), %xmm4    # 0x44d20
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movl 0x60(%rdx), %r9d
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
mulsd 0x1cc51(%rip), %xmm0    # 0x44b88
movq %rax, %xmm2
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
subpd %xmm4, %xmm2
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm1, %xmm3
cvttsd2si %xmm3, %eax
xorl %r10d, %r10d
testl %eax, %eax
cmovlel %r10d, %eax
leaq 0x70(%rsp), %rcx
movq 0x10(%rsp), %rdi
movl 0x18(%rsp), %r8d
pushq %rax
pushq %r10
callq 0x24297
addq $0x10, %rsp
movq 0x8(%rsp), %rcx
movq 0xb0(%rcx), %rax
movq 0xb8(%rcx), %r12
subq %rax, %r12
movl $0x0, 0x2c(%rsp)
movq (%rsp), %rax
movl 0x50(%rax), %eax
movq %rax, 0x18(%rsp)
movq 0xb8(%r13), %rbp
subq 0xb0(%r13), %rbp
shrq $0x3, %rbp
shrq $0x3, %r12
xorpd %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leal (%r12,%rbp), %eax
movslq %eax, %rsi
callq 0x2c688
movq 0xb0(%r13), %rax
cmpq %rax, 0xb8(%r13)
je 0x2805e
xorl %r14d, %r14d
leaq 0x30(%rsp), %rbx
leaq 0x20(%rsp), %r15
movq (%rax,%r14,8), %rax
movl 0x70(%rax), %eax
movb $0x1, 0x20(%rsp)
movl %r14d, 0x24(%rsp)
movl %eax, 0x28(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x28036
movl 0x28(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x20(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x38(%rsp)
jmp 0x28041
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3185c
incq %r14
movq 0xb0(%r13), %rax
movq 0xb8(%r13), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r14
jb 0x27ffe
movq 0x8(%rsp), %rcx
movq 0xb0(%rcx), %rax
cmpq %rax, 0xb8(%rcx)
je 0x280e5
xorl %r14d, %r14d
leaq 0x30(%rsp), %rbx
leaq 0x20(%rsp), %r15
movq (%rax,%r14,8), %rax
movl 0x70(%rax), %eax
movb $0x0, 0x20(%rsp)
movl %r14d, 0x24(%rsp)
movl %eax, 0x28(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x280b8
movl 0x28(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x20(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x38(%rsp)
jmp 0x280c3
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3185c
incq %r14
movq 0x8(%rsp), %rcx
movq 0xb0(%rcx), %rax
movq 0xb8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r14
jb 0x28080
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r15
cmpq %r15, %rbx
je 0x2813d
movq %r15, %rax
subq %rbx, %rax
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0x2144(%rip), %rcx     # 0x25fdc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x319eb
leaq -0x2156(%rip), %rdx     # 0x25fdc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31b46
testl %ebp, %ebp
jle 0x281d1
testl %r12d, %r12d
jle 0x281d1
movq (%rsp), %rax
cmpl $0x3, 0x78(%rax)
jl 0x2819e
movq 0x2be89(%rip), %rbx     # 0x53fe8
leaq 0x1d510(%rip), %rsi     # 0x45676
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x7340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2be57(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x18(%rsp), %rax
incl %eax
leaq 0x2c(%rsp), %r10
leaq 0x30(%rsp), %r9
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
movq (%rsp), %rcx
movq 0x48(%rsp), %r8
pushq %rax
pushq %r10
callq 0x268cd
addq $0x10, %rsp
movl 0xc8(%r13), %ebp
movq (%rsp), %r14
movl 0x78(%r14), %eax
cmpl $0x2, %eax
jl 0x28239
movq 0x2bdfc(%rip), %rdi     # 0x53fe8
leaq 0x1d36e(%rip), %rsi     # 0x45561
movl $0x11, %edx
callq 0x7340
movq 0x2bde4(%rip), %rdi     # 0x53fe8
movl %ebp, %esi
callq 0x75d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl 0x78(%r14), %eax
movq 0x48(%rsp), %rcx
cmpb $0x1, 0x9(%rcx)
jne 0x282b0
movq 0x18(%rsp), %rcx
cmpl %ecx, 0x2c(%rsp)
jg 0x282b0
cmpl $0x3, %eax
jl 0x2829a
movq 0x2bd8d(%rip), %rbx     # 0x53fe8
leaq 0x1d431(%rip), %rsi     # 0x45693
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x7340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2bd5b(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
callq 0x25a9b
movl 0x78(%r14), %eax
cmpl $0x2, %eax
jl 0x2830c
movq 0x2bd2c(%rip), %rdi     # 0x53fe8
leaq 0x1d2b0(%rip), %rsi     # 0x45573
movl $0x11, %edx
callq 0x7340
movl 0xc8(%r13), %esi
subl %ebp, %esi
movq 0x2bd0b(%rip), %rdi     # 0x53fe8
callq 0x75d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x28390
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
jmp 0x28390
movq (%rsp), %rax
cmpl $0x2, 0x78(%rax)
jl 0x28375
movq 0x2bcb2(%rip), %rbx     # 0x53fe8
leaq 0x1d30d(%rip), %rsi     # 0x4564a
movl $0x12, %edx
movq %rbx, %rdi
callq 0x7340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2bc80(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
movq (%rsp), %rcx
movq 0x48(%rsp), %r8
callq 0x26c10
leaq 0x70(%rsp), %rdi
callq 0x2c640
leaq 0x90(%rsp), %rdi
callq 0x2c640
leaq 0xb0(%rsp), %rdi
callq 0x2c640
leaq 0x50(%rsp), %rdi
callq 0x2c640
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x283dd
movq %rax, %rbx
jmp 0x28415
jmp 0x283dd
jmp 0x283fb
jmp 0x283dd
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x283fe
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
jmp 0x283fe
jmp 0x283fb
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2c640
leaq 0x90(%rsp), %rdi
callq 0x2c640
leaq 0xb0(%rsp), %rdi
callq 0x2c640
leaq 0x50(%rsp), %rdi
callq 0x2c640
movq %rbx, %rdi
callq 0x7600