// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__jpeg_decode_block_prog_ac(stbi__jpeg*, short*, stbi__huffman*, short*)
static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac)
{
   int k;
   if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");

   if (j->succ_high == 0) {
      int shift = j->succ_low;

      if (j->eob_run) {
         --j->eob_run;
         return 1;
      }

      k = j->spec_start;
      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;
            zig = stbi__jpeg_dezigzag[k++];
            data[zig] = (short) ((r >> 8) << shift);
         } 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 (r < 15) {
                  j->eob_run = (1 << r);
                  if (r)
                     j->eob_run += stbi__jpeg_get_bits(j, r);
                  --j->eob_run;
                  break;
               }
               k += 16;
            } else {
               k += r;
               zig = stbi__jpeg_dezigzag[k++];
               data[zig] = (short) (stbi__extend_receive(j,s) << shift);
            }
         }
      } while (k <= j->spec_end);
   } else {
      // refinement scan for these AC coefficients

      short bit = (short) (1 << j->succ_low);

      if (j->eob_run) {
         --j->eob_run;
         for (k = j->spec_start; k <= j->spec_end; ++k) {
            short *p = &data[stbi__jpeg_dezigzag[k]];
            if (*p != 0)
               if (stbi__jpeg_get_bit(j))
                  if ((*p & bit)==0) {
                     if (*p > 0)
                        *p += bit;
                     else
                        *p -= bit;
                  }
         }
      } else {
         k = j->spec_start;
         do {
            int r,s;
            int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh
            if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
            s = rs & 15;
            r = rs >> 4;
            if (s == 0) {
               if (r < 15) {
                  j->eob_run = (1 << r) - 1;
                  if (r)
                     j->eob_run += stbi__jpeg_get_bits(j, r);
                  r = 64; // force end of block
               } else {
                  // r=15 s=0 should write 16 0s, so we just do
                  // a run of 15 0s and then write s (which is 0),
                  // so we don't have to do anything special here
               }
            } else {
               if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG");
               // sign bit
               if (stbi__jpeg_get_bit(j))
                  s = bit;
               else
                  s = -bit;
            }

            // advance by r
            while (k <= j->spec_end) {
               short *p = &data[stbi__jpeg_dezigzag[k++]];
               if (*p != 0) {
                  if (stbi__jpeg_get_bit(j))
                     if ((*p & bit)==0) {
                        if (*p > 0)
                           *p += bit;
                        else
                           *p -= bit;
                     }
               } else {
                  if (r == 0) {
                     *p = (short) s;
                     break;
                  }
                  --r;
               }
            }
         } while (k <= j->spec_end);
      }
   }
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4834(%rax)
jne 0x16079
leaq 0xaa4f(%rip), %rdi      # 0x20abb
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x16537
movq -0x10(%rbp), %rax
cmpl $0x0, 0x483c(%rax)
jne 0x16290
movq -0x10(%rbp), %rax
movl 0x4840(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4844(%rax)
je 0x160c3
movq -0x10(%rbp), %rax
movl 0x4844(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4844(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x16537
movq -0x10(%rbp), %rax
movl 0x4834(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x10, 0x4824(%rax)
jge 0x160e6
movq -0x10(%rbp), %rdi
callq 0x15e10
movq -0x10(%rbp), %rax
movl 0x4820(%rax), %eax
shrl $0x17, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movslq -0x38(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x1618e
movl -0x3c(%rbp), %eax
sarl $0x4, %eax
andl $0xf, %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x3c(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0x4820(%rax), %edx
shll %cl, %edx
movl %edx, %ecx
movl %ecx, 0x4820(%rax)
movl -0x40(%rbp), %edx
movq -0x10(%rbp), %rax
movl 0x4824(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4824(%rax)
movl -0x2c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x2c(%rbp)
movslq %eax, %rcx
leaq 0xa117(%rip), %rax      # 0x20280
movzbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
movl -0x3c(%rbp), %eax
sarl $0x8, %eax
movl -0x30(%rbp), %ecx
shll %cl, %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
movw %dx, (%rax,%rcx,2)
jmp 0x16276
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x16540
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jge 0x161b8
leaq 0xa808(%rip), %rdi      # 0x209b3
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x16537
movl -0x44(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x40(%rbp)
movl -0x44(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x40(%rbp)
jne 0x16230
cmpl $0xf, -0x3c(%rbp)
jge 0x16225
movl -0x3c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4844(%rax)
cmpl $0x0, -0x3c(%rbp)
je 0x16210
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x168f0
movl %eax, %ecx
movq -0x10(%rbp), %rax
addl 0x4844(%rax), %ecx
movl %ecx, 0x4844(%rax)
movq -0x10(%rbp), %rax
movl 0x4844(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4844(%rax)
jmp 0x1628b
movl -0x2c(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x2c(%rbp)
jmp 0x16274
movl -0x3c(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x2c(%rbp)
movslq %eax, %rcx
leaq 0xa032(%rip), %rax      # 0x20280
movzbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x16770
movl -0x30(%rbp), %ecx
shll %cl, %eax
movw %ax, %dx
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
movw %dx, (%rax,%rcx,2)
jmp 0x16276
jmp 0x16278
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4838(%rcx), %eax
jle 0x160d0
jmp 0x16530
movq -0x10(%rbp), %rax
movl 0x4840(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
movw %ax, -0x46(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4844(%rax)
je 0x1637b
movq -0x10(%rbp), %rax
movl 0x4844(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4844(%rax)
movq -0x10(%rbp), %rax
movl 0x4834(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4838(%rcx), %eax
jg 0x16376
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rdx
leaq 0x9f88(%rip), %rcx      # 0x20280
movzbl (%rcx,%rdx), %ecx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movswl (%rax), %eax
cmpl $0x0, %eax
je 0x16366
movq -0x10(%rbp), %rdi
callq 0x16880
cmpl $0x0, %eax
je 0x16364
movq -0x50(%rbp), %rax
movswl (%rax), %eax
movswl -0x46(%rbp), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x16362
movq -0x50(%rbp), %rax
movswl (%rax), %eax
cmpl $0x0, %eax
jle 0x16350
movswl -0x46(%rbp), %edx
movq -0x50(%rbp), %rax
movswl (%rax), %ecx
addl %edx, %ecx
movw %cx, (%rax)
jmp 0x16360
movswl -0x46(%rbp), %edx
movq -0x50(%rbp), %rax
movswl (%rax), %ecx
subl %edx, %ecx
movw %cx, (%rax)
jmp 0x16362
jmp 0x16364
jmp 0x16366
jmp 0x16368
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x162d6
jmp 0x1652e
movq -0x10(%rbp), %rax
movl 0x4834(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x16540
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jge 0x163b2
leaq 0xa60e(%rip), %rdi      # 0x209b3
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x16537
movl -0x5c(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x58(%rbp)
movl -0x5c(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x58(%rbp)
jne 0x1641a
cmpl $0xf, -0x54(%rbp)
jge 0x16416
movl -0x54(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4844(%rax)
cmpl $0x0, -0x54(%rbp)
je 0x1640d
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x168f0
movl %eax, %ecx
movq -0x10(%rbp), %rax
addl 0x4844(%rax), %ecx
movl %ecx, 0x4844(%rax)
movl $0x40, -0x54(%rbp)
jmp 0x16418
jmp 0x16418
jmp 0x16458
cmpl $0x1, -0x58(%rbp)
je 0x16434
leaq 0xa58c(%rip), %rdi      # 0x209b3
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x16537
movq -0x10(%rbp), %rdi
callq 0x16880
cmpl $0x0, %eax
je 0x1644b
movswl -0x46(%rbp), %eax
movl %eax, -0x58(%rbp)
jmp 0x16456
movswl -0x46(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x58(%rbp)
jmp 0x16458
jmp 0x1645a
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4838(%rcx), %eax
jg 0x16517
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x2c(%rbp)
movslq %ecx, %rdx
leaq 0x9dfa(%rip), %rcx      # 0x20280
movzbl (%rcx,%rdx), %ecx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movswl (%rax), %eax
cmpl $0x0, %eax
je 0x164f4
movq -0x10(%rbp), %rdi
callq 0x16880
cmpl $0x0, %eax
je 0x164f2
movq -0x68(%rbp), %rax
movswl (%rax), %eax
movswl -0x46(%rbp), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x164f0
movq -0x68(%rbp), %rax
movswl (%rax), %eax
cmpl $0x0, %eax
jle 0x164de
movswl -0x46(%rbp), %edx
movq -0x68(%rbp), %rax
movswl (%rax), %ecx
addl %edx, %ecx
movw %cx, (%rax)
jmp 0x164ee
movswl -0x46(%rbp), %edx
movq -0x68(%rbp), %rax
movswl (%rax), %ecx
subl %edx, %ecx
movw %cx, (%rax)
jmp 0x164f0
jmp 0x164f2
jmp 0x16512
cmpl $0x0, -0x54(%rbp)
jne 0x16509
movl -0x58(%rbp), %eax
movw %ax, %cx
movq -0x68(%rbp), %rax
movw %cx, (%rax)
jmp 0x16517
movl -0x54(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1645a
jmp 0x16519
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4838(%rcx), %eax
jle 0x16388
jmp 0x1652e
jmp 0x16530
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq