// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ebwt.h
// Function: Ebwt::reportChaseOne(SDnaStringExpandable<25, 2> const&, SStringExpandable<char, 25, 2, 0>*, SStringExpandable<char, 25, 2, 0>*, EList<unsigned int, 128> const&, EList<unsigned char, 128> const&, unsigned long, unsigned int, unsigned int, unsigned int, unsigned int, int, unsigned short, unsigned int, unsigned int, EbwtSearchParams const&, SideLocus*) const
inline bool Ebwt::reportChaseOne(const BTDnaString& query,
                                       BTString* quals,
                                       BTString* name,
                                       const EList<TIndexOffU>& mmui32,
                                       const EList<uint8_t>& refcs,
                                       size_t numMms,
                                       TIndexOffU i,
                                       TIndexOffU top,
                                       TIndexOffU bot,
                                       uint32_t qlen,
                                       int stratum,
                                       uint16_t cost,
                                       uint32_t patid,
                                       uint32_t seed,
                                       const EbwtSearchParams& params,
                                       SideLocus *l) const
{
	VMSG_NL("In reportChaseOne");
	TIndexOffU off;
	uint32_t jumps = 0;
	ASSERT_ONLY(uint32_t origi = i);
	SideLocus myl;
	const TIndexOffU offMask = this->_eh._offMask;
	const uint32_t offRate = this->_eh._offRate;
	const TIndexOffU* offs = this->_offs;
	// If the caller didn't give us a pre-calculated (and prefetched)
	// locus, then we have to do that now
	if(l == NULL) {
		l = &myl;
		l->initFromRow(i, this->_eh, this->_ebwt);
	}
	assert(l != NULL);
	assert(l->valid());
	// Walk along until we reach the next marked row to the left
	while(((i & offMask) != i) && i != _zOff) {
		// Not a marked row; walk left one more char
		TIndexOffU newi = mapLF(*l); // calc next row
		assert_neq(newi, i);
		i = newi;                                  // update row
		l->initFromRow(i, this->_eh, this->_ebwt); // update locus
		jumps++;
	}
	// This is a marked row
	if(i == _zOff) {
		// Special case: it's the row corresponding to the
		// lexicographically smallest suffix, which is implicitly
		// marked 0
		off = jumps;
		VMSG_NL("reportChaseOne found zoff off=" << off << " (jumps=" << jumps << ")");
	} else {
		// Normal marked row, calculate offset of row i
		off = offs[i >> offRate] + jumps;
		VMSG_NL("reportChaseOne found off=" << off << " (jumps=" << jumps << ")");
	}
#ifndef NDEBUG
	{
		uint32_t rcoff = RowChaser::toFlatRefOff(this, qlen, origi);
		assert_eq(rcoff, off);
	}
#endif
	return report(query, quals, name, mmui32, refcs, numMms, off, top, bot,
	              qlen, stratum, cost, patid, seed, params);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
cmpb $0x1, 0xc(%rdi)
jne 0x36ad4
leaq 0x70(%rsp), %rdi
callq 0x9340
leaq 0x80(%rsp), %rdi
leaq 0x14624(%rip), %rsi     # 0x4b0b8
callq 0x94e0
movq %rax, %rdi
callq 0x9210
leaq 0x88(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x97f0
leaq 0x10(%rsp), %rsi
movq %rbp, %rdi
callq 0x15e38
leaq 0x10(%rsp), %rdi
callq 0x9a68
leaq 0x70(%rsp), %rdi
callq 0x9390
movq %r13, 0x48(%rsp)
movq %r12, 0x50(%rsp)
movq %r15, 0x58(%rsp)
movq %r14, 0x60(%rsp)
movq %rbx, 0x68(%rsp)
andq $0x0, 0x30(%rsp)
andw $0x0, 0x38(%rsp)
movb $0x1, 0x3a(%rsp)
orw $-0x1, 0x3c(%rsp)
movq 0x280(%rsp), %r12
movl 0x238(%rsp), %ebx
movb $-0x1, 0x3e(%rsp)
leaq 0xf8(%rbp), %r15
movl 0x118(%rbp), %r14d
movl 0x114(%rbp), %eax
movl %eax, 0xc(%rsp)
movq 0xa8(%rbp), %rax
movq %rax, 0x40(%rsp)
testq %r12, %r12
jne 0x36b5a
movq 0xb8(%rbp), %rcx
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x15ee4
xorl %r13d, %r13d
notl %r14d
movl 0x68(%rbp), %eax
testl %r14d, %ebx
je 0x36b92
cmpl %eax, %ebx
je 0x36b92
movq %rbp, %rdi
movq %r12, %rsi
callq 0x15eac
movl %eax, %ebx
movq 0xb8(%rbp), %rcx
movq %r12, %rdi
movl %eax, %esi
movq %r15, %rdx
callq 0x15ee4
incl %r13d
jmp 0x36b60
cmpl %eax, %ebx
jne 0x36c39
cmpb $0x1, 0xc(%rbp)
jne 0x36ce3
leaq 0x70(%rsp), %rdi
callq 0x9340
leaq 0x80(%rsp), %rdi
leaq 0x1450d(%rip), %rsi     # 0x4b0ca
callq 0x94e0
movl %r13d, %ebx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x9310
leaq 0x14512(%rip), %rsi     # 0x4b0e9
movq %rax, %rdi
callq 0x94e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x9310
leaq 0x1466d(%rip), %rsi     # 0x4b25e
movq %rax, %rdi
callq 0x94e0
movq %rax, %rdi
callq 0x9210
leaq 0x88(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x97f0
leaq 0x10(%rsp), %rsi
movq %rbp, %rdi
callq 0x15e38
leaq 0x10(%rsp), %rdi
callq 0x9a68
leaq 0x70(%rsp), %rdi
callq 0x9390
jmp 0x36ce3
movl 0xc(%rsp), %ecx
shrl %cl, %ebx
movq 0x40(%rsp), %rax
movl (%rax,%rbx,4), %ebx
addl %r13d, %ebx
cmpb $0x1, 0xc(%rbp)
jne 0x36ce0
leaq 0x70(%rsp), %rdi
callq 0x9340
leaq 0x80(%rsp), %rdi
leaq 0x14485(%rip), %rsi     # 0x4b0f2
callq 0x94e0
movl %ebx, %esi
movq %rax, %rdi
callq 0x9310
leaq 0x14466(%rip), %rsi     # 0x4b0e9
movq %rax, %rdi
callq 0x94e0
movl %r13d, %esi
movq %rax, %rdi
callq 0x9310
leaq 0x145c1(%rip), %rsi     # 0x4b25e
movq %rax, %rdi
callq 0x94e0
movq %rax, %rdi
callq 0x9210
leaq 0x88(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x97f0
leaq 0x10(%rsp), %rsi
movq %rbp, %rdi
callq 0x15e38
leaq 0x10(%rsp), %rdi
callq 0x9a68
leaq 0x70(%rsp), %rdi
callq 0x9390
movl %ebx, %r13d
movzwl 0x260(%rsp), %eax
movq %rbp, %rdi
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %r8
movq 0x68(%rsp), %r9
pushq 0x278(%rsp)
movl 0x278(%rsp), %r10d
pushq %r10
movl 0x278(%rsp), %r10d
pushq %r10
pushq %rax
movl 0x278(%rsp), %eax
pushq %rax
movl 0x278(%rsp), %eax
pushq %rax
movl 0x278(%rsp), %eax
pushq %rax
movl 0x278(%rsp), %eax
pushq %rax
pushq %r13
pushq 0x278(%rsp)
callq 0x36da6
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x36d65
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9a68
jmp 0x36d93
jmp 0x36d90
jmp 0x36d90
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9a68
jmp 0x36d8c
jmp 0x36d89
movq %rax, %rbx
jmp 0x36d93
jmp 0x36d90
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x9390
movq %rbx, %rdi
callq 0x9950
nop