// File: /workspace/github_cpp_makefile_star2_O3/BenLangmead[P]bowtie/./multikey_qsort.h
// Function: void qsortSufDcU8<S2bDnaString, S2bDnaString>(S2bDnaString const&, S2bDnaString const&, unsigned long, unsigned long*, unsigned long, DifferenceCoverSample<S2bDnaString> const&, unsigned long, unsigned long, bool)
inline
void qsortSufDcU8(const T1& host1,
                  const T2& host,
                  size_t hlen,
                  TIndexOffU* s,
                  size_t slen,
                  const DifferenceCoverSample<T1>& dc,
                  size_t begin,
                  size_t end,
                  bool sanityCheck = false)
{
	assert_leq(end, slen);
	assert_lt(begin, slen);
	assert_gt(end, begin);
	size_t n = end - begin;
	if(n <= 1) return;                 // 1-element list already sorted
	// Note: rand() didn't really cut it here; it seemed to run out of
	// randomness and, after a time, returned the same thing over and
	// over again
	size_t a = (rand() % n) + begin; // choose pivot between begin and end
	assert_lt(a, end);
	assert_geq(a, begin);
	SWAP(s, end-1, a); // move pivot to end
	size_t cur = 0;
	for(size_t i = begin; i < end-1; i++) {
		if(sufDcLtU8(host1, host, hlen, s[i], s[end-1], dc, sanityCheck)) {
#ifndef NDEBUG
			if(sanityCheck) {
				assert(sstr_suf_lt(host1, s[i], hlen, host1, s[end-1], hlen, false));
			}
			assert_lt(begin + cur, end-1);

#endif
			SWAP(s, i, begin + cur);
			cur++;
		}
	}
	// Put pivot into place
	assert_lt(cur, end-begin);
	SWAP(s, end-1, begin+cur);
	if(begin+cur > begin) qsortSufDcU8(host1, host, hlen, s, slen, dc, begin, begin+cur);
	if(end > begin+cur+1) qsortSufDcU8(host1, host, hlen, s, slen, dc, begin+cur+1, end);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x38(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, 0x20(%rsp)
movq 0x88(%rsp), %r14
movq %r8, 0x8(%rsp)
cmpq %r8, %r14
ja 0x24fb3
movq %rcx, %rbp
movb 0x90(%rsp), %al
movl %eax, 0x14(%rsp)
movq 0x80(%rsp), %rax
leaq -0x1(%r14), %r12
cmpq 0x8(%rsp), %rax
jae 0x24c4a
movq %r14, %rbx
subq %rax, %rbx
jbe 0x24ba1
cmpq $0x2, %rbx
jb 0x249f0
movq %rax, 0x18(%rsp)
callq 0x40e0
cltq
xorl %edx, %edx
divq %rbx
movq 0x18(%rsp), %r15
movq %r14, %rax
movq %rdx, %r14
addq %r15, %r14
cmpq %rax, %r14
jae 0x24d95
cmpq %r15, %r14
jb 0x24cf2
movq %rbx, 0x40(%rsp)
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0xec66
cmpq %r12, %r15
jae 0x24960
movzbl 0x14(%rsp), %r13d
andl $0x1, %r13d
xorl %ebx, %ebx
movq 0x88(%rsp), %r14
movq (%rbp,%r15,8), %rcx
movq -0x8(%rbp,%r14,8), %r8
subq $0x8, %rsp
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x40(%rsp), %r9
pushq %r13
callq 0x25058
addq $0x10, %rsp
testb %al, %al
je 0x24952
testb $0x1, 0x14(%rsp)
je 0x24910
movq (%rbp,%r15,8), %rsi
movq -0x8(%rbp,%r14,8), %r8
movq 0x20(%rsp), %rcx
movq %rcx, %rdi
movq 0x28(%rsp), %rdx
movq %rdx, %r9
callq 0xf3e8
testb %al, %al
je 0x24b82
movq 0x18(%rsp), %rax
leaq (%rbx,%rax), %r14
cmpq %r12, %r14
jae 0x249ff
cmpq %rax, %r15
jb 0x24aa2
cmpq %rax, %r14
jb 0x24add
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xec66
incq %rbx
movq 0x88(%rsp), %r14
incq %r15
cmpq %r15, %r12
jne 0x248b1
jmp 0x2496a
xorl %ebx, %ebx
movq 0x88(%rsp), %r14
movq 0x40(%rsp), %r15
cmpq %r15, %rbx
jae 0x24e6a
movq 0x18(%rsp), %r15
addq %r15, %rbx
jb 0x24e3d
cmpq %r14, %rbx
jae 0x24f0d
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0xec66
movq 0x18(%rsp), %rax
cmpq %rax, %rbx
jbe 0x249d9
subq $0x8, %rsp
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbp, %rcx
movq 0x10(%rsp), %r8
movq 0x40(%rsp), %r9
pushq $0x0
pushq %rbx
pushq %rax
callq 0x247d8
addq $0x20, %rsp
incq %rbx
movl $0x0, 0x14(%rsp)
movq %rbx, %rax
cmpq %r14, %rbx
jb 0x2482a
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x125b2(%rip), %rbx     # 0x36fb8
leaq 0x78e7(%rip), %rsi      # 0x2c2f4
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x78e3(%rip), %rsi      # 0x2c30a
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r12, %rsi
callq 0x40c0
leaq 0x9964(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xa252(%rip), %r14      # 0x2ecaa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x8d3e(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x335, %esi            # imm = 0x335
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x8bfa(%rip), %rdi      # 0x2d688
leaq 0xa3e4(%rip), %rcx      # 0x2ee79
movq %r14, %rsi
movl $0x335, %edx            # imm = 0x335
callq 0x41c0
movq 0x1250f(%rip), %rbx     # 0x36fb8
leaq 0x7802(%rip), %rsi      # 0x2c2b2
movq %rbx, %rdi
movq %rax, %r14
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x77fc(%rip), %rsi      # 0x2c2c9
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
jmp 0x24b15
movq 0x124d4(%rip), %rbx     # 0x36fb8
leaq 0x77c7(%rip), %rsi      # 0x2c2b2
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x77c4(%rip), %rsi      # 0x2c2c9
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x40c0
leaq 0x9884(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xa172(%rip), %r14      # 0x2ecaa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x8c5e(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x338, %esi            # imm = 0x338
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x8b1a(%rip), %rdi      # 0x2d688
leaq 0xa304(%rip), %rcx      # 0x2ee79
movq %r14, %rsi
movl $0x338, %edx            # imm = 0x338
callq 0x41c0
leaq 0xa398(%rip), %rdi      # 0x2ef21
leaq 0xa11a(%rip), %rsi      # 0x2ecaa
leaq 0xa2e2(%rip), %rcx      # 0x2ee79
movl $0x333, %edx            # imm = 0x333
callq 0x41c0
movq 0x12410(%rip), %rbx     # 0x36fb8
leaq 0x75f6(%rip), %rsi      # 0x2c1a5
movq %rbx, %rdi
movq %r14, %r15
movq %rax, %r14
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x75ec(%rip), %rsi      # 0x2c1bb
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x97bc(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xa0aa(%rip), %r14      # 0x2ecaa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x8b96(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x324, %esi            # imm = 0x324
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x8a52(%rip), %rdi      # 0x2d688
leaq 0xa23c(%rip), %rcx      # 0x2ee79
movq %r14, %rsi
movl $0x324, %edx            # imm = 0x324
callq 0x41c0
movq 0x12367(%rip), %rbx     # 0x36fb8
leaq 0x769c(%rip), %rsi      # 0x2c2f4
movq %rbx, %rdi
movq %rax, %r14
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x7695(%rip), %rsi      # 0x2c30a
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x40c0
leaq 0x9714(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0xa002(%rip), %r14      # 0x2ecaa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x8aee(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x323, %esi            # imm = 0x323
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x89aa(%rip), %rdi      # 0x2d688
leaq 0xa194(%rip), %rcx      # 0x2ee79
movq %r14, %rsi
movl $0x323, %edx            # imm = 0x323
callq 0x41c0
movq 0x122bf(%rip), %rbx     # 0x36fb8
leaq 0x75b2(%rip), %rsi      # 0x2c2b2
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x75af(%rip), %rsi      # 0x2c2c9
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x9671(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x9f5f(%rip), %r14      # 0x2ecaa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x8a4b(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x32c, %esi            # imm = 0x32C
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x8907(%rip), %rdi      # 0x2d688
leaq 0xa0f1(%rip), %rcx      # 0x2ee79
movq %r14, %rsi
movl $0x32c, %edx            # imm = 0x32C
callq 0x41c0
movq 0x1221c(%rip), %rbx     # 0x36fb8
leaq 0x7551(%rip), %rsi      # 0x2c2f4
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x754d(%rip), %rsi      # 0x2c30a
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq 0x88(%rsp), %rsi
callq 0x40c0
leaq 0x95c9(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x9eb7(%rip), %r14      # 0x2ecaa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x89a3(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x32b, %esi            # imm = 0x32B
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x885f(%rip), %rdi      # 0x2d688
leaq 0xa049(%rip), %rcx      # 0x2ee79
movq %r14, %rsi
movl $0x32b, %edx            # imm = 0x32B
callq 0x41c0
movq 0x12174(%rip), %r14     # 0x36fb8
leaq 0x7467(%rip), %rsi      # 0x2c2b2
movq %r14, %rdi
callq 0x4310
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40c0
leaq 0x7464(%rip), %rsi      # 0x2c2c9
jmp 0x24f38
movq 0x12147(%rip), %r14     # 0x36fb8
leaq 0x747c(%rip), %rsi      # 0x2c2f4
movq %r14, %rdi
callq 0x4310
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40c0
leaq 0x7478(%rip), %rsi      # 0x2c30a
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x94f9(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x9de7(%rip), %rbx      # 0x2ecaa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x88d3(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x33d, %esi            # imm = 0x33D
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x878f(%rip), %rdi      # 0x2d688
leaq 0x9f79(%rip), %rcx      # 0x2ee79
movq %rbx, %rsi
movl $0x33d, %edx            # imm = 0x33D
callq 0x41c0
movq %r14, %r15
movq 0x120a1(%rip), %r14     # 0x36fb8
leaq 0x73d6(%rip), %rsi      # 0x2c2f4
movq %r14, %rdi
callq 0x4310
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40c0
leaq 0x73d2(%rip), %rsi      # 0x2c30a
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq %r15, %rsi
callq 0x40c0
leaq 0x9453(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x9d41(%rip), %rbx      # 0x2ecaa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4310
leaq 0x882d(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x33e, %esi            # imm = 0x33E
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x86e9(%rip), %rdi      # 0x2d688
leaq 0x9ed3(%rip), %rcx      # 0x2ee79
movq %rbx, %rsi
movl $0x33e, %edx            # imm = 0x33E
callq 0x41c0
movq 0x11ffe(%rip), %rbx     # 0x36fb8
leaq 0x728f(%rip), %rsi      # 0x2c250
movq %rbx, %rdi
callq 0x4310
movq %rax, %rdi
movq %r14, %rsi
callq 0x40c0
leaq 0x728c(%rip), %rsi      # 0x2c267
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x40c0
leaq 0x93ae(%rip), %rsi      # 0x2e3a5
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
callq 0x4150
leaq 0x9c9c(%rip), %r14      # 0x2ecaa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4310
leaq 0x8788(%rip), %rsi      # 0x2d7a8
movq %rax, %rdi
callq 0x4310
movq %rax, %rdi
movl $0x322, %esi            # imm = 0x322
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x8644(%rip), %rdi      # 0x2d688
leaq 0x9e2e(%rip), %rcx      # 0x2ee79
movq %r14, %rsi
movl $0x322, %edx            # imm = 0x322
callq 0x41c0