// File: /workspace/github_cpp_makefile_star2_O3/readmapping[P]alfalfa/src/mapper.cpp
// Function: fullDP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned char const*, int, alignment_t*, int, signed char const*, int, int, int, int)
void fullDP(const string & S, const uint8_t * readP, int Plen, alignment_t * alignment, int fixedBand, 
        const int8_t *mat, int match, int openGap, int extendGap, int print){
    int qLen = alignment->qE - alignment->qB + 1;
    int refLen = (int)(alignment->refE - alignment->refB + 1L);
    int band = bandSizeEstimate(fixedBand, qLen, refLen, match, openGap, extendGap, alignment->alignmentScore);
    //calculate CIGAR STRING
    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[alignment->refB+i]];
    int n_cigar;
    uint32_t * cigar;
    if(print>=2) cerr << "#COSTPOSTPROC " << refLen*band << endl;
    alignment->alignmentScore = ksw_global(qLen, readP+alignment->qB, refLen, target, 5, mat, -1*openGap, -1*extendGap, band, &n_cigar, &cigar);
    alignment->setFieldsKsw(n_cigar, cigar, readP+alignment->qB, target, alignment->qB, Plen-1-alignment->qE);
    free(target);
    free(cigar);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x18(%rsp)
movq %rcx, %r14
movl %edx, 0xc(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, 0x10(%rsp)
movl 0x78(%rsp), %edi
movl 0x70(%rsp), %edx
movl 0x14(%rcx), %eax
movl 0x10(%rcx), %ecx
movl %ecx, 0x4(%rsp)
subl %ecx, %eax
leal 0x1(%rax), %r9d
movl 0x8(%r14), %r13d
movq (%r14), %rbx
subl %ebx, %r13d
leal 0x1(%r13), %r10d
subl %r13d, %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
cmpl %r9d, %r10d
movl %r9d, %ecx
cmovll %r10d, %ecx
imull %edx, %ecx
movl %edi, %eax
subl 0x70(%r14), %eax
addl %ecx, %eax
xorl %r12d, %r12d
subl 0x80(%rsp), %r12d
movl %r9d, 0x8(%rsp)
movl %r9d, %ecx
sarl %ecx
imull %edx, %ecx
cltd
idivl %r12d
movl %eax, %r15d
incl %r15d
addl %edi, %ecx
movl %ecx, %eax
cltd
idivl %r12d
addl %esi, %eax
incl %eax
cmpl %eax, %r15d
cmovgel %eax, %r15d
cmpl %r8d, %r15d
cmovgel %r8d, %r15d
leal 0x3(%rsi), %eax
cmpl %r15d, %eax
cmovgl %eax, %r15d
movl %r10d, (%rsp)
movslq %r10d, %rdi
callq 0x7430
movq %rax, %rbp
cmpl $0x7ffffffe, %r13d      # imm = 0x7FFFFFFE
ja 0x204a8
movq 0x10(%rsp), %rax
addq (%rax), %rbx
movl (%rsp), %eax
xorl %ecx, %ecx
leaq 0x2476e(%rip), %rdx     # 0x44c00
movsbq (%rbx,%rcx), %rsi
movb (%rsi,%rdx), %sil
movb %sil, (%rbp,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x20492
cmpl $0x1, 0x88(%rsp)
movl 0x4(%rsp), %eax
jle 0x2050e
movq 0x33b2b(%rip), %rbx     # 0x53fe8
leaq 0x248e7(%rip), %rsi     # 0x44dab
movl $0xe, %edx
movq %rbx, %rdi
callq 0x7340
movl %r15d, %esi
imull (%rsp), %esi
movq %rbx, %rdi
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
movl 0x10(%r14), %eax
movslq %eax, %rsi
movq 0x20(%rsp), %rbx
addq %rbx, %rsi
movl 0x78(%rsp), %eax
negl %eax
subq $0x8, %rsp
leaq 0x30(%rsp), %r10
leaq 0x3c(%rsp), %r13
movl 0x10(%rsp), %edi
movl 0x8(%rsp), %edx
movq %rbp, %rcx
movl $0x5, %r8d
movq 0x20(%rsp), %r9
pushq %r10
pushq %r13
pushq %r15
pushq %r12
pushq %rax
callq 0x7fce
addq $0x30, %rsp
movl %eax, 0x70(%r14)
movl (%r13), %esi
leaq 0x28(%rsp), %r15
movq (%r15), %rdx
movslq 0x10(%r14), %r9
addq %r9, %rbx
movl 0x14(%r14), %eax
notl %eax
addl 0xc(%rsp), %eax
subq $0x8, %rsp
movq %r14, %rdi
movq %rbx, %rcx
movq %rbp, %r8
pushq %rax
callq 0x1ef94
addq $0x10, %rsp
movq %rbp, %rdi
callq 0x7380
movq (%r15), %rdi
callq 0x7380
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq