// File: BenLangmead[P]bowtie/./ebwt_search_backtrack.h
// Function: EbwtRangeSource::setQuery(Read&, Range*)
virtual void setQuery(Read& r, Range *seedRange) {
		const bool ebwtFw = ebwt_->fw();
		if(ebwtFw) {
			qry_  = fw_ ? &r.patFw : &r.patRc;
			qual_ = fw_ ? &r.qual  : &r.qualRev;
		} else {
			qry_  = fw_ ? &r.patFwRev : &r.patRcRev;
			qual_ = fw_ ? &r.qualRev  : &r.qual;
		}
		name_ = &r.name;
		if(seedRange != NULL) seedRange_ = *seedRange;
		else                  seedRange_.invalidate();
		qlen_ = qry_->length();
		skippingThisRead_ = false;
		// Apply edits from the partial alignment to the query pattern
		if(seedRange_.valid()) {
			qryBuf_ = *qry_;
			const size_t srSz = seedRange_.mms.size();
			assert_gt(srSz, 0);
			assert_eq(srSz, seedRange_.refcs.size());
			for(size_t i = 0; i < srSz; i++) {
				assert_lt(seedRange_.mms[i], qlen_);
				char rc = (char)seedRange_.refcs[i];
				assert(rc == 'A' || rc == 'C' || rc == 'G' || rc == 'T');
				ASSERT_ONLY(char oc = (char)qryBuf_[qlen_ - seedRange_.mms[i] - 1]);
				assert_neq(rc, oc);
				qryBuf_[qlen_ - seedRange_.mms[i] - 1] = asc2dna[(int)rc];
				assert_neq(rc, (*qry_)[qlen_ - seedRange_.mms[i] - 1]);
			}
			qry_ = &qryBuf_;
		}
		// Make sure every qual is a valid qual ASCII character (>= 33)
		for(size_t i = 0; i < qual_->length(); i++) {
			assert_geq((*qual_)[i], 33);
		}
		assert_geq(qual_->length(), qlen_);
		this->done = false;
		this->foundRange = false;
		rand_.init(r.seed);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq 0x68(%rax), %rdi
callq 0x402a0
andb $0x1, %al
movb %al, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
je 0x3e9bf
movq -0x48(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x3e977
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x3e983
movq -0x10(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x18(%rax)
testb $0x1, 0x70(%rax)
je 0x3e9a3
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x58(%rbp)
jmp 0x3e9b1
movq -0x10(%rbp), %rax
addq $0xf0, %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x58(%rax)
jmp 0x3ea21
movq -0x48(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x3e9d9
movq -0x10(%rbp), %rax
addq $0x90, %rax
movq %rax, -0x60(%rbp)
jmp 0x3e9e7
movq -0x10(%rbp), %rax
addq $0xc0, %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, 0x18(%rax)
testb $0x1, 0x70(%rax)
je 0x3ea09
movq -0x10(%rbp), %rax
addq $0xf0, %rax
movq %rax, -0x68(%rbp)
jmp 0x3ea15
movq -0x10(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x150, %rcx            # imm = 0x150
movq %rcx, 0x60(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x3ea51
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x118, %rdi            # imm = 0x118
callq 0x402c0
jmp 0x3ea61
movq -0x48(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
callq 0x40340
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2ef90
movq -0x48(%rbp), %rdi
movq %rax, 0x50(%rdi)
movb $0x0, 0x178(%rdi)
addq $0x118, %rdi            # imm = 0x118
callq 0x40360
testb $0x1, %al
jne 0x3ea92
jmp 0x3eb68
movq -0x48(%rbp), %rdi
movq 0x18(%rdi), %rsi
addq $0x20, %rdi
callq 0x35e50
movq -0x48(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
addq $0x18, %rdi
callq 0x24960
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x3eb59
movq -0x48(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
addq $0x38, %rdi
movq -0x30(%rbp), %rsi
callq 0x40380
movq -0x48(%rbp), %rdi
movb (%rax), %al
movb %al, -0x31(%rbp)
movsbl -0x31(%rbp), %eax
movslq %eax, %rcx
leaq 0x6bbb0(%rip), %rax     # 0xaa6b0
movb (%rax,%rcx), %al
movb %al, -0x69(%rbp)
movq %rdi, %rax
addq $0x20, %rax
movq %rax, -0x78(%rbp)
movq 0x50(%rdi), %rax
movq %rax, -0x80(%rbp)
addq $0x118, %rdi            # imm = 0x118
addq $0x18, %rdi
movq -0x30(%rbp), %rsi
callq 0x24930
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdi
movl (%rax), %eax
subq %rax, %rsi
subq $0x1, %rsi
callq 0x403a0
movb -0x69(%rbp), %cl
movb %cl, (%rax)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x3eac3
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x18(%rax)
movq $0x0, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movq 0x58(%rax), %rdi
callq 0x2ef90
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jae 0x3eba7
jmp 0x3eb99
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x3eb70
movq -0x48(%rbp), %rdi
movb $0x0, 0x8(%rdi)
movb $0x0, 0x9(%rdi)
addq $0xa0, %rdi
movq -0x10(%rbp), %rax
movl 0x18c(%rax), %esi
callq 0x403d0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)