// File: donfreiday[P]gb/./imgui/stb_truetype.h
// Function: stbtt__rasterize_sorted_edges(stbtt__bitmap*, stbtt__edge*, int, int, int, int, void*)
static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata)
{
   (void)vsubsample;
   stbtt__hheap hh = { 0 };
   stbtt__active_edge *active = NULL;
   int y,j=0, i;
   float scanline_data[129], *scanline, *scanline2;

   if (result->w > 64)
      scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata);
   else
      scanline = scanline_data;

   scanline2 = scanline + result->w;

   y = off_y;
   e[n].y0 = (float) (off_y + result->h) + 1;

   while (j < result->h) {
      // find center of pixel for this scanline
      float scan_y_top    = y + 0.0f;
      float scan_y_bottom = y + 1.0f;
      stbtt__active_edge **step = &active;

      STBTT_memset(scanline , 0, result->w*sizeof(scanline[0]));
      STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0]));

      // update all active edges;
      // remove all active edges that terminate before the top of this scanline
      while (*step) {
         stbtt__active_edge * z = *step;
         if (z->ey <= scan_y_top) {
            *step = z->next; // delete from list
            STBTT_assert(z->direction);
            z->direction = 0;
            stbtt__hheap_free(&hh, z);
         } else {
            step = &((*step)->next); // advance through list
         }
      }

      // insert all edges that start before the bottom of this scanline
      while (e->y0 <= scan_y_bottom) {
         stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata);
         STBTT_assert(z->ey >= scan_y_top);
         // insert at front
         z->next = active;
         active = z;
         ++e;
      }

      // now process all active edges
      if (active)
         stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top);

      {
         float sum = 0;
         for (i=0; i < result->w; ++i) {
            float k;
            int m;
            sum += scanline2[i];
            k = scanline[i] + sum;
            k = (float) fabs(k)*255 + 0.5f;
            m = (int) k;
            if (m > 255) m = 255;
            result->pixels[j*result->stride + i] = (unsigned char) m;
         }
      }
      // advance all the edges
      step = &active;
      while (*step) {
         stbtt__active_edge *z = *step;
         z->fx += z->fdx; // advance to position for current scanline
         step = &((*step)->next); // advance through list
      }

      ++y;
      ++j;
   }

   stbtt__hheap_cleanup(&hh, userdata);

   if (scanline != scanline_data)
      STBTT_free(scanline, userdata);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x7240
movq $0x0, -0x40(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x40, (%rax)
jle 0x49cbd
movq -0x8(%rbp), %rax
movl (%rax), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x93d0
movq %rax, -0x258(%rbp)
jmp 0x49ccb
leaq -0x250(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x260(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x4(%rcx), %eax
cvtsi2ss %eax, %xmm0
movss 0x11315(%rip), %xmm1    # 0x5b018
addss %xmm1, %xmm0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movss %xmm0, 0x4(%rax)
movl -0x48(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x4a07c
cvtsi2ssl -0x44(%rbp), %xmm0
xorps %xmm1, %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x264(%rbp)
cvtsi2ssl -0x44(%rbp), %xmm0
movss 0x112cc(%rip), %xmm1    # 0x5b018
addss %xmm1, %xmm0
movss %xmm0, -0x268(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x270(%rbp)
movq -0x258(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq (%rax), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x7240
movq -0x260(%rbp), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x7240
movq -0x270(%rbp), %rax
cmpq $0x0, (%rax)
je 0x49e59
movq -0x270(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
movss 0x1c(%rax), %xmm1
movss -0x264(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jb 0x49e43
movq -0x278(%rbp), %rax
movq (%rax), %rcx
movq -0x270(%rbp), %rax
movq %rcx, (%rax)
movq -0x278(%rbp), %rax
movss 0x14(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x49e01
jp 0x49e01
jmp 0x49e03
jmp 0x49e22
leaq 0x1aefb(%rip), %rdi     # 0x64d05
leaq 0x1ac43(%rip), %rsi     # 0x64a54
movl $0x821, %edx            # imm = 0x821
leaq 0x1aef5(%rip), %rcx     # 0x64d12
callq 0x7160
movq -0x278(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x14(%rax)
movq -0x278(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x4a520
jmp 0x49e54
movq -0x270(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x270(%rbp)
jmp 0x49d9a
jmp 0x49e5b
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm1
movss -0x268(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jb 0x49ef8
movq -0x10(%rbp), %rsi
movl -0x1c(%rbp), %edx
movss -0x264(%rbp), %xmm0
movq 0x10(%rbp), %rcx
leaq -0x38(%rbp), %rdi
callq 0x4a550
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rax
movss 0x1c(%rax), %xmm0
ucomiss -0x264(%rbp), %xmm0
jb 0x49eaf
jmp 0x49ece
leaq 0x1aebb(%rip), %rdi     # 0x64d71
leaq 0x1ab97(%rip), %rsi     # 0x64a54
movl $0x82c, %edx            # imm = 0x82C
leaq 0x1ae49(%rip), %rcx     # 0x64d12
callq 0x7160
movq -0x40(%rbp), %rcx
movq -0x280(%rbp), %rax
movq %rcx, (%rax)
movq -0x280(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x10(%rbp)
jmp 0x49e5b
cmpq $0x0, -0x40(%rbp)
je 0x49f28
movq -0x258(%rbp), %rdi
movq -0x260(%rbp), %rsi
addq $0x4, %rsi
movq -0x8(%rbp), %rax
movl (%rax), %edx
movq -0x40(%rbp), %rcx
movss -0x264(%rbp), %xmm0
callq 0x4a6b0
xorps %xmm0, %xmm0
movss %xmm0, -0x284(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x4a00c
movq -0x260(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
addss -0x284(%rbp), %xmm0
movss %xmm0, -0x284(%rbp)
movq -0x258(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
addss -0x284(%rbp), %xmm0
movss %xmm0, -0x288(%rbp)
movss -0x288(%rbp), %xmm0
callq 0x4ce10
movss 0x110ee(%rip), %xmm1    # 0x5b08c
mulss %xmm1, %xmm0
movss 0x1107a(%rip), %xmm1    # 0x5b024
addss %xmm1, %xmm0
movss %xmm0, -0x288(%rbp)
cvttss2si -0x288(%rbp), %eax
movl %eax, -0x28c(%rbp)
cmpl $0xff, -0x28c(%rbp)
jle 0x49fda
movl $0xff, -0x28c(%rbp)
movl -0x28c(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x48(%rbp), %ecx
movq -0x8(%rbp), %rsi
imull 0x8(%rsi), %ecx
addl -0x4c(%rbp), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x49f3a
leaq -0x40(%rbp), %rax
movq %rax, -0x270(%rbp)
movq -0x270(%rbp), %rax
cmpq $0x0, (%rax)
je 0x4a065
movq -0x270(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x298(%rbp), %rax
addss 0x8(%rax), %xmm0
movss %xmm0, 0x8(%rax)
movq -0x270(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x270(%rbp)
jmp 0x4a017
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x49d1b
movq 0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x4b1a0
movq -0x258(%rbp), %rax
leaq -0x250(%rbp), %rcx
cmpq %rcx, %rax
je 0x4a0a8
movq -0x258(%rbp), %rdi
callq 0xa760
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
nopw %cs:(%rax,%rax)