// File: BenLangmead[P]bowtie/./diff_sample.h
// Function: DifferenceCoverSample<SString<char>>::doBuiltSanityCheck() const
void DifferenceCoverSample<TStr>::doBuiltSanityCheck() const {
	uint32_t v = this->v();
	assert(built());
	VMSG_NL("  Doing sanity check");
	TIndexOffU added = 0;
	EList<TIndexOffU> sorted;
	sorted.resizeExact(_isaPrime.size());
	sorted.fill(OFF_MASK);
	for(size_t di = 0; di < this->d(); di++) {
		uint32_t d = _ds[di];
		size_t i = 0;
		for(size_t doi = _doffs[di]; doi < _doffs[di+1]; doi++, i++) {
			assert_eq(OFF_MASK, sorted[_isaPrime[doi]]);
			// Maps the offset of the suffix to its rank
			sorted[_isaPrime[doi]] = (TIndexOffU)(v*i + d);
			added++;
		}
	}
	assert_eq(added, _isaPrime.size());
	for(size_t i = 0; i < sorted.size()-1; i++) {
		assert(suffixLt(this->text(), sorted[i], sorted[i+1]));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x2a570
movq -0x228(%rbp), %rdi
movl %eax, -0xc(%rbp)
callq 0x2a4d0
testb $0x1, %al
jne 0x2aeb7
jmp 0x2af7b
leaq -0x198(%rbp), %rdi
callq 0x6280
leaq -0x188(%rbp), %rdi
leaq 0x1b860(%rip), %rsi     # 0x46731
callq 0x6410
movq %rax, -0x230(%rbp)
jmp 0x2aedf
movq -0x230(%rbp), %rdi
movq 0x2707b(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x2aef4
leaq -0x1c8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x6400
jmp 0x2af09
movq -0x228(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2a4f0
jmp 0x2af1e
leaq -0x1c8(%rbp), %rdi
callq 0x69a8
leaq -0x198(%rbp), %rdi
callq 0x62c0
jmp 0x2af7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0x2af6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x69a8
leaq -0x198(%rbp), %rdi
callq 0x62c0
jmp 0x2b1b4
movl $0x0, -0x1cc(%rbp)
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x1b460
movq -0x228(%rbp), %rdi
addq $0x78, %rdi
callq 0x14440
movq -0x238(%rbp), %rdi
movq %rax, %rsi
callq 0x2a3c0
jmp 0x2afb9
movl $0xffffffff, -0x1f4(%rbp) # imm = 0xFFFFFFFF
leaq -0x1f0(%rbp), %rdi
leaq -0x1f4(%rbp), %rsi
callq 0x2a440
movq $0x0, -0x200(%rbp)
movq -0x228(%rbp), %rdi
movq -0x200(%rbp), %rax
movq %rax, -0x240(%rbp)
callq 0x2b200
movl %eax, %ecx
movq -0x240(%rbp), %rax
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x2b151
movq -0x228(%rbp), %rdi
addq $0x10, %rdi
movq -0x200(%rbp), %rsi
callq 0x19d10
movq -0x228(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x204(%rbp)
movq $0x0, -0x210(%rbp)
addq $0x58, %rdi
movq -0x200(%rbp), %rsi
callq 0x19d10
movl (%rax), %eax
movq %rax, -0x218(%rbp)
movq -0x228(%rbp), %rdi
movq -0x218(%rbp), %rax
movq %rax, -0x248(%rbp)
addq $0x58, %rdi
movq -0x200(%rbp), %rsi
addq $0x1, %rsi
callq 0x19d10
movq %rax, %rcx
movq -0x248(%rbp), %rax
movl (%rcx), %ecx
cmpq %rcx, %rax
jae 0x2b138
movq -0x228(%rbp), %rdi
movl -0xc(%rbp), %eax
imulq -0x210(%rbp), %rax
movl -0x204(%rbp), %ecx
addq %rcx, %rax
movl %eax, -0x24c(%rbp)
addq $0x78, %rdi
movq -0x218(%rbp), %rsi
callq 0x19d10
movl (%rax), %eax
movl %eax, %esi
leaq -0x1f0(%rbp), %rdi
callq 0x14410
movl -0x24c(%rbp), %ecx
movl %ecx, (%rax)
movl -0x1cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1cc(%rbp)
movq -0x218(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x218(%rbp)
movq -0x210(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x210(%rbp)
jmp 0x2b059
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x1d0c0
jmp 0x2b1b4
jmp 0x2b13a
movq -0x200(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x200(%rbp)
jmp 0x2afe1
movq $0x0, -0x220(%rbp)
movq -0x220(%rbp), %rax
movq %rax, -0x258(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x14440
movq %rax, %rcx
movq -0x258(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x2b19f
jmp 0x2b18b
movq -0x220(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x220(%rbp)
jmp 0x2b15c
leaq -0x1f0(%rbp), %rdi
callq 0x1d0c0
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0x1a0(%rbp), %rdi
callq 0x6850