// File: BenLangmead[P]bowtie/./range_chaser.h
// Function: RangeChaser::setRow(unsigned int)
void setRow(TIndexOffU row) {
		// Must be within bounds of range
		assert_lt(row, bot_);
		assert_geq(row, top_);
		row_ = row;
		while(true) {
			// First thing to try is the cache
			if(cached_) {
				assert(cacheEnt_.valid());
				TIndexOffU cached = cacheEnt_.get(row_ - top_);
				assert(cacheEnt_.valid());
				if(cached != RANGE_NOT_SET) {
					// Assert that it matches what we would have got...
					ASSERT_ONLY(uint32_t sanity = RowChaser::toFlatRefOff(ebwt_, 1, row_));
					assert_eq(sanity, cached);
					// We have a cached result.  Cached result is in the
					// form of an offset into the joined reference string,
					// so now we have to convert it to a tidx/toff pair.
					ebwt_->joinedToTextOff(qlen_, cached, off_.first, off_.second, tlen_);
					// Note: tidx may be 0xffffffff, if alignment overlaps a
					// reference boundary
					if(off_.first != OFF_MASK) {
						// Bingo, we found a valid result using the cache
						assert(foundOff());
						return;
					}
				} else {
					// Wasn't in the cache; use the RowChaser
				}
			}
			// Second thing to try is the chaser
			chaser_.setRow(row_, qlen_, ebwt_);
			assert(chaser_.prepped_ || chaser_.done);
			// It might be done immediately...
			if(chaser_.done) {
				// We're done immediately
				off_ = chaser_.off();
				if(off_.first != OFF_MASK) {
					// This is a valid result
					if(cached_) {
						// Install the result in the cache
						assert(cacheEnt_.valid());
						cacheEnt_.install(row_ - top_, chaser_.flatOff());
						//if(ebwt_->fw()) assert(cacheFw_->repOk());
						//else            assert(cacheBw_->repOk());
					}
					tlen_ = chaser_.tlen();
					assert(foundOff());
					return; // found result
				}
			} else {
				// Pursue this row
				break;
			}
			// That row didn't have a valid result, move to the next
			row_++;
			if(row_ == bot_) {
				// Wrap back to top_
				row_ = top_;
			}
			if(row_ == irow_) {
				// Exhausted all possible rows
				done = true;
				assert_eq(OFF_MASK, off_.first);
				return;
			}
		}
		assert(chaser_.prepped_);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, 0x24(%rax)
movq -0x20(%rbp), %rax
testb $0x1, 0xa8(%rax)
je 0x4c5db
movq -0x20(%rbp), %rax
movq %rax, %rdi
addq $0x80, %rdi
movl 0x24(%rax), %esi
subl 0x18(%rax), %esi
callq 0x4c970
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
je 0x4c5d7
movq -0x20(%rbp), %r9
movq 0x8(%r9), %rdi
movl 0x10(%r9), %esi
movl -0x10(%rbp), %edx
movq %r9, %rcx
addq $0x28, %rcx
movq %r9, %r8
addq $0x28, %r8
addq $0x4, %r8
addq $0x30, %r9
callq 0xd9d0
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x28(%rax)
je 0x4c5d5
jmp 0x4c6c2
jmp 0x4c5d9
jmp 0x4c5d9
jmp 0x4c5db
movq -0x20(%rbp), %rax
movq %rax, %rdi
addq $0x38, %rdi
movl 0x24(%rax), %esi
movl 0x10(%rax), %edx
movq 0x8(%rax), %rcx
callq 0x4ca60
movq -0x20(%rbp), %rax
testb $0x1, 0x38(%rax)
je 0x4c687
movq -0x20(%rbp), %rdi
addq $0x38, %rdi
callq 0x4c7c0
movq -0x20(%rbp), %rdi
movq %rax, -0x18(%rbp)
addq $0x28, %rdi
leaq -0x18(%rbp), %rsi
callq 0x4c820
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x28(%rax)
je 0x4c685
movq -0x20(%rbp), %rax
testb $0x1, 0xa8(%rax)
je 0x4c66d
movq -0x20(%rbp), %rdi
movq %rdi, %rax
addq $0x80, %rax
movq %rax, -0x30(%rbp)
movl 0x24(%rdi), %eax
subl 0x18(%rdi), %eax
movl %eax, -0x24(%rbp)
addq $0x38, %rdi
callq 0x4c930
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %esi
movl %eax, %edx
callq 0x4c850
movq -0x20(%rbp), %rdi
addq $0x38, %rdi
callq 0x4c950
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x4c6c2
jmp 0x4c689
jmp 0x4c6c2
movq -0x20(%rbp), %rcx
movl 0x24(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x24(%rcx)
movl 0x24(%rcx), %eax
cmpl 0x1c(%rcx), %eax
jne 0x4c6a8
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
movl %ecx, 0x24(%rax)
movq -0x20(%rbp), %rcx
movl 0x24(%rcx), %eax
cmpl 0x20(%rcx), %eax
jne 0x4c6bd
movq -0x20(%rbp), %rax
movb $0x1, (%rax)
jmp 0x4c6c2
jmp 0x4c56d
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)