// File: /workspace/github_c_makefile_star2_O2/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_PackFontRangesGatherRects
STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const 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].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];
         int glyph = stbtt_FindGlyphIndex(info, codepoint);
         if (glyph == 0 && spc->skip_missing) {
            rects[k].w = rects[k].h = 0;
         } else {
            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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r13
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
movq %rcx, -0x58(%rbp)
addq $0x10, %r8
movq %r8, -0x50(%rbp)
xorl %r15d, %r15d
movq %rdx, -0x48(%rbp)
cmpq -0x58(%rbp), %rax
je 0x6603
movq %rax, -0x60(%rbp)
imulq $0x28, %rax, %r14
movss (%rbx,%r14), %xmm0
ucomiss 0x75d9(%rip), %xmm0     # 0xdac4
jbe 0x64f7
movq %r12, %rdi
callq 0x4b6c
jmp 0x651c
xorps 0x7632(%rip), %xmm0     # 0xdb30
movq 0x8(%r12), %rax
movslq 0x1c(%r12), %rcx
movzwl 0x12(%rax,%rcx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
movaps %xmm0, -0x70(%rbp)
addq %rbx, %r14
movb 0x24(%r13), %al
movb %al, 0x20(%r14)
movb 0x28(%r13), %al
movb %al, 0x21(%r14)
movl %r15d, -0x2c(%rbp)
movslq %r15d, %rax
imulq $0x18, %rax, %r15
addq -0x50(%rbp), %r15
xorl %ebx, %ebx
movslq 0x10(%r14), %rax
cmpq %rax, %rbx
jge 0x65ec
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x655f
movl (%rax,%rbx,4), %esi
jmp 0x6565
movl 0x4(%r14), %esi
addl %ebx, %esi
movq %r12, %rdi
callq 0x34bb
testl %eax, %eax
je 0x65d4
movl 0x24(%r13), %ecx
movl 0x28(%r13), %edx
cvtsi2ss %rcx, %xmm0
movaps -0x70(%rbp), %xmm2
mulss %xmm2, %xmm0
cvtsi2ss %rdx, %xmm1
mulss %xmm2, %xmm1
xorps %xmm2, %xmm2
xorps %xmm3, %xmm3
movq %r12, %rdi
movl %eax, %esi
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
callq 0x4bd7
movl 0x1c(%r13), %eax
decl %eax
movl -0x34(%rbp), %ecx
addl %eax, %ecx
subl -0x3c(%rbp), %ecx
addl 0x24(%r13), %ecx
movl %ecx, -0x4(%r15)
addl -0x30(%rbp), %eax
subl -0x38(%rbp), %eax
addl 0x28(%r13), %eax
movl %eax, (%r15)
jmp 0x65e0
cmpl $0x0, 0x20(%r13)
je 0x6571
andq $0x0, -0x4(%r15)
incq %rbx
addq $0x18, %r15
jmp 0x6544
movl -0x2c(%rbp), %r15d
addl %ebx, %r15d
movq -0x60(%rbp), %rax
incq %rax
movq -0x48(%rbp), %rbx
jmp 0x64cc
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq