// File: /workspace/github_cpp_makefile_star2_O1/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 $0x1d8, %rsp            # imm = 0x1D8
movq %r9, 0x10(%rsp)
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
movb 0x228(%rsp), %al
movl 0x220(%rsp), %ecx
movl 0x8(%rbx), %edx
subl (%rbx), %edx
movl 0x218(%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 0x1aa00
movq 0x38(%r12), %rax
movl 0x8(%rax), %eax
testl %eax, %eax
movq %rbx, 0x28(%rsp)
movq %r15, 0x8(%rsp)
movq %r13, 0x20(%rsp)
movl %eax, 0x18(%rsp)
je 0x1dd63
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl $0x1, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x1af00
jmp 0x1dd7c
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl $0x1, %ecx
movq %rbx, %r8
movq %r14, %r9
callq 0x1b5ca
movl 0x20(%r12), %ebx
movl 0x24(%r12), %r15d
movl 0x2c(%r12), %eax
addl %ebx, %eax
cmpl %r15d, %eax
cmovgel %r15d, %eax
leaq 0x4(%rsp), %r13
movl %eax, (%r13)
movl 0x30(%r12), %eax
addl %r15d, %eax
cmpl %ebx, %eax
cmovgel %ebx, %eax
movq %rsp, %rbp
movl %eax, (%rbp)
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x1acd2
movq (%r12), %rax
movslq (%r13), %rcx
movq (%rax,%rcx,8), %rdx
movslq (%rbp), %rax
movl (%rdx,%rax,4), %edx
movq 0x210(%rsp), %rsi
movl %edx, 0x4(%rsi)
movq 0x10(%rsp), %rdx
cmpl $0x0, (%rdx)
movq 0x28(%rsp), %r13
jle 0x1e04c
cmpl %r15d, %ecx
setl %dl
andb 0x3(%r14), %dl
cmpb $0x1, %dl
movl 0x18(%rsp), %ebp
jne 0x1de11
movl 0x10(%r13), %edx
addl %edx, %ecx
decl %ecx
movl %ecx, 0x14(%r13)
cmpl %ebx, %eax
setl %cl
andb 0x1(%r14), %cl
cmpb $0x1, %cl
movq 0x210(%rsp), %r15
jne 0x1de35
movq (%r13), %rcx
addq %rcx, %rax
decq %rax
movq %rax, 0x8(%r13)
leaq 0x50(%rsp), %rdi
callq 0x71e0
testl %ebp, %ebp
je 0x1de74
subq $0x8, %rsp
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x58(%rsp), %r8
movq %r12, %rdi
movq %r15, %rcx
movq %r13, %r9
pushq 0x28(%rsp)
pushq 0x18(%rsp)
pushq $0x1
callq 0x1ba0a
addq $0x20, %rsp
jmp 0x1de9f
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
leaq 0x50(%rsp), %r9
movq %r12, %rdi
movq %r14, %rcx
movq %r15, %r8
pushq 0x20(%rsp)
pushq 0x10(%rsp)
pushq $0x1
pushq %r13
callq 0x1c2fc
addq $0x20, %rsp
movl 0x4(%rsp), %ebx
testl %ebx, %ebx
jle 0x1deb1
cmpb $0x0, 0x2(%r14)
jne 0x1deb1
addl %ebx, (%r15)
movl (%rsp), %ebp
testl %ebp, %ebp
jle 0x1dec1
cmpb $0x0, (%r14)
jne 0x1dec1
addl %ebp, (%r15)
movq 0x10(%rsp), %rax
movl (%rax), %eax
addl $-0x3, %eax
cmpl $0x1, %eax
ja 0x1e02e
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x7540
testl %ebx, %ebx
jle 0x1def0
movb $0x49, %al
cmpb $0x0, 0x2(%r14)
je 0x1defe
testl %ebp, %ebp
jle 0x1df14
movb $0x44, %al
cmpb $0x0, (%r14)
movl %ebp, %ebx
jne 0x1df14
movl %ebx, %ecx
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rsi
movzbl %al, %r8d
xorl %edx, %edx
callq 0x7670
movq %r14, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
testq %rcx, %rcx
setne %dl
addq %rax, %rcx
decq %rcx
cmpq %rax, %rcx
seta %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x1df5d
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 0x1df42
movq 0x38(%rsp), %rbp
testl %ebp, %ebp
jle 0x1e009
leaq 0x8(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%r15), %r13
movl %ebp, %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movl %ebx, %r12d
movq 0x30(%rsp), %rax
movslq %ebx, %rdx
leal 0x1(%rdx), %ecx
cmpl %ebp, %ecx
cmovlel %ebp, %ecx
leaq 0x1(%rdx), %rsi
cmpq %r14, %rsi
jge 0x1dfb0
movb (%rax,%rsi), %dil
incl %ebx
incq %rsi
cmpb (%rax,%rdx), %dil
je 0x1df9a
jmp 0x1dfb2
movl %ecx, %ebx
addq 0x30(%rsp), %rdx
movq 0x10(%r15), %rsi
cmpq 0x18(%r15), %rsi
je 0x1dfcb
movb (%rdx), %al
movb %al, (%rsi)
incq 0x10(%r15)
jmp 0x1dfd5
movq 0x10(%rsp), %rdi
callq 0x1ebb8
movl %ebx, %eax
subl %r12d, %eax
movl %eax, 0x1c(%rsp)
movq 0x28(%r15), %rsi
cmpq 0x30(%r15), %rsi
je 0x1dff4
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%r15)
jmp 0x1e001
movq %r13, %rdi
leaq 0x1c(%rsp), %rdx
callq 0x1ecaa
cmpl %ebp, %ebx
jl 0x1df83
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e024
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x28(%rsp), %r13
movq 0x8(%rsp), %r14
movq 0x35f63(%rip), %rsi     # 0x53f98
leaq 0x50(%rsp), %rdi
callq 0x7210
leaq 0xd0(%rsp), %rdi
callq 0x7100
movl 0x4(%rsp), %eax
testl %eax, %eax
setg %cl
andb 0x2(%r14), %cl
cmpb $0x1, %cl
jne 0x1e062
addl %eax, 0x10(%r13)
movl (%rsp), %eax
testl %eax, %eax
setg %cl
andb (%r14), %cl
cmpb $0x1, %cl
jne 0x1e078
movl %eax, %eax
addq %rax, (%r13)
xorl %eax, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e097
jmp 0x1e090
movq %rax, %rbx
jmp 0x1e0b5
jmp 0x1e097
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e0b5
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x35edc(%rip), %rsi     # 0x53f98
leaq 0x50(%rsp), %rdi
callq 0x7210
leaq 0xd0(%rsp), %rdi
callq 0x7100
movq %rbx, %rdi
callq 0x7600
nop