// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpq -0x10(%rbp), %rax
jb 0x3256d
movq 0x17b04(%rip), %rdi     # 0x49fc0
leaq 0xcd84(%rip), %rsi      # 0x3f247
callq 0x5360
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0xcd7c(%rip), %rsi      # 0x3f25d
callq 0x5360
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0xf0bc(%rip), %rsi      # 0x415b8
callq 0x5360
movq %rax, %rdi
movq 0x17a75(%rip), %rsi     # 0x49f80
callq 0x53c0
movq 0x17aa9(%rip), %rdi     # 0x49fc0
leaq 0xfa10(%rip), %rsi      # 0x41f2e
callq 0x5360
movq %rax, %rdi
leaq 0xe25d(%rip), %rsi      # 0x4078a
callq 0x5360
movq %rax, %rdi
movl $0x152, %esi            # imm = 0x152
callq 0x5750
movq %rax, %rdi
movq 0x17a37(%rip), %rsi     # 0x49f80
callq 0x53c0
leaq 0xe115(%rip), %rdi      # 0x4066a
leaq 0xf9d2(%rip), %rsi      # 0x41f2e
movl $0x152, %edx            # imm = 0x152
leaq 0x10548(%rip), %rcx     # 0x42ab0
callq 0x51e0
movq -0x20(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1b390
movq (%rax), %rax
movq %rax, 0x10(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq 0x10(%rbp), %rax
jae 0x3266c
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
cmpq -0x10(%rbp), %rax
jb 0x325bb
jmp 0x3265b
cmpq $-0x1, -0x28(%rbp)
jne 0x32622
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %r8
movq 0x8(%rax,%r8,8), %r8
movq -0x10(%rbp), %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x15f40
testb $0x1, %al
jne 0x325ff
jmp 0x32601
jmp 0x32620
leaq 0x10518(%rip), %rdi     # 0x42b20
leaq 0xf91f(%rip), %rsi      # 0x41f2e
movl $0x15a, %edx            # imm = 0x15A
leaq 0x10495(%rip), %rcx     # 0x42ab0
callq 0x51e0
jmp 0x32659
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rcx
movq -0x28(%rbp), %r8
xorl %r9d, %r9d
callq 0x17580
testb $0x1, %al
jne 0x32655
jmp 0x32657
jmp 0x32657
jmp 0x32659
jmp 0x3265b
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x32595
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)