// File: /workspace/github_cpp_makefile_star2_O3/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 0x3cdfa
movq 0xc8(%rbx), %rdi
cmpl $-0x1, 0x28(%rdi)
je 0x3cde0
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 0x3d204
movq 0xc8(%rbx), %rax
movl $0xffffffff, 0x28(%rax) # imm = 0xFFFFFFFF
jmp 0x3cdfa
cmpb $0x0, (%rdi)
je 0x3cf71
movb $0x0, 0x68(%rbx)
movq 0xd0(%rbx), %rax
movb 0x9(%rax), %al
movb %al, 0x8(%rbx)
cmpb $0x0, 0x8(%rbx)
jne 0x3cfea
cmpb $0x0, 0x68(%rbx)
jne 0x3cfea
movq 0xd0(%rbx), %rax
cmpb $0x0, 0x9(%rax)
je 0x3ce24
movb $0x1, 0x8(%rbx)
jmp 0x3cfea
cmpb $0x0, 0x69(%rbx)
jne 0x3ce9e
movq 0x80(%rbx), %rdi
movzwl 0xa(%rax), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movb %al, 0x69(%rbx)
testb %al, %al
je 0x3ce9e
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 0x3ce6e
movb $0x1, 0x8(%rbx)
testq %rax, %rax
je 0x3ce9e
cmpb $0x1, 0x6a(%rbx)
jne 0x3ce86
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x48(%rax)
cmpb $0x1, 0x6b(%rbx)
jne 0x3ce9e
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x48(%rax)
movb 0x8(%rbx), %al
testb %al, %al
jne 0x3cf8e
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x3cf8e
cmpb $0x0, 0x6a(%rbx)
jne 0x3ceef
movq 0xd0(%rbx), %rax
movzwl 0xa(%rax), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movb %al, 0x6a(%rbx)
testb %al, %al
je 0x3ceef
cmpb $0x1, 0x69(%rbx)
jne 0x3ceef
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x48(%rax)
cmpb $0x0, 0x6b(%rbx)
jne 0x3cf2c
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 0x3cf2c
cmpb $0x1, 0x69(%rbx)
jne 0x3cf2c
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x48(%rax)
movb 0x6a(%rbx), %cl
testb %cl, %cl
jne 0x3cf7f
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 0x3cf7d
movb $0x1, %cl
cmpb $0x1, 0x69(%rbx)
jne 0x3cf7f
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x48(%rax)
movb 0x6a(%rbx), %cl
jmp 0x3cf7f
callq 0x3109c
xorl %eax, %eax
jmp 0x3d045
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 0x3cfab
movq (%rdi), %rax
movl $0x2, %esi
callq *0x20(%rax)
movq 0xd0(%rbx), %rdi
cmpb $0x1, 0x8(%rdi)
jne 0x3cfea
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 0x3112c
cmpb $0x1, 0x8(%rbx)
jne 0x3d042
movq 0x58(%rbx), %rsi
movq 0x80(%rbx), %rdi
movq (%rdi), %rax
movl $0x1, %edx
movl $0x1, %ecx
callq *0x10(%rax)
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x3d042
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