// File: BenLangmead[P]bowtie/./aligner.h
// Function: UnpairedAlignerV2<EbwtRangeSource>::advance()
virtual bool advance() {
		assert(!this->done);
		if(chase_) {
			assert(!rangeMode_);
			assert(driver_->foundRange);
			assert(!sinkPt_->irrelevantCost(driver_->range().cost));
			if(!rchase_->foundOff() && !rchase_->done) {
				rchase_->advance();
				return false;
			}
			if(rchase_->foundOff()) {
				this->done = report(driver_->range(), rchase_->off().first,
				                    rchase_->off().second, rchase_->tlen());
				rchase_->reset();
			} else {
				assert(rchase_->done);
				// Forget this range; keep looking for ranges
				chase_ = false;
				driver_->foundRange = false;
				this->done = driver_->done;
			}
		}
		// Still advancing a
		if(!this->done && !chase_) {
			assert(!driver_->done || driver_->foundRange);
			if(driver_->foundRange) {
				const Range& ra = driver_->range();
				assert(!sinkPt_->irrelevantCost(ra.cost));
				assert(ra.repOk());
				if(rangeMode_) {
					this->done = report(ra, ra.top, ra.bot, 0);
					driver_->foundRange = false;
				} else {
					rchase_->setTopBot(ra.top, ra.bot, alen_, rand_, ra.ebwt);
					if(rchase_->foundOff()) {
						this->done = report(
								ra, rchase_->off().first,
								rchase_->off().second, rchase_->tlen());
						rchase_->reset();
					}
					if(!rchase_->done && !sinkPt_->irrelevantCost(ra.cost)) {
						// Keep chasing this range
						chase_ = true;
					} else {
						driver_->foundRange = false;
					}
				}
			} else {
				this->done = sinkPt_->irrelevantCost(driver_->minCost);
				if(!this->done) {
					driver_->advance(ADV_COST_CHANGES);
				} else {
					// No longer necessarily true with chain input
					//assert(!sinkPt_->spanStrata());
				}
			}
			if(driver_->done && !driver_->foundRange && !chase_) {
				this->done = true;
			}
		}
		if(this->done) {
			sinkPt_->finishRead(*patsrc_, true, true);
		}
		return this->done;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
testb $0x1, 0x5a(%rax)
je 0x4b9b3
movq -0x40(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x4bee0
testb $0x1, %al
jne 0x4b8f2
movq -0x40(%rbp), %rax
movq 0x78(%rax), %rax
testb $0x1, (%rax)
jne 0x4b8f2
movq -0x40(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x4bf00
movb $0x0, -0x1(%rbp)
jmp 0x4bbe6
movq -0x40(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x4bee0
testb $0x1, %al
jne 0x4b908
jmp 0x4b98e
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq 0x78(%rax), %rdi
callq 0x4c360
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x18(%rbp)
movl -0x18(%rbp), %ecx
movl %ecx, -0x48(%rbp)
movq 0x78(%rax), %rdi
callq 0x4c360
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x20(%rbp)
movl -0x1c(%rbp), %ecx
movl %ecx, -0x44(%rbp)
movq 0x78(%rax), %rdi
callq 0x4c380
movq -0x50(%rbp), %rsi
movl -0x48(%rbp), %edx
movl -0x44(%rbp), %ecx
movq -0x40(%rbp), %rdi
movl %eax, %r8d
callq 0x4c010
movb %al, %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
movq 0x78(%rax), %rdi
callq 0x4c3a0
jmp 0x4b9b1
movq -0x40(%rbp), %rax
movb $0x0, 0x5a(%rax)
movq 0x80(%rax), %rcx
movb $0x0, 0x8(%rcx)
movq 0x80(%rax), %rcx
movb 0x9(%rcx), %cl
andb $0x1, %cl
movb %cl, 0x8(%rax)
jmp 0x4b9b3
movq -0x40(%rbp), %rax
testb $0x1, 0x8(%rax)
jne 0x4bbb7
movq -0x40(%rbp), %rax
testb $0x1, 0x5a(%rax)
jne 0x4bbb7
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rax
testb $0x1, 0x8(%rax)
je 0x4bb37
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x28(%rbp)
testb $0x1, 0x34(%rax)
je 0x4ba3f
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x28(%rbp), %rax
movl (%rax), %edx
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
xorl %r8d, %r8d
callq 0x4c010
movb %al, %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
movq 0x80(%rax), %rax
movb $0x0, 0x8(%rax)
jmp 0x4bb35
movq -0x40(%rbp), %r8
movq 0x78(%r8), %rdi
movq -0x28(%rbp), %rax
movl (%rax), %esi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edx
movl 0x20(%r8), %ecx
addq $0x38, %r8
movq -0x28(%rbp), %rax
movq 0x58(%rax), %r9
callq 0x4c3c0
movq -0x40(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x4bee0
testb $0x1, %al
jne 0x4ba7c
jmp 0x4baf0
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movq 0x78(%rax), %rdi
callq 0x4c360
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x30(%rbp)
movl -0x30(%rbp), %ecx
movl %ecx, -0x58(%rbp)
movq 0x78(%rax), %rdi
callq 0x4c360
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x38(%rbp)
movl -0x34(%rbp), %ecx
movl %ecx, -0x54(%rbp)
movq 0x78(%rax), %rdi
callq 0x4c380
movq -0x60(%rbp), %rsi
movl -0x58(%rbp), %edx
movl -0x54(%rbp), %ecx
movq -0x40(%rbp), %rdi
movl %eax, %r8d
callq 0x4c010
movb %al, %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
movq 0x78(%rax), %rdi
callq 0x4c3a0
movq -0x40(%rbp), %rax
movq 0x78(%rax), %rax
testb $0x1, (%rax)
jne 0x4bb24
movq -0x40(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x28(%rbp), %rax
movw 0x8(%rax), %cx
movq (%rdi), %rax
movzwl %cx, %esi
callq *0x38(%rax)
testb $0x1, %al
jne 0x4bb24
movq -0x40(%rbp), %rax
movb $0x1, 0x5a(%rax)
jmp 0x4bb33
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rax
movb $0x0, 0x8(%rax)
jmp 0x4bb35
jmp 0x4bb81
movq -0x40(%rbp), %rax
movq 0x68(%rax), %rdi
movq 0x80(%rax), %rax
movw 0xa(%rax), %cx
movq (%rdi), %rax
movzwl %cx, %esi
callq *0x38(%rax)
movb %al, %cl
movq -0x40(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8(%rax)
testb $0x1, 0x8(%rax)
jne 0x4bb7d
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x20(%rax)
jmp 0x4bb7f
jmp 0x4bb7f
jmp 0x4bb81
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rax
testb $0x1, 0x9(%rax)
je 0x4bbb5
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rax
testb $0x1, 0x8(%rax)
jne 0x4bbb5
movq -0x40(%rbp), %rax
testb $0x1, 0x5a(%rax)
jne 0x4bbb5
movq -0x40(%rbp), %rax
movb $0x1, 0x8(%rax)
jmp 0x4bbb7
movq -0x40(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x4bbda
movq -0x40(%rbp), %rax
movq 0x68(%rax), %rdi
movq 0x10(%rax), %rsi
movq (%rdi), %rax
movl $0x1, %ecx
movl %ecx, %edx
callq *0x10(%rax)
movq -0x40(%rbp), %rax
movb 0x8(%rax), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)