// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ebwt.h
// Function: Ebwt::sanityCheckUpToSide(long) const
void Ebwt::sanityCheckUpToSide(TIndexOff upToSide) const {
	assert(isInMemory());
	TIndexOffU occ[] = {0, 0, 0, 0};
	ASSERT_ONLY(TIndexOffU occ_save[] = {0, 0});
	TIndexOffU cur = 0; // byte pointer
	const EbwtParams& eh = this->_eh;
	bool fw = false;
	while(cur < (TIndexOffU)(upToSide * eh._sideSz)) {
		assert_leq(cur + eh._sideSz, eh._ebwtTotLen);
		for(uint32_t i = 0; i < eh._sideBwtSz; i++) {
			uint8_t by = this->_ebwt[cur + (fw ? i : eh._sideBwtSz-i-1)];
			for(int j = 0; j < 4; j++) {
				// Unpack from lowest to highest bit pair
				int twoBit = unpack_2b_from_8b(by, fw ? j : 3-j);
				occ[twoBit]++;
				//if(_verbose) cout << "ACGT"[twoBit];
			}
			assert_eq(0, (occ[0] + occ[1] + occ[2] + occ[3]) % 4);
		}
		assert_eq(0, (occ[0] + occ[1] + occ[2] + occ[3]) % eh._sideBwtLen);
		if(fw) {
			// Finished forward bucket; check saved [G] and [T]
			// against the two uint32_ts encoded here
			ASSERT_ONLY(TIndexOffU *u32ebwt = reinterpret_cast<TIndexOffU*>(&this->_ebwt[cur + eh._sideBwtSz]));
			ASSERT_ONLY(TIndexOffU gs = u32ebwt[0]);
			ASSERT_ONLY(TIndexOffU ts = u32ebwt[1]);
			assert_eq(gs, occ_save[0]);
			assert_eq(ts, occ_save[1]);
			fw = false;
		} else {
			// Finished backward bucket; check current [A] and [C]
			// against the two uint32_ts encoded here
			ASSERT_ONLY(TIndexOffU *u32ebwt = reinterpret_cast<TIndexOffU*>(&this->_ebwt[cur + eh._sideBwtSz]));
			ASSERT_ONLY(TIndexOffU as = u32ebwt[0]);
			ASSERT_ONLY(TIndexOffU cs = u32ebwt[1]);
			assert(as == occ[0] || as == occ[0]-1); // one 'a' is a skipped '$' and doesn't count toward occ[]
			assert_eq(cs, occ[1]);
			ASSERT_ONLY(occ_save[0] = occ[2]); // save gs
			ASSERT_ONLY(occ_save[1] = occ[3]); // save ts
			fw = true;
		}
		cur += eh._sideSz;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
callq 0xd5d2
testb %al, %al
je 0x5d0b
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movl 0x18c(%rbx), %eax
xorl %esi, %esi
xorl %edi, %edi
xorl %r12d, %r12d
xorl %ecx, %ecx
xorl %r15d, %r15d
xorl %ebp, %ebp
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq %rbx, 0x18(%rsp)
movl %eax, %eax
movq %rax, %rdx
imulq 0x10(%rsp), %rdx
cmpq %rdx, %rbp
jae 0x563a
addq %rbp, %rax
cmpq 0x1b0(%rbx), %rax
ja 0x5771
xorl %r14d, %r14d
movl 0x190(%rbx), %r8d
cmpl %r8d, %r14d
jae 0x55a6
movl %r14d, %eax
notl %eax
addl %r8d, %eax
testb $0x1, %r15b
cmovnel %r14d, %eax
movq 0xc8(%rbx), %rcx
movq %rbp, %rbx
addq %rbp, %rcx
movb (%rax,%rcx), %r12b
xorl %r13d, %r13d
pushq $0x3
popq %rbp
cmpl $0x4, %r13d
je 0x556b
testb $0x1, %r15b
movl %ebp, %esi
cmovnel %r13d, %esi
movzbl %r12b, %edi
callq 0x5095
movl %eax, %eax
incq 0x20(%rsp,%rax,8)
incl %r13d
decl %ebp
jmp 0x5544
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r12
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
leal (%rsi,%rdi), %r13d
addl %r12d, %r13d
addl %ecx, %r13d
andl $0x3, %r13d
incl %r14d
testl %r13d, %r13d
movq %rbx, %rbp
movq 0x18(%rsp), %rbx
je 0x550d
jmp 0x5649
leaq (%rdi,%rsi), %r13
addq %r12, %r13
addq %rcx, %r13
movl 0x194(%rbx), %r9d
movq %r13, %rax
xorl %edx, %edx
divq %r9
testq %rdx, %rdx
jne 0x5821
movq 0xc8(%rbx), %rax
addq %rbp, %rax
movq (%r8,%rax), %r13
testb $0x1, %r15b
je 0x55f7
cmpq 0x8(%rsp), %r13
jne 0x5965
movq 0x8(%rax,%r8), %r13
cmpq (%rsp), %r13
je 0x5628
jmp 0x5ab3
cmpq %rcx, %r13
sete %dl
leaq -0x1(%rcx), %r9
cmpq %r9, %r13
sete %r9b
orb %dl, %r9b
je 0x5a94
movq 0x8(%rax,%r8), %r13
movq %rsi, (%rsp)
movq %rdi, 0x8(%rsp)
cmpq %r12, %r13
jne 0x5be1
xorb $0x1, %r15b
movl 0x18c(%rbx), %eax
addq %rax, %rbp
jmp 0x54e6
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e968(%rip), %rbx     # 0x33fb8
leaq 0x22b02(%rip), %rsi     # 0x28159
movq %rbx, %rdi
callq 0x42d0
movq %rax, %rdi
xorl %esi, %esi
callq 0x45d0
leaq 0x22aff(%rip), %r14     # 0x2816f
movq %rax, %rdi
movq %r14, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
xorl %esi, %esi
callq 0x45d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x22abe(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x24d08(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x229d6(%rip), %r14     # 0x280fd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42d0
leaq 0x24002(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x640, %esi            # imm = 0x640
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x23ebe(%rip), %rdi     # 0x2961b
leaq 0x22a4f(%rip), %rcx     # 0x281b3
movq %r14, %rsi
movl $0x640, %edx            # imm = 0x640
callq 0x4190
movq 0x2e840(%rip), %r14     # 0x33fb8
leaq 0x22a64(%rip), %rsi     # 0x281e3
movq %r14, %rdi
callq 0x42d0
movl 0x18c(%rbx), %ecx
addq %rcx, %rbp
movq %rax, %rdi
movq %rbp, %rsi
callq 0x40b0
leaq 0x22a58(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0x1b0(%rbx), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x24c58(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x22926(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x23f52(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x637, %esi            # imm = 0x637
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x23e0e(%rip), %rdi     # 0x2961b
leaq 0x2299f(%rip), %rcx     # 0x281b3
movq %rbx, %rsi
movl $0x637, %edx            # imm = 0x637
callq 0x4190
movq 0x2e790(%rip), %r14     # 0x33fb8
leaq 0x2292a(%rip), %rsi     # 0x28159
movq %r14, %rdi
callq 0x42d0
movq %rax, %rdi
xorl %esi, %esi
callq 0x45d0
leaq 0x22927(%rip), %r15     # 0x2816f
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
xorl %esi, %esi
callq 0x45d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x228e6(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl 0x194(%rbx), %ecx
movq %r13, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
callq 0x40b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
movq %rax, %rdi
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rdi,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rdi,%rax)
movl 0x194(%rbx), %ecx
movq %r13, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x24b14(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x227e2(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x23e0e(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x642, %esi            # imm = 0x642
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x23cca(%rip), %rdi     # 0x2961b
leaq 0x2285b(%rip), %rcx     # 0x281b3
movq %rbx, %rsi
movl $0x642, %edx            # imm = 0x642
callq 0x4190
movq 0x2e64c(%rip), %rbx     # 0x33fb8
leaq 0x227e6(%rip), %rsi     # 0x28159
movq %rbx, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
leaq 0x227e2(%rip), %r14     # 0x2816f
movq %rax, %rdi
movq %r14, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x227a0(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x40b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x249e5(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x226b3(%rip), %r14     # 0x280fd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42d0
leaq 0x23cdf(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x649, %esi            # imm = 0x649
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x23b9b(%rip), %rdi     # 0x2961b
leaq 0x2272c(%rip), %rcx     # 0x281b3
movq %r14, %rsi
movl $0x649, %edx            # imm = 0x649
callq 0x4190
leaq 0x22766(%rip), %rdi     # 0x28201
leaq 0x2265b(%rip), %rsi     # 0x280fd
leaq 0x2270a(%rip), %rcx     # 0x281b3
movl $0x652, %edx            # imm = 0x652
callq 0x4190
movq 0x2e4fe(%rip), %rbx     # 0x33fb8
leaq 0x22698(%rip), %rsi     # 0x28159
movq %rbx, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
leaq 0x22694(%rip), %r15     # 0x2816f
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x22652(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movq (%rsp), %r14
movq %r14, %rsi
callq 0x40b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r14, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x24898(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x22566(%rip), %r14     # 0x280fd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42d0
leaq 0x23b92(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x64a, %esi            # imm = 0x64A
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x23a4e(%rip), %rdi     # 0x2961b
leaq 0x225df(%rip), %rcx     # 0x281b3
movq %r14, %rsi
movl $0x64a, %edx            # imm = 0x64A
callq 0x4190
movq 0x2e3d0(%rip), %rbx     # 0x33fb8
leaq 0x2256a(%rip), %rsi     # 0x28159
movq %rbx, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
leaq 0x22566(%rip), %r14     # 0x2816f
movq %rax, %rdi
movq %r14, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x22524(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x40b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r12, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x2476e(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x2243c(%rip), %r14     # 0x280fd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42d0
leaq 0x23a68(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x653, %esi            # imm = 0x653
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x23924(%rip), %rdi     # 0x2961b
leaq 0x224b5(%rip), %rcx     # 0x281b3
movq %r14, %rsi
movl $0x653, %edx            # imm = 0x653
callq 0x4190
leaq 0x223de(%rip), %rdi     # 0x280f0
leaq 0x223e4(%rip), %rsi     # 0x280fd
leaq 0x22493(%rip), %rcx     # 0x281b3
movl $0x630, %edx            # imm = 0x630
callq 0x4190