// File: /workspace/github_c_makefile_star2_O3/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:
testl %ecx, %ecx
jle 0x6a40
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %r12
movl %ecx, %eax
movq %rax, -0x58(%rbp)
addq $0x10, %r8
xorl %r10d, %r10d
xorl %eax, %eax
movq %r8, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
leaq (%r10,%r10,4), %r11
movss (%rdx,%r11,8), %xmm1
ucomiss 0x81fc(%rip), %xmm1     # 0xeac0
jbe 0x6901
movq 0x8(%r15), %rcx
movslq 0x24(%r15), %r9
movzbl 0x5(%rcx,%r9), %esi
movzbl 0x4(%rcx,%r9), %edi
shll $0x8, %edi
movswl %di, %edi
orl %esi, %edi
movzbl 0x7(%rcx,%r9), %esi
movzbl 0x6(%rcx,%r9), %ecx
shll $0x8, %ecx
movswl %cx, %ecx
orl %esi, %ecx
subl %ecx, %edi
xorps %xmm0, %xmm0
cvtsi2ss %edi, %xmm0
jmp 0x6923
xorps 0x8228(%rip), %xmm1     # 0xeb30
movq 0x8(%r15), %rcx
movslq 0x1c(%r15), %rsi
movzwl 0x12(%rcx,%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
divss %xmm0, %xmm1
leaq (%rdx,%r11,8), %r14
movb 0x24(%r12), %cl
movb %cl, 0x20(%r14)
movb 0x28(%r12), %cl
movb %cl, 0x21(%r14)
cmpl $0x0, 0x10(%r14)
jle 0x6a24
movq %r10, -0x60(%rbp)
movl %eax, -0x2c(%rbp)
cltq
leaq (%rax,%rax,2), %rax
leaq (%r8,%rax,8), %rbx
xorl %r13d, %r13d
movaps %xmm1, -0x70(%rbp)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x696f
movl (%rax,%r13,4), %esi
jmp 0x6976
movl 0x4(%r14), %esi
addl %r13d, %esi
movq %r15, %rdi
callq 0x359a
testl %eax, %eax
je 0x69ee
movl 0x24(%r12), %ecx
movl 0x28(%r12), %edx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
movaps -0x70(%rbp), %xmm2
mulss %xmm2, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %rdx, %xmm1
mulss %xmm2, %xmm1
xorps %xmm2, %xmm2
xorps %xmm3, %xmm3
movq %r15, %rdi
movl %eax, %esi
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
callq 0x4d75
movl 0x1c(%r12), %eax
decl %eax
movl -0x34(%rbp), %ecx
addl %eax, %ecx
subl -0x3c(%rbp), %ecx
addl 0x24(%r12), %ecx
movl %ecx, -0x4(%rbx)
addl -0x30(%rbp), %eax
subl -0x38(%rbp), %eax
addl 0x28(%r12), %eax
movl %eax, (%rbx)
jmp 0x69fe
cmpl $0x0, 0x20(%r12)
je 0x6982
movq $0x0, -0x4(%rbx)
incq %r13
movslq 0x10(%r14), %rax
addq $0x18, %rbx
cmpq %rax, %r13
jl 0x6960
movl -0x2c(%rbp), %eax
addl %r13d, %eax
movq -0x50(%rbp), %r8
movq -0x48(%rbp), %rdx
movq -0x60(%rbp), %r10
incq %r10
cmpq -0x58(%rbp), %r10
jne 0x68b3
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq