// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./aligner.h
// Function: PairedBWAlignerV2<EbwtRangeSource>::advance()
virtual bool advance() {
		assert(!this->done);
		if(chase_) {
			assert(!rangeMode_); // chasing ranges
			if(!rchase_->foundOff() && !rchase_->done) {
				rchase_->advance();
				return false;
			}
			assert(rchase_->foundOff() || rchase_->done);
			if(rchase_->foundOff()) {
				const Range& r = driver_->range();
				assert(r.repOk());
				resolveOutstanding(
					rchase_->off(),
					r.ebwt->_plen[rchase_->off().first], r);
				rchase_->reset();
			} else {
				assert(rchase_->done);
				// Forget this range; keep looking for ranges
				chase_ = false;
				this->done = driver_->done;
			}
		}

		if(!this->done && !chase_) {
			// Search for more ranges for whichever mate currently has
			// fewer candidate alignments
			if(!driver_->done) {
				if(!this->done) {
					//
					// Check whether any of the PE/SE possibilities
					// have become impossible due to the minCost
					//
					if(!donePe_) {
						assert(!this->done);
						donePe_ = sinkPt_->irrelevantCost(driver_->minCost);
						if(donePe_ && (!sinkPt_->empty() || sinkPtSe1_ == NULL)) {
							// Paired-end alignment(s) were found, no
							// more will be found, and no unpaired
							// alignments are requested, so stop
							this->done = true;
						}
						if(donePe_ && sinkPtSe1_ != NULL) {
							// Note: removeMate affects minCost
							if(doneSe1_) driver_->removeMate(1);
							if(doneSe2_) driver_->removeMate(2);
						}
					}
					if(!this->done && sinkPtSe1_ != NULL) {
						if(!doneSe1_) {
							doneSe1_ = sinkPtSe1_->irrelevantCost(driver_->minCost);
							if(doneSe1_ && donePe_) driver_->removeMate(1);
						}
						if(!doneSe2_) {
							doneSe2_ = sinkPtSe2_->irrelevantCost(driver_->minCost);
							if(doneSe2_ && donePe_) driver_->removeMate(2);
						}
						// Do Se1 again, because removing Se2 may have
						// nudged minCost over the threshold
						if(!doneSe1_) {
							doneSe1_ = sinkPtSe1_->irrelevantCost(driver_->minCost);
							if(doneSe1_ && donePe_) driver_->removeMate(1);
						}
						if(doneSe1_ && doneSe2_) assert(donePe_);
						this->done = donePe_ && doneSe1_ && doneSe2_;
					}

					if(!this->done) {
						if(sinkPtSe1_ != NULL) {
							assert(doneSe1_ || !sinkPtSe1_->irrelevantCost(driver_->minCost));
							assert(doneSe2_ || !sinkPtSe2_->irrelevantCost(driver_->minCost));
						}
						assert(donePe_ || !sinkPt_->irrelevantCost(driver_->minCost));
						driver_->advance(ADV_COST_CHANGES);
					}
				}
				if(driver_->foundRange) {
					// Use Burrows-Wheeler for this pair (as usual)
					chase_ = true;
					driver_->foundRange = false;
					const Range& r = driver_->range();
					assert(r.repOk());
					rchase_->setTopBot(r.top, r.bot,
					                   r.mate1 ? qlen1_ : qlen2_,
					                   rand_, r.ebwt);
				}
			} else {
				this->done = true;
			}
		}

		if(this->done) {
			bool reportedPe = (sinkPt_->finishRead(*patsrc_, true, true) > 0);
			if(sinkPtSe1_ != NULL) {
				sinkPtSe1_->finishRead(*patsrc_, !reportedPe, false);
				sinkPtSe2_->finishRead(*patsrc_, !reportedPe, false);
			}
		}
		return this->done;
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x68(%rdi)
jne 0x336a5
movq 0xc8(%rbx), %rdi
cmpl $-0x1, 0x28(%rdi)
je 0x3368b
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0xc8(%rbx), %rcx
movq 0x28(%rcx), %rcx
movq %rsp, %rsi
movq %rcx, (%rsi)
movq 0x58(%rax), %rdx
movq 0x80(%rdx), %rdx
movl %ecx, %ecx
movl (%rdx,%rcx,4), %edx
movq %rbx, %rdi
movq %rax, %rcx
callq 0x33a3a
movq 0xc8(%rbx), %rax
orl $-0x1, 0x28(%rax)
jmp 0x336a5
cmpb $0x0, (%rdi)
je 0x33812
movb $0x0, 0x68(%rbx)
movq 0xd0(%rbx), %rax
movb 0x9(%rax), %al
movb %al, 0x8(%rbx)
cmpb $0x0, 0x8(%rbx)
jne 0x33889
cmpb $0x0, 0x68(%rbx)
jne 0x33889
movq 0xd0(%rbx), %rax
cmpb $0x0, 0x9(%rax)
je 0x336cf
movb $0x1, 0x8(%rbx)
jmp 0x33889
cmpb $0x0, 0x69(%rbx)
jne 0x33745
movq 0x80(%rbx), %rdi
movzwl 0xa(%rax), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movb %al, 0x69(%rbx)
testb %al, %al
je 0x33745
movq 0x80(%rbx), %rcx
movq 0x88(%rbx), %rax
cmpq $0x0, 0x58(%rcx)
setne %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x33714
movb $0x1, 0x8(%rbx)
testq %rax, %rax
je 0x33745
cmpb $0x1, 0x6a(%rbx)
jne 0x3372f
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
pushq $0x1
popq %rsi
callq *0x48(%rax)
cmpb $0x1, 0x6b(%rbx)
jne 0x33745
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
pushq $0x2
popq %rsi
callq *0x48(%rax)
movb 0x8(%rbx), %al
testb %al, %al
jne 0x3382f
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x3382f
cmpb $0x0, 0x6a(%rbx)
jne 0x33794
movq 0xd0(%rbx), %rax
movzwl 0xa(%rax), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movb %al, 0x6a(%rbx)
testb %al, %al
je 0x33794
cmpb $0x1, 0x69(%rbx)
jne 0x33794
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
pushq $0x1
popq %rsi
callq *0x48(%rax)
cmpb $0x0, 0x6b(%rbx)
jne 0x337cf
movq 0x90(%rbx), %rdi
movq 0xd0(%rbx), %rax
movzwl 0xa(%rax), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movb %al, 0x6b(%rbx)
testb %al, %al
je 0x337cf
cmpb $0x1, 0x69(%rbx)
jne 0x337cf
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
pushq $0x2
popq %rsi
callq *0x48(%rax)
movb 0x6a(%rbx), %cl
testb %cl, %cl
jne 0x33820
movq 0x88(%rbx), %rdi
movq 0xd0(%rbx), %rax
movzwl 0xa(%rax), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movb %al, 0x6a(%rbx)
testb %al, %al
je 0x3381e
movb $0x1, %cl
cmpb $0x1, 0x69(%rbx)
jne 0x33820
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
pushq $0x1
popq %rsi
callq *0x48(%rax)
movb 0x6a(%rbx), %cl
jmp 0x33820
callq 0x281ee
xorl %eax, %eax
jmp 0x338df
xorl %ecx, %ecx
xorl %eax, %eax
testb %cl, 0x69(%rbx)
movzbl 0x6b(%rbx), %ecx
cmovnel %ecx, %eax
movb %al, 0x8(%rbx)
movq 0xd0(%rbx), %rdi
testb $0x1, %al
jne 0x3384a
movq (%rdi), %rax
pushq $0x2
popq %rsi
callq *0x20(%rax)
movq 0xd0(%rbx), %rdi
cmpb $0x1, 0x8(%rdi)
jne 0x33889
movb $0x1, 0x68(%rbx)
movb $0x0, 0x8(%rdi)
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0xc8(%rbx), %rdi
movl (%rax), %esi
movl 0x4(%rax), %edx
movzbl 0x15(%rax), %ecx
xorl $0x1, %ecx
movl 0x60(%rbx,%rcx,4), %ecx
leaq 0x38(%rbx), %r8
movq 0x58(%rax), %r9
callq 0x28390
cmpb $0x1, 0x8(%rbx)
jne 0x338dc
movq 0x58(%rbx), %rsi
movq 0x80(%rbx), %rdi
movq (%rdi), %rax
pushq $0x1
popq %rcx
movl %ecx, %edx
callq *0x10(%rax)
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x338dc
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
movq 0x58(%rbx), %rsi
movq (%rdi), %rax
movl %ebp, %edx
xorl %ecx, %ecx
callq *0x10(%rax)
movq 0x58(%rbx), %rsi
movq 0x90(%rbx), %rdi
movq (%rdi), %rax
movl %ebp, %edx
xorl %ecx, %ecx
callq *0x10(%rax)
movb 0x8(%rbx), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq