// File: /workspace/github_cpp_makefile_star2_O3/readmapping[P]alfalfa/src/mapper.cpp
// Function: alignment_t::constructCIGAR(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned char const*, int, int, signed char const*, int, int, int, int)
void alignment_t::constructCIGAR(const string& S, const uint8_t * readP, 
        int Plen, int fixedBand, const int8_t *mat, int match, int openGap, int extendGap, int print){
    //use chain to recreate succesfull alignment, but now use other method that recovers alignment
    stringstream sNM;
    editDist = 0;
    int costEx = 0; //performanceCounter
    //start with beginGap:
    if(qB){
        if(print >= 4) cerr << "clipping before start alignment: " << qB << endl;
        sNM << qB << "S";
    }
    assert(chain.size()>0);
    int qLen = qE - qB + 1;
    int refLen = (int)(refE - refB + 1L);
    int band;
    uint8_t *target;
    target = (uint8_t *)malloc(refLen);
    for (int i = 0; i < refLen; ++i) // convert to the nt4 encoding
        target[i] = Utils::ORDVALUE[(size_t)S[refB+i]];
    //before first element of chain
    if(chain[0].query > qB){
        qLen = chain[0].query - qB;
        refLen = (int)(chain[0].ref - refB);
        int n_cigar;
        uint32_t * cigar;
        band = bandSizeEstimate(fixedBand, qLen, refLen, match, openGap, extendGap, alignmentScore);
        costEx += refLen*band;
        if(print >=7 ) cerr << "dp called with dimension " << (qLen) << "x" << (refLen) << " and band " << band << endl;
        ksw_global(qLen, readP+qB, refLen, target, 5, mat, -1*openGap, -1*extendGap, band, &n_cigar, &cigar);
        editDist += recoverCIGAR4(n_cigar, cigar, readP+qB, target, sNM);
        if(print >=4 ) cerr << "current cigar " << sNM.str() << endl;
        free(cigar);        
    }
    sNM << chain[0].len << '=';
    //traverse chain
    for(size_t i = 1; i < chain.size(); i++){
        int qDist = chain[i].query - (chain[i-1].query + chain[i-1].len - 1);
        int refDist = (int) (chain[i].ref - (chain[i-1].ref + chain[i-1].len - 1L));
        if (qDist < 0 || refDist < 0) {
            if (qDist >= refDist)
                qDist -= refDist; //qDist insertions
            else
                refDist -= qDist;
        }
        if (qDist <= 0) {//minRefDist deletions //1+|qDist| matches lost of next mem
            sNM << refDist << 'D' << (chain[i].len - 1 + qDist) << '=';
            editDist += refDist;
        } else if (refDist <= 0) {
            sNM << qDist << 'I' << (chain[i].len - 1 + refDist) << '=';
            editDist += qDist;
        } else if (qDist == 1) {
            sNM << (refDist-1) << 'D' << chain[i].len << '=';
            editDist += refDist-1;
        } else if (refDist == 1) {
            sNM << (qDist-1) << 'I' << chain[i].len << '=';
            editDist += qDist-1;
        } else if (refDist == 2 && qDist==2) {
            sNM << 1 << 'X' << chain[i].len << '=';
            editDist += 1;
        } else {//both distances are positive and not equal to (1,1), otherwise seeds would not be maximal!
            qLen = chain[i].query - 1 - (chain[i-1].query + chain[i-1].len) + 1;
            refLen = (int)(chain[i].ref - 1 - (chain[i-1].ref + chain[i-1].len) + 1);
            int n_cigar;
            uint32_t * cigar;
            band = bandSizeEstimate(fixedBand, qLen, refLen, match, openGap, extendGap, alignmentScore);
            costEx += refLen*band;
            if(print >= 7) cerr << "dp called with dimension " << (qLen) << "x" << (refLen) << " and band " << band << endl;
            ksw_global(qLen, readP+chain[i-1].query + chain[i-1].len, refLen, target+(chain[i-1].ref + chain[i-1].len-refB), 5, mat, -1*openGap, -1*extendGap, band, &n_cigar, &cigar);
            editDist += recoverCIGAR4(n_cigar, cigar, readP+chain[i-1].query + chain[i-1].len, target + (chain[i-1].ref + chain[i-1].len-refB), sNM);
            sNM << chain[i].len << '=';
            free(cigar);
        }
        if(print>= 4) cerr << "current cigar " << sNM.str() << endl;
    }
    //after last element of chain
    int lastIndex = chain.size()-1;
    if(chain[lastIndex].query+chain[lastIndex].len-1 < qE){
        qLen = qE - (chain[lastIndex].query + chain[lastIndex].len) + 1;
        refLen = (int)(refE - (chain[lastIndex].ref + chain[lastIndex].len) + 1);
        int n_cigar;
        uint32_t * cigar;
        band = bandSizeEstimate(fixedBand, qLen, refLen, match, openGap, extendGap, alignmentScore);
        if(print>=7) cerr << "dp called with dimension " << (qLen) << "x" << (refLen) << " and band " << band << endl;
        costEx += refLen*band;
        ksw_global(qLen, readP+chain[lastIndex].query + chain[lastIndex].len, refLen, target+(chain[lastIndex].ref + chain[lastIndex].len-refB), 5, mat, -1*openGap, -1*extendGap, band, &n_cigar, &cigar);
        editDist += recoverCIGAR4(n_cigar, cigar, readP+chain[lastIndex].query + chain[lastIndex].len, target+(chain[lastIndex].ref + chain[lastIndex].len-refB), sNM);
        if(print>=4) cerr << "current cigar " << sNM.str() << endl;
        free(cigar);        
    }    
    //end with possible endGap
    if(Plen-1-qE){
        if(print>=4) cerr << "clipping after end alignment: " << (Plen-1-qE) << endl;
        sNM << (Plen-1-qE) << "S";
    }
    //final results:
    free(target);    
    NMtag = sNM.str();
    cigar = recoverCIGAR3from4(NMtag);
    if(print>=2) cerr << "#COSTPOSTPROC " << costEx << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %r9, 0x60(%rsp)
movl %r8d, 0x4c(%rsp)
movl %ecx, %r12d
movq %rdx, 0x50(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x71e0
movl $0x0, 0x6c(%rbx)
movl 0x10(%rbx), %esi
testl %esi, %esi
je 0x1f449
cmpl $0x4, 0x278(%rsp)
jl 0x1f428
movq 0x34c0d(%rip), %rdi     # 0x53fe8
leaq 0x25954(%rip), %rsi     # 0x44d36
movl $0x21, %edx
callq 0x7340
movl 0x10(%rbx), %esi
movq 0x34bf2(%rip), %rdi     # 0x53fe8
callq 0x75d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl 0x10(%rbx), %esi
leaq 0xb0(%rsp), %rdi
callq 0x75d0
leaq 0x26165(%rip), %rsi     # 0x455a1
movl $0x1, %edx
movq %rax, %rdi
callq 0x7340
movl 0x8(%rbx), %r15d
movq %rbx, 0x8(%rsp)
movq (%rbx), %rbx
subl %ebx, %r15d
leal 0x1(%r15), %ebp
movslq %ebp, %rdi
callq 0x7430
cmpl $0x7ffffffe, %r15d      # imm = 0x7FFFFFFE
ja 0x1f493
movq (%r14), %r8
addq %rbx, %r8
movl %ebp, %ecx
xorl %edx, %edx
leaq 0x25782(%rip), %rsi     # 0x44c00
movsbq (%r8,%rdx), %rdi
movb (%rdi,%rsi), %dil
movb %dil, (%rax,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x1f47e
movq %rax, 0x38(%rsp)
movl 0x270(%rsp), %r9d
movl 0x268(%rsp), %r8d
movl 0x260(%rsp), %r10d
movq 0x8(%rsp), %rbp
movq 0xe8(%rbp), %rax
movl 0x8(%rax), %r14d
movl 0x10(%rbp), %ecx
xorl %r13d, %r13d
subl %ecx, %r14d
jle 0x1f709
movq %rbp, %rdi
movl (%rax), %ebp
subl %ebx, %ebp
movl %ebp, %eax
subl %r14d, %eax
movl %r14d, %edx
cmovll %ebp, %edx
negl %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
imull %r10d, %edx
movl %r8d, %eax
subl 0x70(%rdi), %eax
addl %edx, %eax
movl %r9d, %ebx
negl %ebx
cltd
idivl %ebx
movl %eax, %r13d
incl %r13d
movl %r14d, %eax
sarl %eax
imull %r10d, %eax
addl %r8d, %eax
cltd
idivl %ebx
addl %esi, %eax
incl %eax
cmpl %eax, %r13d
cmovgel %eax, %r13d
leal 0x3(%rsi), %eax
movl 0x4c(%rsp), %edx
cmpl %edx, %r13d
cmovgel %edx, %r13d
cmpl %r13d, %eax
cmovgl %eax, %r13d
cmpl $0x7, 0x278(%rsp)
jl 0x1f5dd
movq 0x34aa0(%rip), %rdi     # 0x53fe8
leaq 0x25809(%rip), %rsi     # 0x44d58
movl $0x19, %edx
callq 0x7340
movq 0x34a88(%rip), %rdi     # 0x53fe8
movl %r14d, %esi
callq 0x75d0
movq %rax, %r15
leaq 0x218c9(%rip), %rsi     # 0x40e3b
movl $0x1, %edx
movq %rax, %rdi
callq 0x7340
movq %r15, %rdi
movl %ebp, %esi
callq 0x75d0
movq %rax, %r15
leaq 0x257df(%rip), %rsi     # 0x44d72
movl $0xa, %edx
movq %rax, %rdi
callq 0x7340
movq %r15, %rdi
movl %r13d, %esi
callq 0x75d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x8(%rsp), %rax
movl 0x10(%rax), %ecx
movslq %ecx, %rsi
addq 0x50(%rsp), %rsi
movl 0x268(%rsp), %eax
negl %eax
subq $0x8, %rsp
leaq 0x48(%rsp), %r10
leaq 0x3c(%rsp), %r11
movl %r14d, %edi
movl %ebp, %edx
movq 0x40(%rsp), %rcx
movl $0x5, %r8d
movq 0x68(%rsp), %r9
pushq %r10
pushq %r11
pushq %r13
pushq %rbx
pushq %rax
callq 0x7fce
addq $0x30, %rsp
movl 0x34(%rsp), %edi
movq 0x40(%rsp), %rsi
movq 0x8(%rsp), %rax
movslq 0x10(%rax), %rdx
addq 0x50(%rsp), %rdx
leaq 0xa0(%rsp), %r8
movq 0x38(%rsp), %rcx
callq 0x1eda4
movq 0x8(%rsp), %rcx
addl %eax, 0x6c(%rcx)
cmpl $0x4, 0x278(%rsp)
jl 0x1f6e6
movq 0x34980(%rip), %rdi     # 0x53fe8
leaq 0x2570e(%rip), %rsi     # 0x44d7d
movl $0xe, %edx
callq 0x7340
leaq 0xb8(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x7540
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x3494c(%rip), %rdi     # 0x53fe8
callq 0x7340
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
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1f6e6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
imull %ebp, %r13d
movq 0x40(%rsp), %rdi
callq 0x7380
movq 0x8(%rsp), %rbp
movq 0xe8(%rbp), %rax
movl 0x268(%rsp), %ebx
jmp 0x1f70c
movq %r8, %rbx
leaq 0xb0(%rsp), %rdi
movl 0xc(%rax), %esi
callq 0x75d0
leaq 0x10(%rsp), %rsi
movb $0x3d, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x7340
movq %r13, 0x58(%rsp)
movl %r12d, 0x6c(%rsp)
movq 0xe8(%rbp), %rax
movq 0xf0(%rbp), %rcx
subq %rax, %rcx
cmpq $0x11, %rcx
jb 0x1fc9f
movl 0x270(%rsp), %ecx
negl %ecx
movq %rcx, 0x70(%rsp)
negl %ebx
movq %rbx, 0x78(%rsp)
movl $0x1, %r13d
xorl %ebx, %ebx
movl 0x18(%rax,%rbx), %ebp
movl 0x8(%rax,%rbx), %esi
movl 0xc(%rax,%rbx), %edi
subl %edi, %ebp
subl %esi, %ebp
movq 0x10(%rax,%rbx), %r14
movq (%rax,%rbx), %rcx
movq %rdi, %rax
addq %rcx, %rax
movl %r14d, %r12d
subl %eax, %r12d
incl %r12d
movl %ebp, %edx
incl %edx
js 0x1f7a6
testl %r12d, %r12d
jns 0x1f7b1
movl %edx, %r15d
subl %r12d, %r15d
jge 0x1f7b4
subl %edx, %r12d
movl %edx, %r15d
testl %r15d, %r15d
jle 0x1f827
testl %r12d, %r12d
jle 0x1f88c
cmpl $0x1, %r15d
jne 0x1f8ea
decl %r12d
leaq 0xb0(%rsp), %rdi
movl %r12d, %esi
callq 0x75d0
movq 0x8(%rsp), %rbp
movb $0x44, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
movq 0xe8(%rbp), %rcx
movl 0x1c(%rcx,%rbx), %esi
movq %rax, %rdi
callq 0x75d0
movb $0x3d, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
jmp 0x1f883
leaq 0xb0(%rsp), %rdi
movl %r12d, %esi
callq 0x75d0
movq 0x8(%rsp), %rbp
movb $0x44, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
movq 0xe8(%rbp), %rcx
movl 0x1c(%rcx,%rbx), %ecx
leal (%r15,%rcx), %esi
decl %esi
movq %rax, %rdi
callq 0x75d0
movb $0x3d, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
addl %r12d, 0x6c(%rbp)
jmp 0x1f951
leaq 0xb0(%rsp), %rdi
movl %r15d, %esi
callq 0x75d0
movq 0x8(%rsp), %rbp
movb $0x49, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
movq 0xe8(%rbp), %rcx
movl 0x1c(%rcx,%rbx), %ecx
leal (%r12,%rcx), %esi
decl %esi
movq %rax, %rdi
callq 0x75d0
movb $0x3d, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
jmp 0x1f94d
cmpl $0x1, %r12d
jne 0x1fa12
decl %r15d
leaq 0xb0(%rsp), %rdi
movl %r15d, %esi
callq 0x75d0
movq 0x8(%rsp), %rbp
movb $0x49, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
movq 0xe8(%rbp), %rcx
movl 0x1c(%rcx,%rbx), %esi
movq %rax, %rdi
callq 0x75d0
movb $0x3d, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
addl %r15d, 0x6c(%rbp)
cmpl $0x4, 0x278(%rsp)
jl 0x1f9e5
movl $0xe, %edx
movq 0x3467d(%rip), %rdi     # 0x53fe8
leaq 0x2540b(%rip), %rsi     # 0x44d7d
callq 0x7340
leaq 0x10(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x7540
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x3464e(%rip), %rdi     # 0x53fe8
callq 0x7340
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
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1f9e5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
incq %r13
movq 0xe8(%rbp), %rax
movq 0xf0(%rbp), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x4, %rdx
addq $0x10, %rbx
cmpq %rdx, %r13
jb 0x1f773
jmp 0x1fc9f
cmpl $0x2, %r15d
jne 0x1fa7e
cmpl $0x2, %r12d
jne 0x1fa7e
leaq 0xb0(%rsp), %rdi
movl $0x1, %esi
callq 0x75d0
movq 0x8(%rsp), %rbp
movb $0x58, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
movq 0xe8(%rbp), %rcx
movl 0x1c(%rcx,%rbx), %esi
movq %rax, %rdi
callq 0x75d0
movb $0x3d, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7340
incl 0x6c(%rbp)
jmp 0x1f951
subl %eax, %r14d
movl %r14d, %edx
subl %ebp, %edx
movl %ebp, %eax
cmovll %r14d, %eax
negl %edx
movl %edx, %r8d
negl %r8d
cmovsl %edx, %r8d
movl 0x260(%rsp), %r11d
imull %r11d, %eax
movl 0x268(%rsp), %edx
movq %rdx, %r10
addl %r10d, %eax
movq 0x8(%rsp), %r9
subl 0x70(%r9), %eax
cltd
movq 0x70(%rsp), %r15
idivl %r15d
movl %eax, %r12d
incl %r12d
movl %ebp, %eax
sarl %eax
imull %r11d, %eax
addl %r10d, %eax
cltd
idivl %r15d
addl %r8d, %eax
incl %eax
cmpl %eax, %r12d
cmovgel %eax, %r12d
leal 0x3(%r8), %eax
movl 0x4c(%rsp), %edx
cmpl %edx, %r12d
cmovgel %edx, %r12d
cmpl %r12d, %eax
cmovgl %eax, %r12d
cmpl $0x7, 0x278(%rsp)
jl 0x1fbb4
movl $0x19, %edx
movq 0x344d4(%rip), %rdi     # 0x53fe8
leaq 0x2523d(%rip), %rsi     # 0x44d58
callq 0x7340
movq 0x344c1(%rip), %rdi     # 0x53fe8
movl %ebp, %esi
callq 0x75d0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x212fb(%rip), %rsi     # 0x40e3b
callq 0x7340
movq %r15, %rdi
movl %r14d, %esi
callq 0x75d0
movq %rax, %r15
movl $0xa, %edx
movq %rax, %rdi
leaq 0x25210(%rip), %rsi     # 0x44d72
callq 0x7340
movq %r15, %rdi
movl %r12d, %esi
callq 0x75d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x8(%rsp), %r9
movq 0xe8(%r9), %rax
movl 0x8(%rax,%rbx), %esi
movl 0xc(%rax,%rbx), %edi
movq (%rax,%rbx), %rcx
movslq %esi, %rsi
addq 0x50(%rsp), %rsi
movslq %edi, %rax
addq %rax, %rsi
addq %rax, %rcx
subq (%r9), %rcx
addq 0x38(%rsp), %rcx
subq $0x8, %rsp
movl %ebp, %edi
movl %r14d, %edx
movl $0x5, %r8d
movq 0x68(%rsp), %r9
leaq 0x18(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
pushq %r12
pushq 0x90(%rsp)
pushq 0xa0(%rsp)
callq 0x7fce
addq $0x30, %rsp
movl 0x40(%rsp), %edi
movq 0x8(%rsp), %r8
movq 0xe8(%r8), %rax
movslq 0x8(%rax,%rbx), %rdx
addq 0x50(%rsp), %rdx
movslq 0xc(%rax,%rbx), %rcx
addq %rcx, %rdx
addq (%rax,%rbx), %rcx
movq 0x10(%rsp), %rsi
subq (%r8), %rcx
addq 0x38(%rsp), %rcx
leaq 0xa0(%rsp), %r8
callq 0x1eda4
movq 0x8(%rsp), %rcx
addl %eax, 0x6c(%rcx)
movq 0xe8(%rcx), %rax
movl 0x1c(%rax,%rbx), %esi
leaq 0xb0(%rsp), %rdi
callq 0x75d0
movb $0x3d, 0x34(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x34(%rsp), %rsi
callq 0x7340
imull %r14d, %r12d
addl 0x58(%rsp), %r12d
movq 0x10(%rsp), %rdi
callq 0x7380
movq %r12, 0x58(%rsp)
movq 0x8(%rsp), %rbp
jmp 0x1f951
shlq $0x1c, %rcx
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
addq %rcx, %rbx
movq %rbx, %r8
sarq $0x1c, %r8
movl 0x8(%rax,%r8), %esi
movl 0xc(%rax,%r8), %edi
leal (%rdi,%rsi), %r9d
movl 0x14(%rbp), %ecx
movl %ecx, %edx
subl %r9d, %edx
jge 0x1fcd9
movq 0x58(%rsp), %r13
jmp 0x1ff93
sarq $0x20, %rbx
addq %r8, %rax
movq %rbp, %r10
leal 0x1(%rdx), %ebp
movl 0x8(%r10), %r8d
movq (%rax), %rcx
leal (%rcx,%rdi), %eax
movl %r8d, %r9d
subl %eax, %r9d
negl %eax
leal (%r8,%rax), %r12d
incl %r12d
subl %r9d, %edx
movl %edx, %r8d
negl %r8d
cmovsl %edx, %r8d
cmpl %ebp, %r12d
movl %ebp, %edx
cmovll %r12d, %edx
movl 0x268(%rsp), %eax
movq %rax, %r9
subl 0x70(%r10), %eax
movl 0x260(%rsp), %r14d
imull %r14d, %edx
addl %edx, %eax
movl 0x270(%rsp), %edx
movq %rdx, %r11
negl %r11d
cltd
idivl %r11d
movl %eax, %r13d
incl %r13d
movl %ebp, %eax
sarl %eax
imull %r14d, %eax
addl %r9d, %eax
cltd
movq %r11, %r15
idivl %r11d
addl %r8d, %eax
incl %eax
cmpl %eax, %r13d
cmovgel %eax, %r13d
leal 0x3(%r8), %eax
movl 0x4c(%rsp), %edx
cmpl %edx, %r13d
cmovgel %edx, %r13d
cmpl %r13d, %eax
cmovgl %eax, %r13d
cmpl $0x7, 0x278(%rsp)
jl 0x1fe3d
movq 0x34257(%rip), %rdi     # 0x53fe8
leaq 0x24fc0(%rip), %rsi     # 0x44d58
movl $0x19, %edx
callq 0x7340
movq 0x3423f(%rip), %rdi     # 0x53fe8
movl %ebp, %esi
callq 0x75d0
movq %rax, %r14
leaq 0x21081(%rip), %rsi     # 0x40e3b
movl $0x1, %edx
movq %rax, %rdi
callq 0x7340
movq %r14, %rdi
movl %r12d, %esi
callq 0x75d0
movq %rax, %r14
leaq 0x24f96(%rip), %rsi     # 0x44d72
movl $0xa, %edx
movq %rax, %rdi
callq 0x7340
movq %r14, %rdi
movl %r13d, %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
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movq 0x8(%rsp), %r10
movq 0xe8(%r10), %rax
movq %rbx, %rcx
shlq $0x4, %rcx
movl 0x8(%rax,%rcx), %esi
movl 0xc(%rax,%rcx), %edi
movq (%rax,%rcx), %rcx
movslq %esi, %rsi
addq 0x50(%rsp), %rsi
movslq %edi, %rax
addq %rax, %rsi
addq %rax, %rcx
subq (%r10), %rcx
addq 0x38(%rsp), %rcx
movl 0x268(%rsp), %eax
movq %rax, %r11
negl %r11d
subq $0x8, %rsp
leaq 0x48(%rsp), %rax
leaq 0x3c(%rsp), %r10
movl %ebp, %edi
movl %r12d, %edx
movl $0x5, %r8d
movq 0x68(%rsp), %r9
pushq %rax
pushq %r10
pushq %r13
pushq %r15
pushq %r11
callq 0x7fce
addq $0x30, %rsp
movl 0x34(%rsp), %edi
movq 0x40(%rsp), %rsi
movq 0x8(%rsp), %r8
movq 0xe8(%r8), %rax
shlq $0x4, %rbx
movslq 0x8(%rax,%rbx), %rcx
movq 0x50(%rsp), %rdx
addq %rcx, %rdx
movslq 0xc(%rax,%rbx), %r9
addq %r9, %rdx
addq (%rax,%rbx), %r9
subq (%r8), %r9
movq 0x38(%rsp), %rcx
addq %r9, %rcx
leaq 0xa0(%rsp), %r8
callq 0x1eda4
movq 0x8(%rsp), %rbp
addl %eax, 0x6c(%rbp)
cmpl $0x4, 0x278(%rsp)
jl 0x1ff7d
movq 0x340ee(%rip), %rdi     # 0x53fe8
leaq 0x24e7c(%rip), %rsi     # 0x44d7d
movl $0xe, %edx
callq 0x7340
leaq 0xb8(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x7540
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x340ba(%rip), %rdi     # 0x53fe8
callq 0x7340
movq 0x8(%rsp), %rbp
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
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ff7d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
imull %r12d, %r13d
addl 0x58(%rsp), %r13d
movq 0x40(%rsp), %rdi
callq 0x7380
movl 0x14(%rbp), %ecx
movl 0x6c(%rsp), %ebx
decl %ebx
cmpl %ecx, %ebx
je 0x20026
cmpl $0x4, 0x278(%rsp)
jl 0x20001
movq 0x34036(%rip), %rdi     # 0x53fe8
leaq 0x24dd3(%rip), %rsi     # 0x44d8c
movl $0x1e, %edx
callq 0x7340
movl %ebx, %esi
subl 0x14(%rbp), %esi
movq 0x34019(%rip), %rdi     # 0x53fe8
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
callq 0x7040
movq %rax, %rdi
callq 0x71d0
movl 0x14(%rbp), %ecx
subl %ecx, %ebx
leaq 0xb0(%rsp), %rdi
movl %ebx, %esi
callq 0x75d0
leaq 0x25588(%rip), %rsi     # 0x455a1
movl $0x1, %edx
movq %rax, %rdi
callq 0x7340
movq 0x38(%rsp), %rdi
callq 0x7380
leaq 0xb8(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x7540
leaq 0x78(%rbp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x73c0
movq (%r14), %rdi
leaq 0x20(%rsp), %rbx
cmpq %rbx, %rdi
je 0x2006d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
leaq 0x90(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x78(%rbp), %rsi
movq 0x80(%rbp), %rdx
addq %rsi, %rdx
leaq 0x80(%rsp), %rdi
callq 0xc1d8
leaq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x1ebee
addq $0x20, %rbp
leaq 0x10(%rsp), %r14
movq %rbp, %rdi
movq %r14, %rsi
callq 0x73c0
movq (%r14), %rdi
cmpq %rbx, %rdi
je 0x200cf
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x200ec
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x72f0
cmpl $0x2, 0x278(%rsp)
jl 0x20147
movq 0x33eeb(%rip), %rdi     # 0x53fe8
leaq 0x24ca7(%rip), %rsi     # 0x44dab
movl $0xe, %edx
callq 0x7340
movq 0x33ed3(%rip), %rdi     # 0x53fe8
movl %r13d, %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
movq 0x33e4a(%rip), %rsi     # 0x53f98
leaq 0xa0(%rsp), %rdi
callq 0x7210
leaq 0x120(%rsp), %rdi
callq 0x7100
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x201db
jmp 0x201db
jmp 0x2019e
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x201de
movq 0x90(%rsp), %rsi
jmp 0x201d1
jmp 0x201db
jmp 0x201db
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x201c7
jmp 0x201db
jmp 0x201db
jmp 0x201db
jmp 0x201db
jmp 0x201db
jmp 0x201db
jmp 0x201db
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x201de
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
jmp 0x201de
movq %rax, %rbx
movq 0x33db3(%rip), %rsi     # 0x53f98
leaq 0xa0(%rsp), %rdi
callq 0x7210
leaq 0x120(%rsp), %rdi
callq 0x7100
movq %rbx, %rdi
callq 0x7600
nop