// File: donfreiday[P]gb/./imgui/stb_truetype.h
// Function: stbtt_PackFontRangesGatherRects(stbtt_pack_context*, stbtt_fontinfo*, stbtt_pack_range*, int, stbrp_rect*)
STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
{
   int i,j,k;

   k=0;
   for (i=0; i < num_ranges; ++i) {
      float fh = ranges[i].font_size;
      float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh);
      ranges[i].h_oversample = (unsigned char) spc->h_oversample;
      ranges[i].v_oversample = (unsigned char) spc->v_oversample;
      for (j=0; j < ranges[i].num_chars; ++j) {
         int x0,y0,x1,y1;
         int codepoint = ranges[i].first_unicode_codepoint_in_range ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
         int glyph = stbtt_FindGlyphIndex(info, codepoint);
         stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,
                                         scale * spc->h_oversample,
                                         scale * spc->v_oversample,
                                         0,0,
                                         &x0,&y0,&x1,&y1);
         rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);
         rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);
         ++k;
      }
   }

   return k;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x44c59
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
movss %xmm0, -0x38(%rbp)
movss -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x44aaf
movq -0x10(%rbp), %rdi
movss -0x38(%rbp), %xmm0
callq 0x45260
movss %xmm0, -0x58(%rbp)
jmp 0x44acf
movq -0x10(%rbp), %rdi
movss -0x38(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
callq 0x46e60
movss %xmm0, -0x58(%rbp)
movss -0x58(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x20(%rax)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x21(%rax)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x44c49
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x4(%rax)
je 0x44b60
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x44b7d
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movl -0x50(%rbp), %esi
callq 0x46eb0
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
movss -0x3c(%rbp), %xmm1
movq -0x8(%rbp), %rax
movl 0x20(%rax), %ecx
movl 0x24(%rax), %eax
cvtsi2ss %rcx, %xmm2
movaps %xmm1, %xmm0
mulss %xmm2, %xmm0
cvtsi2ss %rax, %xmm2
mulss %xmm2, %xmm1
xorps %xmm3, %xmm3
leaq -0x40(%rbp), %rdx
leaq -0x44(%rbp), %rcx
leaq -0x48(%rbp), %r8
leaq -0x4c(%rbp), %r9
movaps %xmm3, %xmm2
callq 0x473f0
movl -0x48(%rbp), %eax
subl -0x40(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x1c(%rcx), %eax
movq -0x8(%rbp), %rcx
addl 0x20(%rcx), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movw %cx, 0x4(%rax)
movl -0x4c(%rbp), %eax
subl -0x44(%rbp), %eax
movq -0x8(%rbp), %rcx
addl 0x1c(%rcx), %eax
movq -0x8(%rbp), %rcx
addl 0x24(%rcx), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movw %cx, 0x6(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x44b16
jmp 0x44c4b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x44a69
movl -0x34(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)