// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ls.h
// Function: LarssonSadakane<int>::sort_split(int*, int)
inline void sort_split(T *p, T n)
	{
	   T *pa, *pb, *pc, *pd, *pl, *pm, *pn;
	   T f, v, s, t, tmp;

	   if (n<7) {                   /* multi-selection sort smallest arrays.*/
		  select_sort_split(p, n);
		  return;
	   }

	   v=choose_pivot(p, n);
	   pa=pb=p;
	   pc=pd=p+n-1;
	   while (1) {                  /* split-end partition.*/
		  while (pb<=pc && (f=LS_KEY(pb))<=v) {
			 if (f==v) {
				LS_SWAP(pa, pb);
				++pa;
			 }
			 ++pb;
		  }
		  while (pc>=pb && (f=LS_KEY(pc))>=v) {
			 if (f==v) {
				LS_SWAP(pc, pd);
				--pd;
			 }
			 --pc;
		  }
		  if (pb>pc)
			 break;
		  LS_SWAP(pb, pc);
		  ++pb;
		  --pc;
	   }
	   pn=p+n;
	   if ((s=(T)(pa-p))>(t=(T)(pb-pa)))
		  s=t;
	   for (pl=p, pm=pb-s; s; --s, ++pl, ++pm)
		  LS_SWAP(pl, pm);
	   if ((s=(T)(pd-pc))>(t=(T)(pn-pd-1)))
		  s=t;
	   for (pl=pb, pm=pn-s; s; --s, ++pl, ++pm)
		  LS_SWAP(pl, pm);

	   s=(T)(pb-pa);
	   t=(T)(pd-pc);
	   if (s>0)
		  sort_split(p, s);
	   update_group(p+s, p+n-t-1);
	   if (t>0)
		  sort_split(p+n-t, t);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movabsq $0x100000000, %r12      # imm = 0x100000000
cmpl $0x6, %r15d
jle 0x17c71
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x17d32
movl %r15d, %ecx
leaq (%r14,%rcx,4), %rdx
movq %rdx, (%rsp)
leaq (%r14,%rcx,4), %rdi
addq $-0x4, %rdi
movq %rdi, %rsi
movq %r14, %rdx
movq %r14, %rbp
movq %r14, %rcx
movq %rdx, %r13
shlq $0x1e, %r13
cmpq %rdi, %rcx
ja 0x17b2b
movq 0x8(%rbx), %r9
movslq (%rcx), %r8
movslq 0x14(%rbx), %r10
addq %r8, %r10
cmpl %eax, (%r9,%r10,4)
jg 0x17b2b
jne 0x17b1e
movl (%rbp), %r9d
movl %r8d, (%rbp)
movl %r9d, (%rcx)
addq $0x4, %rbp
addq $0x4, %rcx
addq %r12, %r13
addq $0x4, %rdx
jmp 0x17af4
movq %rdi, %r8
negq %r8
movq %rdi, %r9
cmpq %rcx, %rdi
jb 0x17b81
movq 0x8(%rbx), %r11
movslq (%rdi), %r10
movslq 0x14(%rbx), %r15
addq %r10, %r15
cmpl %eax, (%r11,%r15,4)
jl 0x17b6a
jne 0x17b5c
movl (%rsi), %r11d
movl %r11d, (%rdi)
movl %r10d, (%rsi)
addq $-0x4, %rsi
addq $-0x4, %rdi
addq $-0x4, %r9
addq $0x4, %r8
jmp 0x17b34
movl (%rcx), %edx
movl %r10d, (%rcx)
movl %edx, (%rdi)
addq $0x4, %rcx
addq $-0x4, %rdi
movq %rcx, %rdx
jmp 0x17aed
movq %rbp, %rax
subq %r14, %rax
shrq $0x2, %rax
subq %rbp, %rdx
shrq $0x2, %rdx
movslq %eax, %rdi
movslq %edx, %rax
cmpq %rax, %rdi
cmovlq %rdi, %rax
leaq (,%rax,4), %r10
movq %rcx, %rdi
subq %r10, %rdi
xorl %r10d, %r10d
cmpl %r10d, %eax
je 0x17bca
movl (%r14,%r10,4), %r11d
movl (%rdi,%r10,4), %r15d
movl %r15d, (%r14,%r10,4)
movl %r11d, (%rdi,%r10,4)
incq %r10
jmp 0x17bb0
movq %rsi, %r15
subq %r9, %r15
shrq $0x2, %r15
movq (%rsp), %r9
movq %r9, %rax
subq %rsi, %rax
shrq $0x2, %rax
decl %eax
movslq %eax, %rdi
addq %rsi, %r8
shrq $0x2, %r8
movslq %r8d, %rax
cmpq %rax, %rdi
cmovlq %rdi, %rax
leaq (,%rax,4), %rdi
movq %r9, %rsi
subq %rdi, %rsi
xorl %edi, %edi
cmpl %edi, %eax
je 0x17c21
movl (%rcx,%rdi,4), %r8d
movl (%rsi,%rdi,4), %r9d
movl %r9d, (%rcx,%rdi,4)
movl %r8d, (%rsi,%rdi,4)
incq %rdi
jmp 0x17c08
testl %edx, %edx
jle 0x17c30
movq %rbx, %rdi
movq %r14, %rsi
callq 0x17a98
shlq $0x1e, %rbp
subq %rbp, %r13
sarq $0x20, %r13
leaq (%r14,%r13,4), %rsi
movslq %r15d, %rax
shlq $0x2, %rax
movq (%rsp), %r14
subq %rax, %r14
leaq -0x4(%r14), %rdx
movq %rbx, %rdi
callq 0x17f00
testl %r15d, %r15d
jg 0x17ab6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17c8e
nop