// File: readmapping[P]alfalfa/src/qsufsort.c
// Function: sort_split
static void sort_split(int *p, int n)
{
   int *pa, *pb, *pc, *pd, *pl, *pm, *pn;
   int 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=KEY(pb))<=v) {
         if (f==v) {
            SWAP(pa, pb);
            ++pa;
         }
         ++pb;
      }
      while (pc>=pb && (f=KEY(pc))>=v) {
         if (f==v) {
            SWAP(pc, pd);
            --pd;
         }
         --pc;
      }
      if (pb>pc)
         break;
      SWAP(pb, pc);
      ++pb;
      --pc;
   }
   pn=p+n;
   if ((s=pa-p)>(t=pb-pa))
      s=t;
   for (pl=p, pm=pb-s; s; --s, ++pl, ++pm)
      SWAP(pl, pm);
   if ((s=pd-pc)>(t=pn-pd-1))
      s=t;
   for (pl=pb, pm=pn-s; s; --s, ++pl, ++pm)
      SWAP(pl, pm);

   s=pb-pa;
   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:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
cmpl $0x7, 0x5c(%rsp)
jge 0x72b37
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
callq 0x72f20
jmp 0x72f1b
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
callq 0x730c0
movl %eax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq 0x60(%rsp), %rax
movslq 0x5c(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
addq $-0x4, %rax
movq %rax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
jmp 0x72b79
movq 0x48(%rsp), %rcx
xorl %eax, %eax
cmpq 0x40(%rsp), %rcx
movb %al, 0xb(%rsp)
ja 0x72bb4
movq 0x2496e(%rip), %rax     # 0x97500
movq 0x48(%rsp), %rcx
movl (%rcx), %ecx
addl 0x24971(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1c(%rsp)
cmpl 0x18(%rsp), %eax
setle %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x72bbe
jmp 0x72c0d
movl 0x1c(%rsp), %eax
cmpl 0x18(%rsp), %eax
jne 0x72bfa
movq 0x50(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x48(%rsp), %rax
movl (%rax), %ecx
movq 0x50(%rsp), %rax
movl %ecx, (%rax)
movl 0xc(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, (%rax)
movq 0x50(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x48(%rsp)
jmp 0x72b79
jmp 0x72c0f
movq 0x40(%rsp), %rcx
xorl %eax, %eax
cmpq 0x48(%rsp), %rcx
movb %al, 0xa(%rsp)
jb 0x72c4a
movq 0x248d8(%rip), %rax     # 0x97500
movq 0x40(%rsp), %rcx
movl (%rcx), %ecx
addl 0x248db(%rip), %ecx     # 0x97510
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1c(%rsp)
cmpl 0x18(%rsp), %eax
setge %al
movb %al, 0xa(%rsp)
movb 0xa(%rsp), %al
testb $0x1, %al
jne 0x72c54
jmp 0x72ca3
movl 0x1c(%rsp), %eax
cmpl 0x18(%rsp), %eax
jne 0x72c90
movq 0x40(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rax
movl (%rax), %ecx
movq 0x40(%rsp), %rax
movl %ecx, (%rax)
movl 0xc(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, (%rax)
movq 0x38(%rsp), %rax
addq $-0x4, %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
addq $-0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x72c0f
movq 0x48(%rsp), %rax
cmpq 0x40(%rsp), %rax
jbe 0x72cb1
jmp 0x72cf6
movq 0x48(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x40(%rsp), %rax
movl (%rax), %ecx
movq 0x48(%rsp), %rax
movl %ecx, (%rax)
movl 0xc(%rsp), %ecx
movq 0x40(%rsp), %rax
movl %ecx, (%rax)
movq 0x48(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rax
addq $-0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x72b77
movq 0x60(%rsp), %rax
movslq 0x5c(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, 0x14(%rsp)
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %rdx
subq %rdx, %rcx
sarq $0x2, %rcx
movl %ecx, 0x10(%rsp)
cmpl %ecx, %eax
jle 0x72d42
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
movslq 0x14(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
cmpl $0x0, 0x14(%rsp)
je 0x72dbb
movq 0x30(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %ecx
movq 0x30(%rsp), %rax
movl %ecx, (%rax)
movl 0xc(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
movl 0x14(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x28(%rsp)
jmp 0x72d67
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rcx
movq 0x38(%rsp), %rdx
subq %rdx, %rcx
sarq $0x2, %rcx
subq $0x1, %rcx
movl %ecx, 0x10(%rsp)
cmpl %ecx, %eax
jle 0x72df5
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x20(%rsp), %rax
movslq 0x14(%rsp), %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
cmpl $0x0, 0x14(%rsp)
je 0x72e6e
movq 0x30(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rax
movl (%rax), %ecx
movq 0x30(%rsp), %rax
movl %ecx, (%rax)
movl 0xc(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, (%rax)
movl 0x14(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x30(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x28(%rsp)
jmp 0x72e1a
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, 0x14(%rsp)
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
subq %rcx, %rax
sarq $0x2, %rax
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x14(%rsp)
jle 0x72ead
movq 0x60(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x72b10
movq 0x60(%rsp), %rdi
movslq 0x14(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq 0x60(%rsp), %rsi
movslq 0x5c(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movslq 0x10(%rsp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x2, %rax
addq %rax, %rsi
addq $-0x4, %rsi
callq 0x73980
cmpl $0x0, 0x10(%rsp)
jle 0x72f1b
movq 0x60(%rsp), %rdi
movslq 0x5c(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rdi
movslq 0x10(%rsp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x2, %rax
addq %rax, %rdi
movl 0x10(%rsp), %esi
callq 0x72b10
addq $0x68, %rsp
retq