// File: BenLangmead[P]bowtie/./ebwt_search_backtrack.h
// Function: GreedyDFSRangeSource::reportAlignment(unsigned int, unsigned int, unsigned int, unsigned short)
bool reportAlignment(uint32_t stackDepth, TIndexOffU top,
			TIndexOffU bot, uint16_t cost)
	{
#ifndef NDEBUG
		// No two elements of _mms[] should be the same
		assert_geq(_mms.size(), stackDepth);
		for(size_t i = 0; i < stackDepth; i++) {
			for(size_t j = i+1; j < stackDepth; j++) {
				assert_neq(_mms[j], _mms[i]);
			}
			// All elements of _mms[] should fall within bounds
			assert_lt(_mms[i], _qlen);
		}
#endif
		if(_reportPartials) {
			assert_leq(stackDepth, _reportPartials);
			if(stackDepth > 0) {
				// Report this partial alignment.  A partial alignment
				// is defined purely by its mismatches; top and bot are
				// ignored.
				reportPartial(stackDepth);
			}
			return false; // keep going - we want to find all partial alignments
		}
		int stratum = 0;
		if(stackDepth > 0) {
			stratum = calcStratum(_mms, stackDepth);
		}
		assert_lt(stratum, 4);
		assert_geq(stratum, 0);
		bool hit;
		// If _muts != NULL then this alignment extends a partial
		// alignment, so we have to account for the differences present
		// in the partial.
		if(_muts != NULL) {
			// Undo partial-alignment mutations to get original _qry
			ASSERT_ONLY(BTDnaString tmp = (*_qry));
			undoPartialMutations();
			assert_neq(tmp, (*_qry));
			// Add the partial-alignment mutations to the _mms[] array
			promotePartialMutations(stackDepth);
			// All muts are in the seed, so they count toward the stratum
			size_t numMuts = _muts->size();
			stratum += numMuts;
			cost |= (stratum << 14);
			assert_geq(cost, (uint32_t)(stratum << 14));
			// Report the range of full alignments
			hit = reportFullAlignment((uint32_t)(stackDepth + numMuts), top, bot, stratum, cost);
			// Re-apply partial-alignment mutations
			applyPartialMutations();
			assert_eq(tmp, (*_qry));
		} else {
			// Report the range of full alignments
			cost |= (stratum << 14);
			assert_geq(cost, (uint32_t)(stratum << 14));
			hit = reportFullAlignment(stackDepth, top, bot, stratum, cost);
		}
		return hit;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movw %r8w, %ax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movw %ax, -0x1e(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, 0xa0(%rax)
je 0x67489
cmpl $0x0, -0x14(%rbp)
jbe 0x67480
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x69600
movb $0x0, -0x1(%rbp)
jmp 0x6756a
movl $0x0, -0x24(%rbp)
cmpl $0x0, -0x14(%rbp)
jbe 0x674ac
movq -0x38(%rbp), %rdi
movq %rdi, %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
callq 0x699f0
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
je 0x67532
movq -0x38(%rbp), %rdi
callq 0x69a70
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x69b10
movq -0x38(%rbp), %rax
movq 0xb0(%rax), %rdi
callq 0x69ca0
movq -0x38(%rbp), %rdi
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movslq -0x24(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %ecx
shll $0xe, %ecx
movzwl -0x1e(%rbp), %eax
orl %ecx, %eax
movw %ax, -0x1e(%rbp)
movl -0x14(%rbp), %eax
addq -0x30(%rbp), %rax
movl %eax, %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %r8d
movzwl -0x1e(%rbp), %r9d
callq 0x69cc0
movq -0x38(%rbp), %rdi
andb $0x1, %al
movb %al, -0x25(%rbp)
callq 0x69e60
jmp 0x67562
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %ecx
shll $0xe, %ecx
movzwl -0x1e(%rbp), %eax
orl %ecx, %eax
movw %ax, -0x1e(%rbp)
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %r8d
movzwl -0x1e(%rbp), %r9d
callq 0x69cc0
andb $0x1, %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop