// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ebwt_search_backtrack.h
// Function: GreedyDFSRangeSource::backtrack(unsigned int)
bool backtrack(uint32_t ham = 0) {
		assert_gt(_qry->length(), 0);
		assert_leq(_qlen, _qry->length());
		assert_geq(_qual->length(), _qry->length());
		const Ebwt& ebwt = *_ebwt;
		int ftabChars = ebwt._eh._ftabChars;
		int nsInSeed = 0; int nsInFtab = 0;
		if(!tallyNs(nsInSeed, nsInFtab)) {
			// No alignments are possible because of the distribution
			// of Ns in the read in combination with the backtracking
			// constraints.
			return false;
		}
		bool ret;
		// m = depth beyond which ftab must not extend or else we might
		// miss some legitimate paths
		uint32_t m = min<uint32_t>(_unrevOff, (uint32_t)_qlen);
		if(nsInFtab == 0 && m >= (uint32_t)ftabChars) {
			uint32_t ftabOff = calcFtabOff();
			TIndexOffU top = ebwt.ftabHi(ftabOff);
			TIndexOffU bot = ebwt.ftabLo(ftabOff+1);
			if(_qlen == (TIndexOffU)ftabChars && bot > top) {
				// We have a match!
				if(_reportPartials > 0) {
					// Oops - we're trying to find seedlings, so we've
					// gone too far; start again
					ret = backtrack(0,   // depth
					                0,   // top
					                0,   // bot
					                ham,
					                nsInFtab > 0);
				} else {
					// We have a match!
					ret = reportAlignment(0, top, bot, ham);
				}
			} else if (bot > top) {
				// We have an arrow pair from which we can backtrack
				ret = backtrack(ftabChars, // depth
				                top,       // top
				                bot,       // bot
				                ham,
				                nsInFtab > 0);
			} else {
				// The arrows are already closed; give up
				ret = false;
			}
		} else {
			// The ftab *does* extend past the unrevisitable portion;
			// we can't use it in this case, because we might jump past
			// a legitimate mismatch
			ret = backtrack(0,   // depth
			                0,   // top
			                0,   // bot
			                ham,
			                // disable ftab jumping if there is more
			                // than 1 N in it
			                nsInFtab > 0);
		}
		if(finalize()) ret = true;
		return ret;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x20(%rdi), %r15
movl 0x124(%r15), %r14d
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
movq %rsp, %rdx
andl $0x0, (%rdx)
callq 0x34de2
testb %al, %al
je 0x34926
movl 0x8(%rbx), %ecx
movl 0x30(%rbx), %eax
cmpl %ecx, %eax
cmovbl %eax, %ecx
movl (%rsp), %eax
testl %eax, %eax
jne 0x3492a
cmpl %r14d, %ecx
jb 0x3492a
movq %rbx, %rdi
callq 0x34e7a
movl %eax, %r13d
movq %r15, %rdi
movl %eax, %esi
callq 0x230f4
movl %eax, %r12d
incl %r13d
movq %r15, %rdi
movl %r13d, %esi
callq 0x23118
cmpl %r12d, %eax
jbe 0x34960
cmpq %r14, 0x8(%rbx)
jne 0x34960
cmpl $0x0, 0xa0(%rbx)
je 0x34981
xorl %r9d, %r9d
cmpl $0x0, (%rsp)
jmp 0x3492f
xorl %eax, %eax
jmp 0x34951
xorl %r9d, %r9d
testl %eax, %eax
setg %r9b
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x34eba
movl %eax, %ebp
movq %rbx, %rdi
callq 0x35036
orb %bpl, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl %r12d, %eax
jbe 0x3497d
xorl %r9d, %r9d
cmpl $0x0, (%rsp)
setg %r9b
movq %rbx, %rdi
movl %r14d, %esi
movl %r12d, %edx
movl %eax, %ecx
jmp 0x3493c
xorl %ebp, %ebp
jmp 0x34946
movzwl %bp, %r8d
movq %rbx, %rdi
xorl %esi, %esi
movl %r12d, %edx
movl %eax, %ecx
callq 0x34f50
jmp 0x34944