// File: /workspace/github_cpp_makefile_star2_O1/BenLangmead[P]bowtie/./reference.h
// Function: BitPairReference::getStretchNaive(unsigned int*, unsigned long, unsigned long, unsigned long) const
int getStretchNaive(uint32_t *destU32,
	                    size_t tidx,
	                    size_t toff,
	                    size_t count) const
	{
		uint8_t *dest = (uint8_t*)destU32;
		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 cur = 0;
		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;
			for(; toff < off && count > 0; toff++) {
				dest[cur++] = 4;
				count--;
			}
			if(count == 0) break;
			assert_geq(toff, off);
			if(toff < off + recs_[i].len) {
				bufOff += (TIndexOffU)(toff - off); // move bufOff pointer forward
			} else {
				bufOff += recs_[i].len;
			}
			off += recs_[i].len;
			for(; toff < off && count > 0; toff++) {
				assert_lt(bufOff, bufSz_);
				const uint64_t bufElt = (bufOff) >> 2;
				const uint64_t shift = (bufOff & 3) << 1;
				dest[cur++] = (buf_[bufElt] >> shift) & 3;
				bufOff++;
				count--;
			}
			if(count == 0) break;
			assert_geq(toff, off);
		} // end for loop over records
		// In any chars are left after scanning all the records,
		// they must be ambiguous
		while(count > 0) {
			count--;
			dest[cur++] = 4;
		}
		assert_eq(0, count);
		return 0;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r12
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, 0x18(%rsp)
movq %rdi, %r15
leaq 0x4c0(%rdi), %rbp
movq %rbp, %rdi
movq %rdx, %rsi
callq 0x1f1da
movq (%rax), %r13
leaq 0x1(%rbx), %rsi
movq %rbp, %rdi
callq 0x1f1da
movq (%rax), %rax
movq %r13, 0x8(%rsp)
movq %rax, 0x20(%rsp)
cmpq %r13, %rax
jbe 0x1f132
leaq 0x460(%r15), %rdi
movq %rbx, %rsi
callq 0x1f1da
movq (%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x400(%r15), %rax
movq %rax, 0x28(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
movq %r15, %r8
movq 0x8(%rsp), %r15
movq %r8, 0x30(%rsp)
cmpq %rbx, %r14
jb 0x1ef49
movq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x184e4
addq (%rax), %rbx
cmpq %rbx, %r14
setb %al
jae 0x1ed4f
testq %r12, %r12
je 0x1ed4f
movq 0x18(%rsp), %rax
leaq (%rax,%rbp), %rdi
movq %r14, %rdx
notq %rdx
addq %rbx, %rdx
leaq -0x1(%r12), %rax
cmpq %rax, %rdx
cmovaeq %rax, %rdx
incq %rdx
movl $0x4, %esi
callq 0x4190
incq %rbp
leaq -0x1(%r12), %r13
incq %r14
cmpq %rbx, %r14
setb %al
jae 0x1ed52
cmpq $0x1, %r12
movq %r13, %r12
jne 0x1ed31
jmp 0x1ed52
movq %r12, %r13
testq %r13, %r13
je 0x1ee67
testb %al, %al
jne 0x1efec
movq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x184e4
movq 0x8(%rax), %rax
addq %rbx, %rax
cmpq %rax, %r14
jae 0x1ed87
movq %r14, %rcx
subq %rbx, %rcx
jmp 0x1ed96
movq %r12, %rdi
movq %r15, %rsi
callq 0x184e4
movq 0x8(%rax), %rcx
movq %r12, %rdi
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rsp)
leaq (%rcx,%rax), %r12
movq %r15, %rsi
callq 0x184e4
addq 0x8(%rax), %rbx
cmpq %rbx, %r14
setb %cl
jae 0x1ee42
movq %r15, %r9
leaq -0x1(%r13), %rax
leal (%r12,%r12), %edx
movq 0x18(%rsp), %rcx
leaq (%rcx,%rbp), %rsi
xorl %r15d, %r15d
movq 0x30(%rsp), %r8
leaq (%r12,%r15), %rcx
cmpq 0x550(%r8), %rcx
jae 0x1ee95
shrq $0x2, %rcx
movq 0x540(%r8), %rdi
movb (%rdi,%rcx), %dil
movl %edx, %ecx
andb $0x6, %cl
shrb %cl, %dil
andb $0x3, %dil
movb %dil, (%rsi,%r15)
leaq (%r15,%r14), %rcx
incq %rcx
leaq 0x1(%r15), %rdi
cmpq %rbx, %rcx
setb %cl
jae 0x1ee29
addb $0x2, %dl
cmpq %r15, %rax
movq %rdi, %r15
jne 0x1eddb
addq %rdi, %r14
subq %rdi, %r13
addq %rdi, %r12
addq %rdi, %rbp
movq %r12, 0x10(%rsp)
movq %r13, %r12
movq %r9, %r15
jmp 0x1ee4a
movq %r12, 0x10(%rsp)
movq %r13, %r12
testq %r12, %r12
je 0x1ee67
testb %cl, %cl
jne 0x1f08f
incq %r15
cmpq 0x20(%rsp), %r15
jne 0x1ece0
jmp 0x1ee6a
xorl %r12d, %r12d
testq %r12, %r12
je 0x1ee84
movq 0x18(%rsp), %rdi
addq %rbp, %rdi
movl $0x4, %esi
movq %r12, %rdx
callq 0x4190
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1811c(%rip), %rbx     # 0x36fb8
leaq 0xe3c1(%rip), %rsi      # 0x2d264
movq %rbx, %rdi
movq %r8, %r14
callq 0x4310
movq 0x8(%rsp), %rsi
addq 0x10(%rsp), %rsi
addq %r15, %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0xe3b0(%rip), %rsi      # 0x2d27a
movq %rax, %rdi
callq 0x4310
movq 0x550(%r14), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x1042d(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xf8d6(%rip), %r14      # 0x2e7d5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0xf807(%rip), %rsi      # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x1c4, %esi            # imm = 0x1C4
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0xf6c3(%rip), %rdi      # 0x2e5f8
leaq 0xf96e(%rip), %rcx      # 0x2e8aa
movq %r14, %rsi
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x41c0
movq 0x18068(%rip), %r15     # 0x36fb8
leaq 0xe2cb(%rip), %rsi      # 0x2d222
movq %r15, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0xe2c8(%rip), %rsi      # 0x2d239
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40c0
leaq 0x1038a(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xf833(%rip), %rbx      # 0x2e7d5
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0xf764(%rip), %rsi      # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x1b5, %esi            # imm = 0x1B5
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0xf620(%rip), %rdi      # 0x2e5f8
leaq 0xf8cb(%rip), %rcx      # 0x2e8aa
movq %rbx, %rsi
movl $0x1b5, %edx            # imm = 0x1B5
callq 0x41c0
movq 0x17fc5(%rip), %r15     # 0x36fb8
leaq 0xe228(%rip), %rsi      # 0x2d222
movq %r15, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0xe225(%rip), %rsi      # 0x2d239
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40c0
leaq 0x102e7(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xf790(%rip), %rbx      # 0x2e7d5
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0xf6c1(%rip), %rsi      # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x1bc, %esi            # imm = 0x1BC
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0xf57d(%rip), %rdi      # 0x2e5f8
leaq 0xf828(%rip), %rcx      # 0x2e8aa
movq %rbx, %rsi
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x41c0
movq 0x17f22(%rip), %r15     # 0x36fb8
leaq 0xe185(%rip), %rsi      # 0x2d222
movq %r15, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0xe182(%rip), %rsi      # 0x2d239
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40c0
leaq 0x10244(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xf6ed(%rip), %rbx      # 0x2e7d5
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0xf61e(%rip), %rsi      # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x1cc, %esi            # imm = 0x1CC
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0xf4da(%rip), %rdi      # 0x2e5f8
leaq 0xf785(%rip), %rcx      # 0x2e8aa
movq %rbx, %rsi
movl $0x1cc, %edx            # imm = 0x1CC
callq 0x41c0
movq 0x17e7f(%rip), %rbx     # 0x36fb8
leaq 0xdfd5(%rip), %rsi      # 0x2d115
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x40c0
leaq 0xdfcf(%rip), %rsi      # 0x2d12b
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x40c0
leaq 0x1019d(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xf646(%rip), %r14      # 0x2e7d5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0xf577(%rip), %rsi      # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x1af, %esi            # imm = 0x1AF
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0xf433(%rip), %rdi      # 0x2e5f8
leaq 0xf6de(%rip), %rcx      # 0x2e8aa
movq %r14, %rsi
movl $0x1af, %edx            # imm = 0x1AF
callq 0x41c0
nop