// File: /workspace/github_cpp_makefile_star2_O3/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, %r14d
movq %rsi, %rbp
movq %rdi, %r15
leaq 0x14(%rsp), %rdx
movl %r14d, (%rdx)
xorl %ebx, %ebx
leaq 0xc(%rsp), %r12
movl %ebx, (%r12)
movl $0x3, %eax
leaq 0x8(%rsp), %r13
movl %eax, (%r13)
leaq 0x130e5(%rip), %rcx     # 0x2c16a
movq %r12, %rdi
movq %r13, %rsi
movl $0x8c1, %r8d            # imm = 0x8C1
callq 0xb674
movl %ebx, (%r12)
movl 0x190(%r15), %eax
decl %eax
movl %eax, (%r13)
movswl 0x14(%rbp), %eax
leaq 0x10(%rsp), %r12
movl %eax, (%r12)
leaq 0xc(%rsp), %r13
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rdx
leaq 0x1309f(%rip), %rcx     # 0x2c16a
movl $0x8c2, %r8d            # imm = 0x8C2
callq 0xb674
movl %ebx, (%r13)
movq %r15, %r13
movq %rbp, %r15
movl $0x3, %eax
leaq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movl %r14d, %ebp
movsbl 0x16(%r15), %eax
movl %eax, (%r12)
leaq 0xc(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x1305c(%rip), %rcx     # 0x2c16a
movl $0x8c3, %r8d            # imm = 0x8C3
callq 0xb674
movq (%r15), %rcx
movq 0xc8(%r13), %rax
addq %rcx, %rax
movzwl 0x14(%r15), %esi
movswl %si, %edx
cmpb $0x0, (%r13)
movslq %r14d, %r12
je 0x1918f
cmpw $0x8, %si
jl 0x19220
leaq 0x16f47(%rip), %rdi     # 0x30090
movq (%rdi,%r12,8), %rdi
xorl %ebx, %ebx
movabsq $0x5555555555555555, %r8 # imm = 0x5555555555555555
xorl %r14d, %r14d
movq %rbx, %r9
movq (%rax,%rbx), %r10
xorq %rdi, %r10
movq %r10, %r11
shrq %r11
andq %r8, %r10
andq %r11, %r10
popcntq %r10, %r11
movslq %r11d, %r10
addq %r10, %r14
addq $0x8, %rbx
addq $0xf, %r9
cmpq %rsi, %r9
jb 0x1915c
jmp 0x1922a
cmpw $0x8, %si
jl 0x19227
movabsq $0x1111111111111111, %rdi # imm = 0x1111111111111111
leaq 0x16ee6(%rip), %r8      # 0x30090
movq (%r8,%r12,8), %r8
xorl %ebx, %ebx
movabsq $0x707070707070707, %r9 # imm = 0x707070707070707
xorl %r14d, %r14d
movq %rbx, %r10
movq (%rax,%rbx), %r11
xorq %r8, %r11
movq %r11, %rbx
shrq %rbx
andq %r11, %rbx
movq %rbx, %r11
andq %rdi, %r11
shrq $0x2, %rbx
andq %rdi, %rbx
addq %r11, %rbx
movq %rbx, %r11
shrq $0x4, %r11
addq %rbx, %r11
andq %r9, %r11
movq %r11, %rbx
shrq $0x8, %rbx
addq %r11, %rbx
movq %rbx, %r11
shrq $0x10, %r11
addq %rbx, %r11
movq %r11, %rbx
shrq $0x20, %rbx
addl %r11d, %ebx
andl $0x3f, %ebx
addq %rbx, %r14
leaq 0x8(%r10), %rbx
addq $0xf, %r10
cmpq %rsi, %r10
jb 0x191bd
jmp 0x1922a
xorl %r14d, %r14d
xorl %ebx, %ebx
jmp 0x1922a
xorl %r14d, %r14d
cmpl %edx, %ebx
jge 0x19257
movl %ebx, %esi
movl %edx, %edi
movq %r12, %r8
shlq $0x8, %r8
addq 0x1dd98(%rip), %r8      # 0x36fd8
movzbl (%rax,%rsi), %r9d
movzbl (%r9,%r8), %r9d
addq %r9, %r14
incq %rsi
cmpq %rsi, %rdi
jne 0x19240
movl %edx, %ebx
movsbq 0x16(%r15), %rdi
testq %rdi, %rdi
jle 0x19287
movl %ebx, %esi
movzbl (%rax,%rsi), %esi
movq %r12, %r8
movq %rdi, %r9
shlq $0xa, %r9
addq 0x1dd60(%rip), %r9      # 0x36fd8
shlq $0x8, %r8
addq %r8, %r9
movzbl (%rsi,%r9), %esi
addq %rsi, %r14
movl 0x194(%r13), %esi
cmpq %rsi, %r14
ja 0x193fe
testl %ebp, %ebp
jne 0x192c5
movq 0x70(%r13), %r8
cmpq %r8, %rcx
ja 0x192c5
movslq %edx, %rdx
addq %rdx, %rcx
cmpq %r8, %rcx
jb 0x192c5
seta %cl
movsbq %dil, %rdx
cmpq %rdx, 0x78(%r13)
setl %dl
orb %cl, %dl
movzbl %dl, %ecx
subq %rcx, %r14
movl 0x190(%r13), %ecx
leaq (%rax,%rcx), %rbx
movq 0x1a0(%r13), %rdx
imulq %rsi, %rdx
cmpq %rdx, (%rax,%rcx)
ja 0x194a5
movq 0x108(%r13), %rax
cmpq %rax, 0x8(%rbx)
ja 0x19554
cmpq %rax, 0x10(%rbx)
ja 0x195fc
cmpq %rax, 0x18(%rbx)
ja 0x196a4
movq (%rbx,%r12,8), %r15
addq %r14, %r15
movq 0xa0(%r13), %rax
addq (%rax,%r12,8), %r15
cmpq 0x8(%rax,%r12,8), %r15
ja 0x1974c
testl %ebp, %ebp
je 0x193e3
cmpq 0x110(%r13), %r15
jbe 0x193ec
movq 0x1dc75(%rip), %r14     # 0x36fb8
leaq 0x12f06(%rip), %rsi     # 0x2c250
movq %r14, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x12f03(%rip), %rsi     # 0x2c267
movq %rax, %rdi
callq 0x4310
movq 0x110(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x15023(%rip), %rsi     # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x12dd1(%rip), %rbx     # 0x2c16a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x143fd(%rip), %rsi     # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8de, %esi            # imm = 0x8DE
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x142b9(%rip), %rdi     # 0x2d688
leaq 0x13e3b(%rip), %rcx     # 0x2d211
movq %rbx, %rsi
movl $0x8de, %edx            # imm = 0x8DE
callq 0x41c0
cmpq %rsi, %r14
ja 0x197f8
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1dbb3(%rip), %r15     # 0x36fb8
leaq 0x12e44(%rip), %rsi     # 0x2c250
movq %r15, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x12e41(%rip), %rsi     # 0x2c267
movq %rax, %rdi
callq 0x4310
movl 0x194(%r13), %esi
movq %rax, %rdi
callq 0x4440
leaq 0x14f61(%rip), %rsi     # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x12d0f(%rip), %rbx     # 0x2c16a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x1433b(%rip), %rsi     # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8c6, %esi            # imm = 0x8C6
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x141f7(%rip), %rdi     # 0x2d688
leaq 0x13d79(%rip), %rcx     # 0x2d211
movq %rbx, %rsi
movl $0x8c6, %edx            # imm = 0x8C6
callq 0x41c0
movq 0x1db0c(%rip), %r14     # 0x36fb8
leaq 0x12d9d(%rip), %rsi     # 0x2c250
movq %r14, %rdi
callq 0x4310
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x12d9a(%rip), %rsi     # 0x2c267
movq %rax, %rdi
callq 0x4310
movl 0x194(%r13), %esi
imulq 0x1a0(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x14eb2(%rip), %rsi     # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x12c60(%rip), %rbx     # 0x2c16a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x1428c(%rip), %rsi     # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8d4, %esi            # imm = 0x8D4
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x14148(%rip), %rdi     # 0x2d688
leaq 0x13cca(%rip), %rcx     # 0x2d211
movq %rbx, %rsi
movl $0x8d4, %edx            # imm = 0x8D4
callq 0x41c0
movq 0x1da5d(%rip), %r14     # 0x36fb8
leaq 0x12cee(%rip), %rsi     # 0x2c250
movq %r14, %rdi
callq 0x4310
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x12cea(%rip), %rsi     # 0x2c267
movq %rax, %rdi
callq 0x4310
movq 0x108(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x14e0a(%rip), %rsi     # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x12bb8(%rip), %rbx     # 0x2c16a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x141e4(%rip), %rsi     # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8d5, %esi            # imm = 0x8D5
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x140a0(%rip), %rdi     # 0x2d688
leaq 0x13c22(%rip), %rcx     # 0x2d211
movq %rbx, %rsi
movl $0x8d5, %edx            # imm = 0x8D5
callq 0x41c0
movq 0x1d9b5(%rip), %r14     # 0x36fb8
leaq 0x12c46(%rip), %rsi     # 0x2c250
movq %r14, %rdi
callq 0x4310
movq 0x10(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x12c42(%rip), %rsi     # 0x2c267
movq %rax, %rdi
callq 0x4310
movq 0x108(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x14d62(%rip), %rsi     # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x12b10(%rip), %rbx     # 0x2c16a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x1413c(%rip), %rsi     # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8d6, %esi            # imm = 0x8D6
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x13ff8(%rip), %rdi     # 0x2d688
leaq 0x13b7a(%rip), %rcx     # 0x2d211
movq %rbx, %rsi
movl $0x8d6, %edx            # imm = 0x8D6
callq 0x41c0
movq 0x1d90d(%rip), %r14     # 0x36fb8
leaq 0x12b9e(%rip), %rsi     # 0x2c250
movq %r14, %rdi
callq 0x4310
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x12b9a(%rip), %rsi     # 0x2c267
movq %rax, %rdi
callq 0x4310
movq 0x108(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x14cba(%rip), %rsi     # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x12a68(%rip), %rbx     # 0x2c16a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x14094(%rip), %rsi     # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8d7, %esi            # imm = 0x8D7
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x13f50(%rip), %rdi     # 0x2d688
leaq 0x13ad2(%rip), %rcx     # 0x2d211
movq %rbx, %rsi
movl $0x8d7, %edx            # imm = 0x8D7
callq 0x41c0
movq 0x1d865(%rip), %r14     # 0x36fb8
leaq 0x12af6(%rip), %rsi     # 0x2c250
movq %r14, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x12af3(%rip), %rsi     # 0x2c267
movq %rax, %rdi
callq 0x4310
movq 0xa0(%r13), %rcx
movq 0x8(%rcx,%r12,8), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x14c0e(%rip), %rsi     # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x129bc(%rip), %rbx     # 0x2c16a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x13fe8(%rip), %rsi     # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8da, %esi            # imm = 0x8DA
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x13ea4(%rip), %rdi     # 0x2d688
leaq 0x13a26(%rip), %rcx     # 0x2d211
movq %rbx, %rsi
movl $0x8da, %edx            # imm = 0x8DA
callq 0x41c0
movq 0x1d7b9(%rip), %r15     # 0x36fb8
leaq 0x12a4a(%rip), %rsi     # 0x2c250
movq %r15, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x12a47(%rip), %rsi     # 0x2c267
movq %rax, %rdi
callq 0x4310
movl 0x194(%r13), %esi
movq %rax, %rdi
callq 0x4440
leaq 0x14b67(%rip), %rsi     # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x12915(%rip), %rbx     # 0x2c16a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x13f41(%rip), %rsi     # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8dc, %esi            # imm = 0x8DC
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x13dfd(%rip), %rdi     # 0x2d688
leaq 0x1397f(%rip), %rcx     # 0x2d211
movq %rbx, %rsi
movl $0x8dc, %edx            # imm = 0x8DC
callq 0x41c0
nop