// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ebwt.h
// Function: Ebwt::sanityCheckAll(int) const
void Ebwt::sanityCheckAll(int reverse) const {
	const EbwtParams& eh = this->_eh;
	assert(isInMemory());
	// Check ftab
	for(TIndexOffU i = 1; i < eh._ftabLen; i++) {
		assert_geq(this->ftabHi(i), this->ftabLo(i-1));
		assert_geq(this->ftabLo(i), this->ftabHi(i-1));
		assert_leq(this->ftabHi(i), eh._bwtLen+1);
	}
	assert_eq(this->ftabHi(eh._ftabLen-1), eh._bwtLen);

	// Check offs
	TIndexOff seenLen = (eh._bwtLen + 31) >> ((TIndexOffU)5);
	TIndexOff *seen;
	try {
		seen = new TIndexOff[seenLen]; // bitvector marking seen offsets
	} catch(bad_alloc& e) {
		cerr << "Out of memory allocating seen[] at " << __FILE__ << ":" << __LINE__ << endl;
		throw e;
	}
	memset(seen, 0, OFF_SIZE * seenLen);
	TIndexOffU offsLen = eh._offsLen;
	for(TIndexOffU i = 0; i < offsLen; i++) {
		assert_lt(this->_offs[i], eh._bwtLen);
		TIndexOff w = this->_offs[i] >> 5;
		TIndexOff r = this->_offs[i] & 31;
		assert_eq(0, (seen[w] >> r) & 1); // shouldn't have been seen before
		seen[w] |= (1 << r);
	}
	delete[] seen;

	// Check nPat
	assert_gt(this->_nPat, 0);

	// Check plen, flen
	for(TIndexOffU i = 0; i < this->_nPat; i++) {
		assert_geq(this->_plen[i], 0);
	}

	// Check rstarts
	for(TIndexOffU i = 0; i < this->_nFrag-1; i++) {
		assert_gt(this->_rstarts[(i+1)*3], this->_rstarts[i*3]);
		if(reverse == REF_READ_REVERSE) {
			assert(this->_rstarts[(i*3)+1] >= this->_rstarts[((i+1)*3)+1]);
		} else {
			assert(this->_rstarts[(i*3)+1] <= this->_rstarts[((i+1)*3)+1]);
		}
	}

	// Check ebwt
	sanityCheckUpToSide(eh._numSides);
	VMSG_NL("Ebwt::sanityCheck passed");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movl %esi, %ebp
movq %rdi, %rbx
callq 0xd5d2
testb %al, %al
je 0x6453
pushq $0x1
popq %r14
movq 0x158(%rbx), %rsi
cmpq %rsi, %r14
jae 0x5dc8
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdcfc
movq %rax, %r12
leaq -0x1(%r14), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdd2a
cmpq %rax, %r12
jb 0x6001
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdd2a
movq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdcfc
cmpq %rax, %r12
jb 0x60c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdcfc
movq 0x110(%rbx), %rcx
incq %rcx
cmpq %rcx, %rax
ja 0x5f49
incq %r14
jmp 0x5d51
decq %rsi
movq %rbx, %rdi
callq 0xdcfc
cmpq 0x110(%rbx), %rax
jne 0x6472
movq %rax, %r14
movl %ebp, 0xc(%rsp)
leaq 0x1f(%rax), %r15
shrq $0x2, %r15
andq $-0x8, %r15
movq %r15, %rdi
callq 0x4030
movq %rax, %r12
xorl %ebp, %ebp
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x4160
movq 0xb8(%rbx), %rax
movq 0x168(%rbx), %rdx
pushq $0x1
popq %rsi
cmpq %rbp, %rdx
je 0x5e64
movq (%rax,%rbp,8), %rcx
cmpq %r14, %rcx
jae 0x62b2
movq %rcx, %rdi
shrq $0x5, %rdi
movl %ecx, %r15d
andl $0x1f, %r15d
movq (%r12,%rdi,8), %r13
btl %ecx, %r13d
jb 0x617f
movl %esi, %r8d
movl %r15d, %ecx
shll %cl, %r8d
movslq %r8d, %rcx
orq %rcx, %r13
movq %r13, (%r12,%rdi,8)
incq %rbp
jmp 0x5e1e
movq %r12, %rdi
callq 0x43d0
cmpq $0x0, 0x80(%rbx)
je 0x65d0
movq 0x88(%rbx), %rax
movq 0x98(%rbx), %rcx
decq %rax
xorl %r15d, %r15d
movl 0xc(%rsp), %edi
subq $0x1, %rax
jb 0x5ecf
movq 0x18(%rcx,%r15), %rdx
cmpq (%rcx,%r15), %rdx
jbe 0x6361
movq 0x8(%rcx,%r15), %rdx
movq 0x20(%rcx,%r15), %rsi
cmpl $0x1, %edi
jne 0x5ec0
cmpq %rsi, %rdx
jae 0x5ec9
jmp 0x6415
cmpq %rsi, %rdx
ja 0x6434
addq $0x18, %r15
jmp 0x5e92
movq 0x1a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x548c
cmpb $0x0, 0xc(%rbx)
je 0x5f37
leaq 0x30(%rsp), %rdi
callq 0x41c0
leaq 0x40(%rsp), %rdi
leaq 0x22417(%rip), %rsi     # 0x28311
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x48(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x4520
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0xdd64
leaq 0x10(%rsp), %rdi
callq 0x46c8
leaq 0x30(%rsp), %rdi
callq 0x4200
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e068(%rip), %r15     # 0x33fb8
leaq 0x2228c(%rip), %rsi     # 0x281e3
movq %r15, %rdi
callq 0x42d0
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdcfc
movq %r12, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x2227b(%rip), %rsi     # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0x110(%rbx), %rsi
incq %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x24478(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x22146(%rip), %rbx     # 0x280fd
movq %r15, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x23772(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x666, %esi            # imm = 0x666
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x2362e(%rip), %rdi     # 0x2961b
leaq 0x2222c(%rip), %rcx     # 0x28220
movq %rbx, %rsi
movl $0x666, %edx            # imm = 0x666
callq 0x4190
movq 0x2dfb0(%rip), %r12     # 0x33fb8
leaq 0x22236(%rip), %rsi     # 0x28245
movq %r12, %rdi
callq 0x42d0
movq %rax, %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdcfc
movq %r13, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x22225(%rip), %rsi     # 0x2825c
movq %rax, %rdi
callq 0x42d0
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdd2a
movq %r14, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x243b9(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x22087(%rip), %rbx     # 0x280fd
movq %r12, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x236b3(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x664, %esi            # imm = 0x664
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x2356f(%rip), %rdi     # 0x2961b
leaq 0x2216d(%rip), %rcx     # 0x28220
movq %rbx, %rsi
movl $0x664, %edx            # imm = 0x664
callq 0x4190
movq 0x2def1(%rip), %r12     # 0x33fb8
leaq 0x22177(%rip), %rsi     # 0x28245
movq %r12, %rdi
callq 0x42d0
movq %rax, %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdd2a
movq %r13, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x22166(%rip), %rsi     # 0x2825c
movq %rax, %rdi
callq 0x42d0
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdcfc
movq %r14, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x242fa(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x21fc8(%rip), %rbx     # 0x280fd
movq %r12, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x235f4(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x665, %esi            # imm = 0x665
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x234b0(%rip), %rdi     # 0x2961b
leaq 0x220ae(%rip), %rcx     # 0x28220
movq %rbx, %rsi
movl $0x665, %edx            # imm = 0x665
callq 0x4190
movq 0x2de32(%rip), %rbx     # 0x33fb8
leaq 0x21fcc(%rip), %rsi     # 0x28159
movq %rbx, %rdi
callq 0x42d0
movq %rax, %rdi
xorl %esi, %esi
callq 0x45d0
leaq 0x21fc9(%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 0x21f88(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
xorl %r12d, %r12d
btl %r15d, %r13d
setb %r12b
movq %rax, %rdi
movq %r12, %rsi
callq 0x4610
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 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 0x241c7(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x21e95(%rip), %r14     # 0x280fd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42d0
leaq 0x234c1(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x679, %esi            # imm = 0x679
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x2337d(%rip), %rdi     # 0x2961b
leaq 0x21f7b(%rip), %rcx     # 0x28220
movq %r14, %rsi
movl $0x679, %edx            # imm = 0x679
callq 0x4190
movq 0x2dcff(%rip), %r14     # 0x33fb8
leaq 0x21fc7(%rip), %rsi     # 0x28287
movq %r14, %rdi
callq 0x42d0
movq 0xb8(%rbx), %rcx
movq (%rcx,%rbp,8), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x21fbb(%rip), %rsi     # 0x2829d
movq %rax, %rdi
callq 0x42d0
movq 0x110(%rbx), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x24118(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x21de6(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x23412(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x676, %esi            # imm = 0x676
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x232ce(%rip), %rdi     # 0x2961b
leaq 0x21ecc(%rip), %rcx     # 0x28220
movq %rbx, %rsi
movl $0x676, %edx            # imm = 0x676
callq 0x4190
movq 0x2dc50(%rip), %r14     # 0x33fb8
leaq 0x21dc9(%rip), %rsi     # 0x28138
movq %r14, %rdi
callq 0x42d0
movq 0x98(%rbx), %rcx
movq 0x18(%rcx,%r15), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x21dbc(%rip), %rsi     # 0x2814e
movq %rax, %rdi
callq 0x42d0
movq 0x98(%rbx), %rcx
movq (%rcx,%r15), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x24064(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x21d32(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x2335e(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x688, %esi            # imm = 0x688
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x2321a(%rip), %rdi     # 0x2961b
leaq 0x21e18(%rip), %rcx     # 0x28220
movq %rbx, %rsi
movl $0x688, %edx            # imm = 0x688
callq 0x4190
leaq 0x21e87(%rip), %rdi     # 0x282a3
leaq 0x21cda(%rip), %rsi     # 0x280fd
leaq 0x21df6(%rip), %rcx     # 0x28220
movl $0x68a, %edx            # imm = 0x68A
callq 0x4190
leaq 0x21e9f(%rip), %rdi     # 0x282da
leaq 0x21cbb(%rip), %rsi     # 0x280fd
leaq 0x21dd7(%rip), %rcx     # 0x28220
movl $0x68c, %edx            # imm = 0x68C
callq 0x4190
leaq 0x21c96(%rip), %rdi     # 0x280f0
leaq 0x21c9c(%rip), %rsi     # 0x280fd
leaq 0x21db8(%rip), %rcx     # 0x28220
movl $0x661, %edx            # imm = 0x661
callq 0x4190
movq 0x2db3f(%rip), %r14     # 0x33fb8
leaq 0x21cd9(%rip), %rsi     # 0x28159
movq %r14, %rdi
callq 0x42d0
movq %rax, %r15
movq 0x158(%rbx), %rsi
decq %rsi
movq %rbx, %rdi
callq 0xdcfc
movq %r15, %rdi
movq %rax, %rsi
callq 0x40b0
leaq 0x21cc0(%rip), %r15     # 0x2816f
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%r12,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r12,%rax)
movq 0x158(%rbx), %rsi
decq %rsi
movq %rbx, %rdi
callq 0xdcfc
movq %r12, %rdi
movq %rax, %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 0x21c67(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
movq 0x110(%rbx), %rsi
movq %rax, %rdi
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 0x110(%rbx), %rsi
movq %rax, %rdi
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 0x23ea9(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x21b77(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x231a3(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x668, %esi            # imm = 0x668
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x2305f(%rip), %rdi     # 0x2961b
leaq 0x21c5d(%rip), %rcx     # 0x28220
movq %rbx, %rsi
movl $0x668, %edx            # imm = 0x668
callq 0x4190
movq 0x2d9e1(%rip), %r14     # 0x33fb8
leaq 0x21b5a(%rip), %rsi     # 0x28138
movq %r14, %rdi
callq 0x42d0
movq 0x80(%rbx), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x21b52(%rip), %rsi     # 0x2814e
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
xorl %esi, %esi
callq 0x45d0
leaq 0x23e03(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x21ad1(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x230fd(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x67f, %esi            # imm = 0x67F
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x22fb9(%rip), %rdi     # 0x2961b
leaq 0x21bb7(%rip), %rcx     # 0x28220
movq %rbx, %rsi
movl $0x67f, %edx            # imm = 0x67F
callq 0x4190
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x46c8
jmp 0x668a
jmp 0x6687
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4200
jmp 0x6727
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x6727
movq %rbx, %rdi
callq 0x4110
movq 0x2d93c(%rip), %rdi     # 0x33ff0
leaq 0x21ba8(%rip), %rsi     # 0x28263
callq 0x42d0
leaq 0x21a36(%rip), %rsi     # 0x280fd
movq %rax, %rdi
callq 0x42d0
leaq 0x23065(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x670, %esi            # imm = 0x670
callq 0x45d0
movq %rax, %rdi
callq 0x4130
pushq $0x8
popq %rdi
callq 0x4140
movq 0x2d8a6(%rip), %rcx     # 0x33fa8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x2d8b0(%rip), %rsi     # 0x33fc0
movq 0x2d879(%rip), %rdx     # 0x33f90
movq %rax, %rdi
callq 0x45b0
movq %rax, %rbx
callq 0x4540
movq %rbx, %rdi
callq 0x45e0
movq %rax, %rdi
callq 0xdd58
nop