// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %r9, %r15
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %r12
movb 0x238(%rsp), %al
movl 0x230(%rsp), %ecx
movl 0x8(%rbx), %edx
subl (%rbx), %edx
movl 0x228(%rsp), %esi
incl %edx
movl %edx, 0x20(%rdi)
movl 0x14(%rbx), %edx
subl 0x10(%rbx), %edx
incl %edx
movl %edx, 0x24(%rdi)
movl $0x0, 0x28(%rdi)
movb $0x1, 0x34(%rdi)
movl %esi, 0x2c(%rdi)
movl %ecx, 0x30(%rdi)
movzbl %al, %ecx
movq %r8, %rsi
xorl %edx, %edx
callq 0x1a78e
movq 0x38(%r12), %rax
movl 0x8(%rax), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
movq %rbx, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq %r13, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
je 0x1da66
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl $0x1, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x1acc0
jmp 0x1da7f
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl $0x1, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x1b384
movq %r14, %r13
movl 0x20(%r12), %r14d
movl 0x24(%r12), %ebx
movl 0x2c(%r12), %eax
addl %r14d, %eax
cmpl %ebx, %eax
cmovgel %ebx, %eax
leaq 0x14(%rsp), %r15
movl %eax, (%r15)
movl 0x30(%r12), %eax
addl %ebx, %eax
cmpl %r14d, %eax
cmovgel %r14d, %eax
leaq 0x10(%rsp), %rbp
movl %eax, (%rbp)
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x1aa64
movq (%r12), %rax
movslq (%r15), %rsi
movq (%rax,%rsi,8), %rcx
movl (%rbp), %ebp
movslq %ebp, %rax
movl (%rcx,%rax,4), %ecx
movq 0x220(%rsp), %rdx
movl %ecx, 0x4(%rdx)
movq 0x30(%rsp), %r15
cmpl $0x0, (%r15)
jle 0x1db7b
cmpl %ebx, %esi
setl %cl
andb 0x3(%r13), %cl
cmpb $0x1, %cl
movq 0x28(%rsp), %rbx
jne 0x1db13
movl 0x10(%rbx), %ecx
addl %esi, %ecx
decl %ecx
movl %ecx, 0x14(%rbx)
cmpl %r14d, %ebp
setl %cl
andb 0x1(%r13), %cl
cmpb $0x1, %cl
jne 0x1db2f
movq (%rbx), %rcx
addq %rcx, %rax
decq %rax
movq %rax, 0x8(%rbx)
leaq 0x60(%rsp), %rdi
callq 0x71e0
cmpl $0x0, 0xc(%rsp)
movq 0x20(%rsp), %rax
je 0x1db85
subq $0x8, %rsp
leaq 0x1c(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x68(%rsp), %r8
movq %r12, %rdi
movq 0x228(%rsp), %r14
movq %r14, %rcx
movq %rbx, %r9
pushq %rax
pushq 0x28(%rsp)
pushq $0x1
callq 0x1b7c4
addq $0x20, %rsp
jmp 0x1dbb6
movq 0x28(%rsp), %rbx
jmp 0x1dd82
leaq 0x14(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x60(%rsp), %r9
movq %r12, %rdi
movq %r13, %rcx
movq 0x220(%rsp), %r14
movq %r14, %r8
pushq %rax
pushq 0x20(%rsp)
pushq $0x1
pushq %rbx
callq 0x1c068
addq $0x20, %rsp
movl 0x14(%rsp), %eax
testl %eax, %eax
jle 0x1dbc8
cmpb $0x0, 0x2(%r13)
jne 0x1dbc8
addl %eax, (%r14)
movq %rax, 0x18(%rsp)
movl 0x10(%rsp), %ebp
testl %ebp, %ebp
jle 0x1dbdf
cmpb $0x0, (%r13)
jne 0x1dbdf
addl %ebp, (%r14)
movl (%r15), %eax
addl $-0x3, %eax
cmpl $0x1, %eax
ja 0x1dd5f
leaq 0x78(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x7540
movq 0x18(%rsp), %rcx
testl %ecx, %ecx
jle 0x1dc0f
movb $0x49, %al
cmpb $0x0, 0x2(%r13)
je 0x1dc1e
testl %ebp, %ebp
jle 0x1dc34
movb $0x44, %al
cmpb $0x0, (%r13)
movl %ebp, %ecx
jne 0x1dc34
movl %ecx, %ecx
leaq 0x40(%rsp), %rdi
movq 0x8(%rdi), %rsi
movzbl %al, %r8d
xorl %edx, %edx
callq 0x7670
movl %ebp, 0xc(%rsp)
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rbp
testq %rbp, %rbp
setne %dl
leaq (%rax,%rbp), %rcx
decq %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x1dc82
incq %rax
movb -0x1(%rax), %dl
movb (%rcx), %sil
movb %sil, -0x1(%rax)
movb %dl, (%rcx)
decq %rcx
leaq 0x1(%rax), %rdx
cmpq %rcx, %rax
movq %rdx, %rax
jb 0x1dc62
movq 0x48(%rsp), %rbp
movq %r13, 0x20(%rsp)
testl %ebp, %ebp
jle 0x1dd36
leaq 0x8(%r14), %rax
movq %rax, 0x30(%rsp)
leaq 0x20(%r14), %r13
movl %ebp, %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movl %r14d, %r12d
movq 0x40(%rsp), %rax
movslq %r14d, %rcx
leaq (%rax,%rcx), %rdx
leal 0x1(%rcx), %esi
cmpl %ebp, %esi
cmovlel %ebp, %esi
incq %rcx
cmpq %rbx, %rcx
jge 0x1dcd7
movb (%rax,%rcx), %dil
incl %r14d
incq %rcx
cmpb (%rdx), %dil
je 0x1dcc1
jmp 0x1dcda
movl %esi, %r14d
movq 0x220(%rsp), %r15
movq 0x10(%r15), %rsi
cmpq 0x18(%r15), %rsi
je 0x1dcf6
movb (%rdx), %al
movb %al, (%rsi)
incq 0x10(%r15)
jmp 0x1dd00
movq 0x30(%rsp), %rdi
callq 0x1e8b4
movl %r14d, %eax
subl %r12d, %eax
movl %eax, 0x3c(%rsp)
movq 0x28(%r15), %rsi
cmpq 0x30(%r15), %rsi
je 0x1dd20
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%r15)
jmp 0x1dd2d
movq %r13, %rdi
leaq 0x3c(%rsp), %rdx
callq 0x1e9a6
cmpl %ebp, %r14d
jl 0x1dca7
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1dd51
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %r13
movl 0xc(%rsp), %ebp
movq 0x36232(%rip), %rsi     # 0x53f98
leaq 0x60(%rsp), %rdi
callq 0x7210
leaq 0xe0(%rsp), %rdi
callq 0x7100
movq 0x18(%rsp), %rsi
testl %esi, %esi
jle 0x1dd90
cmpb $0x0, 0x2(%r13)
je 0x1dd90
addl %esi, 0x10(%rbx)
testl %ebp, %ebp
jle 0x1dda0
cmpb $0x0, (%r13)
je 0x1dda0
movl %ebp, %eax
addq %rax, (%rbx)
xorl %eax, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ddbf
jmp 0x1ddb8
movq %rax, %rbx
jmp 0x1dddd
jmp 0x1ddbf
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1dddd
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x361b4(%rip), %rsi     # 0x53f98
leaq 0x60(%rsp), %rdi
callq 0x7210
leaq 0xe0(%rsp), %rdi
callq 0x7100
movq %rbx, %rdi
callq 0x7600
nop