// File: /workspace/github_cpp_makefile_star2_O3/readmapping[P]alfalfa/src/mapper.cpp
// Function: pairedMatch4(sparseSA const&, read_t&, read_t&, align_opt const&, paired_opt const&)
void pairedMatch4(const sparseSA& sa, read_t & mate1, read_t & mate2, const align_opt & alnOptions, const paired_opt & pairedOpt){
    //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);
    //SORT ALL LIS
    vector<alnScoreInfo_t> pairedOrder;
    pairedOrder.reserve(lisIntervals1.size()+lisIntervals2.size());
    for(size_t i = 0; i < lisIntervals1.size(); i++)
        pairedOrder.push_back(alnScoreInfo_t(true, i,lisIntervals1[i].score));
    for(size_t i = 0; i < lisIntervals2.size(); i++)
        pairedOrder.push_back(alnScoreInfo_t(false, i,lisIntervals2[i].score));
    sort(pairedOrder.begin(),pairedOrder.end(),compAlnScorePaired);
    //TRY TO EXTEND LIS
    int Plength1 = mate1.sequence.length();
    int editDist1 = (int)(alnOptions.errorPercent*Plength1)+1;
    int minScore1 = (int) (Plength1*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*editDist1);
    int Plength2 = mate2.sequence.length();
    int editDist2 = (int)(alnOptions.errorPercent*Plength2)+1;
    int minScore2 = (int) (Plength2*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*editDist2);
    if(alnOptions.print >= 3) cerr << "process LIS in sorted order of both paires"  << endl;
    processLisIntervalsPaired(sa, mate1, mate2, alnOptions, lisIntervals1, lisIntervals2, 
    pairedOrder, alnOptions.maxAlnCount, alnOptions.minCoverage, minScore1, minScore2);
    if(mate1.alignments.empty() && !mate2.alignments.empty() && alnOptions.rescue){
        if(alnOptions.print >= 2) cerr << "#RESCUE" << endl;
        minScore1 = max(0,(int)(Plength1*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*0.2*Plength1));
        int maxAlignmentCount = 20;
        int minCoverage = Plength1*0.01;
        processLisIntervals(sa, mate1, alnOptions, lisIntervals1, editDist1, maxAlignmentCount, minCoverage, minScore1);
    }
    else if(mate2.alignments.empty() && !mate1.alignments.empty() && alnOptions.rescue){
        if(alnOptions.print >= 2) cerr << "#RESCUE" << endl;
        minScore2 = max(0,(int)(Plength2*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*0.2*Plength2));
        int maxAlignmentCount = 20;
        int minCoverage = Plength1*0.01;
        processLisIntervals(sa, mate2, alnOptions, lisIntervals2, editDist2, maxAlignmentCount, minCoverage, 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;
    if(mate1.alignments.empty() && mate2.alignments.empty() && pairedOpt.pairedRescue){
        minScore1 = max(0,(int)(Plength1*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*0.2*Plength1));
        minScore2 = max(0,(int)(Plength2*alnOptions.match + (alnOptions.mismatch-alnOptions.match)*0.2*Plength2));
        processLisIntervalsPaired(sa, mate1, mate2, alnOptions, lisIntervals1, lisIntervals2, 
    pairedOrder, 20, 0.01, minScore1, 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;
    int alnCount1 = mate1.alignmentCount();
    int alnCount2 = mate2.alignmentCount();
    int alnCount = 0;
    int maxPairedAlignments = alnOptions.alignmentCount+1;
    //ORDER ALIGNMENTS ACCORDING TO SCORE
    pairedOrder.clear();
    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);
    }
    //RESCUE PROCEDURE IF NO CONCORDANT ALIGNMENTS WERE FOUND
    if(pairedOpt.pairedRescue && alnCount < maxPairedAlignments && max(alnCount1,alnCount2)>0){
        if(alnOptions.print >= 2) cerr << "#PAIREDRESCUE" << endl;
        vector<alnScoreInfo_t> newAlnFromWindow;
        pairAlignmentToWindow(sa, mate1, mate2, alnOptions, pairedOpt, pairedOrder, 
        newAlnFromWindow, 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 $0xc8, %rsp
movq %r8, 0x68(%rsp)
movq %rcx, %r14
movq %rdx, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, 0x30(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movq %rax, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
cmpl $0x3, 0x78(%rcx)
jl 0x28cb4
movq 0x2b374(%rip), %r13     # 0x53fe8
leaq 0x1c94e(%rip), %rsi     # 0x455c9
movl $0x1b, %edx
movq %r13, %rdi
callq 0x7340
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2b341(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movsd 0x30(%r14), %xmm0
leaq 0x90(%rsp), %rcx
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x24d8b
movsd 0x30(%r14), %xmm0
leaq 0x70(%rsp), %rcx
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x24d8b
movq %r14, 0xb8(%rsp)
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %r14 # imm = 0x6DB6DB6DB6DB6DB7
movq 0x78(%rsp), %rsi
subq 0x70(%rsp), %rsi
imulq %r14, %rax
sarq $0x3, %rsi
imulq %r14, %rsi
addq %rax, %rsi
callq 0x2c688
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x28dd1
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
leaq 0x40(%rsp), %rbp
xorl %r15d, %r15d
movl (%rax,%r12), %eax
movb $0x1, 0x40(%rsp)
movl %r15d, 0x44(%rsp)
movl %eax, 0x48(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x28d9f
movl 0x48(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x40(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x18(%rsp)
jmp 0x28daa
movq %r13, %rdi
movq %rbp, %rdx
callq 0x3185c
incq %r15
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
imulq %r14, %rcx
addq $0x38, %r12
cmpq %rcx, %r15
jb 0x28d6a
movq 0x70(%rsp), %rax
cmpq %rax, 0x78(%rsp)
je 0x28e4e
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
leaq 0x40(%rsp), %rbp
xorl %r15d, %r15d
movl (%rax,%r12), %eax
movb $0x0, 0x40(%rsp)
movl %r15d, 0x44(%rsp)
movl %eax, 0x48(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x28e22
movl 0x48(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x40(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x18(%rsp)
jmp 0x28e2d
movq %r13, %rdi
movq %rbp, %rdx
callq 0x3185c
incq %r15
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
imulq %r14, %rcx
addq $0x38, %r12
cmpq %rcx, %r15
jb 0x28ded
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %rbp
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
cmpq %rbp, %r13
je 0x28ea6
movq %rbp, %rax
subq %r13, %rax
sarq $0x2, %rax
imulq %rcx, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0x2ead(%rip), %rcx     # 0x25fdc
movq %r13, %rdi
movq %rbp, %rsi
callq 0x319eb
leaq -0x2ebf(%rip), %rdx     # 0x25fdc
movq %r13, %rdi
movq %rbp, %rsi
callq 0x31b46
movl 0x28(%rbx), %eax
movl %eax, 0x64(%rsp)
movq 0xb8(%rsp), %r15
movsd 0x30(%r15), %xmm0
movsd %xmm0, 0xc0(%rsp)
movl (%r15), %r12d
movl 0x4(%r15), %r14d
movq 0x8(%rsp), %rax
movl 0x28(%rax), %eax
movl %eax, 0x58(%rsp)
cmpl $0x3, 0x78(%r15)
jl 0x28f25
movq 0x2b103(%rip), %r13     # 0x53fe8
leaq 0x1c7eb(%rip), %rsi     # 0x456d7
movl $0x2a, %edx
movq %r13, %rdi
callq 0x7340
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2b0d0(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl 0x64(%rsp), %eax
cvtsi2sd %eax, %xmm1
movsd 0xc0(%rsp), %xmm2
movapd %xmm2, %xmm0
movsd %xmm1, 0xa8(%rsp)
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %r13d
incl %r13d
movl %r12d, %ecx
imull %eax, %ecx
subl %r12d, %r14d
movl %r13d, %eax
imull %r14d, %eax
addl %ecx, %eax
movl 0x58(%rsp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0xb0(%rsp)
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %ebp
incl %ebp
imull %ecx, %r12d
imull %ebp, %r14d
addl %r12d, %r14d
movl 0x60(%r15), %r10d
movsd 0x68(%r15), %xmm0
leaq 0x90(%rsp), %r8
leaq 0x70(%rsp), %r9
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
pushq %r14
pushq %rax
pushq %r10
leaq 0x28(%rsp), %rax
pushq %rax
callq 0x2d2cd
addq $0x20, %rsp
movq 0xb0(%rbx), %rdx
movq 0x8(%rsp), %rcx
movq 0xb0(%rcx), %rax
movq 0xb8(%rcx), %rcx
cmpq 0xb8(%rbx), %rdx
je 0x290cd
cmpq %rcx, %rax
jne 0x291a9
cmpb $0x1, 0x71(%r15)
jne 0x291a9
cmpl $0x2, 0x78(%r15)
jl 0x2904e
movq 0x2afda(%rip), %r13     # 0x53fe8
leaq 0x1c221(%rip), %rsi     # 0x45236
movl $0x7, %edx
movq %r13, %rdi
callq 0x7340
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2afa7(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl (%r15), %eax
movl 0x4(%r15), %ecx
subl %eax, %ecx
imull 0x58(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
mulsd 0x1bb16(%rip), %xmm1    # 0x44b88
mulsd 0xb0(%rsp), %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
xorl %r10d, %r10d
testl %eax, %eax
cmovgl %eax, %r10d
movsd 0x1780c(%rip), %xmm0    # 0x408a0
mulsd 0xa8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
leaq 0x70(%rsp), %rcx
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movl %ebp, %r8d
movl $0x14, %r9d
pushq %r10
pushq %rax
callq 0x24297
addq $0x10, %rsp
jmp 0x291a9
cmpq %rcx, %rax
je 0x291a9
cmpb $0x1, 0x71(%r15)
jne 0x291a9
cmpl $0x2, 0x78(%r15)
jl 0x2912f
movq 0x2aef9(%rip), %rbp     # 0x53fe8
leaq 0x1c140(%rip), %rsi     # 0x45236
movl $0x7, %edx
movq %rbp, %rdi
callq 0x7340
movq (%rbp), %rax
addq -0x18(%rax), %rbp
movq %rbp, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2aec6(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl (%r15), %eax
movl 0x4(%r15), %ecx
subl %eax, %ecx
imull 0x64(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
mulsd 0x1ba35(%rip), %xmm1    # 0x44b88
movsd 0xa8(%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
xorl %r10d, %r10d
testl %eax, %eax
cmovgl %eax, %r10d
movsd 0x17727(%rip), %xmm0    # 0x408a0
mulsd %xmm2, %xmm0
cvttsd2si %xmm0, %eax
leaq 0x90(%rsp), %rcx
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %r13d, %r8d
movl $0x14, %r9d
pushq %r10
pushq %rax
callq 0x24297
addq $0x10, %rsp
cmpl $0x3, 0x78(%r15)
jl 0x292aa
movq 0x2ae2d(%rip), %rdi     # 0x53fe8
leaq 0x1c49b(%rip), %rsi     # 0x4565d
movl $0x18, %edx
callq 0x7340
movq 0xb8(%rbx), %rsi
subq 0xb0(%rbx), %rsi
sarq $0x3, %rsi
movq 0x2ae03(%rip), %rdi     # 0x53fe8
callq 0x71c0
movq %rax, %r13
leaq 0x1c493(%rip), %rsi     # 0x45687
movl $0xb, %edx
movq %rax, %rdi
callq 0x7340
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
cmpl $0x3, 0x78(%r15)
jl 0x292aa
movq 0x2adb1(%rip), %rdi     # 0x53fe8
leaq 0x1c282(%rip), %rsi     # 0x454c0
movl $0x18, %edx
callq 0x7340
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %rsi
subq 0xb0(%rax), %rsi
sarq $0x3, %rsi
movq 0x2ad82(%rip), %rdi     # 0x53fe8
callq 0x71c0
movq %rax, %r13
leaq 0x1c412(%rip), %rsi     # 0x45687
movl $0xb, %edx
movq %rax, %rdi
callq 0x7340
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0xb0(%rbx), %rax
cmpq 0xb8(%rbx), %rax
jne 0x29388
movq 0x8(%rsp), %rcx
movq 0xb0(%rcx), %rax
cmpq 0xb8(%rcx), %rax
jne 0x29388
movq 0x68(%rsp), %rax
cmpb $0x1, 0x14(%rax)
jne 0x29388
movl (%r15), %ecx
movl 0x4(%r15), %eax
movl 0x64(%rsp), %edx
imull %ecx, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
subl %ecx, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0x1b87c(%rip), %xmm1    # 0x44b88
movsd 0xa8(%rsp), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
cvttsd2si %xmm2, %eax
xorl %r10d, %r10d
testl %eax, %eax
cmovlel %r10d, %eax
movl 0x58(%rsp), %edx
imull %ecx, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
mulsd 0xb0(%rsp), %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
testl %ecx, %ecx
cmovgl %ecx, %r10d
leaq 0x90(%rsp), %r8
leaq 0x70(%rsp), %r9
movsd 0x1753c(%rip), %xmm0    # 0x408a0
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
pushq %r10
pushq %rax
pushq $0x14
leaq 0x28(%rsp), %rax
pushq %rax
callq 0x2d2cd
addq $0x20, %rsp
cmpl $0x3, 0x78(%r15)
jl 0x29489
movq 0x2ac4e(%rip), %rdi     # 0x53fe8
leaq 0x1c0ee(%rip), %rsi     # 0x4548f
movl $0x17, %edx
callq 0x7340
movq 0xb8(%rbx), %rsi
subq 0xb0(%rbx), %rsi
sarq $0x3, %rsi
movq 0x2ac24(%rip), %rdi     # 0x53fe8
callq 0x71c0
movq %rax, %r13
leaq 0x1c2b4(%rip), %rsi     # 0x45687
movl $0xb, %edx
movq %rax, %rdi
callq 0x7340
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
cmpl $0x3, 0x78(%r15)
jl 0x29489
movq 0x2abd2(%rip), %rdi     # 0x53fe8
leaq 0x1c0a3(%rip), %rsi     # 0x454c0
movl $0x18, %edx
callq 0x7340
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %rsi
subq 0xb0(%rax), %rsi
sarq $0x3, %rsi
movq 0x2aba3(%rip), %rdi     # 0x53fe8
callq 0x71c0
movq %rax, %r13
leaq 0x1c233(%rip), %rsi     # 0x45687
movl $0xb, %edx
movq %rax, %rdi
callq 0x7340
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0xb8(%rbx), %r14
subq 0xb0(%rbx), %r14
shrq $0x3, %r14
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %r12
subq 0xb0(%rax), %r12
shrq $0x3, %r12
movl $0x0, 0x3c(%rsp)
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x294cb
movq %rax, 0x18(%rsp)
movl 0x50(%r15), %eax
movq %rax, 0x58(%rsp)
leal (%r12,%r14), %eax
movslq %eax, %rsi
leaq 0x10(%rsp), %rdi
callq 0x2c688
movq 0xb0(%rbx), %rax
cmpq %rax, 0xb8(%rbx)
je 0x29562
xorl %r15d, %r15d
leaq 0x10(%rsp), %r13
leaq 0x40(%rsp), %rbp
movq (%rax,%r15,8), %rax
movl 0x70(%rax), %eax
movb $0x1, 0x40(%rsp)
movl %r15d, 0x44(%rsp)
movl %eax, 0x48(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2953a
movl 0x48(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x40(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x18(%rsp)
jmp 0x29545
movq %r13, %rdi
movq %rbp, %rdx
callq 0x3185c
incq %r15
movq 0xb0(%rbx), %rax
movq 0xb8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jb 0x29502
movq 0x8(%rsp), %rcx
movq 0xb0(%rcx), %rax
cmpq %rax, 0xb8(%rcx)
je 0x295e9
xorl %r15d, %r15d
leaq 0x10(%rsp), %r13
leaq 0x40(%rsp), %rbp
movq (%rax,%r15,8), %rax
movl 0x70(%rax), %eax
movb $0x0, 0x40(%rsp)
movl %r15d, 0x44(%rsp)
movl %eax, 0x48(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x295bc
movl 0x48(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x40(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x18(%rsp)
jmp 0x295c7
movq %r13, %rdi
movq %rbp, %rdx
callq 0x3185c
incq %r15
movq 0x8(%rsp), %rcx
movq 0xb0(%rcx), %rax
movq 0xb8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jb 0x29584
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %rbp
cmpq %rbp, %r13
movq 0xb8(%rsp), %r15
je 0x29649
movq %rbp, %rax
subq %r13, %rax
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0x3650(%rip), %rcx     # 0x25fdc
movq %r13, %rdi
movq %rbp, %rsi
callq 0x319eb
leaq -0x3662(%rip), %rdx     # 0x25fdc
movq %r13, %rdi
movq %rbp, %rsi
callq 0x31b46
movq 0x58(%rsp), %rax
leal 0x1(%rax), %ebp
xorl %eax, %eax
testl %r14d, %r14d
jle 0x296dd
testl %r12d, %r12d
jle 0x296dd
cmpl $0x3, 0x78(%r15)
jl 0x296af
movq 0x2a979(%rip), %r13     # 0x53fe8
leaq 0x1c000(%rip), %rsi     # 0x45676
movl $0x1c, %edx
movq %r13, %rdi
callq 0x7340
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2a946(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
leaq 0x3c(%rsp), %rax
leaq 0x10(%rsp), %r9
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rcx
movq 0x68(%rsp), %r8
pushq %rbp
pushq %rax
callq 0x268cd
addq $0x10, %rsp
movl 0x3c(%rsp), %eax
cmpl %r12d, %r14d
cmovgl %r14d, %r12d
movq 0x68(%rsp), %rcx
cmpb $0x1, 0x14(%rcx)
jne 0x297b0
cmpl 0x58(%rsp), %eax
jg 0x297b0
testl %r12d, %r12d
jle 0x297b0
cmpl $0x2, 0x78(%r15)
jl 0x29754
movq 0x2a8d4(%rip), %r13     # 0x53fe8
leaq 0x1bde6(%rip), %rsi     # 0x45501
movl $0xd, %edx
movq %r13, %rdi
callq 0x7340
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2a8a1(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
xorpd %xmm0, %xmm0
leaq 0x40(%rsp), %rax
movapd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
subq $0x8, %rsp
leaq 0x44(%rsp), %r10
leaq 0x18(%rsp), %r9
movq 0x38(%rsp), %rdi
movq %rbx, %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
movq 0x70(%rsp), %r8
pushq %rbp
pushq %r10
pushq %rax
callq 0x26072
addq $0x20, %rsp
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x297b0
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
movl 0xc8(%rbx), %ebp
movl 0x78(%r15), %eax
cmpl $0x2, %eax
jl 0x29813
movq 0x2a822(%rip), %rdi     # 0x53fe8
leaq 0x1bd94(%rip), %rsi     # 0x45561
movl $0x11, %edx
callq 0x7340
movq 0x2a80a(%rip), %rdi     # 0x53fe8
movl %ebp, %esi
callq 0x75d0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl 0x78(%r15), %eax
movq 0x68(%rsp), %rcx
cmpb $0x1, 0x9(%rcx)
jne 0x2988b
movq 0x58(%rsp), %rcx
cmpl %ecx, 0x3c(%rsp)
jg 0x2988b
cmpl $0x3, %eax
jl 0x29875
movq 0x2a7b3(%rip), %r13     # 0x53fe8
leaq 0x1be57(%rip), %rsi     # 0x45693
movl $0x1c, %edx
movq %r13, %rdi
callq 0x7340
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x2a780(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
callq 0x25a9b
movl 0x78(%r15), %eax
cmpl $0x2, %eax
jl 0x298e6
movq 0x2a751(%rip), %rdi     # 0x53fe8
leaq 0x1bcd5(%rip), %rsi     # 0x45573
movl $0x11, %edx
callq 0x7340
movl 0xc8(%rbx), %esi
subl %ebp, %esi
movq 0x2a731(%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 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x298fd
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
leaq 0x70(%rsp), %rdi
callq 0x2c640
leaq 0x90(%rsp), %rdi
callq 0x2c640
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29959
jmp 0x29959
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x2995c
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
jmp 0x2995c
jmp 0x29959
movq %rax, %rbx
jmp 0x29973
jmp 0x29959
jmp 0x29959
jmp 0x29959
jmp 0x29959
jmp 0x29959
jmp 0x29959
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x29973
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
leaq 0x70(%rsp), %rdi
callq 0x2c640
leaq 0x90(%rsp), %rdi
callq 0x2c640
movq %rbx, %rdi
callq 0x7600