// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq %rdi, %rbx
callq 0xfb60
testb %al, %al
je 0x6097
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl 0x18c(%rbx), %eax
testq %rax, %rax
sete %cl
testq %r15, %r15
sete %dl
orb %cl, %dl
jne 0x59c6
movq %rbx, %r11
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r10d, %r10d
xorl %r14d, %r14d
movq %r15, 0x28(%rsp)
addq %r10, %rax
cmpq 0x1b0(%r11), %rax
ja 0x5afd
movq %rcx, 0x30(%rsp)
movq %rsi, 0x38(%rsp)
movl 0x190(%r11), %edi
testl %edi, %edi
je 0x58f7
xorl %ebp, %ebp
movq %r10, 0x40(%rsp)
movl %ebp, %eax
notl %eax
addl %edi, %eax
testb $0x1, %r14b
cmovnel %ebp, %eax
movq %r11, %rbx
movq 0xc8(%r11), %rcx
addq %r10, %rcx
movb (%rax,%rcx), %r12b
movl $0x3, %r15d
xorl %r13d, %r13d
testb $0x1, %r14b
movl %r15d, %esi
cmovnel %r13d, %esi
movzbl %r12b, %edi
callq 0x53b3
movl %eax, %eax
incq (%rsp,%rax,8)
incl %r13d
decl %r15d
cmpl $0x4, %r13d
jne 0x58a0
movl 0x8(%rsp), %r12d
addl (%rsp), %r12d
addl 0x10(%rsp), %r12d
addl 0x18(%rsp), %r12d
andl $0x3, %r12d
jne 0x59d5
incl %ebp
movq %rbx, %r11
movl 0x190(%rbx), %edi
cmpl %edi, %ebp
movq 0x40(%rsp), %r10
jb 0x5879
movq (%rsp), %r8
movq 0x8(%rsp), %rbp
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rcx
leaq (%rsi,%rcx), %r12
addq %rbp, %r12
addq %r8, %r12
movl 0x194(%r11), %r9d
movq %r12, %rax
xorl %edx, %edx
divq %r9
testq %rdx, %rdx
jne 0x5bb3
movl %edi, %eax
testb $0x1, %r14b
je 0x596e
movq 0xc8(%r11), %rcx
addq %r10, %rcx
movq (%rax,%rcx), %r12
movq 0x38(%rsp), %r13
cmpq %r13, %r12
jne 0x5cfa
movq 0x8(%rcx,%rax), %r12
movq 0x30(%rsp), %r15
cmpq %r15, %r12
jne 0x5e43
xorl %r14d, %r14d
movq %r15, %rcx
movq %r13, %rsi
jmp 0x59a7
movq 0xc8(%r11), %rdx
addq %r10, %rdx
movq (%rax,%rdx), %rdi
cmpq %r8, %rdi
sete %r9b
decq %r8
cmpq %r8, %rdi
sete %dil
orb %r9b, %dil
je 0x5e24
movq 0x8(%rdx,%rax), %r15
movb $0x1, %r14b
cmpq %rbp, %r15
jne 0x5f6d
movl 0x18c(%r11), %eax
addq %rax, %r10
movq %rax, %rdx
movq 0x28(%rsp), %r15
imulq %r15, %rdx
cmpq %rdx, %r10
jb 0x5849
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x315dc(%rip), %rbx     # 0x36fb8
leaq 0x27753(%rip), %rsi     # 0x2d136
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
xorl %esi, %esi
callq 0x4610
leaq 0x27750(%rip), %r14     # 0x2d14c
movq %rax, %rdi
movq %r14, %rsi
callq 0x4310
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 0x4610
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x2770f(%rip), %rsi     # 0x2d151
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r12, %rsi
callq 0x40c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x4310
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 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x29879(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x27627(%rip), %r14     # 0x2d0da
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x28c53(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x640, %esi            # imm = 0x640
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x28b0f(%rip), %rdi     # 0x2e5f8
leaq 0x276a0(%rip), %rcx     # 0x2d190
movq %r14, %rsi
movl $0x640, %edx            # imm = 0x640
callq 0x41c0
movq 0x314b4(%rip), %r14     # 0x36fb8
leaq 0x276b5(%rip), %rsi     # 0x2d1c0
movq %r14, %rdi
movq %r10, %r15
movq %r11, %rbx
callq 0x4310
movl 0x18c(%rbx), %ecx
addq %rcx, %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x276a3(%rip), %rsi     # 0x2d1d7
movq %rax, %rdi
callq 0x4310
movq 0x1b0(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x297c3(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x27571(%rip), %rbx     # 0x2d0da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x28b9d(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x637, %esi            # imm = 0x637
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x28a59(%rip), %rdi     # 0x2e5f8
leaq 0x275ea(%rip), %rcx     # 0x2d190
movq %rbx, %rsi
movl $0x637, %edx            # imm = 0x637
callq 0x41c0
movq 0x313fe(%rip), %r14     # 0x36fb8
leaq 0x27575(%rip), %rsi     # 0x2d136
movq %r14, %rdi
movq %r11, %rbx
callq 0x4310
movq %rax, %rdi
xorl %esi, %esi
callq 0x4610
leaq 0x2756f(%rip), %r15     # 0x2d14c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4310
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 0x4610
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x2752e(%rip), %rsi     # 0x2d151
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl 0x194(%rbx), %ecx
movq %r12, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
callq 0x40c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4310
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 %r12, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rsi
callq 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x2967c(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x2742a(%rip), %rbx     # 0x2d0da
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x28a56(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x642, %esi            # imm = 0x642
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x28912(%rip), %rdi     # 0x2e5f8
leaq 0x274a3(%rip), %rcx     # 0x2d190
movq %rbx, %rsi
movl $0x642, %edx            # imm = 0x642
callq 0x41c0
movq 0x312b7(%rip), %rbx     # 0x36fb8
leaq 0x2742e(%rip), %rsi     # 0x2d136
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq %r12, %rsi
callq 0x40c0
leaq 0x2742a(%rip), %r15     # 0x2d14c
movq %rax, %rdi
movq %r15, %rsi
callq 0x4310
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 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x273e8(%rip), %rsi     # 0x2d151
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r13, %rsi
callq 0x40c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4310
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 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x29552(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x27300(%rip), %r14     # 0x2d0da
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x2892c(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x649, %esi            # imm = 0x649
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x287e8(%rip), %rdi     # 0x2e5f8
leaq 0x27379(%rip), %rcx     # 0x2d190
movq %r14, %rsi
movl $0x649, %edx            # imm = 0x649
callq 0x41c0
leaq 0x273b3(%rip), %rdi     # 0x2d1de
leaq 0x272a8(%rip), %rsi     # 0x2d0da
leaq 0x27357(%rip), %rcx     # 0x2d190
movl $0x652, %edx            # imm = 0x652
callq 0x41c0
movq 0x3116e(%rip), %rbx     # 0x36fb8
leaq 0x272e5(%rip), %rsi     # 0x2d136
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq %r12, %rsi
callq 0x40c0
leaq 0x272e1(%rip), %r14     # 0x2d14c
movq %rax, %rdi
movq %r14, %rsi
callq 0x4310
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 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x2729f(%rip), %rsi     # 0x2d151
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x4310
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 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x29409(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x271b7(%rip), %r14     # 0x2d0da
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x287e3(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x64a, %esi            # imm = 0x64A
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x2869f(%rip), %rdi     # 0x2e5f8
leaq 0x27230(%rip), %rcx     # 0x2d190
movq %r14, %rsi
movl $0x64a, %edx            # imm = 0x64A
callq 0x41c0
movq 0x31044(%rip), %rbx     # 0x36fb8
leaq 0x271bb(%rip), %rsi     # 0x2d136
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x271b7(%rip), %r14     # 0x2d14c
movq %rax, %rdi
movq %r14, %rsi
callq 0x4310
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 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x27175(%rip), %rsi     # 0x2d151
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %rbp, %rsi
callq 0x40c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x4310
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 %rbp, %rsi
callq 0x40c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x292df(%rip), %rsi     # 0x2f315
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x2708d(%rip), %r14     # 0x2d0da
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x286b9(%rip), %rsi     # 0x2e718
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x653, %esi            # imm = 0x653
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x28575(%rip), %rdi     # 0x2e5f8
leaq 0x27106(%rip), %rcx     # 0x2d190
movq %r14, %rsi
movl $0x653, %edx            # imm = 0x653
callq 0x41c0
leaq 0x2702f(%rip), %rdi     # 0x2d0cd
leaq 0x27035(%rip), %rsi     # 0x2d0da
leaq 0x270e4(%rip), %rcx     # 0x2d190
movl $0x630, %edx            # imm = 0x630
callq 0x41c0