// File: /workspace/github_cpp_makefile_star2_O1/readmapping[P]alfalfa/src/mapper.cpp
// Function: processLisIntervalsSimultaneous(sparseSA const&, read_t&, read_t&, align_opt const&, paired_opt const&, std::vector<lis_t, std::allocator<lis_t>> const&, std::vector<lis_t, std::allocator<lis_t>> const&, std::vector<LIScouple_t, std::allocator<LIScouple_t>> const&, int, double, int, int)
inline void processLisIntervalsSimultaneous(const sparseSA& sa, read_t & mate1, read_t & mate2, 
        const align_opt & alnOptions, const paired_opt & pairedOpt, const vector<lis_t> & lisIntervals1, 
        const vector<lis_t> & lisIntervals2, const vector<LIScouple_t> & pairedOrder, 
        int maxAlnCount, double minCoveragePercent, int minScore1, int minScore2){
    int minCoverage1 = mate1.sequence.length()*minCoveragePercent;
    int minCoverage2 = mate2.sequence.length()*minCoveragePercent;
    int editDist1 = (int)(alnOptions.errorPercent*mate1.sequence.length())+1;
    int editDist2 = (int)(alnOptions.errorPercent*mate2.sequence.length())+1;
    //for every interval, try to align
    size_t lisIndex = 0;
    //trial parameter for performance reasons
    int trial = 0;
    //////////////////////
    //MAIN ALIGNMENT LOOP
    //////////////////////
    //tree containing information for uniqueness option
    int maxAlnScore = 0;
    int alnCount = 0;
    while(alnCount < maxAlnCount && lisIndex < pairedOrder.size()){
        const lis_t & cluster1 = lisIntervals1[pairedOrder[lisIndex].firstPosition];
        const lis_t & cluster2 = lisIntervals2[pairedOrder[lisIndex].secondPosition];
        bool extensionCriterium = (trial < alnOptions.maxTrial);        
        if(alnOptions.print >=2 ){
            cerr << "#LISI " << lisIndex << endl;
            cerr << "#TRIAL " << trial << endl;
            cerr << "#EXTEND " << extensionCriterium << endl;
            cerr << "#LISMEMS " << (cluster1.matches.size()+cluster2.matches.size()) << endl;
            cerr << "#LISSCORE " << pairedOrder[lisIndex].score << endl;
        }
        if(extensionCriterium){
            const vector<match_t> & matchVector1 = cluster1.matches;
            const vector<match_t> & matchVector2 = cluster2.matches;
            long chrStart1, chrEnd1, chrStart2, chrEnd2;
            sa.getChromBounds(matchVector1[0].ref, chrStart1, chrEnd1);
            sa.getChromBounds(matchVector2[0].ref, chrStart2, chrEnd2);
            int returnedAlnScore, returnedAlnScore1, returnedAlnScore2;
            size_t baseAln1 = mate1.alignments.size();
            size_t baseAln2 = mate2.alignments.size();
            //extend cluster1
            if(alnOptions.print >=5) cerr << "try cluster " << pairedOrder[lisIndex].firstPosition << " with " << matchVector1.size() << " seeds on " << (cluster1.fw ? "forward" : "reverse complemented") << " strand." << endl;
            returnedAlnScore1 = extendAlignmentChain(sa.S, cluster1.fw ? mate1.sequence : mate1.rcSequence, matchVector1, editDist1, minScore1, minCoverage1, alnOptions, chrStart1, chrEnd1, mate1, cluster1.fw);
            //extend cluster2
            if(alnOptions.print >=5) cerr << "try cluster " << pairedOrder[lisIndex].secondPosition << " with " << matchVector2.size() << " seeds on " << (cluster2.fw ? "forward" : "reverse complemented") << " strand." << endl;
            returnedAlnScore2 = extendAlignmentChain(sa.S, cluster2.fw ? mate2.sequence : mate2.rcSequence, matchVector2, editDist2, minScore2, minCoverage2, alnOptions, chrStart2, chrEnd2, mate2, cluster2.fw);
            //rescue cluster1 or 2
            if(baseAln1 == mate1.alignments.size() && baseAln2 < mate2.alignments.size() && 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()));
                returnedAlnScore1 = extendAlignmentChain(sa.S, cluster1.fw ? mate1.sequence : mate1.rcSequence, matchVector1, editDist1, minScore1, minCoverage1, alnOptions, chrStart1, chrEnd1, mate1, cluster1.fw);
            }
            else if(baseAln1 < mate1.alignments.size() && baseAln2 == mate2.alignments.size() && 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()));
                returnedAlnScore2 = extendAlignmentChain(sa.S, cluster2.fw ? mate2.sequence : mate2.rcSequence, matchVector2, editDist2, minScore2, minCoverage2, alnOptions, chrStart2, chrEnd2, mate2, cluster2.fw);
            }
            //pair if possible
            if(baseAln1 < mate1.alignments.size() && baseAln2 < mate2.alignments.size()){
                size_t mate1MaxSize = mate1.alignments.size();
                size_t mate2MaxSize = mate2.alignments.size();
                for(size_t i = baseAln1; i < mate1MaxSize; i++){
                    for(size_t j = baseAln2; j < mate2MaxSize; j++){
                        alignment_t * aln1 = mate1.alignments[i];
                        aln1->setLocalPos(sa);
                        alignment_t * aln2 = mate2.alignments[j];
                        aln2->setLocalPos(sa);
                        if(isConcordant(aln1, aln2, pairedOpt, alnOptions.print)){
                            if(alnOptions.print >= 4) cerr << "found concordancy between aln " << i << " of mate 1 and aln " << j << " of mate 2" << endl;
                            setPaired(sa, mate1, mate2,i,j, true);
                            alnCount++;
                        }
                    }
                }
            }
            //deal with new alignments
            trial++;
            returnedAlnScore = returnedAlnScore1 + returnedAlnScore2;
            if(returnedAlnScore >= 0 && (!alnOptions.maxTrialBest || maxAlnScore < returnedAlnScore))
                trial = 0;
            maxAlnScore = max(maxAlnScore, returnedAlnScore);
        }
        lisIndex++;
    }  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r8, 0xd0(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x68(%rsp)
cmpl $0x0, 0x120(%rsp)
jle 0x2d3dd
movq %rcx, %r14
movl 0x130(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x128(%rsp), %eax
movl %eax, 0x50(%rsp)
movq 0x18(%rsp), %rcx
leaq 0x20(%rcx), %rax
movq %rax, 0x90(%rsp)
movsd 0x28(%rcx), %xmm1
movsd 0x183eb(%rip), %xmm3    # 0x44d10
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0x183f0(%rip), %xmm4    # 0x44d20
subpd %xmm4, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movapd %xmm2, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x58(%rsp)
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %rdx
movq %rdx, 0x80(%rsp)
movsd 0x28(%rax), %xmm1
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
movapd %xmm1, %xmm3
unpckhpd %xmm1, %xmm3            # xmm3 = xmm3[1],xmm1[1]
addsd %xmm1, %xmm3
mulsd %xmm3, %xmm0
cvttsd2si %xmm0, %edx
movl %edx, 0x4c(%rsp)
movsd 0x30(%r14), %xmm0
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %edx
incl %edx
movl %edx, 0x54(%rsp)
mulsd %xmm0, %xmm3
cvttsd2si %xmm3, %edx
incl %edx
movl %edx, 0x48(%rsp)
movq 0x68(%rsp), %rdx
addq $0x50, %rdx
movq %rdx, 0xc8(%rsp)
addq $0x60, %rcx
movq %rcx, 0x88(%rsp)
addq $0x60, %rax
movq %rax, 0x78(%rsp)
xorl %r15d, %r15d
movl $0x0, 0x14(%rsp)
movl $0x0, 0x64(%rsp)
movl $0x0, 0x60(%rsp)
movq %r9, 0x98(%rsp)
movq %r14, 0x38(%rsp)
movq 0x118(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %rcx, %r15
jae 0x2d3dd
leaq (%r15,%r15,2), %rdx
movslq (%rax,%rdx,4), %rcx
imulq $0x38, %rcx, %r13
addq (%r9), %r13
movq %rdx, 0x20(%rsp)
movslq 0x4(%rax,%rdx,4), %rax
imulq $0x38, %rax, %rcx
movl 0x54(%r14), %r12d
movq 0x110(%rsp), %rax
addq (%rax), %rcx
movq %rcx, 0x28(%rsp)
cmpl $0x2, 0x78(%r14)
movq %r15, 0x70(%rsp)
jl 0x2cc25
xorl %ebx, %ebx
movl 0x14(%rsp), %r15d
cmpl %r12d, %r15d
setl %bl
movl $0x6, %edx
movq 0x2756c(%rip), %rbp     # 0x53fe8
movq %rbp, %rdi
leaq 0x18619(%rip), %rsi     # 0x4509f
callq 0x7340
movq %rbp, %rdi
movq 0x70(%rsp), %rsi
callq 0x71c0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl $0x7, %edx
movq %rbp, %rdi
leaq 0x185de(%rip), %rsi     # 0x450af
callq 0x7340
movq %rbp, %rdi
movl %r15d, %esi
callq 0x75d0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r14, %rdi
movq 0x38(%rsp), %r14
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl $0x8, %edx
movq %rbp, %rdi
leaq 0x18598(%rip), %rsi     # 0x450b7
callq 0x7340
movq %rbp, %rdi
movl %ebx, %esi
callq 0x75a0
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 $0x9, %edx
movq %rbp, %rdi
leaq 0x18559(%rip), %rsi     # 0x450c0
callq 0x7340
movq 0x28(%r13), %rax
subq 0x20(%r13), %rax
sarq $0x4, %rax
movq 0x28(%rsp), %rcx
movq 0x28(%rcx), %rsi
subq 0x20(%rcx), %rsi
sarq $0x4, %rsi
addq %rax, %rsi
movq %rbp, %rdi
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
movl $0xa, %edx
movq %rbp, %rdi
leaq 0x184fd(%rip), %rsi     # 0x450ca
callq 0x7340
movq 0x118(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl 0x8(%rax,%rcx,4), %esi
movq %rbp, %rdi
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
movq 0x70(%rsp), %r15
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x98(%rsp), %r9
cmpl %r12d, 0x14(%rsp)
jge 0x2d3c9
movq 0x20(%r13), %rax
movq (%rax), %rsi
movq 0x68(%rsp), %rbx
movq %rbx, %rdi
leaq 0xb8(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
callq 0x2c6f4
movq 0x28(%rsp), %r12
movq 0x20(%r12), %rax
movq (%rax), %rsi
movq %rbx, %rdi
leaq 0xa8(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0x2c6f4
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rbx
subq 0xb0(%rax), %rbx
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %rcx
subq 0xb0(%rax), %rcx
movq %rcx, 0x30(%rsp)
cmpl $0x5, 0x78(%r14)
jl 0x2cd94
movl $0xc, %edx
movq 0x2732d(%rip), %r14     # 0x53fe8
movq %r14, %rdi
leaq 0x18410(%rip), %rsi     # 0x450d5
callq 0x7340
movq 0x118(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rax,%rcx,4), %esi
movq %r14, %rdi
callq 0x75d0
movq %rax, %r14
movl $0x6, %edx
movq %rax, %rdi
leaq 0x18225(%rip), %rsi     # 0x44f1c
callq 0x7340
movq 0x28(%r13), %rsi
subq 0x20(%r13), %rsi
sarq $0x4, %rsi
movq %r14, %rdi
callq 0x71c0
movq %rax, %r14
movl $0xa, %edx
movq %rax, %rdi
leaq 0x183c0(%rip), %rsi     # 0x450e2
callq 0x7340
cmpb $0x0, 0x4(%r13)
leaq 0x183ba(%rip), %rsi     # 0x450ed
leaq 0x1512b(%rip), %rax     # 0x41e65
cmovneq %rax, %rsi
movl $0x14, %edx
movl $0x7, %eax
cmovneq %rax, %rdx
movq %r14, %rdi
callq 0x7340
movl $0x8, %edx
movq %r14, %rdi
leaq 0x15142(%rip), %rsi     # 0x41ea5
callq 0x7340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r14, %rdi
movq 0x38(%rsp), %r14
callq 0x7040
movq %rax, %rdi
callq 0x71d0
leaq 0x20(%r13), %rdx
movzbl 0x4(%r13), %eax
testl %eax, %eax
movq 0x88(%rsp), %rsi
cmovneq 0x90(%rsp), %rsi
subq $0x8, %rsp
movq 0xd0(%rsp), %r15
movq %r15, %rdi
movq %rdx, 0xc8(%rsp)
movl 0x5c(%rsp), %ecx
movl 0x58(%rsp), %r8d
movl 0x60(%rsp), %r9d
pushq %rax
pushq 0x28(%rsp)
pushq 0xc8(%rsp)
pushq 0xd8(%rsp)
pushq %r14
callq 0x22a63
addq $0x30, %rsp
movl %eax, 0x5c(%rsp)
cmpl $0x5, 0x78(%r14)
jl 0x2ceeb
movl $0xc, %edx
movq 0x271da(%rip), %r14     # 0x53fe8
movq %r14, %rdi
leaq 0x182bd(%rip), %rsi     # 0x450d5
callq 0x7340
movq 0x118(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl 0x4(%rax,%rcx,4), %esi
movq %r14, %rdi
callq 0x75d0
movq %rax, %r14
movl $0x6, %edx
movq %rax, %rdi
leaq 0x180d1(%rip), %rsi     # 0x44f1c
callq 0x7340
movq 0x28(%r12), %rsi
subq 0x20(%r12), %rsi
sarq $0x4, %rsi
movq %r14, %rdi
callq 0x71c0
movq %rax, %r14
movl $0xa, %edx
movq %rax, %rdi
leaq 0x1826a(%rip), %rsi     # 0x450e2
callq 0x7340
cmpb $0x0, 0x4(%r12)
leaq 0x18263(%rip), %rsi     # 0x450ed
leaq 0x14fd4(%rip), %rax     # 0x41e65
cmovneq %rax, %rsi
movl $0x14, %edx
movl $0x7, %eax
cmovneq %rax, %rdx
movq %r14, %rdi
callq 0x7340
movl $0x8, %edx
movq %r14, %rdi
leaq 0x14feb(%rip), %rsi     # 0x41ea5
callq 0x7340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r14, %rdi
movq 0x38(%rsp), %r14
callq 0x7040
movq %rax, %rdi
callq 0x71d0
leaq 0x20(%r12), %rdx
sarq $0x3, %rbx
movzbl 0x4(%r12), %eax
testl %eax, %eax
movq 0x78(%rsp), %rsi
cmovneq 0x80(%rsp), %rsi
subq $0x8, %rsp
movq %r15, %rdi
movq %rdx, %rbp
movl 0x50(%rsp), %ecx
movl 0x4c(%rsp), %r8d
movl 0x54(%rsp), %r9d
pushq %rax
pushq 0x18(%rsp)
pushq 0xb8(%rsp)
pushq 0xc8(%rsp)
pushq %r14
callq 0x22a63
addq $0x30, %rsp
movl %eax, 0x20(%rsp)
movq 0x18(%rsp), %rcx
movq 0xb8(%rcx), %rax
subq 0xb0(%rcx), %rax
sarq $0x3, %rax
cmpq %rax, %rbx
jne 0x2d0ae
movq 0x8(%rsp), %rdx
movq 0xb8(%rdx), %rcx
subq 0xb0(%rdx), %rcx
cmpq %rcx, 0x30(%rsp)
jae 0x2d0ae
cmpb $0x1, 0x71(%r14)
jne 0x2d0ae
cmpl $0x2, 0x78(%r14)
jl 0x2cfd7
movl $0x7, %edx
movq 0x27048(%rip), %r12     # 0x53fe8
movq %r12, %rdi
leaq 0x1828c(%rip), %rsi     # 0x45236
callq 0x7340
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x18(%rsp), %r10
movq 0x28(%r10), %rax
movslq (%r14), %rcx
movl 0x4(%r14), %edx
subl %ecx, %edx
imulq %rax, %rcx
movq %rcx, %xmm0
movq 0x17d16(%rip), %xmm3    # 0x44d10
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x17d1a(%rip), %xmm4    # 0x44d20
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
cvtsi2sd %edx, %xmm2
addsd %xmm0, %xmm1
mulsd 0x17b66(%rip), %xmm2    # 0x44b88
movq %rax, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
cvttsd2si %xmm3, %r8d
testl %r8d, %r8d
movl $0x0, %eax
cmovlel %eax, %r8d
movzbl 0x4(%r13), %eax
testl %eax, %eax
movq 0x88(%rsp), %rsi
cmovneq 0x90(%rsp), %rsi
subq $0x8, %rsp
movq %r15, %rdi
movq 0xc8(%rsp), %rdx
movl 0x5c(%rsp), %ecx
movl %r8d, 0x58(%rsp)
movl 0x60(%rsp), %r9d
pushq %rax
pushq %r10
pushq 0xc8(%rsp)
pushq 0xd8(%rsp)
pushq %r14
callq 0x22a63
addq $0x30, %rsp
movl %eax, 0x5c(%rsp)
jmp 0x2d1fa
cmpq %rax, %rbx
jae 0x2d1fa
movq 0x8(%rsp), %rcx
movq 0xb8(%rcx), %rax
subq 0xb0(%rcx), %rax
cmpq %rax, 0x30(%rsp)
jne 0x2d1fa
cmpb $0x1, 0x71(%r14)
jne 0x2d1fa
cmpl $0x2, 0x78(%r14)
jl 0x2d12f
movl $0x7, %edx
movq 0x26ef5(%rip), %r12     # 0x53fe8
movq %r12, %rdi
leaq 0x18139(%rip), %rsi     # 0x45236
callq 0x7340
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r12, %rdi
movq 0x28(%rsp), %r12
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x8(%rsp), %r10
movq 0x28(%r10), %rax
movslq (%r14), %rcx
movl 0x4(%r14), %edx
subl %ecx, %edx
imulq %rax, %rcx
movq %rcx, %xmm0
movq 0x17bbe(%rip), %xmm3    # 0x44d10
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x17bc2(%rip), %xmm4    # 0x44d20
subpd %xmm4, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
cvtsi2sd %edx, %xmm2
addsd %xmm0, %xmm1
mulsd 0x17a0e(%rip), %xmm2    # 0x44b88
movq %rax, %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
subpd %xmm4, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
cvttsd2si %xmm3, %r8d
testl %r8d, %r8d
movl $0x0, %eax
cmovlel %eax, %r8d
movzbl 0x4(%r12), %eax
testl %eax, %eax
movq 0x78(%rsp), %rsi
cmovneq 0x80(%rsp), %rsi
subq $0x8, %rsp
movq %r15, %rdi
movq %rbp, %rdx
movl 0x50(%rsp), %ecx
movl %r8d, 0x4c(%rsp)
movl 0x54(%rsp), %r9d
pushq %rax
pushq %r10
pushq 0xb8(%rsp)
pushq 0xc8(%rsp)
pushq %r14
callq 0x22a63
addq $0x30, %rsp
movl %eax, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rcx
subq 0xb0(%rax), %rcx
sarq $0x3, %rcx
movq %rcx, 0x28(%rsp)
cmpq %rcx, %rbx
jae 0x2d37e
movq 0x30(%rsp), %rbp
sarq $0x3, %rbp
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %r15
subq 0xb0(%rax), %r15
sarq $0x3, %r15
movq %rbp, 0x30(%rsp)
cmpq %r15, %rbp
jae 0x2d37e
movq 0x30(%rsp), %r14
movq 0x18(%rsp), %rax
movq 0xb0(%rax), %rax
movq (%rax,%rbx,8), %r12
movq %r12, %rdi
movq 0x68(%rsp), %rbp
movq %rbp, %rsi
callq 0x2b8ec
movq 0x8(%rsp), %rax
movq 0xb0(%rax), %rax
movq (%rax,%r14,8), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2b8ec
movq 0x38(%rsp), %rbp
movl 0x78(%rbp), %ecx
movq %r12, %rdi
movq %r13, %rsi
movq 0xd0(%rsp), %rdx
callq 0x2551e
testb %al, %al
je 0x2d364
cmpl $0x4, 0x78(%rbp)
jl 0x2d341
movl $0x1e, %edx
movq 0x26d22(%rip), %r12     # 0x53fe8
movq %r12, %rdi
leaq 0x18169(%rip), %rsi     # 0x45439
callq 0x7340
movq %r12, %rdi
movq %rbx, %rsi
callq 0x71c0
movq %rax, %r12
movl $0x13, %edx
movq %rax, %rdi
leaq 0x18166(%rip), %rsi     # 0x45458
callq 0x7340
movq %r12, %rdi
movq %r14, %rsi
callq 0x71c0
movq %rax, %r12
movl $0xa, %edx
movq %rax, %rdi
leaq 0x18158(%rip), %rsi     # 0x4546c
callq 0x7340
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x68(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdx
movl %ebx, %ecx
movl %r14d, %r8d
movl $0x1, %r9d
callq 0x25a0b
incl 0x64(%rsp)
incq %r14
cmpq %r14, %r15
jne 0x2d252
incq %rbx
cmpq 0x28(%rsp), %rbx
jne 0x2d24d
movl 0x14(%rsp), %edx
incl %edx
movl 0x5c(%rsp), %esi
addl 0x20(%rsp), %esi
movl 0x60(%rsp), %ecx
cmpl %esi, %ecx
movl $0x0, %eax
cmovgel %edx, %eax
cmovlel %esi, %ecx
movl %ecx, 0x60(%rsp)
movq 0x38(%rsp), %r14
testb $0x1, 0x5c(%r14)
movl $0x0, %ecx
cmovel %ecx, %eax
testl %esi, %esi
cmovnsl %eax, %edx
movl %edx, 0x14(%rsp)
movq 0x98(%rsp), %r9
movq 0x70(%rsp), %r15
incq %r15
movl 0x64(%rsp), %eax
cmpl 0x120(%rsp), %eax
jl 0x2c9f5
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq