// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ebwt.h
// Function: Ebwt::countBt2Side(SideLocus const&, int) const
inline TIndexOffU Ebwt::countBt2Side(const SideLocus& l, int c) const {
	assert_range(0, 3, c);
	assert_range(0, (int)this->_eh._sideBwtSz-1, (int)l._by);
	assert_range(0, 3, (int)l._bp);
	const uint8_t *side = l.side(this->ebwt());
	TIndexOffU cCnt = countUpTo(l, c);
	assert_leq(cCnt, this->_eh._sideBwtLen);
	if(c == 0 && l._sideByteOff <= _zEbwtByteOff && l._sideByteOff + l._by >= _zEbwtByteOff) {
		// Adjust for the fact that we represented $ with an 'A', but
		// shouldn't count it as an 'A' here
		if((l._sideByteOff + l._by > _zEbwtByteOff) ||
		   (l._sideByteOff + l._by == _zEbwtByteOff && l._bp > _zEbwtBpOff))
		{
			cCnt--; // Adjust for '$' looking like an 'A'
		}
	}
	TIndexOffU ret;
	// Now factor in the occ[] count at the side break
	const uint8_t *acgt8 = side + _eh._sideBwtSz;
	const TIndexOffU *acgt = reinterpret_cast<const TIndexOffU*>(acgt8);
	assert_leq(acgt[0], this->_eh._numSides * this->_eh._sideBwtLen); // b/c it's used as padding
	assert_leq(acgt[1], this->_eh._len);
	assert_leq(acgt[2], this->_eh._len);
	assert_leq(acgt[3], this->_eh._len);
	ret = acgt[c] + cCnt + this->fchr()[c];
#ifndef NDEBUG
	assert_leq(ret, this->fchr()[c+1]); // can't have jumpded into next char's section
	if(c == 0) {
		assert_leq(cCnt, this->_eh._sideBwtLen);
	} else {
		assert_leq(ret, this->_eh._bwtLen);
	}
#endif
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x14(%rsp), %rdx
leaq 0xc(%rsp), %r12
andl $0x0, (%r12)
movl %ebp, (%rdx)
pushq $0x3
popq %rax
leaq 0x8(%rsp), %r13
movl %eax, (%r13)
leaq 0x12a25(%rip), %rcx     # 0x280fd
movq %r12, %rdi
movq %r13, %rsi
movl $0x8c1, %r8d            # imm = 0x8C1
callq 0xa43a
andl $0x0, (%r12)
movl 0x190(%r14), %eax
decl %eax
movl %eax, (%r13)
movswl 0x14(%r15), %eax
leaq 0x10(%rsp), %r12
movl %eax, (%r12)
leaq 0xc(%rsp), %r13
leaq 0x8(%rsp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
leaq 0x129da(%rip), %rcx     # 0x280fd
movl $0x8c2, %r8d            # imm = 0x8C2
callq 0xa43a
andl $0x0, (%r13)
pushq $0x3
popq %rax
movl %eax, (%rbx)
movsbl 0x16(%r15), %eax
movl %eax, (%r12)
movq %r14, %r12
leaq 0xc(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x129a3(%rip), %rcx     # 0x280fd
movl $0x8c3, %r8d            # imm = 0x8C3
callq 0xa43a
movq 0xc8(%r14), %rbx
addq (%r15), %rbx
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x172e4
movq %rax, %r14
movl 0x194(%r12), %eax
cmpq %rax, %r14
ja 0x15901
testl %ebp, %ebp
jne 0x157bf
movq (%r15), %rcx
movq 0x70(%r12), %rdx
cmpq %rdx, %rcx
ja 0x157bf
movswq 0x14(%r15), %rsi
addq %rsi, %rcx
cmpq %rdx, %rcx
jb 0x157bf
ja 0x157bc
movsbq 0x16(%r15), %rcx
cmpq %rcx, 0x78(%r12)
jge 0x157bf
decq %r14
movl 0x190(%r12), %ecx
leaq (%rbx,%rcx), %r15
movq 0x1a0(%r12), %rdx
imulq %rax, %rdx
cmpq %rdx, (%rbx,%rcx)
ja 0x159a9
movq 0x108(%r12), %rcx
cmpq %rcx, 0x8(%r15)
ja 0x15a5a
cmpq %rcx, 0x10(%r15)
ja 0x15b03
cmpq %rcx, 0x18(%r15)
ja 0x15bac
movslq %ebp, %rbx
movq (%r15,%rbx,8), %r15
addq %r14, %r15
movq 0xa0(%r12), %rcx
addq (%rcx,%rbx,8), %r15
cmpq 0x8(%rcx,%rbx,8), %r15
ja 0x15c55
testl %ebp, %ebp
je 0x158e6
cmpq 0x110(%r12), %r15
jbe 0x158ef
movq 0x1e773(%rip), %r14     # 0x33fb8
leaq 0x12997(%rip), %rsi     # 0x281e3
movq %r14, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b0
leaq 0x12994(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0x110(%r12), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x14b93(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x12861(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x13e8d(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x8de, %esi            # imm = 0x8DE
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x13d49(%rip), %rdi     # 0x2961b
leaq 0x138cb(%rip), %rcx     # 0x291a4
movq %rbx, %rsi
movl $0x8de, %edx            # imm = 0x8DE
callq 0x4190
cmpq %rax, %r14
ja 0x15d02
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1e6b0(%rip), %r15     # 0x33fb8
leaq 0x128d4(%rip), %rsi     # 0x281e3
movq %r15, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x40b0
leaq 0x128d1(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movl 0x194(%r12), %esi
movq %rax, %rdi
callq 0x4400
leaq 0x14ad0(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x1279e(%rip), %rbx     # 0x280fd
movq %r15, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x13dca(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x8c6, %esi            # imm = 0x8C6
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x13c86(%rip), %rdi     # 0x2961b
leaq 0x13808(%rip), %rcx     # 0x291a4
movq %rbx, %rsi
movl $0x8c6, %edx            # imm = 0x8C6
callq 0x4190
movq 0x1e608(%rip), %r14     # 0x33fb8
leaq 0x1282c(%rip), %rsi     # 0x281e3
movq %r14, %rdi
callq 0x42d0
movq (%r15), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x12829(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movl 0x194(%r12), %esi
imulq 0x1a0(%r12), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x14a1f(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x126ed(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x13d19(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x8d4, %esi            # imm = 0x8D4
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x13bd5(%rip), %rdi     # 0x2961b
leaq 0x13757(%rip), %rcx     # 0x291a4
movq %rbx, %rsi
movl $0x8d4, %edx            # imm = 0x8D4
callq 0x4190
movq 0x1e557(%rip), %r14     # 0x33fb8
leaq 0x1277b(%rip), %rsi     # 0x281e3
movq %r14, %rdi
callq 0x42d0
movq 0x8(%r15), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x12777(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0x108(%r12), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x14976(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x12644(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x13c70(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x8d5, %esi            # imm = 0x8D5
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x13b2c(%rip), %rdi     # 0x2961b
leaq 0x136ae(%rip), %rcx     # 0x291a4
movq %rbx, %rsi
movl $0x8d5, %edx            # imm = 0x8D5
callq 0x4190
movq 0x1e4ae(%rip), %r14     # 0x33fb8
leaq 0x126d2(%rip), %rsi     # 0x281e3
movq %r14, %rdi
callq 0x42d0
movq 0x10(%r15), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x126ce(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0x108(%r12), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x148cd(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x1259b(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x13bc7(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x8d6, %esi            # imm = 0x8D6
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x13a83(%rip), %rdi     # 0x2961b
leaq 0x13605(%rip), %rcx     # 0x291a4
movq %rbx, %rsi
movl $0x8d6, %edx            # imm = 0x8D6
callq 0x4190
movq 0x1e405(%rip), %r14     # 0x33fb8
leaq 0x12629(%rip), %rsi     # 0x281e3
movq %r14, %rdi
callq 0x42d0
movq 0x18(%r15), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x12625(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0x108(%r12), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x14824(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x124f2(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x13b1e(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x8d7, %esi            # imm = 0x8D7
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x139da(%rip), %rdi     # 0x2961b
leaq 0x1355c(%rip), %rcx     # 0x291a4
movq %rbx, %rsi
movl $0x8d7, %edx            # imm = 0x8D7
callq 0x4190
movq 0x1e35c(%rip), %r14     # 0x33fb8
leaq 0x12580(%rip), %rsi     # 0x281e3
movq %r14, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b0
leaq 0x1257d(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0xa0(%r12), %rcx
movq 0x8(%rcx,%rbx,8), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x14777(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x12445(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x13a71(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x8da, %esi            # imm = 0x8DA
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x1392d(%rip), %rdi     # 0x2961b
leaq 0x134af(%rip), %rcx     # 0x291a4
movq %rbx, %rsi
movl $0x8da, %edx            # imm = 0x8DA
callq 0x4190
movq 0x1e2af(%rip), %r15     # 0x33fb8
leaq 0x124d3(%rip), %rsi     # 0x281e3
movq %r15, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x40b0
leaq 0x124d0(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movl 0x194(%r12), %esi
movq %rax, %rdi
callq 0x4400
leaq 0x146cf(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x1239d(%rip), %rbx     # 0x280fd
movq %r15, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x139c9(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x8dc, %esi            # imm = 0x8DC
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x13885(%rip), %rdi     # 0x2961b
leaq 0x13407(%rip), %rcx     # 0x291a4
movq %rbx, %rsi
movl $0x8dc, %edx            # imm = 0x8DC
callq 0x4190