// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt__sort_edges_quicksort
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:
cmpl $0xd, %esi
jl 0xc47a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorl %r13d, %r13d
movl %esi, %eax
shrl %eax
movss 0x4(%rbx), %xmm0
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,4), %rax
movss 0x4(%rax), %xmm1
leal -0x1(%rsi), %r14d
leaq (%r14,%r14,4), %rcx
movss 0x4(%rbx,%rcx,4), %xmm2
movaps %xmm0, %xmm3
cmpnltps %xmm1, %xmm3
cmpltps %xmm2, %xmm1
xorps %xmm1, %xmm3
movd %xmm3, %ecx
testb $0x1, %cl
jne 0xc37a
cmpnltps %xmm2, %xmm0
xorps %xmm1, %xmm0
movd %xmm0, %ecx
testb $0x1, %cl
movq %r14, %rcx
cmovneq %r13, %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x10(%rbx,%rcx,4), %edx
movl %edx, -0x30(%rbp)
movups (%rbx,%rcx,4), %xmm0
movaps %xmm0, -0x40(%rbp)
movl 0x10(%rax), %edx
movl %edx, 0x10(%rbx,%rcx,4)
movups (%rax), %xmm0
movups %xmm0, (%rbx,%rcx,4)
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
movl $0x1, %ecx
movss 0x4(%rbx), %xmm0
movslq %ecx, %rcx
movl %esi, %r15d
subl %ecx, %r15d
leaq (%rcx,%rcx,4), %rdx
leaq -0x14(,%rdx,4), %r12
incq %rcx
decl %r15d
ucomiss 0x18(%rbx,%r12), %xmm0
leaq 0x14(%r12), %r12
ja 0xc3c5
movslq %r14d, %rdi
leaq -0x1(%rcx), %r8
addq %rbx, %r12
leaq (%rdi,%rdi,4), %rdx
incq %rdi
leaq (%rax,%rdx,4), %rdx
movss -0x10(%rdx), %xmm1
decq %rdi
decl %r14d
addq $-0x14, %rdx
ucomiss %xmm0, %xmm1
ja 0xc3ed
cmpq %rdi, %r8
jge 0xc439
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 0xc3ab
incl %r14d
cmpl %r14d, %r15d
jle 0xc451
movq %rbx, %rdi
movl %r14d, %esi
callq 0xc2dc
movq %r12, %rbx
jmp 0xc45f
movq %r12, %rdi
movl %r15d, %esi
callq 0xc2dc
movl %r14d, %r15d
movl %r15d, %esi
cmpl $0xc, %r15d
jg 0xc2fc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq