// File: readmapping[P]alfalfa/src/mapper.cpp
// Function: processLisIntervalsPaired(sparseSA const&, read_t&, read_t&, align_opt const&, std::vector<lis_t, std::allocator<lis_t>> const&, std::vector<lis_t, std::allocator<lis_t>> const&, std::vector<alnScoreInfo_t, std::allocator<alnScoreInfo_t>> const&, int, double, int, int)
inline void processLisIntervalsPaired(const sparseSA& sa, read_t & mate1, read_t & mate2, 
        const align_opt & alnOptions, const vector<lis_t> & lisIntervals1, 
        const vector<lis_t> & lisIntervals2, const vector<alnScoreInfo_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 trialF = 0;
    int trialR = 0;
    //////////////////////
    //MAIN ALIGNMENT LOOP
    //////////////////////
    //tree containing information for uniqueness option
    kbtree_t(qCov) *treeF;
    kbtree_t(qCov) *treeR;
    treeF = kb_init(qCov, KB_DEFAULT_SIZE);
    treeR = kb_init(qCov, KB_DEFAULT_SIZE);
    int maxAlnScore = 0;
    int alnCount = 0;
    while(alnCount < maxAlnCount && lisIndex < pairedOrder.size()){
        const lis_t & cluster = pairedOrder[lisIndex].firstMate ? lisIntervals1[pairedOrder[lisIndex].position] : lisIntervals2[pairedOrder[lisIndex].position];
        bool unique = hasUnique(cluster, cluster.fw ? treeF : treeR);
        bool extend = unique;
        int trial = cluster.fw ? trialF : trialR;
        bool highCoverage = pairedOrder[lisIndex].firstMate ? cluster.score >= minCoverage1 : cluster.score >= minCoverage2;
        bool extensionCriterium = (trial < alnOptions.maxTrial || extend) && (cluster.matches.size() > 1 || highCoverage);        
        if(alnOptions.print >=2 ){
            cerr << "#LISI " << lisIndex << endl;
            cerr << "#UNIQUE " << unique << endl;
            cerr << "#TRIAL " << trial << endl;
            cerr << "#EXTEND " << extensionCriterium << endl;
            cerr << "#LISMEMS " << cluster.matches.size() << endl;
            cerr << "#LISSCORE " << cluster.score << endl;
        }
        if(extensionCriterium){
            //sort matches in this interval according to query position
            const vector<match_t> & matchVector = cluster.matches;
            long chrStart, chrEnd;
            sa.getChromBounds(matchVector[0].ref, chrStart, chrEnd);
            int returnedAlnScore;
            if(alnOptions.print >=5) cerr << "try cluster " << lisIndex << " with " << matchVector.size() << " seeds on " << (cluster.fw ? "forward" : "reverse complemented") << " strand." << endl;
            if(pairedOrder[lisIndex].firstMate)
                returnedAlnScore = extendAlignmentChain(sa.S, cluster.fw ? mate1.sequence : mate1.rcSequence, matchVector, editDist1, minScore1, minCoverage1, alnOptions, chrStart, chrEnd, mate1, cluster.fw);
            else
                returnedAlnScore = extendAlignmentChain(sa.S, cluster.fw ? mate2.sequence : mate2.rcSequence, matchVector, editDist2, minScore2, minCoverage2, alnOptions, chrStart, chrEnd, mate2, cluster.fw);
            //deal with new alignments
            if(cluster.fw) trialF++;
            else trialR++;
            if(returnedAlnScore >= 0 && (!alnOptions.maxTrialBest || maxAlnScore < returnedAlnScore)){
                if(cluster.fw) trialF = 0;
                else trialR = 0;
            }
            alnCount = mate1.alignments.size() + mate2.alignments.size();
            maxAlnScore = max(maxAlnScore, returnedAlnScore);
        }
        lisIndex++;
    }  
    kb_destroy(qCov, treeF);
    kb_destroy(qCov, treeR);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movl 0x1f8(%rsp), %eax
movl 0x1f0(%rsp), %eax
movl 0x1e8(%rsp), %eax
movq 0x1e0(%rsp), %rax
movq %rdi, 0x1c0(%rsp)
movq %rsi, 0x1b8(%rsp)
movq %rdx, 0x1b0(%rsp)
movq %rcx, 0x1a8(%rsp)
movq %r8, 0x1a0(%rsp)
movq %r9, 0x198(%rsp)
movsd %xmm0, 0x190(%rsp)
movq 0x1b8(%rsp), %rdi
addq $0x20, %rdi
callq 0x8630
movq %rax, %xmm0
movaps 0x2df03(%rip), %xmm1    # 0x7db70
movaps %xmm1, 0xb0(%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x2deff(%rip), %xmm1    # 0x7db80
movaps %xmm1, 0xc0(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x190(%rsp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x18c(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x20, %rdi
callq 0x8630
movaps 0xb0(%rsp), %xmm2
movaps 0xc0(%rsp), %xmm1
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x190(%rsp), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x188(%rsp)
movq 0x1a8(%rsp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x1b8(%rsp), %rdi
addq $0x20, %rdi
callq 0x8630
movsd 0xa8(%rsp), %xmm0
movaps 0xb0(%rsp), %xmm3
movaps 0xc0(%rsp), %xmm2
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
incl %eax
movl %eax, 0x184(%rsp)
movq 0x1a8(%rsp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, 0xd8(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x20, %rdi
callq 0x8630
movaps 0xb0(%rsp), %xmm3
movaps 0xc0(%rsp), %xmm2
movsd 0xd8(%rsp), %xmm0
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addl $0x1, %eax
movl %eax, 0x180(%rsp)
movq $0x0, 0x178(%rsp)
movl $0x0, 0x174(%rsp)
movl $0x0, 0x170(%rsp)
movl $0x200, %edi            # imm = 0x200
callq 0x41680
movq %rax, 0x168(%rsp)
movl $0x200, %edi            # imm = 0x200
callq 0x41680
movq %rax, 0x160(%rsp)
movl $0x0, 0x15c(%rsp)
movl $0x0, 0x158(%rsp)
movl 0x158(%rsp), %ecx
xorl %eax, %eax
cmpl 0x1e8(%rsp), %ecx
movb %al, 0xa7(%rsp)
jge 0x4fe7e
movq 0x178(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x1e0(%rsp), %rdi
callq 0x4e5b0
movq %rax, %rcx
movq 0x98(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0xa7(%rsp)
movb 0xa7(%rsp), %al
testb $0x1, %al
jne 0x4fe8e
jmp 0x5058b
movq 0x1e0(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x4e5d0
testb $0x1, (%rax)
je 0x4fee8
movq 0x1a0(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x1e0(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x4e5d0
movq 0x88(%rsp), %rdi
movslq 0x4(%rax), %rsi
callq 0x4e190
movq %rax, 0x90(%rsp)
jmp 0x4ff26
movq 0x198(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x1e0(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x4e5d0
movq 0x80(%rsp), %rdi
movslq 0x4(%rax), %rsi
callq 0x4e190
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x150(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x150(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x4ff60
movq 0x168(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x4ff6d
movq 0x160(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x41790
andb $0x1, %al
movb %al, 0x14f(%rsp)
movb 0x14f(%rsp), %al
andb $0x1, %al
movb %al, 0x14e(%rsp)
movq 0x150(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x4ffb0
movl 0x174(%rsp), %eax
movl %eax, 0x6c(%rsp)
jmp 0x4ffbb
movl 0x170(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0x148(%rsp)
movq 0x1e0(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x4e5d0
testb $0x1, (%rax)
je 0x4fffa
movq 0x150(%rsp), %rax
movl (%rax), %eax
cmpl 0x18c(%rsp), %eax
setge %al
movb %al, 0x6b(%rsp)
jmp 0x50012
movq 0x150(%rsp), %rax
movl (%rax), %eax
cmpl 0x188(%rsp), %eax
setge %al
movb %al, 0x6b(%rsp)
movb 0x6b(%rsp), %al
andb $0x1, %al
movb %al, 0x147(%rsp)
movl 0x148(%rsp), %eax
movq 0x1a8(%rsp), %rcx
cmpl 0x54(%rcx), %eax
jl 0x50043
xorl %eax, %eax
testb $0x1, 0x14e(%rsp)
movb %al, 0x6a(%rsp)
je 0x50076
movq 0x150(%rsp), %rdi
addq $0x20, %rdi
callq 0x23440
movq %rax, %rcx
movb $0x1, %al
cmpq $0x1, %rcx
movb %al, 0x69(%rsp)
ja 0x5006e
movb 0x147(%rsp), %al
movb %al, 0x69(%rsp)
movb 0x69(%rsp), %al
movb %al, 0x6a(%rsp)
movb 0x6a(%rsp), %al
andb $0x1, %al
movb %al, 0x146(%rsp)
movq 0x1a8(%rsp), %rax
cmpl $0x2, 0x78(%rax)
jl 0x501dd
movq 0x46f54(%rip), %rdi     # 0x96ff0
leaq 0x2de5c(%rip), %rsi     # 0x7deff
callq 0x8360
movq %rax, %rdi
movq 0x178(%rsp), %rsi
callq 0x8100
movq %rax, %rdi
movq 0x46eee(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x46f22(%rip), %rdi     # 0x96ff0
leaq 0x2de31(%rip), %rsi     # 0x7df06
callq 0x8360
movq %rax, %rdi
movb 0x14f(%rsp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x8760
movq %rax, %rdi
movq 0x46eb8(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x46eec(%rip), %rdi     # 0x96ff0
leaq 0x2de04(%rip), %rsi     # 0x7df0f
callq 0x8360
movq %rax, %rdi
movl 0x148(%rsp), %esi
callq 0x8710
movq %rax, %rdi
movq 0x46e87(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x46ebb(%rip), %rdi     # 0x96ff0
leaq 0x2dddb(%rip), %rsi     # 0x7df17
callq 0x8360
movq %rax, %rdi
movb 0x146(%rsp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x8760
movq %rax, %rdi
movq 0x46e51(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x46e85(%rip), %rdi     # 0x96ff0
leaq 0x2ddae(%rip), %rsi     # 0x7df20
callq 0x8360
movq %rax, 0x60(%rsp)
movq 0x150(%rsp), %rdi
addq $0x20, %rdi
callq 0x23440
movq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0x8100
movq %rax, %rdi
movq 0x46e0c(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x46e40(%rip), %rdi     # 0x96ff0
leaq 0x2dd73(%rip), %rsi     # 0x7df2a
callq 0x8360
movq %rax, %rdi
movq 0x150(%rsp), %rax
movl (%rax), %esi
callq 0x8710
movq %rax, %rdi
movq 0x46dd8(%rip), %rsi     # 0x96fb0
callq 0x83b0
testb $0x1, 0x146(%rsp)
je 0x50572
movq 0x150(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x138(%rsp)
movq 0x1c0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x138(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4c8f0
movq 0x58(%rsp), %rdi
movq (%rax), %rsi
leaq 0x130(%rsp), %rdx
leaq 0x128(%rsp), %rcx
callq 0x4e1b0
movq 0x1a8(%rsp), %rax
cmpl $0x5, 0x78(%rax)
jl 0x502f2
movq 0x46d9d(%rip), %rdi     # 0x96ff0
leaq 0x2dcdb(%rip), %rsi     # 0x7df35
callq 0x8360
movq %rax, %rdi
movq 0x178(%rsp), %rsi
callq 0x8100
movq %rax, %rdi
leaq 0x2db03(%rip), %rsi     # 0x7dd7c
callq 0x8360
movq %rax, 0x50(%rsp)
movq 0x138(%rsp), %rdi
callq 0x23440
movq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x8100
movq %rax, %rdi
leaq 0x2dc9b(%rip), %rsi     # 0x7df42
callq 0x8360
movq %rax, %rdi
movq 0x150(%rsp), %rax
movb 0x4(%rax), %cl
leaq 0x2dc8c(%rip), %rsi     # 0x7df4d
leaq 0x2abdd(%rip), %rax     # 0x7aea5
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x8360
movq %rax, %rdi
leaq 0x2ac07(%rip), %rsi     # 0x7aee5
callq 0x8360
movq %rax, %rdi
movq 0x46cc3(%rip), %rsi     # 0x96fb0
callq 0x83b0
movq 0x1e0(%rsp), %rdi
movq 0x178(%rsp), %rsi
callq 0x4e5d0
testb $0x1, (%rax)
je 0x503d4
movq 0x1c0(%rsp), %rax
addq $0x50, %rax
movq %rax, 0x48(%rsp)
movq 0x150(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x50342
movq 0x1b8(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x40(%rsp)
jmp 0x50353
movq 0x1b8(%rsp), %rax
addq $0x60, %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x138(%rsp), %rdx
movl 0x184(%rsp), %ecx
movl 0x1f0(%rsp), %r8d
movl 0x18c(%rsp), %r9d
movq 0x1a8(%rsp), %r14
movq 0x130(%rsp), %rbx
movq 0x128(%rsp), %r11
movq 0x1b8(%rsp), %r10
movq 0x150(%rsp), %rax
movb 0x4(%rax), %al
andb $0x1, %al
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movzbl %al, %eax
movl %eax, 0x20(%rsp)
callq 0x3f5b0
movl %eax, 0x124(%rsp)
jmp 0x50493
movq 0x1c0(%rsp), %rax
addq $0x50, %rax
movq %rax, 0x38(%rsp)
movq 0x150(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x50406
movq 0x1b0(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x30(%rsp)
jmp 0x50417
movq 0x1b0(%rsp), %rax
addq $0x60, %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x138(%rsp), %rdx
movl 0x180(%rsp), %ecx
movl 0x1f8(%rsp), %r8d
movl 0x188(%rsp), %r9d
movq 0x1a8(%rsp), %r14
movq 0x130(%rsp), %rbx
movq 0x128(%rsp), %r11
movq 0x1b0(%rsp), %r10
movq 0x150(%rsp), %rax
movb 0x4(%rax), %al
andb $0x1, %al
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movzbl %al, %eax
movl %eax, 0x20(%rsp)
callq 0x3f5b0
movl %eax, 0x124(%rsp)
movq 0x150(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x504b4
movl 0x174(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x174(%rsp)
jmp 0x504c5
movl 0x170(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x170(%rsp)
cmpl $0x0, 0x124(%rsp)
jl 0x50515
movq 0x1a8(%rsp), %rax
testb $0x1, 0x5c(%rax)
je 0x504ed
movl 0x15c(%rsp), %eax
cmpl 0x124(%rsp), %eax
jge 0x50515
movq 0x150(%rsp), %rax
testb $0x1, 0x4(%rax)
je 0x50508
movl $0x0, 0x174(%rsp)
jmp 0x50513
movl $0x0, 0x170(%rsp)
jmp 0x50515
movq 0x1b8(%rsp), %rdi
addq $0xb0, %rdi
callq 0xdac0
movq %rax, 0x28(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0xb0, %rdi
callq 0xdac0
movq %rax, %rcx
movq 0x28(%rsp), %rax
addq %rcx, %rax
movl %eax, 0x158(%rsp)
leaq 0x15c(%rsp), %rdi
leaq 0x124(%rsp), %rsi
callq 0x14d40
movl (%rax), %eax
movl %eax, 0x15c(%rsp)
movq 0x178(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x178(%rsp)
jmp 0x4fe30
jmp 0x5058d
movl $0x8, 0x11c(%rsp)
movq $0x0, 0x100(%rsp)
cmpq $0x0, 0x168(%rsp)
je 0x50788
movslq 0x11c(%rsp), %rdi
movl $0x8, %esi
callq 0x8220
movq %rax, 0x100(%rsp)
movq %rax, 0x108(%rsp)
movq 0x168(%rsp), %rax
movq (%rax), %rcx
movq 0x108(%rsp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x108(%rsp)
movq %rcx, (%rax)
movq 0x108(%rsp), %rax
cmpq 0x100(%rsp), %rax
je 0x50786
movq 0x108(%rsp), %rax
movq %rax, %rcx
addq $-0x8, %rcx
movq %rcx, 0x108(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rax
movl (%rax), %eax
shll $0x1f, %eax
sarl $0x1f, %eax
cmpl $0x0, %eax
jne 0x50657
movq 0x110(%rsp), %rdi
callq 0x8470
jmp 0x505fa
movl $0x0, 0x120(%rsp)
movl 0x120(%rsp), %eax
movq 0x110(%rsp), %rcx
movl (%rcx), %ecx
sarl %ecx
cmpl %ecx, %eax
jg 0x50774
movq 0x110(%rsp), %rax
movq 0x168(%rsp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
movslq 0x120(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x5075c
movq 0x108(%rsp), %rax
movq 0x100(%rsp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movslq 0x11c(%rsp), %rcx
cmpq %rcx, %rax
jne 0x5071f
movl 0x11c(%rsp), %eax
shll %eax
movl %eax, 0x11c(%rsp)
movq 0x100(%rsp), %rdi
movslq 0x11c(%rsp), %rsi
shlq $0x3, %rsi
callq 0x86d0
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rax
movl 0x11c(%rsp), %ecx
sarl %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x108(%rsp)
movq 0x110(%rsp), %rax
movq 0x168(%rsp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
movslq 0x120(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x108(%rsp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x108(%rsp)
movq %rcx, (%rax)
jmp 0x5075e
movl 0x120(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x120(%rsp)
jmp 0x50662
movq 0x110(%rsp), %rdi
callq 0x8470
jmp 0x505fa
jmp 0x50788
movq 0x168(%rsp), %rdi
callq 0x8470
movq 0x100(%rsp), %rdi
callq 0x8470
jmp 0x507a4
movl $0x8, 0xf8(%rsp)
movq $0x0, 0xe0(%rsp)
cmpq $0x0, 0x160(%rsp)
je 0x5099f
movslq 0xf8(%rsp), %rdi
movl $0x8, %esi
callq 0x8220
movq %rax, 0xe0(%rsp)
movq %rax, 0xe8(%rsp)
movq 0x160(%rsp), %rax
movq (%rax), %rcx
movq 0xe8(%rsp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0xe8(%rsp)
movq %rcx, (%rax)
movq 0xe8(%rsp), %rax
cmpq 0xe0(%rsp), %rax
je 0x5099d
movq 0xe8(%rsp), %rax
movq %rax, %rcx
addq $-0x8, %rcx
movq %rcx, 0xe8(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movl (%rax), %eax
shll $0x1f, %eax
sarl $0x1f, %eax
cmpl $0x0, %eax
jne 0x5086e
movq 0xf0(%rsp), %rdi
callq 0x8470
jmp 0x50811
movl $0x0, 0xfc(%rsp)
movl 0xfc(%rsp), %eax
movq 0xf0(%rsp), %rcx
movl (%rcx), %ecx
sarl %ecx
cmpl %ecx, %eax
jg 0x5098b
movq 0xf0(%rsp), %rax
movq 0x160(%rsp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
movslq 0xfc(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x50973
movq 0xe8(%rsp), %rax
movq 0xe0(%rsp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
movslq 0xf8(%rsp), %rcx
cmpq %rcx, %rax
jne 0x50936
movl 0xf8(%rsp), %eax
shll %eax
movl %eax, 0xf8(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0xf8(%rsp), %rsi
shlq $0x3, %rsi
callq 0x86d0
movq %rax, 0xe0(%rsp)
movq 0xe0(%rsp), %rax
movl 0xf8(%rsp), %ecx
sarl %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0xe8(%rsp)
movq 0xf0(%rsp), %rax
movq 0x160(%rsp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
movslq 0xfc(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0xe8(%rsp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0xe8(%rsp)
movq %rcx, (%rax)
jmp 0x50975
movl 0xfc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xfc(%rsp)
jmp 0x50879
movq 0xf0(%rsp), %rdi
callq 0x8470
jmp 0x50811
jmp 0x5099f
movq 0x160(%rsp), %rdi
callq 0x8470
movq 0xe0(%rsp), %rdi
callq 0x8470
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r14
retq
nopw %cs:(%rax,%rax)
nop