// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__compute_huffman_codes(stbi__zbuf*)
static int stbi__compute_huffman_codes(stbi__zbuf *a)
{
   static const 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;
   int ntot  = hlit + hdist;

   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 < ntot) {
      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 {
         stbi_uc fill = 0;
         if (c == 16) {
            c = stbi__zreceive(a,2)+3;
            if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG");
            fill = lencodes[n-1];
         } else if (c == 17)
            c = stbi__zreceive(a,3)+3;
         else {
            STBI_ASSERT(c == 18);
            c = stbi__zreceive(a,7)+11;
         }
         if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG");
         memset(lencodes+n, fill, c);
         n += c;
      }
   }
   if (n != ntot) 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:
pushq %rbp
movq %rsp, %rbp
subq $0xa10, %rsp            # imm = 0xA10
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x1d3d0
addl $0x101, %eax            # imm = 0x101
movl %eax, -0x9ec(%rbp)
movq -0x10(%rbp), %rdi
movl $0x5, %esi
callq 0x1d3d0
addl $0x1, %eax
movl %eax, -0x9f0(%rbp)
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x1d3d0
addl $0x4, %eax
movl %eax, -0x9f4(%rbp)
movl -0x9ec(%rbp), %eax
addl -0x9f0(%rbp), %eax
movl %eax, -0x9f8(%rbp)
leaq -0x9e0(%rbp), %rdi
xorl %esi, %esi
movl $0x13, %edx
callq 0x2100
movl $0x0, -0x9e4(%rbp)
movl -0x9e4(%rbp), %eax
cmpl -0x9f4(%rbp), %eax
jge 0x1d9f9
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x1d3d0
movl %eax, -0x9fc(%rbp)
movl -0x9fc(%rbp), %eax
movb %al, %cl
movslq -0x9e4(%rbp), %rdx
leaq 0x2b73(%rip), %rax      # 0x20550
movzbl (%rax,%rdx), %eax
movb %cl, -0x9e0(%rbp,%rax)
movl -0x9e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9e4(%rbp)
jmp 0x1d9a5
leaq -0x9e0(%rbp), %rsi
leaq -0x7f4(%rbp), %rdi
movl $0x13, %edx
callq 0x1d610
cmpl $0x0, %eax
jne 0x1da22
movl $0x0, -0x4(%rbp)
jmp 0x1dc56
movl $0x0, -0x9e8(%rbp)
movl -0x9e8(%rbp), %eax
cmpl -0x9f8(%rbp), %eax
jge 0x1dbd3
movq -0x10(%rbp), %rdi
leaq -0x7f4(%rbp), %rsi
callq 0x1e190
movl %eax, -0xa00(%rbp)
cmpl $0x0, -0xa00(%rbp)
jl 0x1da66
cmpl $0x13, -0xa00(%rbp)
jl 0x1da7a
leaq 0x37d8(%rip), %rdi      # 0x21245
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x1dc56
cmpl $0x10, -0xa00(%rbp)
jge 0x1daaa
movl -0xa00(%rbp), %eax
movb %al, %cl
movl -0x9e8(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x9e8(%rbp)
cltq
movb %cl, -0x9c0(%rbp,%rax)
jmp 0x1dbce
movb $0x0, -0xa01(%rbp)
cmpl $0x10, -0xa00(%rbp)
jne 0x1db08
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x1d3d0
addl $0x3, %eax
movl %eax, -0xa00(%rbp)
cmpl $0x0, -0x9e8(%rbp)
jne 0x1daee
leaq 0x3764(%rip), %rdi      # 0x21245
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x1dc56
movl -0x9e8(%rbp), %eax
subl $0x1, %eax
cltq
movb -0x9c0(%rbp,%rax), %al
movb %al, -0xa01(%rbp)
jmp 0x1db6d
cmpl $0x11, -0xa00(%rbp)
jne 0x1db2a
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x1d3d0
addl $0x3, %eax
movl %eax, -0xa00(%rbp)
jmp 0x1db6b
cmpl $0x12, -0xa00(%rbp)
jne 0x1db35
jmp 0x1db54
leaq 0x3744(%rip), %rdi      # 0x21280
leaq 0x2c93(%rip), %rsi      # 0x207d6
movl $0x1019, %edx           # imm = 0x1019
leaq 0x3739(%rip), %rcx      # 0x21288
callq 0x2140
movq -0x10(%rbp), %rdi
movl $0x7, %esi
callq 0x1d3d0
addl $0xb, %eax
movl %eax, -0xa00(%rbp)
jmp 0x1db6d
movl -0x9f8(%rbp), %eax
subl -0x9e8(%rbp), %eax
cmpl -0xa00(%rbp), %eax
jge 0x1db95
leaq 0x36bd(%rip), %rdi      # 0x21245
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x1dc56
leaq -0x9c0(%rbp), %rdi
movslq -0x9e8(%rbp), %rax
addq %rax, %rdi
movzbl -0xa01(%rbp), %eax
movslq -0xa00(%rbp), %rdx
movzbl %al, %esi
callq 0x2100
movl -0xa00(%rbp), %eax
addl -0x9e8(%rbp), %eax
movl %eax, -0x9e8(%rbp)
jmp 0x1da2c
movl -0x9e8(%rbp), %eax
cmpl -0x9f8(%rbp), %eax
je 0x1dbf2
leaq 0x365d(%rip), %rdi      # 0x21245
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x1dc56
movq -0x10(%rbp), %rdi
addq $0x34, %rdi
leaq -0x9c0(%rbp), %rsi
movl -0x9ec(%rbp), %edx
callq 0x1d610
cmpl $0x0, %eax
jne 0x1dc1a
movl $0x0, -0x4(%rbp)
jmp 0x1dc56
movq -0x10(%rbp), %rdi
addq $0x818, %rdi            # imm = 0x818
leaq -0x9c0(%rbp), %rsi
movslq -0x9ec(%rbp), %rax
addq %rax, %rsi
movl -0x9f0(%rbp), %edx
callq 0x1d610
cmpl $0x0, %eax
jne 0x1dc4f
movl $0x0, -0x4(%rbp)
jmp 0x1dc56
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa10, %rsp            # imm = 0xA10
popq %rbp
retq
nopw %cs:(%rax,%rax)