// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__jpeg_decode_block(stbi__jpeg*, short*, stbi__huffman*, stbi__huffman*, short*, int, unsigned short*)
static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi__uint16 *dequant)
{
   int diff,dc,k;
   int t;

   if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
   t = stbi__jpeg_huff_decode(j, hdc);
   if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG");

   // 0 all the ac values now so we can do it 32-bits at a time
   memset(data,0,64*sizeof(data[0]));

   diff = t ? stbi__extend_receive(j, t) : 0;
   dc = j->img_comp[b].dc_pred + diff;
   j->img_comp[b].dc_pred = dc;
   data[0] = (short) (dc * dequant[0]);

   // decode AC components, see JPEG spec
   k = 1;
   do {
      unsigned int zig;
      int c,r,s;
      if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
      c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
      r = fac[c];
      if (r) { // fast-AC path
         k += (r >> 4) & 15; // run
         s = r & 15; // combined length
         j->code_buffer <<= s;
         j->code_bits -= s;
         // decode into unzigzag'd location
         zig = stbi__jpeg_dezigzag[k++];
         data[zig] = (short) ((r >> 8) * dequant[zig]);
      } else {
         int rs = stbi__jpeg_huff_decode(j, hac);
         if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
         s = rs & 15;
         r = rs >> 4;
         if (s == 0) {
            if (rs != 0xf0) break; // end block
            k += 16;
         } else {
            k += r;
            // decode into unzigzag'd location
            zig = stbi__jpeg_dezigzag[k++];
            data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]);
         }
      }
   } while (k < 64);
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x10, 0x4824(%rax)
jge 0x15bca
movq -0x10(%rbp), %rdi
callq 0x15e10
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x16540
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jge 0x15bf4
leaq 0xadcc(%rip), %rdi      # 0x209b3
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x15e04
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x2100
cmpl $0x0, -0x44(%rbp)
je 0x15c1b
movq -0x10(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x16770
movl %eax, -0x5c(%rbp)
jmp 0x15c22
xorl %eax, %eax
movl %eax, -0x5c(%rbp)
jmp 0x15c22
movl -0x5c(%rbp), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
addq $0x46a0, %rax           # imm = 0x46A0
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rax
addq $0x46a0, %rax           # imm = 0x46A0
movslq -0x34(%rbp), %rdx
imulq $0x60, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movl -0x3c(%rbp), %eax
movq 0x10(%rbp), %rcx
movzwl (%rcx), %ecx
imull %ecx, %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
movl $0x1, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x10, 0x4824(%rax)
jge 0x15c95
movq -0x10(%rbp), %rdi
callq 0x15e10
movq -0x10(%rbp), %rax
movl 0x4820(%rax), %eax
shrl $0x17, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x15d4a
movl -0x50(%rbp), %eax
sarl $0x4, %eax
andl $0xf, %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x50(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0x4820(%rax), %edx
shll %cl, %edx
movl %edx, %ecx
movl %ecx, 0x4820(%rax)
movl -0x54(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x4824(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4824(%rax)
movl -0x40(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x40(%rbp)
movslq %eax, %rcx
leaq 0xa564(%rip), %rax      # 0x20280
movzbl (%rax,%rcx), %eax
movl %eax, -0x48(%rbp)
movl -0x50(%rbp), %eax
sarl $0x8, %eax
movq 0x10(%rbp), %rcx
movl -0x48(%rbp), %edx
movzwl (%rcx,%rdx,2), %ecx
imull %ecx, %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movl -0x48(%rbp), %ecx
movw %dx, (%rax,%rcx,2)
jmp 0x15df1
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x16540
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
jge 0x15d74
leaq 0xac4c(%rip), %rdi      # 0x209b3
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x15e04
movl -0x58(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x54(%rbp)
movl -0x58(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x54(%rbp)
jne 0x15da2
cmpl $0xf0, -0x58(%rbp)
je 0x15d97
jmp 0x15dfd
movl -0x40(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x40(%rbp)
jmp 0x15def
movl -0x50(%rbp), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x40(%rbp)
movslq %eax, %rcx
leaq 0xa4c0(%rip), %rax      # 0x20280
movzbl (%rax,%rcx), %eax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x16770
movq 0x10(%rbp), %rcx
movl -0x48(%rbp), %edx
movzwl (%rcx,%rdx,2), %ecx
imull %ecx, %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movl -0x48(%rbp), %ecx
movw %dx, (%rax,%rcx,2)
jmp 0x15df1
jmp 0x15df3
cmpl $0x40, -0x40(%rbp)
jl 0x15c7f
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)