// File: /workspace/github_cpp_makefile_star2_O1/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 0x3daa8
movq 0xc8(%rbx), %rdi
movl 0x28(%rdi), %eax
cmpl $-0x1, %eax
je 0x3dad2
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 0x3decc
movq 0xc8(%rbx), %rax
movl $0xffffffff, 0x28(%rax) # imm = 0xFFFFFFFF
cmpb $0x0, 0x8(%rbx)
jne 0x3dca8
cmpb $0x0, 0x68(%rbx)
jne 0x3dca8
movq 0xd0(%rbx), %rax
cmpb $0x0, 0x9(%rax)
je 0x3daf3
movb $0x1, 0x8(%rbx)
jmp 0x3dca8
cmpb $0x0, (%rdi)
je 0x3dd0a
cmpl $-0x1, %eax
jne 0x3da61
movb $0x0, 0x68(%rbx)
movq 0xd0(%rbx), %rax
movb 0x9(%rax), %al
movb %al, 0x8(%rbx)
jmp 0x3daa8
cmpb $0x0, 0x69(%rbx)
jne 0x3db6e
movq 0x80(%rbx), %rdi
movzwl 0xa(%rax), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movb %al, 0x69(%rbx)
testb %al, %al
je 0x3db2d
movq 0x80(%rbx), %rcx
cmpq $0x0, 0x58(%rcx)
jne 0x3db29
cmpq $0x0, 0x88(%rbx)
jne 0x3db2d
movb $0x1, 0x8(%rbx)
cmpq $0x0, 0x88(%rbx)
setne %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x3db6e
cmpb $0x1, 0x6a(%rbx)
jne 0x3db56
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x48(%rax)
cmpb $0x1, 0x6b(%rbx)
jne 0x3db6e
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x48(%rax)
cmpb $0x0, 0x8(%rbx)
jne 0x3dc4a
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x3dc4a
cmpb $0x0, 0x6a(%rbx)
jne 0x3dbbe
movq 0xd0(%rbx), %rax
movzwl 0xa(%rax), %esi
movq (%rdi), %rax
callq *0x38(%rax)
movb %al, 0x6a(%rbx)
testb %al, %al
je 0x3dbbe
cmpb $0x1, 0x69(%rbx)
jne 0x3dbbe
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x48(%rax)
cmpb $0x0, 0x6b(%rbx)
jne 0x3dbfb
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 0x3dbfb
cmpb $0x1, 0x69(%rbx)
jne 0x3dbfb
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x48(%rax)
cmpb $0x0, 0x6a(%rbx)
jne 0x3dc38
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 0x3dc38
cmpb $0x1, 0x69(%rbx)
jne 0x3dc38
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x48(%rax)
movb 0x6a(%rbx), %al
xorl %ecx, %ecx
testb %al, 0x69(%rbx)
movzbl 0x6b(%rbx), %eax
cmovnel %eax, %ecx
movb %cl, 0x8(%rbx)
cmpb $0x0, 0x8(%rbx)
jne 0x3dc62
movq 0xd0(%rbx), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x20(%rax)
movq 0xd0(%rbx), %rax
cmpb $0x1, 0x8(%rax)
jne 0x3dca8
movb $0x1, 0x68(%rbx)
movb $0x0, 0x8(%rax)
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 0x315c2
cmpb $0x1, 0x8(%rbx)
jne 0x3dd00
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 0x3dd00
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
callq 0x31530
xorl %eax, %eax
jmp 0x3dd03
nop