// File: /workspace/github_c_makefile_star2_O0/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_PackFontRanges
STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges)
{
   stbtt_fontinfo info;
   int i,j,n, return_value = 1;
   //stbrp_context *context = (stbrp_context *) spc->pack_info;
   stbrp_rect    *rects;

   // flag all characters as NOT packed
   for (i=0; i < num_ranges; ++i)
      for (j=0; j < ranges[i].num_chars; ++j)
         ranges[i].chardata_for_range[j].x0 =
         ranges[i].chardata_for_range[j].y0 =
         ranges[i].chardata_for_range[j].x1 =
         ranges[i].chardata_for_range[j].y1 = 0;

   n = 0;
   for (i=0; i < num_ranges; ++i)
      n += ranges[i].num_chars;
         
   rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context);
   if (rects == NULL)
      return 0;

   info.userdata = spc->user_allocator_context;
   stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index));

   n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects);

   stbtt_PackFontRangesPackRects(spc, rects, n);
  
   return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects);

   STBTT_free(rects, spc->user_allocator_context);
   return return_value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl $0x1, -0xe0(%rbp)
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x967d
movl $0x0, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
movq -0x28(%rbp), %rcx
movslq -0xd4(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0x9667
movq -0x28(%rbp), %rax
movslq -0xd4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0xd8(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0x6(%rax)
movq -0x28(%rbp), %rax
movslq -0xd4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0xd8(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0x4(%rax)
movq -0x28(%rbp), %rax
movslq -0xd4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0xd8(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0x2(%rax)
movq -0x28(%rbp), %rax
movslq -0xd4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movslq -0xd8(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movw $0x0, (%rax)
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x958b
jmp 0x9669
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x9572
movl $0x0, -0xdc(%rbp)
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x96ce
movq -0x28(%rbp), %rax
movslq -0xd4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
addl -0xdc(%rbp), %eax
movl %eax, -0xdc(%rbp)
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x9691
movslq -0xdc(%rbp), %rax
imulq $0x18, %rax, %rdi
callq 0x1140
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
jne 0x96fb
movl $0x0, -0x4(%rbp)
jmp 0x97a8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x97f0
movq -0xf0(%rbp), %rsi
movl %eax, %edx
leaq -0xd0(%rbp), %rdi
callq 0x97c0
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movq -0xe8(%rbp), %r8
leaq -0xd0(%rbp), %rsi
callq 0x84a0
movl %eax, -0xdc(%rbp)
movq -0x10(%rbp), %rdi
movq -0xe8(%rbp), %rsi
movl -0xdc(%rbp), %edx
callq 0x93a0
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movq -0xe8(%rbp), %r8
leaq -0xd0(%rbp), %rsi
callq 0x8e50
movl %eax, -0xe0(%rbp)
movq -0xe8(%rbp), %rdi
callq 0x1030
movl -0xe0(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)