// File: /workspace/github_cpp_makefile_star2_O1/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 0x1b55c(%rip), %r14     # 0x6afb0
leaq 0x70cd(%rip), %rsi      # 0x56b28
movl $0x8, %edx
movq %r14, %rdi
callq 0x9560
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1fe01
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 0x708d(%rip), %rsi      # 0x56b31
movl $0x8, %edx
movq %r14, %rdi
callq 0x9560
testb %bpl, %bpl
je 0x4fb06
testq %r15, %r15
je 0x4fb57
xorl %r14d, %r14d
movq 0x1b4e7(%rip), %rbx     # 0x6afb0
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 0x4face
jmp 0x4fb57
testl %r15d, %r15d
jle 0x4fb57
leal 0x1(%r15), %r14d
movq 0x1b49a(%rip), %rbx     # 0x6afb0
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
jg 0x4fb1b
movq 0x1b452(%rip), %r14     # 0x6afb0
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 0x8944(%rip), %rsi      # 0x584d0
movl $0x8, %edx
movq %r14, %rdi
callq 0x9560
testl %r15d, %r15d
jle 0x4fc08
leaq 0x8997(%rip), %r13      # 0x5853c
leaq 0x4c76(%rip), %rbx      # 0x54822
leaq 0x715a(%rip), %rbp      # 0x56d0d
movq 0x1b3f6(%rip), %r12     # 0x6afb0
movq %r13, %rsi
cmpl 0x14(%rsp), %r15d
jle 0x4fbef
movq %rbx, %rsi
cmpl 0x10(%rsp), %r15d
jle 0x4fbef
movq %rbp, %rsi
cmpl 0x50(%rsp), %r15d
jle 0x4fbef
cmpl 0x58(%rsp), %r15d
leaq 0x492d(%rip), %rsi      # 0x54511
leaq 0x88ee(%rip), %rax      # 0x584d9
cmovgq %rax, %rsi
decl %r15d
movl $0x1, %edx
movq %r12, %rdi
callq 0x9560
leal 0x1(%r15), %eax
cmpl $0x1, %eax
jg 0x4fbba
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