// File: readmapping[P]alfalfa/src/dp.cpp
// Function: dynProg::dpBandFull(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, boundaries&, dp_type const&, outputType const&, dp_output&, int, int, bool)
int dynProg::dpBandFull( const string& ref, 
        const string&     query,
        boundaries& offset,
        const dp_type&    type,
        const outputType& oType,
        dp_output&  output, 
        int bandL, 
        int bandR, 
        bool print){
    L1 = offset.refE-offset.refB+1;
    L2 = offset.queryE-offset.queryB+1;
    bandSize = 0;
    banded = true;
    bandLeft = bandL;
    bandRight = bandR;
    assert(L1 >=0 && L2 >= 0 && bandLeft >0 && bandRight > 0);
    //build matrices
    updateMatrix(type, false, print);
    bool affine = scores.openGap != 0;
    //dp
    if(affine)
        dpFillStatic( ref, query, true, offset, type);
    else
        dpFillOptStatic( ref, query, true, offset, type);
    //traceback and output
    int        i = min(L2,L1+bandLeft), j = min(L1,L2+bandRight);
    //find beginPosition for traceBack and find dpScore
    findTraceBackPosStatic(&i,&j,type);
    output.dpScore = M[i][j];
    //Next is for output only
    if(oType>DPSCORE){
        //Alter boundaries to return the new positions when free gaps were introduced.
        if(type.freeQueryE && i < L2)
            offset.queryE = offset.queryB+i-1;
        if(type.freeRefE && j < L1)
            offset.refE = offset.refB+j-1;
        //traceBack
        std::stringstream ss;
        if(affine)
            dpTraceBackFull( i, j, output, ss, offset, true, ref, query);
        else
            dpTraceBackOptFull( i, j, type, output, ss, offset, true, ref, query);
        //Edit Dist ouput
        if( i > 0 && !type.freeQueryB)
            output.editDist += i;
        if(j > 0 && !type.freeRefB)
            output.editDist += j;
        //Errorstring output
        if(oType == ERRORSTRING || oType == ALL){
            string errorString = ss.str();
            if(i > 0 && !type.freeQueryB)
                errorString.append(i,'I');
            else if(j > 0 && !type.freeRefB)
                errorString.append(j, 'D');
            reverse( errorString.begin(), errorString.end() );
            //create output: errorString
            int iter = 0;
            int temp;
            int errorStringLength = errorString.length();
            while(iter < errorStringLength){
                temp = iter;
                while(iter+1 < errorStringLength && errorString[iter+1]==errorString[temp])
                    iter++;
                iter++;
                output.cigarChars.push_back(errorString[temp]);
                output.cigarLengths.push_back(iter-temp);
            }
        }
    }
    //change boundaries for local and freeGap types to return changed free boundaries.
    if(type.freeQueryB && i > 0)
        offset.queryB = offset.queryB+i;
    if(type.freeRefB && j > 0)
        offset.refB = offset.refB+j;

    return 0;
}

// Assembly:
subq $0x288, %rsp            # imm = 0x288
movb 0x2a8(%rsp), %al
movl 0x2a0(%rsp), %r10d
movl 0x298(%rsp), %r10d
movq 0x290(%rsp), %r10
movq %rdi, 0x280(%rsp)
movq %rsi, 0x278(%rsp)
movq %rdx, 0x270(%rsp)
movq %rcx, 0x268(%rsp)
movq %r8, 0x260(%rsp)
movq %r9, 0x258(%rsp)
andb $0x1, %al
movb %al, 0x257(%rsp)
movq 0x280(%rsp), %rdi
movq %rdi, 0x60(%rsp)
movq 0x268(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x268(%rsp), %rcx
subq (%rcx), %rax
addq $0x1, %rax
movl %eax, 0x20(%rdi)
movq 0x268(%rsp), %rax
movl 0x14(%rax), %eax
movq 0x268(%rsp), %rcx
subl 0x10(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x24(%rdi)
movl $0x0, 0x28(%rdi)
movb $0x1, 0x34(%rdi)
movl 0x298(%rsp), %eax
movl %eax, 0x2c(%rdi)
movl 0x2a0(%rsp), %eax
movl %eax, 0x30(%rdi)
movq 0x260(%rsp), %rsi
movb 0x257(%rsp), %al
xorl %edx, %edx
andb $0x1, %al
movzbl %al, %ecx
callq 0x31920
movq 0x60(%rsp), %rax
movq 0x38(%rax), %rax
cmpl $0x0, 0x8(%rax)
setne %al
andb $0x1, %al
movb %al, 0x256(%rsp)
testb $0x1, 0x256(%rsp)
je 0x37494
movq 0x60(%rsp), %rdi
movq 0x278(%rsp), %rsi
movq 0x270(%rsp), %rdx
movq 0x268(%rsp), %r8
movq 0x260(%rsp), %r9
movl $0x1, %ecx
callq 0x32140
jmp 0x374c3
movq 0x60(%rsp), %rdi
movq 0x278(%rsp), %rsi
movq 0x270(%rsp), %rdx
movq 0x268(%rsp), %r8
movq 0x260(%rsp), %r9
movl $0x1, %ecx
callq 0x33500
movq 0x60(%rsp), %rcx
movq %rcx, %rdi
addq $0x24, %rdi
movl 0x20(%rcx), %eax
addl 0x2c(%rcx), %eax
movl %eax, 0x24c(%rsp)
leaq 0x24c(%rsp), %rsi
callq 0xc080
movq 0x60(%rsp), %rcx
movl (%rax), %eax
movl %eax, 0x250(%rsp)
movq %rcx, %rdi
addq $0x20, %rdi
movl 0x24(%rcx), %eax
addl 0x30(%rcx), %eax
movl %eax, 0x244(%rsp)
leaq 0x244(%rsp), %rsi
callq 0xc080
movq 0x60(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x248(%rsp)
movq 0x260(%rsp), %rcx
leaq 0x250(%rsp), %rsi
leaq 0x248(%rsp), %rdx
callq 0x31ca0
movq 0x60(%rsp), %rax
movq (%rax), %rax
movslq 0x250(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x248(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movq 0x290(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x258(%rsp), %rax
cmpl $0x0, (%rax)
jle 0x37994
movq 0x260(%rsp), %rax
testb $0x1, 0x3(%rax)
je 0x375bd
movq 0x60(%rsp), %rcx
movl 0x250(%rsp), %eax
cmpl 0x24(%rcx), %eax
jge 0x375bd
movq 0x268(%rsp), %rax
movl 0x10(%rax), %ecx
addl 0x250(%rsp), %ecx
subl $0x1, %ecx
movq 0x268(%rsp), %rax
movl %ecx, 0x14(%rax)
movq 0x260(%rsp), %rax
testb $0x1, 0x1(%rax)
je 0x37602
movq 0x60(%rsp), %rcx
movl 0x248(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x37602
movq 0x268(%rsp), %rax
movq (%rax), %rcx
movslq 0x248(%rsp), %rax
addq %rax, %rcx
subq $0x1, %rcx
movq 0x268(%rsp), %rax
movq %rcx, 0x8(%rax)
leaq 0xb8(%rsp), %rdi
callq 0x8260
testb $0x1, 0x256(%rsp)
je 0x37689
movq 0x60(%rsp), %rdi
movq 0x290(%rsp), %rcx
movq 0x268(%rsp), %r9
movq 0x278(%rsp), %rdx
movq 0x270(%rsp), %rsi
movq %rsp, %rax
movq %rsi, 0x10(%rax)
movq %rdx, 0x8(%rax)
movl $0x1, (%rax)
leaq 0x250(%rsp), %rsi
leaq 0x248(%rsp), %rdx
leaq 0xb8(%rsp), %r8
callq 0x342a0
jmp 0x3766e
jmp 0x376ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x37985
movq 0x60(%rsp), %rdi
movq 0x260(%rsp), %rcx
movq 0x290(%rsp), %r8
movq 0x268(%rsp), %rdx
movq 0x278(%rsp), %rsi
movq 0x270(%rsp), %r9
movq %rsp, %rax
movq %r9, 0x18(%rax)
movq %rsi, 0x10(%rax)
movq %rdx, (%rax)
movl $0x1, 0x8(%rax)
leaq 0x250(%rsp), %rsi
leaq 0x248(%rsp), %rdx
leaq 0xb8(%rsp), %r9
callq 0x35140
jmp 0x376ea
jmp 0x376ec
cmpl $0x0, 0x250(%rsp)
jle 0x37717
movq 0x260(%rsp), %rax
testb $0x1, 0x2(%rax)
jne 0x37717
movl 0x250(%rsp), %ecx
movq 0x290(%rsp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
cmpl $0x0, 0x248(%rsp)
jle 0x37741
movq 0x260(%rsp), %rax
testb $0x1, (%rax)
jne 0x37741
movl 0x248(%rsp), %ecx
movq 0x290(%rsp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq 0x258(%rsp), %rax
cmpl $0x3, (%rax)
je 0x3775f
movq 0x258(%rsp), %rax
cmpl $0x4, (%rax)
jne 0x37976
leaq 0x88(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x8350
jmp 0x37776
cmpl $0x0, 0x250(%rsp)
jle 0x377d2
movq 0x260(%rsp), %rax
testb $0x1, 0x2(%rax)
jne 0x377d2
movslq 0x250(%rsp), %rsi
leaq 0x88(%rsp), %rdi
movl $0x49, %edx
callq 0x83d0
jmp 0x377aa
jmp 0x37809
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x8858
jmp 0x37985
cmpl $0x0, 0x248(%rsp)
jle 0x37807
movq 0x260(%rsp), %rax
testb $0x1, (%rax)
jne 0x37807
movslq 0x248(%rsp), %rsi
leaq 0x88(%rsp), %rdi
movl $0x44, %edx
callq 0x83d0
jmp 0x37805
jmp 0x37807
jmp 0x37809
leaq 0x88(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x8310
movq 0x58(%rsp), %rdi
movq %rax, 0x80(%rsp)
callq 0x81e0
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0xe110
jmp 0x37846
movl $0x0, 0x74(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x8630
movl %eax, 0x6c(%rsp)
movl 0x74(%rsp), %eax
cmpl 0x6c(%rsp), %eax
jge 0x37969
movl 0x74(%rsp), %eax
movl %eax, 0x70(%rsp)
movl 0x74(%rsp), %ecx
addl $0x1, %ecx
xorl %eax, %eax
cmpl 0x6c(%rsp), %ecx
movb %al, 0x57(%rsp)
jge 0x378df
movl 0x74(%rsp), %eax
incl %eax
movslq %eax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x8830
movq %rax, 0x48(%rsp)
jmp 0x378a5
movq 0x48(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0x3c(%rsp)
movslq 0x70(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x8830
movq %rax, 0x40(%rsp)
jmp 0x378ca
movl 0x3c(%rsp), %eax
movq 0x40(%rsp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, 0x57(%rsp)
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0x378e9
jmp 0x378f9
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x37875
movl 0x74(%rsp), %eax
incl %eax
movl %eax, 0x74(%rsp)
movq 0x290(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x28(%rsp)
movslq 0x70(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x8830
movq %rax, 0x30(%rsp)
jmp 0x3792d
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x39060
jmp 0x3793e
movq 0x290(%rsp), %rdi
addq $0x20, %rdi
movl 0x74(%rsp), %eax
movl 0x70(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0x68(%rsp)
leaq 0x68(%rsp), %rsi
callq 0x390d0
jmp 0x37964
jmp 0x3785f
leaq 0x88(%rsp), %rdi
callq 0x8858
leaq 0xb8(%rsp), %rdi
callq 0x8290
jmp 0x37994
leaq 0xb8(%rsp), %rdi
callq 0x8290
jmp 0x37a0b
movq 0x260(%rsp), %rax
testb $0x1, 0x2(%rax)
je 0x379c9
cmpl $0x0, 0x250(%rsp)
jle 0x379c9
movq 0x268(%rsp), %rax
movl 0x10(%rax), %ecx
addl 0x250(%rsp), %ecx
movq 0x268(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x260(%rsp), %rax
testb $0x1, (%rax)
je 0x37a01
cmpl $0x0, 0x248(%rsp)
jle 0x37a01
movq 0x268(%rsp), %rax
movq (%rax), %rcx
movslq 0x248(%rsp), %rax
addq %rax, %rcx
movq 0x268(%rsp), %rax
movq %rcx, (%rax)
xorl %eax, %eax
addq $0x288, %rsp            # imm = 0x288
retq
movq 0xb0(%rsp), %rdi
callq 0x8730
nopl (%rax,%rax)