// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpl $0x7, -0x14(%rbp)
jge 0x2d359
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x2d6d0
jmp 0x2d6bb
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x2d850
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, -0x38(%rbp)
movq %rax, -0x30(%rbp)
jmp 0x2d395
movq -0x28(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x71(%rbp)
ja 0x2d3c7
movq -0x70(%rbp), %rdx
movq 0x8(%rdx), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
cmpl -0x58(%rbp), %eax
setle %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x2d3d0
jmp 0x2d410
movl -0x54(%rbp), %eax
cmpl -0x58(%rbp), %eax
jne 0x2d402
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x64(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
jmp 0x2d395
jmp 0x2d412
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq -0x28(%rbp), %rcx
movb %al, -0x72(%rbp)
jb 0x2d444
movq -0x70(%rbp), %rdx
movq 0x8(%rdx), %rax
movq -0x30(%rbp), %rcx
movl (%rcx), %ecx
addl 0x14(%rdx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
cmpl -0x58(%rbp), %eax
setge %al
movb %al, -0x72(%rbp)
movb -0x72(%rbp), %al
testb $0x1, %al
jne 0x2d44d
jmp 0x2d48d
movl -0x54(%rbp), %eax
cmpl -0x58(%rbp), %eax
jne 0x2d47f
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x64(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $-0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
addq $-0x4, %rax
movq %rax, -0x30(%rbp)
jmp 0x2d412
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0x2d499
jmp 0x2d4d4
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x64(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $-0x4, %rax
movq %rax, -0x30(%rbp)
jmp 0x2d393
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, -0x5c(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rdx
subq %rdx, %rcx
sarq $0x2, %rcx
movl %ecx, -0x60(%rbp)
cmpl %ecx, %eax
jle 0x2d515
movl -0x60(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movslq -0x5c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x5c(%rbp)
je 0x2d57c
movq -0x40(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movl -0x64(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movl -0x5c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x48(%rbp)
jmp 0x2d535
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, -0x5c(%rbp)
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %rdx
subq %rdx, %rcx
sarq $0x2, %rcx
subq $0x1, %rcx
movl %ecx, -0x60(%rbp)
cmpl %ecx, %eax
jle 0x2d5ae
movl -0x60(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x5c(%rbp)
je 0x2d615
movq -0x40(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movl -0x64(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movl -0x5c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x48(%rbp)
jmp 0x2d5ce
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, -0x5c(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x5c(%rbp)
jle 0x2d64f
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x5c(%rbp), %edx
callq 0x2d320
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x5c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movq -0x10(%rbp), %rdx
movslq -0x14(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdx
movslq -0x60(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x2, %rax
addq %rax, %rdx
addq $-0x4, %rdx
callq 0x2e030
cmpl $0x0, -0x60(%rbp)
jle 0x2d6bb
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movslq -0x60(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x2, %rax
addq %rax, %rsi
movl -0x60(%rbp), %edx
callq 0x2d320
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop