// File: /workspace/github_cpp_makefile_star2_O1/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 0x13b75(%rip), %rcx     # 0x2d0da
movq %r12, %rdi
movq %r13, %rsi
movl $0x8c1, %r8d            # imm = 0x8C1
callq 0xb7d6
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 0x13b2f(%rip), %rcx     # 0x2d0da
movl $0x8c2, %r8d            # imm = 0x8C2
callq 0xb7d6
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 0x13aec(%rip), %rcx     # 0x2d0da
movl $0x8c3, %r8d            # imm = 0x8C3
callq 0xb7d6
movq (%r15), %rcx
movq 0xc8(%r13), %rax
addq %rcx, %rax
movzwl 0x14(%r15), %edx
cmpb $0x0, (%r13)
movslq %r14d, %r12
je 0x1966c
cmpw $0x8, %dx
jl 0x196fe
leaq 0x179da(%rip), %rsi     # 0x31000
movq (%rsi,%r12,8), %rsi
xorl %ebx, %ebx
movabsq $0x5555555555555555, %rdi # imm = 0x5555555555555555
xorl %r14d, %r14d
movq %rbx, %r8
movq (%rax,%rbx), %r9
xorq %rsi, %r9
movq %r9, %r10
shrq %r10
andq %rdi, %r9
andq %r10, %r9
popcntq %r9, %r10
movslq %r10d, %r9
addq %r9, %r14
addq $0x8, %rbx
addq $0xf, %r8
cmpq %rdx, %r8
jb 0x19639
jmp 0x19708
cmpw $0x8, %dx
jl 0x19705
movabsq $0x1111111111111111, %rsi # imm = 0x1111111111111111
leaq 0x17979(%rip), %rdi     # 0x31000
movq (%rdi,%r12,8), %rdi
xorl %ebx, %ebx
movabsq $0x707070707070707, %r8 # imm = 0x707070707070707
xorl %r14d, %r14d
movq %rbx, %r9
movq (%rax,%rbx), %r10
xorq %rdi, %r10
movq %r10, %r11
shrq %r11
andq %r10, %r11
movq %r11, %r10
andq %rsi, %r10
shrq $0x2, %r11
andq %rsi, %r11
addq %r10, %r11
movq %r11, %r10
shrq $0x4, %r10
addq %r11, %r10
andq %r8, %r10
movq %r10, %r11
shrq $0x8, %r11
addq %r10, %r11
movq %r11, %r10
shrq $0x10, %r10
addq %r11, %r10
movq %r10, %r11
shrq $0x20, %r11
addl %r10d, %r11d
andl $0x3f, %r11d
addq %r11, %r14
addq $0x8, %rbx
addq $0xf, %r9
cmpq %rdx, %r9
jb 0x1969a
jmp 0x19708
xorl %r14d, %r14d
xorl %ebx, %ebx
jmp 0x19708
xorl %r14d, %r14d
movswl 0x14(%r15), %esi
cmpl %esi, %ebx
jge 0x1973a
movl %ebx, %edx
movl %esi, %edi
movq %r12, %r8
shlq $0x8, %r8
addq 0x1d8b5(%rip), %r8      # 0x36fd8
movzbl (%rax,%rdx), %r9d
movzbl (%r9,%r8), %r9d
addq %r9, %r14
incq %rdx
cmpq %rdx, %rdi
jne 0x19723
movl %esi, %ebx
movsbq 0x16(%r15), %rdi
testq %rdi, %rdi
jle 0x1976a
movl %ebx, %edx
movzbl (%rax,%rdx), %edx
movq %r12, %r8
movq %rdi, %r9
shlq $0xa, %r9
addq 0x1d87d(%rip), %r9      # 0x36fd8
shlq $0x8, %r8
addq %r8, %r9
movzbl (%rdx,%r9), %edx
addq %rdx, %r14
movl 0x194(%r13), %edx
cmpq %rdx, %r14
ja 0x198d8
testl %ebp, %ebp
jne 0x1979f
movq 0x70(%r13), %r8
cmpq %r8, %rcx
ja 0x1979f
movslq %esi, %rsi
addq %rsi, %rcx
cmpq %r8, %rcx
jb 0x1979f
ja 0x1979c
jne 0x1979f
cmpq %rdi, 0x78(%r13)
jge 0x1979f
decq %r14
movl 0x190(%r13), %ecx
leaq (%rax,%rcx), %rbx
movq 0x1a0(%r13), %rsi
imulq %rdx, %rsi
cmpq %rsi, (%rax,%rcx)
ja 0x1997f
movq 0x108(%r13), %rax
cmpq %rax, 0x8(%rbx)
ja 0x19a2e
cmpq %rax, 0x10(%rbx)
ja 0x19ad6
cmpq %rax, 0x18(%rbx)
ja 0x19b7e
movq (%rbx,%r12,8), %r15
addq %r14, %r15
movq 0xa0(%r13), %rax
addq (%rax,%r12,8), %r15
cmpq 0x8(%rax,%r12,8), %r15
ja 0x19c26
testl %ebp, %ebp
je 0x198bd
cmpq 0x110(%r13), %r15
jbe 0x198c6
movq 0x1d79b(%rip), %r14     # 0x36fb8
leaq 0x1399c(%rip), %rsi     # 0x2d1c0
movq %r14, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x13999(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movq 0x110(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x15ab9(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x13867(%rip), %rbx     # 0x2d0da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x14e93(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8de, %esi            # imm = 0x8DE
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x14d4f(%rip), %rdi     # 0x2e5f8
leaq 0x148d1(%rip), %rcx     # 0x2e181
movq %rbx, %rsi
movl $0x8de, %edx            # imm = 0x8DE
callq 0x41c0
cmpq %rdx, %r14
ja 0x19cd2
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1d6d9(%rip), %r15     # 0x36fb8
leaq 0x138da(%rip), %rsi     # 0x2d1c0
movq %r15, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x138d7(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movl 0x194(%r13), %esi
movq %rax, %rdi
callq 0x4440
leaq 0x159f7(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x137a5(%rip), %rbx     # 0x2d0da
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x14dd1(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8c6, %esi            # imm = 0x8C6
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x14c8d(%rip), %rdi     # 0x2e5f8
leaq 0x1480f(%rip), %rcx     # 0x2e181
movq %rbx, %rsi
movl $0x8c6, %edx            # imm = 0x8C6
callq 0x41c0
movq 0x1d632(%rip), %r14     # 0x36fb8
leaq 0x13833(%rip), %rsi     # 0x2d1c0
movq %r14, %rdi
callq 0x4310
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x13830(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movl 0x194(%r13), %esi
imulq 0x1a0(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x15948(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x136f6(%rip), %rbx     # 0x2d0da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x14d22(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8d4, %esi            # imm = 0x8D4
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x14bde(%rip), %rdi     # 0x2e5f8
leaq 0x14760(%rip), %rcx     # 0x2e181
movq %rbx, %rsi
movl $0x8d4, %edx            # imm = 0x8D4
callq 0x41c0
movq 0x1d583(%rip), %r14     # 0x36fb8
leaq 0x13784(%rip), %rsi     # 0x2d1c0
movq %r14, %rdi
callq 0x4310
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x13780(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movq 0x108(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x158a0(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x1364e(%rip), %rbx     # 0x2d0da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x14c7a(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8d5, %esi            # imm = 0x8D5
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x14b36(%rip), %rdi     # 0x2e5f8
leaq 0x146b8(%rip), %rcx     # 0x2e181
movq %rbx, %rsi
movl $0x8d5, %edx            # imm = 0x8D5
callq 0x41c0
movq 0x1d4db(%rip), %r14     # 0x36fb8
leaq 0x136dc(%rip), %rsi     # 0x2d1c0
movq %r14, %rdi
callq 0x4310
movq 0x10(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x136d8(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movq 0x108(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x157f8(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x135a6(%rip), %rbx     # 0x2d0da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x14bd2(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8d6, %esi            # imm = 0x8D6
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x14a8e(%rip), %rdi     # 0x2e5f8
leaq 0x14610(%rip), %rcx     # 0x2e181
movq %rbx, %rsi
movl $0x8d6, %edx            # imm = 0x8D6
callq 0x41c0
movq 0x1d433(%rip), %r14     # 0x36fb8
leaq 0x13634(%rip), %rsi     # 0x2d1c0
movq %r14, %rdi
callq 0x4310
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x13630(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movq 0x108(%r13), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x15750(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x134fe(%rip), %rbx     # 0x2d0da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x14b2a(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8d7, %esi            # imm = 0x8D7
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x149e6(%rip), %rdi     # 0x2e5f8
leaq 0x14568(%rip), %rcx     # 0x2e181
movq %rbx, %rsi
movl $0x8d7, %edx            # imm = 0x8D7
callq 0x41c0
movq 0x1d38b(%rip), %r14     # 0x36fb8
leaq 0x1358c(%rip), %rsi     # 0x2d1c0
movq %r14, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x13589(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movq 0xa0(%r13), %rcx
movq 0x8(%rcx,%r12,8), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x156a4(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x13452(%rip), %rbx     # 0x2d0da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x14a7e(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8da, %esi            # imm = 0x8DA
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x1493a(%rip), %rdi     # 0x2e5f8
leaq 0x144bc(%rip), %rcx     # 0x2e181
movq %rbx, %rsi
movl $0x8da, %edx            # imm = 0x8DA
callq 0x41c0
movq 0x1d2df(%rip), %r15     # 0x36fb8
leaq 0x134e0(%rip), %rsi     # 0x2d1c0
movq %r15, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x134dd(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movl 0x194(%r13), %esi
movq %rax, %rdi
callq 0x4440
leaq 0x155fd(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x133ab(%rip), %rbx     # 0x2d0da
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x149d7(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x8dc, %esi            # imm = 0x8DC
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x14893(%rip), %rdi     # 0x2e5f8
leaq 0x14415(%rip), %rcx     # 0x2e181
movq %rbx, %rsi
movl $0x8dc, %edx            # imm = 0x8DC
callq 0x41c0
nop