// File: /workspace/github_cpp_makefile_star2_O3/BenLangmead[P]bowtie/ebwt_search_util.cpp
// Function: printHit(EList<SString<char>, 128> const&, Hit const&, SDnaStringExpandable<25, 2> const&, unsigned long, unsigned int, unsigned int, unsigned int, unsigned int, bool)
void printHit(const EList<BTRefString >& os,
              const Hit& h,
              const BTDnaString& qry,
              size_t qlen,
              uint32_t unrevOff,
              uint32_t oneRevOff,
              uint32_t twoRevOff,
              uint32_t threeRevOff,
              bool ebwtFw)
{
	// Print pattern sequence
	cout << "  Pat:  " << qry << endl;
	// Print text sequence
	cout << "  Tseg: ";
	if(ebwtFw) {
		for(size_t i = 0; i < qlen; i++) {
			cout << os[h.h.first][h.h.second + i];
		}
	} else {
		for(int i = (int)qlen-1; i >= 0; i--) {
			cout << os[h.h.first][h.h.second + i];
		}
	}
	cout << endl;
	cout << "  Bt:   ";
	for(int i = (int)qlen-1; i >= 0; i--) {
		if     (i < (int)unrevOff)    cout << "0";
		else if(i < (int)oneRevOff)   cout << "1";
		else if(i < (int)twoRevOff)   cout << "2";
		else if(i < (int)threeRevOff) cout << "3";
		else cout << "X";
	}
	cout << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0x10(%rsp)
movl %r8d, 0x14(%rsp)
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r13
movb 0x60(%rsp), %bpl
movq 0x1b8e0(%rip), %r14     # 0x69fb0
leaq 0x7531(%rip), %rsi      # 0x55c08
movl $0x8, %edx
movq %r14, %rdi
callq 0x9560
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1fb3f
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9050
movq %rax, %rdi
callq 0x92f0
leaq 0x74f1(%rip), %rsi      # 0x55c11
movl $0x8, %edx
movq %r14, %rdi
callq 0x9560
testb %bpl, %bpl
je 0x4e782
testq %r15, %r15
je 0x4e7d3
xorl %r14d, %r14d
movq 0x1b86b(%rip), %rbx     # 0x69fb0
leaq 0xe(%rsp), %rbp
movl (%r12), %eax
movl 0x4(%r12), %ecx
movq 0x8(%r13), %rdx
shlq $0x5, %rax
addq 0x8(%rdx,%rax), %rcx
movb (%r14,%rcx), %al
movb %al, 0xe(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x9560
incq %r14
cmpq %r14, %r15
jne 0x4e74a
jmp 0x4e7d3
testl %r15d, %r15d
jle 0x4e7d3
leal 0x1(%r15), %r14d
movq 0x1b81e(%rip), %rbx     # 0x69fb0
leaq 0xf(%rsp), %rbp
movl (%r12), %eax
movl 0x4(%r12), %ecx
movq 0x8(%r13), %rdx
addl %r14d, %ecx
addl $-0x2, %ecx
shlq $0x5, %rax
movq 0x8(%rdx,%rax), %rax
movb (%rax,%rcx), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x9560
decl %r14d
cmpl $0x1, %r14d
ja 0x4e797
movq 0x1b7d6(%rip), %r14     # 0x69fb0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r14, %rdi
callq 0x9050
movq %rax, %rdi
callq 0x92f0
leaq 0x8daa(%rip), %rsi      # 0x575b2
movl $0x8, %edx
movq %r14, %rdi
callq 0x9560
testl %r15d, %r15d
jle 0x4e884
leaq 0x8dfd(%rip), %r13      # 0x5761e
leaq 0x50da(%rip), %rbx      # 0x53902
leaq 0x75be(%rip), %rbp      # 0x55ded
movq 0x1b77a(%rip), %r12     # 0x69fb0
movq %r13, %rsi
cmpl 0x14(%rsp), %r15d
jle 0x4e86b
movq %rbx, %rsi
cmpl 0x10(%rsp), %r15d
jle 0x4e86b
movq %rbp, %rsi
cmpl 0x50(%rsp), %r15d
jle 0x4e86b
cmpl 0x58(%rsp), %r15d
leaq 0x4d91(%rip), %rsi      # 0x535f1
leaq 0x8d54(%rip), %rax      # 0x575bb
cmovgq %rax, %rsi
decl %r15d
movl $0x1, %edx
movq %r12, %rdi
callq 0x9560
leal 0x1(%r15), %eax
cmpl $0x1, %eax
ja 0x4e836
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r14, %rdi
callq 0x9050
movq %rax, %rdi
callq 0x92f0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop