// File: /workspace/github_c_makefile_star2_O2/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbi_zlib_compress
STBIWDEF unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)
{
#ifdef STBIW_ZLIB_COMPRESS
   // user provided a zlib compress implementation, use that
   return STBIW_ZLIB_COMPRESS(data, data_len, out_len, quality);
#else // use builtin
   static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 };
   static unsigned char  lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4,  4,  5,  5,  5,  5,  0 };
   static unsigned short distc[]   = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 };
   static unsigned char  disteb[]  = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 };
   unsigned int bitbuf=0;
   int i,j, bitcount=0;
   unsigned char *out = NULL;
   unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**));
   if (hash_table == NULL)
      return NULL;
   if (quality < 5) quality = 5;

   stbiw__sbpush(out, 0x78);   // DEFLATE 32K window
   stbiw__sbpush(out, 0x5e);   // FLEVEL = 1
   stbiw__zlib_add(1,1);  // BFINAL = 1
   stbiw__zlib_add(1,2);  // BTYPE = 1 -- fixed huffman

   for (i=0; i < stbiw__ZHASH; ++i)
      hash_table[i] = NULL;

   i=0;
   while (i < data_len-3) {
      // hash next 3 bytes of data to be compressed
      int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3;
      unsigned char *bestloc = 0;
      unsigned char **hlist = hash_table[h];
      int n = stbiw__sbcount(hlist);
      for (j=0; j < n; ++j) {
         if (hlist[j]-data > i-32768) { // if entry lies within window
            int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i);
            if (d >= best) { best=d; bestloc=hlist[j]; }
         }
      }
      // when hash table entry is too long, delete half the entries
      if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) {
         STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality);
         stbiw__sbn(hash_table[h]) = quality;
      }
      stbiw__sbpush(hash_table[h],data+i);

      if (bestloc) {
         // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal
         h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1);
         hlist = hash_table[h];
         n = stbiw__sbcount(hlist);
         for (j=0; j < n; ++j) {
            if (hlist[j]-data > i-32767) {
               int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1);
               if (e > best) { // if next match is better, bail on current match
                  bestloc = NULL;
                  break;
               }
            }
         }
      }

      if (bestloc) {
         int d = (int) (data+i - bestloc); // distance back
         STBIW_ASSERT(d <= 32767 && best <= 258);
         for (j=0; best > lengthc[j+1]-1; ++j);
         stbiw__zlib_huff(j+257);
         if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]);
         for (j=0; d > distc[j+1]-1; ++j);
         stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5);
         if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]);
         i += best;
      } else {
         stbiw__zlib_huffb(data[i]);
         ++i;
      }
   }
   // write out final bytes
   for (;i < data_len; ++i)
      stbiw__zlib_huffb(data[i]);
   stbiw__zlib_huff(256); // end of block
   // pad with 0 bits to byte boundary
   while (bitcount)
      stbiw__zlib_add(0,1);

   for (i=0; i < stbiw__ZHASH; ++i)
      (void) stbiw__sbfree(hash_table[i]);
   STBIW_FREE(hash_table);

   {
      // compute adler32 on input
      unsigned int s1=1, s2=0;
      int blocklen = (int) (data_len % 5552);
      j=0;
      while (j < data_len) {
         for (i=0; i < blocklen; ++i) { s1 += data[j+i]; s2 += s1; }
         s1 %= 65521; s2 %= 65521;
         j += blocklen;
         blocklen = 5552;
      }
      stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8));
      stbiw__sbpush(out, STBIW_UCHAR(s2));
      stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8));
      stbiw__sbpush(out, STBIW_UCHAR(s1));
   }
   *out_len = stbiw__sbn(out);
   // make returned pointer freeable
   STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len);
   return (unsigned char *) stbiw__sbraw(out);
#endif // STBIW_ZLIB_COMPRESS
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %ecx, %ebx
movq %rdx, -0x98(%rbp)
movq %rsi, -0x50(%rbp)
movq %rdi, -0x60(%rbp)
andq $0x0, -0x48(%rbp)
movl $0x20000, %edi          # imm = 0x20000
callq 0x1170
testq %rax, %rax
je 0x2467
movq %rax, %r15
cmpl $0x6, %ebx
pushq $0x5
popq %rax
cmovgel %ebx, %eax
movq %rax, -0x88(%rbp)
leaq -0x48(%rbp), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x249a
movq (%rbx), %rdi
movslq -0x4(%rdi), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rdi)
movb $0x78, (%rdi,%rax)
movl -0x4(%rdi), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%rdi), %ecx
jl 0x1e23
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x249a
movq (%rbx), %rdi
movl -0x4(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rdi)
cltq
movb $0x5e, (%rdi,%rax)
leaq -0x30(%rbp), %rbx
pushq $0x1
popq %r12
movl %r12d, (%rbx)
leaq -0x2c(%rbp), %r14
movl %r12d, (%r14)
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2518
movl (%r14), %ecx
movl %r12d, %edx
shll %cl, %edx
orl %edx, (%rbx)
addl $0x2, %ecx
movl %ecx, (%r14)
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2518
movq %rax, %rdi
movq %rax, -0x48(%rbp)
xorl %eax, %eax
cmpq $0x4000, %rax           # imm = 0x4000
je 0x1e82
andq $0x0, (%r15,%rax,8)
incq %rax
jmp 0x1e70
movq -0x50(%rbp), %rax
addl $-0x3, %eax
movl %eax, -0x80(%rbp)
movq -0x88(%rbp), %rax
leal (%rax,%rax), %ecx
movl %ecx, -0x7c(%rbp)
movl %eax, %eax
movq %rax, -0xa8(%rbp)
leaq (,%rax,8), %rax
movq %rax, -0xa0(%rbp)
xorl %r14d, %r14d
movq %r15, -0x58(%rbp)
cmpl -0x80(%rbp), %r14d
jge 0x2234
movq %rdi, -0x70(%rbp)
movslq %r14d, %rdi
addq -0x60(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x258e
andl $0x3fff, %eax           # imm = 0x3FFF
movq (%r15,%rax,8), %rbx
testq %rbx, %rbx
je 0x1eea
movslq -0x4(%rbx), %r13
jmp 0x1eed
xorl %r13d, %r13d
leaq (%r15,%rax,8), %rax
movq %rax, -0xb0(%rbp)
leal -0x8000(%r14), %eax
movq -0x50(%rbp), %rcx
movq %r14, -0x90(%rbp)
subl %r14d, %ecx
movl %ecx, -0x78(%rbp)
testq %r13, %r13
movl $0x0, %ecx
cmovleq %rcx, %r13
movslq %eax, %r15
xorl %r12d, %r12d
pushq $0x3
popq %rax
movl %eax, -0x34(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x40(%rbp), %rdx
cmpq %r12, %r13
je 0x1f78
movq (%rbx,%r12,8), %r14
movq %r14, %rax
subq -0x60(%rbp), %rax
cmpq %r15, %rax
jle 0x1f73
movq %r14, %rdi
movq -0x40(%rbp), %rsi
movl -0x78(%rbp), %edx
callq 0x25cc
movq -0x40(%rbp), %rdx
movl -0x34(%rbp), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, -0x34(%rbp)
movq -0x68(%rbp), %rax
cmovgeq %r14, %rax
movq %rax, -0x68(%rbp)
incq %r12
jmp 0x1f34
testq %rbx, %rbx
je 0x1fb5
movl -0x4(%rbx), %eax
cmpl -0x7c(%rbp), %eax
jne 0x1fad
movq -0xa8(%rbp), %rax
leaq (%rbx,%rax,8), %rsi
movq %rbx, %rdi
movq -0xa0(%rbp), %rdx
callq 0x11b0
movq -0x40(%rbp), %rdx
movq -0x88(%rbp), %rax
movl %eax, -0x4(%rbx)
leal 0x1(%rax), %ecx
cmpl -0x8(%rbx), %ecx
jl 0x1fd4
movq -0xb0(%rbp), %rbx
movq %rbx, %rdi
pushq $0x8
popq %rsi
callq 0x249a
movq -0x40(%rbp), %rdx
movq (%rbx), %rbx
movl -0x4(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rbx)
cltq
movq %rdx, (%rbx,%rax,8)
cmpq $0x0, -0x68(%rbp)
je 0x206b
leaq 0x1(%rdx), %rdi
movq %rdi, -0x78(%rbp)
callq 0x258e
andl $0x3fff, %eax           # imm = 0x3FFF
movq -0x58(%rbp), %rcx
movq (%rcx,%rax,8), %r12
testq %r12, %r12
je 0x200e
movl -0x4(%r12), %r13d
jmp 0x2011
xorl %r13d, %r13d
movq -0x90(%rbp), %rax
movl %eax, %r14d
notl %r14d
addl -0x50(%rbp), %r14d
addl $0xffff8001, %eax       # imm = 0xFFFF8001
movslq %eax, %r15
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
xorl %ebx, %ebx
movq -0x40(%rbp), %rdx
cmpq %rbx, %r13
je 0x208e
movq (%r12,%rbx,8), %rdi
movq %rdi, %rax
subq -0x60(%rbp), %rax
cmpq %r15, %rax
jle 0x2066
movq -0x78(%rbp), %rsi
movl %r14d, %edx
callq 0x25cc
movq -0x40(%rbp), %rdx
cmpl -0x34(%rbp), %eax
jg 0x206b
incq %rbx
jmp 0x203c
movzbl (%rdx), %edi
cmpl $0x8f, %edi
ja 0x20f0
addl $0x30, %edi
pushq $0x8
popq %rsi
callq 0x25f1
movl -0x2c(%rbp), %ecx
shll %cl, %eax
orl %eax, -0x30(%rbp)
addl $0x8, %ecx
jmp 0x2109
subl -0x68(%rbp), %edx
cmpl $0x7fff, %edx           # imm = 0x7FFF
movl -0x34(%rbp), %esi
jg 0x247b
cmpl $0x102, %esi            # imm = 0x102
jg 0x247b
xorl %edi, %edi
movq -0x58(%rbp), %r15
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r13
leaq 0xa05f(%rip), %rcx      # 0xc120
movzwl 0x2(%rcx,%rdi,2), %eax
incq %rdi
cmpl %eax, %esi
jge 0x20c1
movq %rdx, -0x40(%rbp)
leaq -0x1(%rdi), %r14
cmpq $0x16, %r14
ja 0x2124
pushq $0x7
popq %rsi
callq 0x25f1
movl -0x2c(%rbp), %ecx
shll %cl, %eax
orl %eax, -0x30(%rbp)
addl $0x7, %ecx
jmp 0x213d
orl $0x100, %edi            # imm = 0x100
pushq $0x9
popq %rsi
callq 0x25f1
movl -0x2c(%rbp), %ecx
shll %cl, %eax
orl %eax, -0x30(%rbp)
addl $0x9, %ecx
movl %ecx, -0x2c(%rbp)
pushq $0x1
popq %rbx
movq -0x58(%rbp), %r15
movq -0x70(%rbp), %rdi
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r13
jmp 0x2218
addl $0xa8, %edi
pushq $0x8
popq %rsi
callq 0x25f1
movl -0x2c(%rbp), %ecx
shll %cl, %eax
orl %eax, -0x30(%rbp)
addl $0x8, %ecx
movl %ecx, -0x2c(%rbp)
movq -0x70(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2518
movq %rax, %rbx
movl %r14d, %eax
leaq -0x1c(%rax), %rcx
cmpq $-0x14, %rcx
jb 0x2198
leaq 0x9fba(%rip), %rcx      # 0xc120
movzwl (%rcx,%rax,2), %ecx
movl -0x34(%rbp), %edx
subl %ecx, %edx
movl -0x2c(%rbp), %ecx
shll %cl, %edx
orl %edx, -0x30(%rbp)
leaq 0x9fe2(%rip), %rdx      # 0xc160
movzbl (%rax,%rdx), %eax
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2518
movq %rax, %rbx
leaq 0x9fe1(%rip), %rcx      # 0xc180
movq -0x40(%rbp), %rdx
pushq $-0x1
popq %r14
movzwl 0x4(%rcx,%r14,2), %eax
incq %r14
cmpl %edx, %eax
jle 0x21a7
movl %r14d, %edi
pushq $0x5
popq %rsi
callq 0x25f1
movl -0x2c(%rbp), %ecx
shll %cl, %eax
orl %eax, -0x30(%rbp)
addl $0x5, %ecx
movl %ecx, -0x2c(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2518
movq %rax, %rdi
cmpq $0x4, %r14
jae 0x21e9
movl -0x34(%rbp), %ebx
jmp 0x2226
movl %r14d, %eax
leaq 0x9f8d(%rip), %rcx      # 0xc180
movzwl (%rcx,%rax,2), %ecx
movq -0x40(%rbp), %rdx
subl %ecx, %edx
movl -0x2c(%rbp), %ecx
shll %cl, %edx
orl %edx, -0x30(%rbp)
leaq 0x9fb4(%rip), %rdx      # 0xc1c0
movzbl (%rax,%rdx), %eax
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
movl -0x34(%rbp), %ebx
movq %r12, %rsi
movq %r13, %rdx
callq 0x2518
movq %rax, %rdi
addl -0x90(%rbp), %ebx
movl %ebx, %r14d
jmp 0x1eb8
movslq %r14d, %r15
movq %rdi, -0x48(%rbp)
movslq -0x50(%rbp), %r12
leaq -0x30(%rbp), %r14
leaq -0x2c(%rbp), %r13
cmpq %r12, %r15
jge 0x22aa
movq %rdi, %rbx
movq -0x60(%rbp), %rax
movzbl (%rax,%r15), %edi
cmpl $0x8f, %edi
ja 0x2278
addl $0x30, %edi
pushq $0x8
popq %rsi
callq 0x25f1
movl -0x2c(%rbp), %ecx
shll %cl, %eax
orl %eax, -0x30(%rbp)
addl $0x8, %ecx
jmp 0x2291
orl $0x100, %edi            # imm = 0x100
pushq $0x9
popq %rsi
callq 0x25f1
movl -0x2c(%rbp), %ecx
shll %cl, %eax
orl %eax, -0x30(%rbp)
addl $0x9, %ecx
movl %ecx, -0x2c(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2518
movq %rax, %rdi
incq %r15
jmp 0x2247
movq %rdi, -0x48(%rbp)
pushq $0x7
popq %rsi
movq %rdi, %rbx
xorl %edi, %edi
callq 0x25f1
movq %rbx, %rdi
leaq -0x2c(%rbp), %rbx
movl (%rbx), %ecx
shll %cl, %eax
leaq -0x30(%rbp), %r14
orl %eax, (%r14)
addl $0x7, %ecx
movl %ecx, -0x2c(%rbp)
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2518
movq %rax, %rdi
movl -0x2c(%rbp), %eax
leal 0x1(%rax), %ecx
testl %eax, %eax
jne 0x22d0
movq %rdi, %r15
movq %rdi, -0x48(%rbp)
xorl %ebx, %ebx
movq -0x58(%rbp), %r14
cmpq $0x4000, %rbx           # imm = 0x4000
je 0x2318
movq (%r14,%rbx,8), %rdi
testq %rdi, %rdi
je 0x2313
addq $-0x8, %rdi
callq 0x1030
incq %rbx
jmp 0x22f8
movq %r14, %rdi
callq 0x1030
movl $0x15b0, %ecx           # imm = 0x15B0
movq -0x50(%rbp), %rax
cltd
idivl %ecx
movl %edx, %ecx
pushq $0x1
popq %r12
xorl %esi, %esi
movl $0xfff1, %edi           # imm = 0xFFF1
xorl %ebx, %ebx
cmpl -0x50(%rbp), %esi
jge 0x238a
movslq %esi, %rax
testl %ecx, %ecx
movl $0x0, %edx
cmovgl %ecx, %edx
addq -0x60(%rbp), %rax
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x236f
movzbl (%rax,%r8), %r9d
movl %r12d, %r10d
addl %r9d, %r10d
movl %r10d, %r12d
addl %r10d, %ebx
incq %r8
jmp 0x2354
movl %r12d, %eax
xorl %edx, %edx
divl %edi
movl %edx, %r12d
movl %ebx, %eax
xorl %edx, %edx
divl %edi
addl %ecx, %esi
movl $0x15b0, %ecx           # imm = 0x15B0
movl %edx, %ebx
jmp 0x233b
testq %r15, %r15
je 0x239f
movq %r15, %rdx
movl -0x4(%r15), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%r15), %ecx
jl 0x23b7
leaq -0x48(%rbp), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x249a
movq (%r14), %rdx
movl -0x4(%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rdx)
cltq
movb %bh, (%rdx,%rax)
movl -0x4(%rdx), %eax
incl %eax
cmpl -0x8(%rdx), %eax
jl 0x23d5
leaq -0x48(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x249a
movq -0x48(%rbp), %rsi
movslq -0x4(%rsi), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rsi)
movb %bl, (%rsi,%rax)
movl -0x4(%rsi), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%rsi), %ecx
jl 0x2409
leaq -0x48(%rbp), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x249a
movq (%rbx), %rsi
movl -0x4(%rsi), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rsi)
cltq
movl %r12d, %ecx
movb %ch, (%rsi,%rax)
movl -0x4(%rsi), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%rsi), %ecx
jl 0x2437
leaq -0x48(%rbp), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x249a
movq (%rbx), %rsi
movl -0x4(%rsi), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rsi)
cltq
movb %r12b, (%rsi,%rax)
movslq -0x4(%rsi), %rdx
movq -0x98(%rbp), %rax
movl %edx, (%rax)
leaq -0x8(%rsi), %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11b0
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb706(%rip), %rdi      # 0xdb88
leaq 0xb719(%rip), %rsi      # 0xdba2
leaq 0xb726(%rip), %rcx      # 0xdbb6
movl $0x39a, %edx            # imm = 0x39A
callq 0x10c0