// File: /workspace/github_c_makefile_star2_O0/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__compute_huffman_codes(stbi__zbuf*)
static int stbi__compute_huffman_codes(stbi__zbuf *a)
{
   static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
   stbi__zhuffman z_codelength;
   stbi_uc lencodes[286+32+137];//padding for maximum single op
   stbi_uc codelength_sizes[19];
   int i,n;

   int hlit  = stbi__zreceive(a,5) + 257;
   int hdist = stbi__zreceive(a,5) + 1;
   int hclen = stbi__zreceive(a,4) + 4;

   memset(codelength_sizes, 0, sizeof(codelength_sizes));
   for (i=0; i < hclen; ++i) {
      int s = stbi__zreceive(a,3);
      codelength_sizes[length_dezigzag[i]] = (stbi_uc) s;
   }
   if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;

   n = 0;
   while (n < hlit + hdist) {
      int c = stbi__zhuffman_decode(a, &z_codelength);
      if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG");
      if (c < 16)
         lencodes[n++] = (stbi_uc) c;
      else if (c == 16) {
         c = stbi__zreceive(a,2)+3;
         memset(lencodes+n, lencodes[n-1], c);
         n += c;
      } else if (c == 17) {
         c = stbi__zreceive(a,3)+3;
         memset(lencodes+n, 0, c);
         n += c;
      } else {
         STBI_ASSERT(c == 18);
         c = stbi__zreceive(a,7)+11;
         memset(lencodes+n, 0, c);
         n += c;
      }
   }
   if (n != hlit+hdist) return stbi__err("bad codelengths","Corrupt PNG");
   if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;
   if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;
   return 1;
}

// Assembly:
subq $0xa08, %rsp            # imm = 0xA08
movq %rdi, 0x9f8(%rsp)
movq 0x9f8(%rsp), %rdi
movl $0x5, %esi
callq 0x2ae10
addl $0x101, %eax            # imm = 0x101
movl %eax, 0x14(%rsp)
movq 0x9f8(%rsp), %rdi
movl $0x5, %esi
callq 0x2ae10
addl $0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x9f8(%rsp), %rdi
movl $0x4, %esi
callq 0x2ae10
addl $0x4, %eax
movl %eax, 0xc(%rsp)
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x13, %edx
callq 0xd200
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0x2b5cc
movq 0x9f8(%rsp), %rdi
movl $0x3, %esi
callq 0x2ae10
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movb %al, %cl
movslq 0x1c(%rsp), %rdx
leaq 0xaf89(%rip), %rax      # 0x36540
movzbl (%rax,%rdx), %eax
movb %cl, 0x20(%rsp,%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2b585
leaq 0x20(%rsp), %rsi
leaq 0x214(%rsp), %rdi
movl $0x13, %edx
callq 0x2b150
cmpl $0x0, %eax
jne 0x2b5f8
movl $0x0, 0xa04(%rsp)
jmp 0x2b81a
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movl 0x14(%rsp), %ecx
addl 0x10(%rsp), %ecx
cmpl %ecx, %eax
jge 0x2b787
movq 0x9f8(%rsp), %rdi
leaq 0x214(%rsp), %rsi
callq 0x2bdc0
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
jl 0x2b63b
cmpl $0x13, 0x4(%rsp)
jl 0x2b653
leaq 0x2ca3(%rip), %rdi      # 0x2e2e5
callq 0x1a190
movl %eax, 0xa04(%rsp)
jmp 0x2b81a
cmpl $0x10, 0x4(%rsp)
jge 0x2b678
movl 0x4(%rsp), %eax
movb %al, %cl
movl 0x18(%rsp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x18(%rsp)
cltq
movb %cl, 0x40(%rsp,%rax)
jmp 0x2b782
cmpl $0x10, 0x4(%rsp)
jne 0x2b6d1
movq 0x9f8(%rsp), %rdi
movl $0x2, %esi
callq 0x2ae10
addl $0x3, %eax
movl %eax, 0x4(%rsp)
leaq 0x40(%rsp), %rdi
movslq 0x18(%rsp), %rax
addq %rax, %rdi
movl 0x18(%rsp), %eax
subl $0x1, %eax
cltq
movzbl 0x40(%rsp,%rax), %eax
movslq 0x4(%rsp), %rdx
movzbl %al, %esi
callq 0xd200
movl 0x4(%rsp), %eax
addl 0x18(%rsp), %eax
movl %eax, 0x18(%rsp)
jmp 0x2b780
cmpl $0x11, 0x4(%rsp)
jne 0x2b718
movq 0x9f8(%rsp), %rdi
movl $0x3, %esi
callq 0x2ae10
addl $0x3, %eax
movl %eax, 0x4(%rsp)
leaq 0x40(%rsp), %rdi
movslq 0x18(%rsp), %rax
addq %rax, %rdi
movslq 0x4(%rsp), %rdx
xorl %esi, %esi
callq 0xd200
movl 0x4(%rsp), %eax
addl 0x18(%rsp), %eax
movl %eax, 0x18(%rsp)
jmp 0x2b77e
cmpl $0x12, 0x4(%rsp)
jne 0x2b721
jmp 0x2b740
leaq 0x2bf8(%rip), %rdi      # 0x2e320
leaq 0x24e4(%rip), %rsi      # 0x2dc13
movl $0xe74, %edx            # imm = 0xE74
leaq 0x2bed(%rip), %rcx      # 0x2e328
callq 0xd270
movq 0x9f8(%rsp), %rdi
movl $0x7, %esi
callq 0x2ae10
addl $0xb, %eax
movl %eax, 0x4(%rsp)
leaq 0x40(%rsp), %rdi
movslq 0x18(%rsp), %rax
addq %rax, %rdi
movslq 0x4(%rsp), %rdx
xorl %esi, %esi
callq 0xd200
movl 0x4(%rsp), %eax
addl 0x18(%rsp), %eax
movl %eax, 0x18(%rsp)
jmp 0x2b780
jmp 0x2b782
jmp 0x2b600
movl 0x18(%rsp), %eax
movl 0x14(%rsp), %ecx
addl 0x10(%rsp), %ecx
cmpl %ecx, %eax
je 0x2b7ac
leaq 0x2b47(%rip), %rdi      # 0x2e2e5
callq 0x1a190
movl %eax, 0xa04(%rsp)
jmp 0x2b81a
movq 0x9f8(%rsp), %rdi
addq $0x34, %rdi
leaq 0x40(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0x2b150
cmpl $0x0, %eax
jne 0x2b7d8
movl $0x0, 0xa04(%rsp)
jmp 0x2b81a
movq 0x9f8(%rsp), %rdi
addq $0x818, %rdi            # imm = 0x818
leaq 0x40(%rsp), %rsi
movslq 0x14(%rsp), %rax
addq %rax, %rsi
movl 0x10(%rsp), %edx
callq 0x2b150
cmpl $0x0, %eax
jne 0x2b80f
movl $0x0, 0xa04(%rsp)
jmp 0x2b81a
movl $0x1, 0xa04(%rsp)
movl 0xa04(%rsp), %eax
addq $0xa08, %rsp            # imm = 0xA08
retq
nopl (%rax)