// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imstb_truetype.h
// Function: stbtt__sort_edges_quicksort(stbtt__edge*, int)
static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n)
{
   /* threshold for transitioning to insertion sort */
   while (n > 12) {
      stbtt__edge t;
      int c01,c12,c,m,i,j;

      /* compute median of three */
      m = n >> 1;
      c01 = STBTT__COMPARE(&p[0],&p[m]);
      c12 = STBTT__COMPARE(&p[m],&p[n-1]);
      /* if 0 >= mid >= end, or 0 < mid < end, then use mid */
      if (c01 != c12) {
         /* otherwise, we'll need to swap something else to middle */
         int z;
         c = STBTT__COMPARE(&p[0],&p[n-1]);
         /* 0>mid && mid<n:  0>n => n; 0<n => 0 */
         /* 0<mid && mid>n:  0>n => 0; 0<n => n */
         z = (c == c12) ? 0 : n-1;
         t = p[z];
         p[z] = p[m];
         p[m] = t;
      }
      /* now p[m] is the median-of-three */
      /* swap it to the beginning so it won't move around */
      t = p[0];
      p[0] = p[m];
      p[m] = t;

      /* partition loop */
      i=1;
      j=n-1;
      for(;;) {
         /* handling of equality is crucial here */
         /* for sentinels & efficiency with duplicates */
         for (;;++i) {
            if (!STBTT__COMPARE(&p[i], &p[0])) break;
         }
         for (;;--j) {
            if (!STBTT__COMPARE(&p[0], &p[j])) break;
         }
         /* make sure we haven't crossed */
         if (i >= j) break;
         t = p[i];
         p[i] = p[j];
         p[j] = t;

         ++i;
         --j;
      }
      /* recurse on smaller side, iterate on larger */
      if (j < (n-i)) {
         stbtt__sort_edges_quicksort(p,j);
         p = p+i;
         n = n-i;
      } else {
         stbtt__sort_edges_quicksort(p+i, n-i);
         n = j;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x1
popq %r13
cmpl $0xd, %esi
jl 0x6eccb
movl %esi, %eax
shrl %eax
movss 0x4(%rbx), %xmm0
imulq $0x14, %rax, %rcx
leaq (%rbx,%rcx), %rax
movss 0x4(%rbx,%rcx), %xmm1
leal -0x1(%rsi), %r14d
imulq $0x14, %r14, %rcx
movss 0x4(%rbx,%rcx), %xmm2
movaps %xmm0, %xmm3
cmpnltps %xmm1, %xmm3
cmpltps %xmm2, %xmm1
xorps %xmm1, %xmm3
movd %xmm3, %ecx
testb $0x1, %cl
jne 0x6ebe2
cmpnltps %xmm2, %xmm0
xorps %xmm1, %xmm0
movd %xmm0, %ecx
testb $0x1, %cl
movq %r14, %rcx
movl $0x0, %edx
cmovneq %rdx, %rcx
imulq $0x14, %rcx, %rcx
movl 0x10(%rbx,%rcx), %edx
movl %edx, -0x30(%rbp)
movups (%rbx,%rcx), %xmm0
movaps %xmm0, -0x40(%rbp)
movl 0x10(%rax), %edx
movl %edx, 0x10(%rbx,%rcx)
movups (%rax), %xmm0
movups %xmm0, (%rbx,%rcx)
movl -0x30(%rbp), %ecx
movl %ecx, 0x10(%rax)
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rax)
movl 0x10(%rbx), %ecx
movl %ecx, -0x30(%rbp)
movups (%rbx), %xmm0
movaps %xmm0, -0x40(%rbp)
movl 0x10(%rax), %ecx
movl %ecx, 0x10(%rbx)
movups (%rax), %xmm0
movups %xmm0, (%rbx)
movl -0x30(%rbp), %ecx
movl %ecx, 0x10(%rax)
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rax)
incl %esi
leaq 0x14(%rbx), %rax
movq %r13, %rcx
movss 0x4(%rbx), %xmm0
movslq %ecx, %rcx
movl %esi, %r15d
subl %ecx, %r15d
imulq $0x14, %rcx, %r12
addq $-0x14, %r12
incq %rcx
decl %r15d
ucomiss 0x18(%rbx,%r12), %xmm0
leaq 0x14(%r12), %r12
ja 0x6ec27
movslq %r14d, %rdi
leaq -0x1(%rcx), %r8
addq %rbx, %r12
imulq $0x14, %rdi, %rdx
incq %rdi
addq %rax, %rdx
movss -0x10(%rdx), %xmm1
decq %rdi
decl %r14d
addq $-0x14, %rdx
ucomiss %xmm0, %xmm1
ja 0x6ec4e
cmpq %rdi, %r8
jge 0x6ec9a
movl 0x10(%r12), %edi
movl %edi, -0x30(%rbp)
movups (%r12), %xmm0
movaps %xmm0, -0x40(%rbp)
movl 0x10(%rdx), %edi
movl %edi, 0x10(%r12)
movups (%rdx), %xmm0
movups %xmm0, (%r12)
movl -0x30(%rbp), %edi
movl %edi, 0x10(%rdx)
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rdx)
jmp 0x6ec11
incl %r14d
cmpl %r14d, %r15d
jle 0x6ecb8
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6eb3d
movl %r15d, %esi
movq %r12, %rbx
jmp 0x6eb55
movq %r12, %rdi
movl %r15d, %esi
callq 0x6eb3d
movl %r14d, %esi
jmp 0x6eb55
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq