// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__zhuffman_decode
stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
{
   int b,s,k;
   if (a->num_bits < 16) stbi__fill_bits(a);
   b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
   if (b < 0xffff) {
      s = z->size[b];
      a->code_buffer >>= s;
      a->num_bits -= s;
      return z->value[b];
   }

   // not resolved by fast table, so compute it the slow way
   // use jpeg approach, which requires MSbits at top
   k = stbi__bit_reverse(a->code_buffer, 16);
   for (s=STBI__ZFAST_BITS+1; ; ++s)
      if (k < z->maxcode[s])
         break;
   if (s == 16) return -1; // invalid code!
   // code size is s, so:
   b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
   STBI_ASSERT(z->size[b] == s);
   a->code_buffer >>= s;
   a->num_bits -= s;
   return z->value[b];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x10, 0x10(%rax)
jge 0x41d953
movq -0x10(%rbp), %rdi
callq 0x41d6f0
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
movl %ecx, %ecx
movzwl (%rax,%rcx,2), %eax
movl %eax, -0x1c(%rbp)
cmpl $0xffff, -0x1c(%rbp)    # imm = 0xFFFF
jge 0x41d9c1
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl 0x484(%rax,%rcx), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0x14(%rax), %edx
shrl %cl, %edx
movl %edx, %ecx
movl %ecx, 0x14(%rax)
movl -0x20(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzwl 0x5a4(%rax,%rcx,2), %eax
movl %eax, -0x4(%rbp)
jmp 0x41daae
movq -0x10(%rbp), %rax
movl 0x14(%rax), %edi
movl $0x10, %esi
callq 0x41d860
movl %eax, -0x24(%rbp)
movl $0xa, -0x20(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
cmpl 0x420(%rcx,%rdx,4), %eax
jge 0x41d9f2
jmp 0x41d9ff
jmp 0x41d9f4
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x41d9dc
cmpl $0x10, -0x20(%rbp)
jne 0x41da11
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x41daae
movl -0x24(%rbp), %eax
movl $0x10, %ecx
subl -0x20(%rbp), %ecx
sarl %cl, %eax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movzwl 0x400(%rcx,%rdx,2), %ecx
subl %ecx, %eax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movzwl 0x464(%rcx,%rdx,2), %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzbl 0x484(%rax,%rcx), %eax
cmpl -0x20(%rbp), %eax
jne 0x41da5c
jmp 0x41da7b
leaq 0xc818e(%rip), %rdi     # 0x4e5bf1
leaq 0xc7b40(%rip), %rsi     # 0x4e55aa
movl $0x70a, %edx            # imm = 0x70A
leaq 0xc818b(%rip), %rcx     # 0x4e5c01
callq 0x42dfd0
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0x14(%rax), %edx
shrl %cl, %edx
movl %edx, %ecx
movl %ecx, 0x14(%rax)
movl -0x20(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzwl 0x5a4(%rax,%rcx,2), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)