// File: /workspace/github_cpp_makefile_star2_O1/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 0x28da8(%rip), %rsi     # 0x390b6
leaq 0x28da3(%rip), %rdx     # 0x390b8
movq %rsp, %rdi
callq 0xbe08
cmpb $0x0, 0x130(%r15)
jne 0x103d0
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x103d0
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 0x1693a
testb %al, %al
je 0x103d0
movq 0x28(%rsp), %rsi
movzbl -0x1(%rsi), %eax
addl $-0x41, %eax
cmpl $0x32, %eax
ja 0x103d0
movabsq $0x400000005, %rcx      # imm = 0x400000005
btq %rax, %rcx
jb 0x103a4
movabsq $0x12000000100, %rcx    # imm = 0x12000000100
btq %rax, %rcx
jae 0x103ab
movl $0x4, %edx
jmp 0x103c0
movl $0x1, %edx
jmp 0x103c0
movabsq $0x4000000040000, %rcx  # imm = 0x4000000040000
btq %rax, %rcx
jae 0x103d0
movl $0x2, %edx
leaq 0x44(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x5380
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x103eb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x28c29(%rip), %rsi     # 0x39026
leaq 0x28c24(%rip), %rdx     # 0x39028
callq 0xbe08
cmpb $0x0, 0x130(%r15)
jne 0x10499
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x10499
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 0x1693a
testb %al, %al
je 0x10499
movq 0x28(%rsp), %rsi
movzbl -0x1(%rsi), %eax
cmpl $0x68, %eax
jg 0x10473
movl $0x1, %edx
cmpl $0x41, %eax
je 0x10489
cmpl $0x63, %eax
je 0x10489
jmp 0x10499
cmpl $0x69, %eax
je 0x10484
cmpl $0x73, %eax
jne 0x10499
movl $0x2, %edx
jmp 0x10489
movl $0x4, %edx
leaq 0x40(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x5380
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x104b4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x28b63(%rip), %rsi     # 0x39029
leaq 0x28b5e(%rip), %rdx     # 0x3902b
callq 0xbe08
cmpb $0x0, 0x130(%r15)
jne 0x10562
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x10562
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 0x1693a
testb %al, %al
je 0x10562
movq 0x28(%rsp), %rsi
movzbl -0x1(%rsi), %eax
cmpl $0x68, %eax
jg 0x1053c
movl $0x1, %edx
cmpl $0x41, %eax
je 0x10552
cmpl $0x63, %eax
je 0x10552
jmp 0x10562
cmpl $0x69, %eax
je 0x1054d
cmpl $0x73, %eax
jne 0x10562
movl $0x2, %edx
jmp 0x10552
movl $0x4, %edx
leaq 0x3c(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x5380
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1057d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x28a91(%rip), %rsi     # 0x39020
leaq 0x28a8c(%rip), %rdx     # 0x39022
callq 0xbe08
cmpb $0x0, 0x130(%r15)
jne 0x1062b
movq 0x90(%r15), %rax
testq %rax, %rax
je 0x1062b
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 0x1693a
testb %al, %al
je 0x1062b
movq 0x28(%rsp), %rsi
movzbl -0x1(%rsi), %eax
cmpl $0x68, %eax
jg 0x10605
movl $0x1, %edx
cmpl $0x41, %eax
je 0x1061b
cmpl $0x63, %eax
je 0x1061b
jmp 0x1062b
cmpl $0x69, %eax
je 0x10616
cmpl $0x73, %eax
jne 0x1062b
movl $0x2, %edx
jmp 0x1061b
movl $0x4, %edx
leaq 0x38(%rsp), %rdi
movl $0x0, (%rdi)
callq 0x5380
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x10646
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq 0xb8(%r15), %r14
cmpq 0xc0(%r15), %r14
je 0x10a97
leaq 0x28(%r15), %rax
movq %rax, 0x78(%rsp)
leaq 0x48(%rsp), %r13
leaq 0x20(%rsp), %rbx
cmpl $0x15, 0x4(%r14)
jb 0x10a66
cmpb $0x49, (%r14)
jne 0x10843
movq 0x50(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x3f93b(%rip), %rdi     # 0x4ffd0
callq 0x54f0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x291bd(%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 0x28b93(%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 0x10843
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
cmpb $0x44, (%r14)
jne 0x10a66
movq 0x50(%rsp), %r13
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x3f76f(%rip), %rdi     # 0x4ffd0
callq 0x54f0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x28ff1(%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 0x289d0(%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 0xbd78
movl 0x20(%rsp), %ecx
movl 0x4(%r14), %r8d
movq %rsp, %rdi
movq 0x80(%rsp), %rsi
movq %r13, %rdx
callq 0x14010
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 0x10a42
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20(%rsp), %rbx
je 0x10a63
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rbp, %r15
movsbl (%r14), %edi
movl 0x4(%r14), %esi
movq %r13, %rdx
callq 0xecd0
movsbl (%r14), %edi
movl 0x4(%r14), %esi
movq %rbx, %rdx
callq 0xed27
addq $0x8, %r14
cmpq 0xc0(%r15), %r14
jne 0x1066d
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10af5
jmp 0x10af5
jmp 0x10af5
jmp 0x10af5
jmp 0x10ab7
jmp 0x10ab7
jmp 0x10ab7
movq %rax, %rbx
jmp 0x10b13
movq %rax, %rbx
jmp 0x10adf
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x10adf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x10b13
movq 0x68(%rsp), %rsi
jmp 0x10b0b
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x10b13
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5470
movq %rbx, %rdi
callq 0x57b0