// File: BenLangmead[P]bowtie/./reference.h
// Function: BitPairReference::getBase(unsigned long, unsigned long) const
int getBase(size_t tidx, size_t toff) const {
		uint64_t reci = refRecOffs_[tidx];   // first record for target reference sequence
		uint64_t recf = refRecOffs_[tidx+1]; // last record (exclusive) for target seq
		assert_gt(recf, reci);
		uint64_t bufOff = refOffs_[tidx];
		uint64_t off = 0;
		// For all records pertaining to the target reference sequence...
		for(uint64_t i = reci; i < recf; i++) {
			assert_geq(toff, off);
			off += recs_[i].off;
			if(toff < off) {
				return 4;
			}
			assert_geq(toff, off);
			uint64_t recOff = off + recs_[i].len;
			if(toff < recOff) {
				toff -= off;
				bufOff += toff;
				assert_lt(bufOff, bufSz_);
				const uint64_t bufElt = (bufOff) >> 2;
				const uint64_t shift = (bufOff & 3) << 1;
				return ((buf_[bufElt] >> shift) & 3);
			}
			bufOff += recs_[i].len;
			off = recOff;
			assert_geq(toff, off);
		} // end for loop over records
		return 4;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x68(%rbp)
addq $0x4c0, %rdi            # imm = 0x4C0
movq -0x18(%rbp), %rsi
callq 0x2bbc0
movq -0x68(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x28(%rbp)
addq $0x4c0, %rdi            # imm = 0x4C0
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
callq 0x2bbc0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
ja 0x2c5f5
movq 0x1da79(%rip), %rdi     # 0x49fc0
leaq 0x12baa(%rip), %rsi     # 0x3f0f8
callq 0x5360
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x12ba5(%rip), %rsi     # 0x3f10e
callq 0x5360
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x15034(%rip), %rsi     # 0x415b8
callq 0x5360
movq %rax, %rdi
movq 0x1d9ed(%rip), %rsi     # 0x49f80
callq 0x53c0
movq 0x1da21(%rip), %rdi     # 0x49fc0
leaq 0x142a1(%rip), %rsi     # 0x40847
callq 0x5360
movq %rax, %rdi
leaq 0x141d5(%rip), %rsi     # 0x4078a
callq 0x5360
movq %rax, %rdi
movl $0x185, %esi            # imm = 0x185
callq 0x5750
movq %rax, %rdi
movq 0x1d9af(%rip), %rsi     # 0x49f80
callq 0x53c0
leaq 0x1408d(%rip), %rdi     # 0x4066a
leaq 0x14263(%rip), %rsi     # 0x40847
movl $0x185, %edx            # imm = 0x185
leaq 0x14f4d(%rip), %rcx     # 0x4153d
callq 0x51e0
movq -0x68(%rbp), %rdi
addq $0x460, %rdi            # imm = 0x460
movq -0x18(%rbp), %rsi
callq 0x2bbc0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x2ca4b
movq -0x20(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x2c6f1
movq 0x1d97d(%rip), %rdi     # 0x49fc0
leaq 0x12bbb(%rip), %rsi     # 0x3f205
callq 0x5360
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x12bb7(%rip), %rsi     # 0x3f21c
callq 0x5360
movq %rax, %rdi
movq -0x40(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x14f38(%rip), %rsi     # 0x415b8
callq 0x5360
movq %rax, %rdi
movq 0x1d8f1(%rip), %rsi     # 0x49f80
callq 0x53c0
movq 0x1d925(%rip), %rdi     # 0x49fc0
leaq 0x141a5(%rip), %rsi     # 0x40847
callq 0x5360
movq %rax, %rdi
leaq 0x140d9(%rip), %rsi     # 0x4078a
callq 0x5360
movq %rax, %rdi
movl $0x18a, %esi            # imm = 0x18A
callq 0x5750
movq %rax, %rdi
movq 0x1d8b3(%rip), %rsi     # 0x49f80
callq 0x53c0
leaq 0x13f91(%rip), %rdi     # 0x4066a
leaq 0x14167(%rip), %rsi     # 0x40847
movl $0x18a, %edx            # imm = 0x18A
leaq 0x14e51(%rip), %rcx     # 0x4153d
callq 0x51e0
movq -0x68(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
movq -0x48(%rbp), %rsi
callq 0x22d20
movq (%rax), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x2c726
movl $0x4, -0x4(%rbp)
jmp 0x2ca52
movq -0x20(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x2c7e9
movq 0x1d885(%rip), %rdi     # 0x49fc0
leaq 0x12ac3(%rip), %rsi     # 0x3f205
callq 0x5360
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x12abf(%rip), %rsi     # 0x3f21c
callq 0x5360
movq %rax, %rdi
movq -0x40(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x14e40(%rip), %rsi     # 0x415b8
callq 0x5360
movq %rax, %rdi
movq 0x1d7f9(%rip), %rsi     # 0x49f80
callq 0x53c0
movq 0x1d82d(%rip), %rdi     # 0x49fc0
leaq 0x140ad(%rip), %rsi     # 0x40847
callq 0x5360
movq %rax, %rdi
leaq 0x13fe1(%rip), %rsi     # 0x4078a
callq 0x5360
movq %rax, %rdi
movl $0x18f, %esi            # imm = 0x18F
callq 0x5750
movq %rax, %rdi
movq 0x1d7bb(%rip), %rsi     # 0x49f80
callq 0x53c0
leaq 0x13e99(%rip), %rdi     # 0x4066a
leaq 0x1406f(%rip), %rsi     # 0x40847
movl $0x18f, %edx            # imm = 0x18F
leaq 0x14d59(%rip), %rcx     # 0x4153d
callq 0x51e0
movq -0x68(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
addq $0x400, %rdi            # imm = 0x400
movq -0x48(%rbp), %rsi
callq 0x22d20
movq %rax, %rcx
movq -0x70(%rbp), %rax
addq 0x8(%rcx), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0x2c94d
movq -0x68(%rbp), %rcx
movq -0x40(%rbp), %rdx
movq -0x20(%rbp), %rax
subq %rdx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq 0x550(%rcx), %rax
jb 0x2c90e
movq 0x1d767(%rip), %rdi     # 0x49fc0
leaq 0x129e7(%rip), %rsi     # 0x3f247
callq 0x5360
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x129e2(%rip), %rsi     # 0x3f25d
callq 0x5360
movq %rax, %rdi
movq -0x68(%rbp), %rax
movq 0x550(%rax), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x14d1b(%rip), %rsi     # 0x415b8
callq 0x5360
movq %rax, %rdi
movq 0x1d6d4(%rip), %rsi     # 0x49f80
callq 0x53c0
movq 0x1d708(%rip), %rdi     # 0x49fc0
leaq 0x13f88(%rip), %rsi     # 0x40847
callq 0x5360
movq %rax, %rdi
leaq 0x13ebc(%rip), %rsi     # 0x4078a
callq 0x5360
movq %rax, %rdi
movl $0x194, %esi            # imm = 0x194
callq 0x5750
movq %rax, %rdi
movq 0x1d696(%rip), %rsi     # 0x49f80
callq 0x53c0
leaq 0x13d74(%rip), %rdi     # 0x4066a
leaq 0x13f4a(%rip), %rsi     # 0x40847
movl $0x194, %edx            # imm = 0x194
leaq 0x14c34(%rip), %rcx     # 0x4153d
callq 0x51e0
movq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
shrq $0x2, %rcx
movq %rcx, -0x58(%rbp)
movq -0x38(%rbp), %rcx
andq $0x3, %rcx
shlq %rcx
movq %rcx, -0x60(%rbp)
movq 0x540(%rax), %rax
movq -0x58(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x60(%rbp), %rcx
sarl %cl, %eax
andl $0x3, %eax
movl %eax, -0x4(%rbp)
jmp 0x2ca52
movq -0x68(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
movq -0x48(%rbp), %rsi
callq 0x22d20
movq 0x8(%rax), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x2ca38
movq 0x1d636(%rip), %rdi     # 0x49fc0
leaq 0x12874(%rip), %rsi     # 0x3f205
callq 0x5360
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x12870(%rip), %rsi     # 0x3f21c
callq 0x5360
movq %rax, %rdi
movq -0x40(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x14bf1(%rip), %rsi     # 0x415b8
callq 0x5360
movq %rax, %rdi
movq 0x1d5aa(%rip), %rsi     # 0x49f80
callq 0x53c0
movq 0x1d5de(%rip), %rdi     # 0x49fc0
leaq 0x13e5e(%rip), %rsi     # 0x40847
callq 0x5360
movq %rax, %rdi
leaq 0x13d92(%rip), %rsi     # 0x4078a
callq 0x5360
movq %rax, %rdi
movl $0x19b, %esi            # imm = 0x19B
callq 0x5750
movq %rax, %rdi
movq 0x1d56c(%rip), %rsi     # 0x49f80
callq 0x53c0
leaq 0x13c4a(%rip), %rdi     # 0x4066a
leaq 0x13e20(%rip), %rsi     # 0x40847
movl $0x19b, %edx            # imm = 0x19B
leaq 0x14b0a(%rip), %rcx     # 0x4153d
callq 0x51e0
jmp 0x2ca3a
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2c620
movl $0x4, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)