// File: BenLangmead[P]bowtie/./blockwise_sa.h
// Function: KarkkainenBlockwiseSA<SString<char>>::qsort(EList<unsigned int, 128>&)
void KarkkainenBlockwiseSA<TStr>::qsort(EList<TIndexOffU>& bucket) {
	const TStr& t = this->text();
	TIndexOffU *s = &bucket[0];
	TIndexOffU slen = (TIndexOffU)bucket.size();
	TIndexOffU len = (TIndexOffU)t.length();
	if(_dc != NULL) {
		// Use the difference cover as a tie-breaker if we have it
		VMSG_NL("  (Using difference cover)");
		// Extract the 'host' array because it's faster to work
		// with than the String<> container
		uint8_t *host = (uint8_t*)&t[0];
		mkeyQSortSufDcU8(t, host, len, s, slen, *_dc, 4,
				 this->verbose(), this->sanityCheck());
	} else {
		VMSG_NL("  (Not using difference cover)");
		// We don't have a difference cover - just do a normal
		// suffix sort
		mkeyQSortSuf(t, s, slen, 4,
			     this->verbose(), this->sanityCheck());
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x271c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x14410
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x14440
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
callq 0x14c10
movq %rax, %rcx
movq -0x398(%rbp), %rax
movl %ecx, -0x28(%rbp)
cmpq $0x0, 0x78(%rax)
je 0x250bf
movq -0x398(%rbp), %rdi
callq 0x271e0
testb $0x1, %al
jne 0x24f3a
jmp 0x24ffe
leaq -0x1b0(%rbp), %rdi
callq 0x6280
leaq -0x1a0(%rbp), %rdi
leaq 0x1f0dc(%rip), %rsi     # 0x44030
callq 0x6410
movq %rax, -0x3a0(%rbp)
jmp 0x24f62
movq -0x3a0(%rbp), %rdi
movq 0x2cff8(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x24f77
leaq -0x1e0(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x6400
jmp 0x24f8c
movq -0x398(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x28930
jmp 0x24fa1
leaq -0x1e0(%rbp), %rdi
callq 0x69a8
leaq -0x1b0(%rbp), %rdi
callq 0x62c0
jmp 0x24ffe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x24fed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x69a8
leaq -0x1b0(%rbp), %rdi
callq 0x62c0
jmp 0x25220
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x14c30
movq -0x398(%rbp), %rdi
movq %rax, -0x1e8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x3c8(%rbp)
movl -0x28(%rbp), %eax
movq %rax, -0x3c0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x3b8(%rbp)
movl -0x24(%rbp), %eax
movq %rax, -0x3b0(%rbp)
movq 0x78(%rdi), %rax
movq %rax, -0x3a8(%rbp)
callq 0x271e0
movq -0x398(%rbp), %rdi
movb %al, -0x3c9(%rbp)
callq 0x27200
movb -0x3c9(%rbp), %sil
movq -0x3c8(%rbp), %rdi
movq -0x3c0(%rbp), %rdx
movq -0x3b8(%rbp), %rcx
movq -0x3b0(%rbp), %r8
movq -0x3a8(%rbp), %r9
movzbl %al, %r10d
andl $0x1, %r10d
movq %rsp, %rax
movl %r10d, 0x10(%rax)
movzbl %sil, %esi
andl $0x1, %esi
movl %esi, 0x8(%rax)
movl $0x4, (%rax)
leaq -0x1e8(%rbp), %rsi
callq 0x30dd0
jmp 0x25217
movq -0x398(%rbp), %rdi
callq 0x271e0
testb $0x1, %al
jne 0x250d4
jmp 0x25198
leaq -0x370(%rbp), %rdi
callq 0x6280
leaq -0x360(%rbp), %rdi
leaq 0x1ef5d(%rip), %rsi     # 0x4404b
callq 0x6410
movq %rax, -0x3d8(%rbp)
jmp 0x250fc
movq -0x3d8(%rbp), %rdi
movq 0x2ce5e(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x25111
leaq -0x390(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0x6400
jmp 0x25126
movq -0x398(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x28930
jmp 0x2513b
leaq -0x390(%rbp), %rdi
callq 0x69a8
leaq -0x370(%rbp), %rdi
callq 0x62c0
jmp 0x25198
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x25187
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x69a8
leaq -0x370(%rbp), %rdi
callq 0x62c0
jmp 0x25220
movq -0x398(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x3f0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x3e8(%rbp)
movl -0x24(%rbp), %eax
movq %rax, -0x3e0(%rbp)
callq 0x271e0
movq -0x398(%rbp), %rdi
movb %al, -0x3f1(%rbp)
callq 0x27200
movb -0x3f1(%rbp), %cl
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
movq -0x3e0(%rbp), %rdx
movq %rsp, %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movq %r9, (%r8)
movzbl %cl, %r8d
andl $0x1, %r8d
movzbl %al, %r9d
andl $0x1, %r9d
movl $0x4, %ecx
callq 0x30ec0
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
movq -0x1b8(%rbp), %rdi
callq 0x6850
nopl (%rax)