// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x6, %r15d
jle 0x1e251
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1e348
movl %r15d, %ecx
leaq (%r14,%rcx,4), %r13
leaq (%r14,%rcx,4), %rdx
addq $-0x4, %rdx
movq %rdx, %r15
movq %r14, %rcx
movq %r14, %rsi
cmpq %rdx, %rcx
ja 0x1e134
movq 0x8(%rbx), %r8
movslq (%rcx), %rdi
movslq 0x14(%rbx), %r9
addq %rdi, %r9
cmpl %eax, (%r8,%r9,4)
jg 0x1e134
jne 0x1e11b
movl (%rsi), %r8d
movl %edi, (%rsi)
movl %r8d, (%rcx)
addq $0x4, %rsi
addq $0x4, %rcx
jmp 0x1e0f4
jne 0x1e130
movl (%r15), %r8d
movl %r8d, (%rdx)
movl %edi, (%r15)
addq $-0x4, %r15
addq $-0x4, %rdx
cmpq %rcx, %rdx
jb 0x1e15f
movq 0x8(%rbx), %r8
movslq (%rdx), %rdi
movslq 0x14(%rbx), %r9
addq %rdi, %r9
cmpl %eax, (%r8,%r9,4)
jge 0x1e121
movl (%rcx), %r8d
movl %edi, (%rcx)
movl %r8d, (%rdx)
addq $0x4, %rcx
addq $-0x4, %rdx
jmp 0x1e0f4
movq %rcx, %r12
subq %rsi, %r12
subq %r14, %rsi
shrq $0x2, %rsi
shrq $0x2, %r12
cmpl %r12d, %esi
cmovgel %r12d, %esi
testl %esi, %esi
je 0x1e1a1
movslq %esi, %rdi
shlq $0x2, %rdi
movq %rcx, %rax
subq %rdi, %rax
xorl %edi, %edi
movl (%r14,%rdi,4), %r8d
movl (%rax,%rdi,4), %r9d
movl %r9d, (%r14,%rdi,4)
movl %r8d, (%rax,%rdi,4)
incq %rdi
cmpl %edi, %esi
jne 0x1e18a
movq %r13, %rax
subq %r15, %rax
subq %rdx, %r15
shrq $0x2, %r15
shrq $0x2, %rax
decl %eax
cmpl %r15d, %eax
cmovgel %r15d, %eax
testl %eax, %eax
je 0x1e1e3
movslq %eax, %rsi
shlq $0x2, %rsi
movq %r13, %rdx
subq %rsi, %rdx
xorl %esi, %esi
movl (%rcx,%rsi,4), %edi
movl (%rdx,%rsi,4), %r8d
movl %r8d, (%rcx,%rsi,4)
movl %edi, (%rdx,%rsi,4)
incq %rsi
cmpl %esi, %eax
jne 0x1e1ce
testl %r12d, %r12d
jle 0x1e1f6
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x1e0b2
movslq %r12d, %rax
leaq (%r14,%rax,4), %rax
movslq %r15d, %rcx
shlq $0x2, %rcx
subq %rcx, %r13
leaq -0x4(%r13), %rcx
movq %rcx, %rdx
subq (%rbx), %rdx
shrq $0x2, %rdx
movq 0x8(%rbx), %rsi
movslq (%rax), %rdi
movl %edx, (%rsi,%rdi,4)
cmpq %rcx, %rax
je 0x1e23a
movq 0x8(%rbx), %rsi
movslq 0x4(%rax), %rdi
addq $0x4, %rax
movl %edx, (%rsi,%rdi,4)
cmpq %rcx, %rax
jb 0x1e224
jmp 0x1e240
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq %r13, %r14
testl %r15d, %r15d
jg 0x1e0c4
jmp 0x1e33e
movslq %r15d, %rax
leaq (%r14,%rax,4), %rax
addq $-0x4, %rax
cmpq %r14, %rax
jbe 0x1e31c
leaq 0x4(%r14), %rdx
movq 0x8(%rbx), %rsi
movl (%r14), %edi
cmpq %rax, %rdx
jbe 0x1e27a
movq %rdx, %rcx
jmp 0x1e2d6
movslq %edi, %rcx
movslq 0x14(%rbx), %rdi
addq %rcx, %rdi
movl (%rsi,%rdi,4), %edi
movq %rdx, %rcx
movq %rdx, %rsi
movq 0x8(%rbx), %r8
movslq (%rsi), %r9
movslq 0x14(%rbx), %r10
addq %r9, %r10
movl (%r8,%r10,4), %r8d
cmpl %edi, %r8d
jge 0x1e2b1
movl (%r14), %ecx
movl %ecx, (%rsi)
movl %r9d, (%r14)
movq %rdx, %rcx
jmp 0x1e2c3
jne 0x1e2c0
movl (%rcx), %r8d
movl %r8d, (%rsi)
movl %r9d, (%rcx)
addq $0x4, %rcx
movl %edi, %r8d
addq $0x4, %rsi
movl %r8d, %edi
cmpq %rax, %rsi
jbe 0x1e28d
movq 0x8(%rbx), %rsi
movl (%r14), %edi
leaq -0x4(%rcx), %rdx
movq %rdx, %r8
subq (%rbx), %r8
shrq $0x2, %r8
movslq %edi, %rdi
movl %r8d, (%rsi,%rdi,4)
cmpq %rdx, %r14
je 0x1e307
movq 0x8(%rbx), %rsi
movslq 0x4(%r14), %rdi
addq $0x4, %r14
movl %r8d, (%rsi,%rdi,4)
cmpq %rdx, %r14
jb 0x1e2f0
jmp 0x1e30e
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movq %rcx, %r14
cmpq %rax, %rcx
jb 0x1e265
jmp 0x1e31f
movq %r14, %rcx
cmpq %rax, %rcx
jne 0x1e33e
movq %rax, %rcx
subq (%rbx), %rcx
shrq $0x2, %rcx
movq 0x8(%rbx), %rdx
movslq (%rax), %rsi
movl %ecx, (%rdx,%rsi,4)
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq