// File: /workspace/github_cpp_makefile_star2_O1/BenLangmead[P]bowtie/./ebwt_search_backtrack.h
// Function: EbwtSeededRangeSourceDriver::advanceImpl(int)
virtual void advanceImpl(int until) {
		assert(!this->done);
		assert(!this->foundRange);
		assert_gt(rsFull_.minCost, 0);
		// Advance the seed range source
		if(rsSeed_->done && rsFull_.done &&
		   !rsSeed_->foundRange && !rsFull_.foundRange)
		{
			this->done = true;
			return;
		}
		if(rsSeed_->done && !rsSeed_->foundRange) {
			rsSeed_->minCost = 0xffff;
			if(rsFull_.minCost > this->minCost) {
				this->minCost = rsFull_.minCost;
				// Cost changed, so return
				return;
			}
		}
		if(rsFull_.done && !rsFull_.foundRange) {
			rsFull_.minCost = 0xffff;
			if(rsSeed_->minCost > this->minCost) {
				this->minCost = rsSeed_->minCost;
				// Cost changed, so return
				return;
			}
		}
		assert(rsSeed_->minCost != 0xffff || rsFull_.minCost != 0xffff);
		// Extend a partial alignment
		ASSERT_ONLY(uint16_t oldMinCost = this->minCost);
		assert_eq(this->minCost, min<uint16_t>(rsSeed_->minCost, rsFull_.minCost));
		bool doFull = rsFull_.minCost <= rsSeed_->minCost;
		if(!doFull) {
			// Advance the partial-alignment generator
			assert_eq(rsSeed_->minCost, this->minCost);
			if(!rsSeed_->foundRange) {
				rsSeed_->advance(until);
			}
			if(rsSeed_->foundRange) {
				assert_eq(this->minCost, rsSeed_->range().cost);
				assert_eq(oldMinCost, rsSeed_->range().cost);
				seedRange_ = &rsSeed_->range();
				rsSeed_->foundRange = false;
				assert_geq(seedRange_->cost, this->minCostAdjustment_);
				this->minCostAdjustment_ = seedRange_->cost;
				assert_gt(seedRange_->numMms, 0);
				// Keep the range for the hi-half partial alignment so
				// that the driver can (a) modify the pattern string
				// and (b) modify results from the RangeSource to
				// include these edits.
				EbwtRangeSourceDriver *partial = rsFact_->create();
				partial->minCost = seedRange_->cost;
				rsFull_.minCost = seedRange_->cost;
				rsFull_.addSource(partial, seedRange_);
				if(rsFull_.foundRange) {
					this->foundRange = true;
					rsFull_.foundRange = false;
					assert(rsFull_.range().repOk());
					assert_eq(range().cost, oldMinCost);
				}
			}
			if(rsSeed_->minCost > this->minCost) {
				this->minCost = rsSeed_->minCost;
				if(!rsFull_.done) {
					this->minCost = min(this->minCost, rsFull_.minCost);
					assert_eq(this->minCost, min<uint16_t>(rsSeed_->minCost, rsFull_.minCost));
				}
			}
		} else {
			// Extend a full alignment
			assert(!rsFull_.done);
			assert(!rsFull_.foundRange);
			uint16_t oldFullCost = rsFull_.minCost;
			if(!rsFull_.foundRange) {
				rsFull_.advance(until);
			}
			// Found a minimum-cost range
			if(rsFull_.foundRange) {
				this->foundRange = true;
				rsFull_.foundRange = false;
				assert(rsFull_.range().repOk());
				assert_eq(range().cost, oldMinCost);
			}
			assert_geq(rsFull_.minCost, oldFullCost);
			// Did the min cost change?
			if(rsFull_.minCost > oldFullCost) {
				// If a range was found, hold on to it and save it for
				// later.  Update the minCost.
				assert(!rsSeed_->done || rsSeed_->minCost == 0xffff);
				this->minCost = min(rsFull_.minCost, rsSeed_->minCost);
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0xa8(%rdi), %rax
movb 0x9(%rax), %cl
cmpb $0x1, %cl
jne 0x30228
cmpb $0x1, 0x21(%rbx)
jne 0x3020a
cmpb $0x0, 0x8(%rax)
jne 0x3020a
cmpb $0x0, 0x20(%rbx)
je 0x30366
testb %cl, %cl
je 0x30228
cmpb $0x0, 0x8(%rax)
jne 0x30228
movw $0xffff, 0xa(%rax)      # imm = 0xFFFF
movzwl 0x22(%rbx), %eax
cmpw 0xa(%rbx), %ax
ja 0x3035d
cmpb $0x1, 0x21(%rbx)
jne 0x3024f
cmpb $0x0, 0x20(%rbx)
jne 0x3024f
movw $0xffff, 0x22(%rbx)     # imm = 0xFFFF
movq 0xa8(%rbx), %rax
movzwl 0xa(%rax), %eax
cmpw 0xa(%rbx), %ax
ja 0x3035d
leaq 0x18(%rbx), %r14
movzwl 0x22(%rbx), %ebp
movq 0xa8(%rbx), %rdi
cmpw 0xa(%rdi), %bp
jbe 0x30316
cmpb $0x0, 0x8(%rdi)
jne 0x30274
movq (%rdi), %rax
callq *0x20(%rax)
movq 0xa8(%rbx), %rdi
cmpb $0x1, 0x8(%rdi)
jne 0x302e8
movq (%rdi), %rax
callq *0x30(%rax)
movq %rax, 0xc0(%rbx)
movq 0xa8(%rbx), %rax
movb $0x0, 0x8(%rax)
movq 0x10(%rbx), %rdi
movq 0xc0(%rbx), %rax
movzwl 0x8(%rax), %eax
movw %ax, 0xc(%rbx)
callq 0x30afc
movq 0xc0(%rbx), %rcx
movzwl 0x8(%rcx), %ecx
movw %cx, 0xa(%rax)
movq 0xc0(%rbx), %rdx
movzwl 0x8(%rdx), %ecx
movw %cx, 0x22(%rbx)
movq %r14, %rdi
movq %rax, %rsi
callq 0x30c16
cmpb $0x1, 0x20(%rbx)
jne 0x302e8
movb $0x1, 0x8(%rbx)
movb $0x0, 0x20(%rbx)
movq 0xa8(%rbx), %rax
movzwl 0xa(%rax), %eax
cmpw 0xa(%rbx), %ax
jbe 0x30361
movw %ax, 0xa(%rbx)
cmpb $0x0, 0x21(%rbx)
jne 0x30361
movzwl 0x22(%rbx), %ecx
cmpw %ax, %cx
jb 0x30310
movzwl 0xa(%rbx), %ecx
movw %cx, 0xa(%rbx)
jmp 0x30361
cmpb $0x0, 0x20(%rbx)
jne 0x30332
cmpl $0x3, %esi
movl $0x2, %eax
cmovgel %esi, %eax
movq (%r14), %rcx
movq %r14, %rdi
movl %eax, %esi
callq *0x28(%rcx)
cmpb $0x1, 0x20(%rbx)
jne 0x30340
movb $0x1, 0x8(%rbx)
movb $0x0, 0x20(%rbx)
movzwl 0x22(%rbx), %ecx
cmpw %bp, %cx
jbe 0x30361
movq 0xa8(%rbx), %rax
movzwl 0xa(%rax), %eax
cmpw %cx, %ax
jb 0x3035d
movzwl 0x22(%rbx), %eax
movw %ax, 0xa(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movb $0x1, 0x9(%rbx)
jmp 0x30361