// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x6, %r14d
jle 0x3eb55
movl %r14d, %eax
shrl %eax
leaq (%rbx,%rax,4), %rcx
movl %r14d, %eax
cmpl $0x7, %r14d
je 0x3e99b
leaq (%rbx,%rax,4), %rdx
addq $-0x4, %rdx
cmpl $0x29, %r14d
jl 0x3e898
shrl $0x3, %r14d
movq 0x15be2(%rip), %rdi     # 0x54430
movslq (%rbx), %rsi
movslq 0x15be8(%rip), %r8      # 0x54440
addq %r8, %rsi
movl (%rdi,%rsi,4), %r9d
leal (,%r14,4), %r11d
leaq (%rbx,%r11), %rsi
movslq (%rbx,%r11), %r10
addq %r8, %r10
movl (%rdi,%r10,4), %ebp
leaq (%rsi,%r11), %r10
movslq (%r11,%rsi), %r11
addq %r8, %r11
movl (%rdi,%r11,4), %r11d
cmpl %ebp, %r9d
jge 0x3e8a0
cmpl %r11d, %ebp
jl 0x3e8af
cmpl %r11d, %r9d
cmovgeq %rbx, %r10
jmp 0x3e8ac
movq %rbx, %rsi
jmp 0x3e94d
cmpl %r11d, %ebp
jg 0x3e8af
cmpl %r11d, %r9d
cmovleq %rbx, %r10
movq %r10, %rsi
leal (,%r14,4), %r12d
movq %rcx, %r9
subq %r12, %r9
movslq (%r9), %r10
addq %r8, %r10
movl (%rdi,%r10,4), %r10d
movslq (%rcx), %r11
addq %r8, %r11
movl (%rdi,%r11,4), %r15d
leaq (%rcx,%r12), %r11
movslq (%rcx,%r12), %r12
addq %r8, %r12
movl (%rdi,%r12,4), %ebp
cmpl %r15d, %r10d
jge 0x3e8f3
cmpl %ebp, %r15d
jl 0x3e902
cmpl %ebp, %r10d
cmovlq %r11, %r9
jmp 0x3e8ff
cmpl %ebp, %r15d
jg 0x3e902
cmpl %ebp, %r10d
cmovgq %r11, %r9
movq %r9, %rcx
negq %r14
leaq (%rdx,%r14,4), %r10
leaq (%r10,%r14,4), %r9
movslq (%r9), %r11
addq %r8, %r11
movl (%rdi,%r11,4), %r11d
movslq (%r10), %r14
addq %r8, %r14
movl (%rdi,%r14,4), %ebp
movslq (%rdx), %r14
addq %r8, %r14
movl (%rdi,%r14,4), %edi
cmpl %ebp, %r11d
jge 0x3e93d
cmpl %edi, %ebp
jl 0x3e941
cmpl %edi, %r11d
cmovgeq %r9, %rdx
jmp 0x3e94d
cmpl %edi, %ebp
jle 0x3e946
movq %r10, %rdx
jmp 0x3e94d
cmpl %edi, %r11d
cmovleq %r9, %rdx
movq 0x15adc(%rip), %r8      # 0x54430
movslq (%rsi), %rdi
movslq 0x15ae2(%rip), %r10     # 0x54440
addq %r10, %rdi
movl (%r8,%rdi,4), %edi
movslq (%rcx), %r9
addq %r10, %r9
movl (%r8,%r9,4), %r9d
movslq (%rdx), %r11
addq %r10, %r11
movl (%r8,%r11,4), %r8d
cmpl %r9d, %edi
jge 0x3e98c
cmpl %r8d, %r9d
jl 0x3e99b
cmpl %r8d, %edi
cmovlq %rdx, %rsi
jmp 0x3e998
cmpl %r8d, %r9d
jg 0x3e99b
cmpl %r8d, %edi
cmovgq %rdx, %rsi
movq %rsi, %rcx
movq 0x15a8e(%rip), %rsi     # 0x54430
movslq (%rcx), %rcx
movslq 0x15a94(%rip), %rdi     # 0x54440
addq %rdi, %rcx
movl (%rsi,%rcx,4), %r8d
leaq (%rbx,%rax,4), %r12
leaq (%rbx,%rax,4), %rdx
addq $-0x4, %rdx
movq %rdx, %r14
movq %rbx, %rax
movq %rbx, %rcx
cmpq %rdx, %rax
ja 0x3e9f2
movl (%rax), %r9d
leal (%r9,%rdi), %r10d
movslq %r10d, %r10
cmpl %r8d, (%rsi,%r10,4)
jg 0x3e9f2
jne 0x3e9ec
movl (%rcx), %r10d
movl %r9d, (%rcx)
movl %r10d, (%rax)
addq $0x4, %rcx
addq $0x4, %rax
jmp 0x3e9c8
cmpq %rax, %rdx
setb %r9b
jb 0x3ea62
movl (%rdx), %r10d
leal (%r10,%rdi), %r11d
movslq %r11d, %r11
movl (%rsi,%r11,4), %r11d
cmpl %r8d, %r11d
jl 0x3ea40
cmpl %r8d, %r11d
jne 0x3ea20
movl (%r14), %r9d
movl %r9d, (%rdx)
movl %r10d, (%r14)
addq $-0x4, %r14
leaq -0x4(%rdx), %r15
cmpq %rax, %r15
setb %r9b
jb 0x3ea5e
movl (%r15), %r10d
leal (%r10,%rdi), %edx
movslq %edx, %rdx
movl (%rsi,%rdx,4), %r11d
movq %r15, %rdx
jmp 0x3ea09
testb %r9b, %r9b
jne 0x3ea62
movl (%rax), %r9d
movl (%rdx), %r10d
movl %r10d, (%rax)
movl %r9d, (%rdx)
addq $0x4, %rax
addq $-0x4, %rdx
jmp 0x3e9c8
addq $-0x4, %rdx
movq %rax, %r15
subq %rcx, %r15
subq %rbx, %rcx
shrq $0x2, %rcx
shrq $0x2, %r15
cmpl %r15d, %ecx
cmovgel %r15d, %ecx
testl %ecx, %ecx
je 0x3eaa4
movslq %ecx, %rdi
shlq $0x2, %rdi
movq %rax, %rsi
subq %rdi, %rsi
xorl %edi, %edi
movl (%rbx,%rdi,4), %r8d
movl (%rsi,%rdi,4), %r9d
movl %r9d, (%rbx,%rdi,4)
movl %r8d, (%rsi,%rdi,4)
incq %rdi
cmpl %edi, %ecx
jne 0x3ea8d
movq %r12, %rcx
subq %r14, %rcx
subq %rdx, %r14
shrq $0x2, %r14
shrq $0x2, %rcx
decl %ecx
cmpl %r14d, %ecx
cmovgel %r14d, %ecx
testl %ecx, %ecx
je 0x3eae6
movslq %ecx, %rsi
shlq $0x2, %rsi
movq %r12, %rdx
subq %rsi, %rdx
xorl %esi, %esi
movl (%rax,%rsi,4), %edi
movl (%rdx,%rsi,4), %r8d
movl %r8d, (%rax,%rsi,4)
movl %edi, (%rdx,%rsi,4)
incq %rsi
cmpl %esi, %ecx
jne 0x3ead1
testl %r15d, %r15d
jle 0x3eaf6
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3e807
movslq %r15d, %rax
leaq (%rbx,%rax,4), %rax
movslq %r14d, %rcx
shlq $0x2, %rcx
subq %rcx, %r12
leaq -0x4(%r12), %rcx
movq %rcx, %rdx
subq 0x15922(%rip), %rdx     # 0x54438
shrq $0x2, %rdx
movq 0x1590f(%rip), %rsi     # 0x54430
movslq (%rax), %rdi
movl %edx, (%rsi,%rdi,4)
cmpq %rcx, %rax
je 0x3eb3e
movslq 0x4(%rax), %rdi
addq $0x4, %rax
movl %edx, (%rsi,%rdi,4)
cmpq %rcx, %rax
jb 0x3eb2c
jmp 0x3eb44
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq %r12, %rbx
testl %r14d, %r14d
jg 0x3e815
jmp 0x3ec43
movslq %r14d, %rax
leaq (%rbx,%rax,4), %rax
addq $-0x4, %rax
cmpq %rbx, %rax
jbe 0x3ec1a
movq 0x158c0(%rip), %rcx     # 0x54430
movslq 0x158c9(%rip), %rdx     # 0x54440
movq 0x158ba(%rip), %rsi     # 0x54438
leaq 0x4(%rbx), %r8
cmpq %rax, %r8
jbe 0x3eb8c
movq %r8, %rdi
jmp 0x3ebd9
movslq (%rbx), %rdi
addq %rdx, %rdi
movl (%rcx,%rdi,4), %r10d
movq %r8, %rdi
movq %r8, %r9
movslq (%r9), %r14
movq %r14, %r11
addq %rdx, %r11
movl (%rcx,%r11,4), %r11d
cmpl %r10d, %r11d
jge 0x3ebbb
movl (%rbx), %edi
movl %edi, (%r9)
movl %r14d, (%rbx)
movq %r8, %rdi
jmp 0x3ebcd
jne 0x3ebca
movl (%rdi), %r11d
movl %r11d, (%r9)
movl %r14d, (%rdi)
addq $0x4, %rdi
movl %r10d, %r11d
addq $0x4, %r9
movl %r11d, %r10d
cmpq %rax, %r9
jbe 0x3eb9c
leaq -0x4(%rdi), %r8
movq %r8, %r9
subq %rsi, %r9
shrq $0x2, %r9
movslq (%rbx), %r10
movl %r9d, (%rcx,%r10,4)
cmpq %r8, %rbx
je 0x3ec06
movslq 0x4(%rbx), %r10
addq $0x4, %rbx
movl %r9d, (%rcx,%r10,4)
cmpq %r8, %rbx
jb 0x3ebf3
jmp 0x3ec0c
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %rdi, %rbx
cmpq %rax, %rdi
jb 0x3eb7e
jmp 0x3ec1d
movq %rbx, %rdi
cmpq %rax, %rdi
jne 0x3ec43
movq %rdi, %rax
subq 0x1580c(%rip), %rax     # 0x54438
shrq $0x2, %rax
movq 0x157f9(%rip), %rcx     # 0x54430
movslq (%rdi), %rdx
movl %eax, (%rcx,%rdx,4)
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq