// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/src/varcall.cpp
// Function: alignmentInternalPrint(BamTools::BamAlignment&, FastaReference&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void alignmentInternalPrint(BamAlignment & al,
                            FastaReference & targetFa,
                            std::string & refName )
{

    long int qPos = 0;
    long int rPos = al.Position;

    float pctA;
    int mbA;
    int qStart;
    int qEnd;

    al.GetTag<float>("PI", pctA);
    al.GetTag<int>("MB", mbA   );
    al.GetTag<int>("QE", qStart);
    al.GetTag<int>("QS", qEnd  );


    for(std::vector< CigarOp >::iterator it = al.CigarData.begin();
        it != al.CigarData.end(); it++){

        if(it->Length > 20){

            if(it->Type == 'I'){
                std::cout << refName
                          << "\t" << rPos
                          << "\t" << rPos
                          << "\t" << "INS:INTERNAL"
                          << "\t" << it->Length
                          << "\t" << pctA
                          << "\t" << mbA
                          << "\t" << al.Name
                          << "\t" << qStart
                          << "\t" << qEnd
                          << "\t" << al.QueryBases.substr(qPos, it->Length)
                          << std::endl;
            }
            if(it->Type == 'D'){
                std::cout << refName
                          << "\t" << rPos
                          << "\t" << (rPos + it->Length)
                          << "\t" << "DEL:INTERNAL"
                          << "\t" << it->Length
                          << "\t" << pctA
                          << "\t" << mbA
                          << "\t" << al.Name
                          << "\t" << qStart
                          << "\t" << qEnd
                          << "\t" << targetFa.getSubSequence(refName,
                                                             rPos, it->Length)
                          << std::endl;
            }
        }
        advanceQuery(it->Type,     it->Length, &qPos);
        advanceReference(it->Type, it->Length, &rPos);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, 0x50(%rsp)
movq %rsi, 0x80(%rsp)
movq %rdi, %r15
movq $0x0, 0x48(%rsp)
movslq 0xac(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x28ea4(%rip), %rsi     # 0x390b6
leaq 0x28e9f(%rip), %rdx     # 0x390b8
movq %rsp, %rdi
callq 0xbdac
cmpb $0x0, 0x130(%r15)
jne 0x102d4
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x102d4
movq 0x88(%r15), %rcx
leaq 0x28(%rsp), %rdx
movq %rcx, (%rdx)
leaq 0x34(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x30(%rsp), %r8
movl $0x0, (%r8)
movq %rsp, %rsi
movq %r15, %rdi
callq 0x16804
testb %al, %al
je 0x102d4
movq 0x28(%rsp), %rsi
movzbl -0x1(%rsi), %eax
addl $-0x41, %eax
cmpl $0x32, %eax
ja 0x102d4
movabsq $0x400000005, %rcx      # imm = 0x400000005
btq %rax, %rcx
jb 0x102a8
movabsq $0x12000000100, %rcx    # imm = 0x12000000100
btq %rax, %rcx
jae 0x102af
movl $0x4, %edx
jmp 0x102c4
movl $0x1, %edx
jmp 0x102c4
movabsq $0x4000000040000, %rcx  # imm = 0x4000000040000
btq %rax, %rcx
jae 0x102d4
movl $0x2, %edx
leaq 0x44(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x5380
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x102ef
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x28d25(%rip), %rsi     # 0x39026
leaq 0x28d20(%rip), %rdx     # 0x39028
callq 0xbdac
cmpb $0x0, 0x130(%r15)
jne 0x1039d
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x1039d
movq 0x88(%r15), %rcx
leaq 0x28(%rsp), %rdx
movq %rcx, (%rdx)
leaq 0x34(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x30(%rsp), %r8
movl $0x0, (%r8)
movq %rsp, %rsi
movq %r15, %rdi
callq 0x16804
testb %al, %al
je 0x1039d
movq 0x28(%rsp), %rsi
movzbl -0x1(%rsi), %eax
cmpl $0x68, %eax
jg 0x10377
movl $0x1, %edx
cmpl $0x41, %eax
je 0x1038d
cmpl $0x63, %eax
je 0x1038d
jmp 0x1039d
cmpl $0x69, %eax
je 0x10388
cmpl $0x73, %eax
jne 0x1039d
movl $0x2, %edx
jmp 0x1038d
movl $0x4, %edx
leaq 0x40(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x5380
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x103b8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x28c5f(%rip), %rsi     # 0x39029
leaq 0x28c5a(%rip), %rdx     # 0x3902b
callq 0xbdac
cmpb $0x0, 0x130(%r15)
jne 0x10466
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x10466
movq 0x88(%r15), %rcx
leaq 0x28(%rsp), %rdx
movq %rcx, (%rdx)
leaq 0x34(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x30(%rsp), %r8
movl $0x0, (%r8)
movq %rsp, %rsi
movq %r15, %rdi
callq 0x16804
testb %al, %al
je 0x10466
movq 0x28(%rsp), %rsi
movzbl -0x1(%rsi), %eax
cmpl $0x68, %eax
jg 0x10440
movl $0x1, %edx
cmpl $0x41, %eax
je 0x10456
cmpl $0x63, %eax
je 0x10456
jmp 0x10466
cmpl $0x69, %eax
je 0x10451
cmpl $0x73, %eax
jne 0x10466
movl $0x2, %edx
jmp 0x10456
movl $0x4, %edx
leaq 0x3c(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x5380
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x10481
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x28b8d(%rip), %rsi     # 0x39020
leaq 0x28b88(%rip), %rdx     # 0x39022
callq 0xbdac
cmpb $0x0, 0x130(%r15)
jne 0x1052f
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x1052f
movq 0x88(%r15), %rcx
leaq 0x28(%rsp), %rdx
movq %rcx, (%rdx)
leaq 0x34(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x30(%rsp), %r8
movl $0x0, (%r8)
movq %rsp, %rsi
movq %r15, %rdi
callq 0x16804
testb %al, %al
je 0x1052f
movq 0x28(%rsp), %rsi
movzbl -0x1(%rsi), %eax
cmpl $0x68, %eax
jg 0x10509
movl $0x1, %edx
cmpl $0x41, %eax
je 0x1051f
cmpl $0x63, %eax
je 0x1051f
jmp 0x1052f
cmpl $0x69, %eax
je 0x1051a
cmpl $0x73, %eax
jne 0x1052f
movl $0x2, %edx
jmp 0x1051f
movl $0x4, %edx
leaq 0x38(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x5380
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1054a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq 0xb8(%r15), %r14
cmpq 0xc0(%r15), %r14
je 0x1099f
leaq 0x28(%r15), %rax
movq %rax, 0x78(%rsp)
leaq 0x48(%rsp), %r13
leaq 0x20(%rsp), %rbx
cmpl $0x15, 0x4(%r14)
movb (%r14), %al
jb 0x1096f
cmpb $0x49, %al
jne 0x1074b
movq 0x50(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x3fa36(%rip), %rdi     # 0x4ffd0
callq 0x54f0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x292b8(%rip), %rbp     # 0x39869
movq %rbp, %rsi
callq 0x54f0
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x5410
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x54f0
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x5410
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x54f0
movl $0xc, %edx
movq %r12, %rdi
leaq 0x28c8e(%rip), %rsi     # 0x39296
callq 0x54f0
movl $0x1, %edx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x54f0
movl 0x4(%r14), %esi
movq %r12, %rdi
callq 0x52d0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x54f0
cvtss2sd 0x44(%rsp), %xmm0
movq %r12, %rdi
callq 0x56e0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x54f0
movl 0x40(%rsp), %esi
movq %r12, %rdi
callq 0x5780
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x54f0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x54f0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x54f0
movl 0x3c(%rsp), %esi
movq %r12, %rdi
callq 0x5780
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x54f0
movl 0x38(%rsp), %esi
movq %r12, %rdi
callq 0x5780
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x54f0
movq 0x48(%rsp), %rdx
movl 0x4(%r14), %ecx
movq %rsp, %rdi
movq 0x78(%rsp), %rsi
callq 0x5490
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rdi
callq 0x54f0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x5430
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52e0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x10748
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movb (%r14), %al
cmpb $0x44, %al
jne 0x1096f
movq 0x50(%rsp), %r13
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x3f869(%rip), %rdi     # 0x4ffd0
callq 0x54f0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x290eb(%rip), %rbx     # 0x39869
movq %rbx, %rsi
callq 0x54f0
movq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x5410
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x54f0
movl 0x4(%r14), %esi
addq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x5410
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x54f0
movl $0xc, %edx
movq %r12, %rdi
leaq 0x28aca(%rip), %rsi     # 0x392a3
callq 0x54f0
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x54f0
movl 0x4(%r14), %esi
movq %r12, %rdi
callq 0x52d0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x54f0
cvtss2sd 0x44(%rsp), %xmm0
movq %r12, %rdi
callq 0x56e0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x54f0
movl 0x40(%rsp), %esi
movq %r12, %rdi
callq 0x5780
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x54f0
movq (%r15), %rsi
movq %r15, %rbp
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x54f0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x54f0
movl 0x3c(%rsp), %esi
movq %r12, %rdi
callq 0x5780
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x54f0
movl 0x38(%rsp), %esi
movq %r12, %rdi
callq 0x5780
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x54f0
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %r13
movq %r13, %rdi
callq 0xbd16
movl 0x20(%rsp), %ecx
movl 0x4(%r14), %r8d
movq %rsp, %rdi
movq 0x80(%rsp), %rsi
movq %r13, %rdx
callq 0x13efa
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r12, %rdi
callq 0x54f0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x5430
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52e0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
leaq 0x48(%rsp), %r13
je 0x10948
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %rbx
je 0x10969
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5470
movb (%r14), %al
movq %rbp, %r15
movl 0x4(%r14), %esi
movsbl %al, %edi
movq %r13, %rdx
callq 0xec10
movsbl (%r14), %edi
movl 0x4(%r14), %esi
movq %rbx, %rdx
callq 0xec5b
addq $0x8, %r14
cmpq 0xc0(%r15), %r14
jne 0x10571
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x109fd
jmp 0x109fd
jmp 0x109fd
jmp 0x109fd
jmp 0x109bf
jmp 0x109bf
jmp 0x109bf
movq %rax, %rbx
jmp 0x10a1b
movq %rax, %rbx
jmp 0x109e7
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x109e7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x10a1b
movq 0x68(%rsp), %rsi
jmp 0x10a13
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x10a1b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rbx, %rdi
callq 0x57b0