// File: Ciaxur[P]yagb-emu/include/imgui/imstb_truetype.h
// Function: stbtt__rasterize(stbtt__bitmap*, stbtt__point*, int*, int, float, float, float, float, int, int, int, void*)
static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, float shift_x, float shift_y, int off_x, int off_y, int invert, void *userdata)
{
   float y_scale_inv = invert ? -scale_y : scale_y;
   stbtt__edge *e;
   int n,i,j,k,m;
#if STBTT_RASTERIZER_VERSION == 1
   int vsubsample = result->h < 8 ? 15 : 5;
#elif STBTT_RASTERIZER_VERSION == 2
   int vsubsample = 1;
#else
   #error "Unrecognized value of STBTT_RASTERIZER_VERSION"
#endif
   // vsubsample should divide 255 evenly; otherwise we won't reach full opacity

   // now we have to blow out the windings into explicit edge lists
   n = 0;
   for (i=0; i < windings; ++i)
      n += wcount[i];

   e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel
   if (e == 0) return;
   n = 0;

   m=0;
   for (i=0; i < windings; ++i) {
      stbtt__point *p = pts + m;
      m += wcount[i];
      j = wcount[i]-1;
      for (k=0; k < wcount[i]; j=k++) {
         int a=k,b=j;
         // skip the edge if horizontal
         if (p[j].y == p[k].y)
            continue;
         // add edge from j to k to the list
         e[n].invert = 0;
         if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) {
            e[n].invert = 1;
            a=j,b=k;
         }
         e[n].x0 = p[a].x * scale_x + shift_x;
         e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample;
         e[n].x1 = p[b].x * scale_x + shift_x;
         e[n].y1 = (p[b].y * y_scale_inv + shift_y) * vsubsample;
         ++n;
      }
   }

   // now sort the edges by their highest point (should snap to integer, and then by x)
   //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare);
   stbtt__sort_edges(e, n);

   // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule
   stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata);

   STBTT_free(e, userdata);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movss %xmm0, -0x20(%rbp)
movss %xmm1, -0x24(%rbp)
movss %xmm2, -0x28(%rbp)
movss %xmm3, -0x2c(%rbp)
movl %r8d, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
cmpl $0x0, 0x10(%rbp)
je 0x123fec
movss -0x24(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x6c(%rbp)
jmp 0x123ff6
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x6c(%rbp)
movss -0x6c(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
movl $0x1, -0x58(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x124039
movq -0x18(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x124015
movl -0x44(%rbp), %eax
addl $0x1, %eax
cltq
imulq $0x14, %rax, %rdi
callq 0xc4820
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x12405a
jmp 0x1242bc
movl $0x0, -0x44(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x124284
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x48(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x124274
movl -0x50(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss 0x4(%rax,%rcx,8), %xmm0
movq -0x60(%rbp), %rax
movslq -0x50(%rbp), %rcx
ucomiss 0x4(%rax,%rcx,8), %xmm0
jne 0x1240fb
jp 0x1240fb
jmp 0x124261
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x10(%rax)
cmpl $0x0, 0x10(%rbp)
je 0x124136
movq -0x60(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss 0x4(%rax,%rcx,8), %xmm0
movq -0x60(%rbp), %rax
movslq -0x50(%rbp), %rcx
ucomiss 0x4(%rax,%rcx,8), %xmm0
ja 0x124157
jmp 0x124179
movq -0x60(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss 0x4(%rax,%rcx,8), %xmm1
movq -0x60(%rbp), %rax
movslq -0x50(%rbp), %rcx
movss 0x4(%rax,%rcx,8), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x124179
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x10(%rax)
movl -0x4c(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movslq -0x64(%rbp), %rcx
movss (%rax,%rcx,8), %xmm0
movss -0x20(%rbp), %xmm2
movss -0x28(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, (%rax)
movq -0x60(%rbp), %rax
movslq -0x64(%rbp), %rcx
movss 0x4(%rax,%rcx,8), %xmm0
movss -0x38(%rbp), %xmm2
movss -0x2c(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtsi2ssl -0x58(%rbp), %xmm1
mulss %xmm1, %xmm0
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0x4(%rax)
movq -0x60(%rbp), %rax
movslq -0x68(%rbp), %rcx
movss (%rax,%rcx,8), %xmm0
movss -0x20(%rbp), %xmm2
movss -0x28(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0x8(%rax)
movq -0x60(%rbp), %rax
movslq -0x68(%rbp), %rcx
movss 0x4(%rax,%rcx,8), %xmm0
movss -0x38(%rbp), %xmm2
movss -0x2c(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtsi2ssl -0x58(%rbp), %xmm1
mulss %xmm1, %xmm0
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0xc(%rax)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x50(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x50(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1240b7
jmp 0x124276
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x12406f
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x124900
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x44(%rbp), %edx
movl -0x58(%rbp), %ecx
movl -0x30(%rbp), %r8d
movl -0x34(%rbp), %r9d
movq 0x18(%rbp), %rax
movq %rax, (%rsp)
callq 0x124930
movq -0x40(%rbp), %rdi
callq 0xc4920
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)