// File: /workspace/github_c_makefile_star2_O0/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_PackFontRangesRenderIntoRects
STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects)
{
   int i,j,k, return_value = 1;

   // save current values
   int old_h_over = spc->h_oversample;
   int old_v_over = spc->v_oversample;

   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);
      float recip_h,recip_v,sub_x,sub_y;
      spc->h_oversample = ranges[i].h_oversample;
      spc->v_oversample = ranges[i].v_oversample;
      recip_h = 1.0f / spc->h_oversample;
      recip_v = 1.0f / spc->v_oversample;
      sub_x = stbtt__oversample_shift(spc->h_oversample);
      sub_y = stbtt__oversample_shift(spc->v_oversample);
      for (j=0; j < ranges[i].num_chars; ++j) {
         stbrp_rect *r = &rects[k];
         if (r->was_packed && r->w != 0 && r->h != 0) {
            stbtt_packedchar *bc = &ranges[i].chardata_for_range[j];
            int advance, lsb, 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);
            stbrp_coord pad = (stbrp_coord) spc->padding;

            // pad on left and top
            r->x += pad;
            r->y += pad;
            r->w -= pad;
            r->h -= pad;
            stbtt_GetGlyphHMetrics(info, glyph, &advance, &lsb);
            stbtt_GetGlyphBitmapBox(info, glyph,
                                    scale * spc->h_oversample,
                                    scale * spc->v_oversample,
                                    &x0,&y0,&x1,&y1);
            stbtt_MakeGlyphBitmapSubpixel(info,
                                          spc->pixels + r->x + r->y*spc->stride_in_bytes,
                                          r->w - spc->h_oversample+1,
                                          r->h - spc->v_oversample+1,
                                          spc->stride_in_bytes,
                                          scale * spc->h_oversample,
                                          scale * spc->v_oversample,
                                          0,0,
                                          glyph);

            if (spc->h_oversample > 1)
               stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes,
                                  r->w, r->h, spc->stride_in_bytes,
                                  spc->h_oversample);

            if (spc->v_oversample > 1)
               stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes,
                                  r->w, r->h, spc->stride_in_bytes,
                                  spc->v_oversample);

            bc->x0       = (stbtt_int16)  r->x;
            bc->y0       = (stbtt_int16)  r->y;
            bc->x1       = (stbtt_int16) (r->x + r->w);
            bc->y1       = (stbtt_int16) (r->y + r->h);
            bc->xadvance =                scale * advance;
            bc->xoff     =       (float)  x0 * recip_h + sub_x;
            bc->yoff     =       (float)  y0 * recip_v + sub_y;
            bc->xoff2    =                (x0 + r->w) * recip_h + sub_x;
            bc->yoff2    =                (y0 + r->h) * recip_v + sub_y;
         } else {
            return_value = 0; // if any fail, report failure
         }

         ++k;
      }
   }

   // restore original values
   spc->h_oversample = old_h_over;
   spc->v_oversample = old_v_over;

   return return_value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl $0x1, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x40(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x937f
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
movss %xmm0, -0x44(%rbp)
movss -0x44(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x8ee0
movq -0x10(%rbp), %rdi
movss -0x44(%rbp), %xmm0
callq 0x6c40
movss %xmm0, -0x90(%rbp)
jmp 0x8f03
movq -0x10(%rbp), %rdi
movss -0x44(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
callq 0x6cb0
movss %xmm0, -0x90(%rbp)
movss -0x90(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
movzbl 0x20(%rax,%rcx,8), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
movzbl 0x21(%rax,%rcx,8), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
cvtsi2ss %rax, %xmm1
movss 0xd6c8(%rip), %xmm0     # 0x1661c
divss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
cvtsi2ss %rax, %xmm1
movss 0xd6ab(%rip), %xmm0     # 0x1661c
divss %xmm1, %xmm0
movss %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
callq 0x8e00
movss %xmm0, -0x54(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x8e00
movss %xmm0, -0x58(%rbp)
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 0x936f
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0x9351
movq -0x60(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x9351
movq -0x60(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x9351
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0x30(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
jne 0x9050
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, -0x94(%rbp)
jmp 0x9070
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, -0x94(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rdi
movl -0x84(%rbp), %esi
callq 0x4450
movl %eax, -0x88(%rbp)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %edx
movq -0x60(%rbp), %rax
movl (%rax), %ecx
addl %edx, %ecx
movl %ecx, (%rax)
movl -0x8c(%rbp), %edx
movq -0x60(%rbp), %rax
movl 0x4(%rax), %ecx
addl %edx, %ecx
movl %ecx, 0x4(%rax)
movl -0x8c(%rbp), %edx
movq -0x60(%rbp), %rax
movl 0xc(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0xc(%rax)
movl -0x8c(%rbp), %edx
movq -0x60(%rbp), %rax
movl 0x10(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movl -0x88(%rbp), %esi
leaq -0x6c(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0x5fa0
movq -0x10(%rbp), %rdi
movl -0x88(%rbp), %esi
movss -0x48(%rbp), %xmm1
movq -0x8(%rbp), %rax
movl 0x24(%rax), %ecx
movl 0x28(%rax), %eax
cvtsi2ss %rcx, %xmm2
movaps %xmm1, %xmm0
mulss %xmm2, %xmm0
cvtsi2ss %rax, %xmm2
mulss %xmm2, %xmm1
leaq -0x74(%rbp), %rdx
leaq -0x78(%rbp), %rcx
leaq -0x7c(%rbp), %r8
leaq -0x80(%rbp), %r9
callq 0x6ea0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x60(%rbp), %rcx
movslq (%rcx), %rdx
addq %rdx, %rsi
movl 0x4(%rcx), %r10d
movl 0xc(%rcx), %edx
movl 0x18(%rax), %r8d
movl 0x24(%rax), %r9d
imull %r8d, %r10d
movslq %r10d, %r10
addq %r10, %rsi
movl %r9d, %r10d
subl %r10d, %edx
incl %edx
movl 0x10(%rcx), %ecx
movl 0x28(%rax), %eax
movl %eax, %r10d
subl %r10d, %ecx
incl %ecx
movss -0x48(%rbp), %xmm1
cvtsi2ss %r9, %xmm2
movaps %xmm1, %xmm0
mulss %xmm2, %xmm0
cvtsi2ss %rax, %xmm2
mulss %xmm2, %xmm1
movl -0x88(%rbp), %r9d
xorps %xmm3, %xmm3
movaps %xmm3, %xmm2
callq 0x7ab0
movq -0x8(%rbp), %rax
cmpl $0x1, 0x24(%rax)
jbe 0x9201
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x60(%rbp), %rax
movslq (%rax), %rax
addq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
imull 0x18(%rcx), %eax
cltq
addq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0xc(%rax), %esi
movq -0x60(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x24(%rax), %r8d
callq 0x8700
movq -0x8(%rbp), %rax
cmpl $0x1, 0x28(%rax)
jbe 0x9253
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x60(%rbp), %rax
movslq (%rax), %rax
addq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
imull 0x18(%rcx), %eax
cltq
addq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0xc(%rax), %esi
movq -0x60(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x28(%rax), %r8d
callq 0x8a50
movq -0x60(%rbp), %rax
movl (%rax), %eax
movw %ax, %cx
movq -0x68(%rbp), %rax
movw %cx, (%rax)
movq -0x60(%rbp), %rax
movl 0x4(%rax), %eax
movw %ax, %cx
movq -0x68(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x60(%rbp), %rax
movl (%rax), %eax
movq -0x60(%rbp), %rcx
addl 0xc(%rcx), %eax
movw %ax, %cx
movq -0x68(%rbp), %rax
movw %cx, 0x4(%rax)
movq -0x60(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x60(%rbp), %rcx
addl 0x10(%rcx), %eax
movw %ax, %cx
movq -0x68(%rbp), %rax
movw %cx, 0x6(%rax)
movss -0x48(%rbp), %xmm0
cvtsi2ssl -0x6c(%rbp), %xmm1
mulss %xmm1, %xmm0
movq -0x68(%rbp), %rax
movss %xmm0, 0x10(%rax)
cvtsi2ssl -0x74(%rbp), %xmm0
movss -0x4c(%rbp), %xmm2
movss -0x54(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x68(%rbp), %rax
movss %xmm0, 0x8(%rax)
cvtsi2ssl -0x78(%rbp), %xmm0
movss -0x50(%rbp), %xmm2
movss -0x58(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x68(%rbp), %rax
movss %xmm0, 0xc(%rax)
movl -0x74(%rbp), %eax
movq -0x60(%rbp), %rcx
addl 0xc(%rcx), %eax
cvtsi2ss %eax, %xmm0
movss -0x4c(%rbp), %xmm2
movss -0x54(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x68(%rbp), %rax
movss %xmm0, 0x14(%rax)
movl -0x78(%rbp), %eax
movq -0x60(%rbp), %rcx
addl 0x10(%rcx), %eax
cvtsi2ss %eax, %xmm0
movss -0x50(%rbp), %xmm2
movss -0x58(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x68(%rbp), %rax
movss %xmm0, 0x18(%rax)
jmp 0x9358
movl $0x0, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x8fa3
jmp 0x9371
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x8e97
movl -0x3c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x40(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x38(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nop