// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0xc, -0xc(%rbp)
jle 0x12513f
movl -0xc(%rbp), %eax
sarl %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
seta %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm1
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
seta %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x124f6b
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
seta %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0x124ee2
xorl %eax, %eax
movl %eax, -0x40(%rbp)
jmp 0x124eeb
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movslq -0x30(%rbp), %rax
imulq $0x14, %rax, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movslq -0x3c(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movslq -0x30(%rbp), %rax
imulq $0x14, %rax, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x10(%rax)
movl $0x1, -0x34(%rbp)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x124fe1
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
ja 0x125005
jmp 0x125012
jmp 0x125007
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x124fe1
jmp 0x125014
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
ja 0x125038
jmp 0x125045
jmp 0x12503a
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x125014
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jl 0x125052
jmp 0x1250e3
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movslq -0x38(%rbp), %rax
imulq $0x14, %rax, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x10(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x124fdf
movl -0x38(%rbp), %eax
movl -0xc(%rbp), %ecx
subl -0x34(%rbp), %ecx
cmpl %ecx, %eax
jge 0x12511a
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x124e10
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0xc(%rbp), %eax
subl -0x34(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x12513a
movq -0x8(%rbp), %rdi
movslq -0x34(%rbp), %rax
imulq $0x14, %rax, %rax
addq %rax, %rdi
movl -0xc(%rbp), %esi
subl -0x34(%rbp), %esi
callq 0x124e10
movl -0x38(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x124e1f
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)