// File: BenLangmead[P]bowtie/./range_chaser.h
// Function: RangeChaser::setTopBot(unsigned int, unsigned int, unsigned int, RandomSource&, Ebwt const*)
void setTopBot(TIndexOffU top,
		       TIndexOffU bot,
		       TIndexOffU qlen,
	               RandomSource& rand,
	               const Ebwt* ebwt)
		{
			assert_neq(OFF_MASK, top);
			assert_neq(OFF_MASK, bot);
			assert_gt(bot, top);
			assert_gt(qlen, 0);
			assert(ebwt != NULL);
			ebwt_ = ebwt;
			qlen_ = qlen;
			top_ = top;
			bot_ = bot;
			TIndexOffU spread = bot - top;
			irow_ = top + (rand.nextU32() % spread); // initial row
			done = false;
			cached_ = false;
			reset();
			if(cacheFw_ != NULL || cacheBw_ != NULL) {
				if(spread > cacheThresh_) {
					bool ret = false;
					if(ebwt->fw() && cacheFw_ != NULL) {
						ret = cacheFw_->lookup(top, bot, cacheEnt_);
						if(ret) assert(cacheEnt_.ebwt()->fw());
					} else if(!ebwt->fw() && cacheBw_ != NULL) {
						ret = cacheBw_->lookup(top, bot, cacheEnt_);
						if(ret) assert(!cacheEnt_.ebwt()->fw());
					} else {
						cacheEnt_.reset();
					}
					assert_eq(cacheEnt_.valid(), ret);
					cached_ = ret;
				} else {
					cacheEnt_.reset();
				}
			}
			setRow(irow_);
			assert(chaser_.prepped_ || foundOff() || done);
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x10(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x18(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x1c(%rax)
movl -0x10(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x47b20
movq -0x38(%rbp), %rdi
xorl %edx, %edx
divl -0x2c(%rbp)
movl -0x3c(%rbp), %eax
addl %edx, %eax
movl %eax, 0x20(%rdi)
movb $0x0, (%rdi)
movb $0x0, 0xa8(%rdi)
callq 0x4c3a0
movq -0x38(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
jne 0x4c457
movq -0x38(%rbp), %rax
cmpq $0x0, 0xb8(%rax)
je 0x4c531
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %eax
cmpl 0x14(%rcx), %eax
jbe 0x4c51f
movb $0x0, -0x2d(%rbp)
movq -0x28(%rbp), %rdi
callq 0x402a0
testb $0x1, %al
jne 0x4c47a
jmp 0x4c4b4
movq -0x38(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
je 0x4c4b4
movq -0x38(%rbp), %rcx
movq 0xb0(%rcx), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
addq $0x80, %rcx
callq 0x4db40
andb $0x1, %al
movb %al, -0x2d(%rbp)
testb $0x1, -0x2d(%rbp)
je 0x4c4b2
jmp 0x4c4b2
jmp 0x4c50d
movq -0x28(%rbp), %rdi
callq 0x402a0
testb $0x1, %al
jne 0x4c4fb
movq -0x38(%rbp), %rax
cmpq $0x0, 0xb8(%rax)
je 0x4c4fb
movq -0x38(%rbp), %rcx
movq 0xb8(%rcx), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
addq $0x80, %rcx
callq 0x4db40
andb $0x1, %al
movb %al, -0x2d(%rbp)
testb $0x1, -0x2d(%rbp)
je 0x4c4f9
jmp 0x4c4f9
jmp 0x4c50b
movq -0x38(%rbp), %rdi
addq $0x80, %rdi
callq 0x4dc50
jmp 0x4c50d
movq -0x38(%rbp), %rax
movb -0x2d(%rbp), %cl
andb $0x1, %cl
movb %cl, 0xa8(%rax)
jmp 0x4c52f
movq -0x38(%rbp), %rdi
addq $0x80, %rdi
callq 0x4dc50
jmp 0x4c531
movq -0x38(%rbp), %rdi
movl 0x20(%rdi), %esi
callq 0x4c550
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)