// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./multikey_qsort.h
// Function: void sanityCheckOrderedSufs<S2bDnaString>(S2bDnaString const&, unsigned long, unsigned long*, unsigned long, unsigned long, unsigned long, unsigned long)
void sanityCheckOrderedSufs(const T& host,
                            size_t hlen,
                            TIndexOffU *s,
                            size_t slen,
                            size_t upto,
                            size_t lower = 0,
                            size_t upper = OFF_MASK)
{
	assert_lt(s[0], hlen);
	upper = min<size_t>(upper, slen-1);
	for(size_t i = lower; i < upper; i++) {
		// Allow s[i+t] to point off the end of the string; this is
		// convenient for some callers
		if(s[i+1] >= hlen) continue;
#ifndef NDEBUG
		if(upto == OFF_MASK) {
			assert(sstr_suf_lt(host, s[i], hlen, host, s[i+1], hlen, false));
		} else {
			if(sstr_suf_upto_lt(host, s[i], host, s[i+1], upto, false)) {
				// operator > treats shorter strings as
				// lexicographically smaller, but we want to opposite
				//assert(isPrefix(suffix(host, s[i+1]), suffix(host, s[i])));
			}
		}
#endif
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x20(%rsp)
movq %rdx, %r15
movq %rsi, %r14
cmpq %rsi, (%rdx)
jae 0x2066c
movq %r9, %rbp
movq %rdi, %rbx
movq 0x60(%rsp), %rax
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x8(%rsp)
movq %r14, 0x18(%rsp)
movq %r15, 0x10(%rsp)
cmpq %rcx, %rbp
jae 0x20515
movq %rbp, %rax
incq %rbp
movq 0x8(%r15,%rax,8), %r12
cmpq %r14, %r12
jae 0x20421
movq (%r15,%rax,8), %r13
cmpq $-0x1, 0x20(%rsp)
je 0x204d2
movq 0x18(%rbx), %r15
movq %r15, %rax
subq %r13, %rax
jb 0x20524
subq %r12, %r15
jb 0x205c8
movq 0x20(%rsp), %rcx
cmpq %rcx, %r15
cmovaeq %rcx, %r15
cmpq %rax, %r15
cmovaeq %rax, %r15
subq $0x1, %r15
jb 0x204be
movq %rbx, %rdi
movq %r13, %rsi
callq 0x22204
movl %eax, %r14d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22204
cmpb %al, %r14b
jl 0x204be
movq %rbx, %rdi
movq %r13, %rsi
callq 0x22204
movl %eax, %r14d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22204
incq %r12
incq %r13
cmpb %al, %r14b
jle 0x20476
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %rcx
jmp 0x20421
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
movq %r14, %r9
callq 0xd07a
movq 0x8(%rsp), %rcx
testb %al, %al
jne 0x20421
leaq 0xb3b1(%rip), %rdi      # 0x2b8ae
leaq 0xa819(%rip), %rsi      # 0x2ad1d
leaq 0xb333(%rip), %rcx      # 0x2b83e
movl $0x15a, %edx            # imm = 0x15A
callq 0x4190
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x13a8d(%rip), %r14     # 0x33fb8
leaq 0x7cb1(%rip), %rsi      # 0x281e3
movq %r14, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x40b0
leaq 0x7cae(%rip), %rsi      # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x9eb1(%rip), %rsi      # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0xaca3(%rip), %rbx      # 0x2b221
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x91ab(%rip), %rsi      # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0xe7, %esi
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x9067(%rip), %rdi      # 0x2961b
leaq 0xb32c(%rip), %rcx      # 0x2b8e7
movq %rbx, %rsi
movl $0xe7, %edx
callq 0x4190
movq 0x139e9(%rip), %r14     # 0x33fb8
leaq 0x7c0d(%rip), %rsi      # 0x281e3
movq %r14, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x40b0
leaq 0x7c0a(%rip), %rsi      # 0x281fa
movq %rax, %rdi
callq 0x42d0
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x9e0d(%rip), %rsi      # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0xabff(%rip), %rbx      # 0x2b221
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x9107(%rip), %rsi      # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0xe8, %esi
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x8fc3(%rip), %rdi      # 0x2961b
leaq 0xb288(%rip), %rcx      # 0x2b8e7
movq %rbx, %rsi
movl $0xe8, %edx
callq 0x4190
movq 0x13945(%rip), %rbx     # 0x33fb8
leaq 0x7c0d(%rip), %rsi      # 0x28287
movq %rbx, %rdi
callq 0x42d0
movq (%r15), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x7c09(%rip), %rsi      # 0x2829d
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x40b0
leaq 0x9d6a(%rip), %rsi      # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0xa658(%rip), %r14      # 0x2ad1d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42d0
leaq 0x9064(%rip), %rsi      # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0x152, %esi            # imm = 0x152
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x8f20(%rip), %rdi      # 0x2961b
leaq 0xb13c(%rip), %rcx      # 0x2b83e
movq %r14, %rsi
movl $0x152, %edx            # imm = 0x152
callq 0x4190