// File: /workspace/github_cpp_makefile_star2_O1/srajangarg[P]raytracer/src/core/stb_image.hpp
// Function: stbi__jpeg_decode_block(stbi__jpeg*, short*, stbi__huffman*, stbi__huffman*, short*, int, unsigned char*)
static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0x4(%rsp)
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r12
cmpl $0xf, 0x4724(%rdi)
jg 0x1e473
movq %r12, %rdi
callq 0x1e962
cmpl $0xf, 0x4724(%r12)
jg 0x1e486
movq %r12, %rdi
callq 0x1e962
movl 0x4720(%r12), %edx
movl %edx, %eax
shrl $0x17, %eax
movzbl (%r13,%rax), %eax
cmpq $0xff, %rax
je 0x1e4df
movzbl 0x500(%r13,%rax), %ecx
movl 0x4724(%r12), %esi
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
subl %ecx, %esi
jl 0x1e591
shll %cl, %edx
movl %edx, 0x4720(%r12)
movl %esi, 0x4724(%r12)
movzbl 0x400(%r13,%rax), %ebp
jmp 0x1e591
movl %edx, %eax
shrl $0x10, %eax
xorl %edi, %edi
movq %rdi, %rcx
incq %rdi
cmpl 0x62c(%r13,%rcx,4), %eax
jae 0x1e4e6
movl 0x4724(%r12), %esi
cmpq $0x8, %rdi
jne 0x1e516
addl $-0x10, %esi
movl %esi, 0x4724(%r12)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x1e591
leaq 0x9(%rdi), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl %eax, %esi
jl 0x1e591
movb $0x17, %cl
subb %dil, %cl
movl %edx, %r8d
shrl %cl, %r8d
leaq 0xe88b(%rip), %r9       # 0x2cdc0
andl 0x24(%r9,%rdi,4), %r8d
addl 0x670(%r13,%rdi,4), %r8d
movslq %r8d, %r8
movzbl 0x500(%r13,%r8), %r10d
movl %r10d, %ecx
negb %cl
movl %edx, %r11d
shrl %cl, %r11d
andl (%r9,%r10,4), %r11d
movzwl 0x200(%r13,%r8,2), %ecx
cmpl %ecx, %r11d
jne 0x1e943
subl %edi, %esi
movl %eax, %ecx
shll %cl, %edx
addl $-0x9, %esi
movl %esi, 0x4724(%r12)
movl %edx, 0x4720(%r12)
movzbl 0x400(%r13,%r8), %ebp
testl %ebp, %ebp
js 0x1e61e
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rbx)
movups %xmm0, 0x60(%rbx)
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
je 0x1e631
cmpl %ebp, 0x4724(%r12)
jge 0x1e5cf
movq %r12, %rdi
callq 0x1e962
cmpl $0x11, %ebp
jae 0x1e924
movl 0x4720(%r12), %esi
movl %esi, %eax
movl %ebp, %ecx
roll %cl, %eax
movl %ebp, %edx
leaq 0xe7d1(%rip), %rcx      # 0x2cdc0
movl (%rcx,%rdx,4), %ecx
movl %ecx, %edi
notl %edi
andl %eax, %edi
movl %edi, 0x4720(%r12)
subl %ebp, 0x4724(%r12)
andl %ecx, %eax
xorl %ecx, %ecx
testl %esi, %esi
js 0x1e61a
leaq 0xe7f9(%rip), %rcx      # 0x2ce10
movl (%rcx,%rdx,4), %ecx
addl %eax, %ecx
jmp 0x1e633
leaq 0xec51(%rip), %rax      # 0x2d276
movq %rax, 0x19d84(%rip)     # 0x383b0
jmp 0x1e913
xorl %ecx, %ecx
movq 0x50(%rsp), %r13
movslq 0x4(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x5, %rax
addl 0x45b8(%r12,%rax), %ecx
movl %ecx, 0x45b8(%r12,%rax)
movzbl (%r13), %eax
imull %ecx, %eax
movw %ax, (%rbx)
movl $0x1, %ebp
movq %r15, 0x10(%rsp)
movq %rbx, 0x8(%rsp)
cmpl $0xf, 0x4724(%r12)
jg 0x1e682
movq %r12, %rdi
callq 0x1e962
movl 0x4720(%r12), %eax
movl %eax, %ecx
shrl $0x17, %ecx
movzwl (%r15,%rcx,2), %ecx
testl %ecx, %ecx
je 0x1e6f9
movswl %cx, %edx
movl %ecx, %esi
shrl $0x4, %esi
andl $0xf, %esi
movslq %ebp, %rdi
andl $0xf, %ecx
shll %cl, %eax
movl %eax, 0x4720(%r12)
subl %ecx, 0x4724(%r12)
addq %rsi, %rdi
leal 0x1(%rdi), %ebp
leaq 0xe6a8(%rip), %rax      # 0x2cd70
movzbl (%rax,%rdi), %eax
sarl $0x8, %edx
movzbl (%r13,%rax), %ecx
imull %edx, %ecx
movw %cx, (%rbx,%rax,2)
xorl %ecx, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x1e90e
cmpl $0x40, %ebp
jl 0x1e66f
jmp 0x1e915
cmpl $0xf, 0x4724(%r12)
jg 0x1e70c
movq %r12, %rdi
callq 0x1e962
movl 0x4720(%r12), %edx
movl %edx, %eax
shrl $0x17, %eax
movzbl (%r14,%rax), %eax
cmpq $0xff, %rax
je 0x1e765
movzbl 0x500(%r14,%rax), %ecx
movl 0x4724(%r12), %esi
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
subl %ecx, %esi
jl 0x1e819
shll %cl, %edx
movl %edx, 0x4720(%r12)
movl %esi, 0x4724(%r12)
movzbl 0x400(%r14,%rax), %r8d
jmp 0x1e819
movl %edx, %eax
shrl $0x10, %eax
xorl %edi, %edi
movq %rdi, %rcx
incq %rdi
cmpl 0x62c(%r14,%rcx,4), %eax
jae 0x1e76c
movl 0x4724(%r12), %esi
cmpq $0x8, %rdi
jne 0x1e79d
addl $-0x10, %esi
movl %esi, 0x4724(%r12)
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
jmp 0x1e819
leaq 0x9(%rdi), %rax
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
cmpl %eax, %esi
jl 0x1e819
movb $0x17, %cl
subb %dil, %cl
movl %edx, %r8d
shrl %cl, %r8d
leaq 0xe603(%rip), %r11      # 0x2cdc0
andl 0x24(%r11,%rdi,4), %r8d
addl 0x670(%r14,%rdi,4), %r8d
movslq %r8d, %r8
movzbl 0x500(%r14,%r8), %r9d
movl %r9d, %ecx
negb %cl
movl %edx, %r10d
shrl %cl, %r10d
andl (%r11,%r9,4), %r10d
movzwl 0x200(%r14,%r8,2), %ecx
cmpl %ecx, %r10d
jne 0x1e943
subl %edi, %esi
movl %eax, %ecx
shll %cl, %edx
addl $-0x9, %esi
movl %esi, 0x4724(%r12)
movl %edx, 0x4720(%r12)
movzbl 0x400(%r14,%r8), %r8d
testl %r8d, %r8d
js 0x1e8d5
movq %r15, %rdx
movq %r13, %r15
movl %r8d, %r13d
andl $0xf, %r13d
je 0x1e8ed
shrl $0x4, %r8d
movslq %ebp, %rbp
addq %r8, %rbp
leaq 0xe52a(%rip), %rax      # 0x2cd70
movzbl (%rax,%rbp), %ebx
cmpl %r13d, 0x4724(%r12)
jge 0x1e85c
movq %r12, %rdi
callq 0x1e962
movl 0x4720(%r12), %r8d
movl %r8d, %eax
movl %r13d, %ecx
roll %cl, %eax
leal (,%r13,4), %esi
leaq 0xe545(%rip), %rcx      # 0x2cdc0
movl (%rsi,%rcx), %edx
movl %edx, %ecx
notl %ecx
andl %eax, %ecx
movl %ecx, 0x4720(%r12)
subl %r13d, 0x4724(%r12)
xorl %ecx, %ecx
movl $0x0, %edi
testl %r8d, %r8d
js 0x1e8aa
leaq 0xe569(%rip), %rdi      # 0x2ce10
movl (%rsi,%rdi), %edi
incl %ebp
andl %edx, %eax
addl %edi, %eax
movq %r15, %r13
movzbl (%r15,%rbx), %edx
imull %eax, %edx
movq 0x8(%rsp), %r15
movw %dx, (%r15,%rbx,2)
movq 0x10(%rsp), %rax
movq %r15, %rbx
movq %rax, %r15
jmp 0x1e6de
leaq 0xe99a(%rip), %rax      # 0x2d276
movq %rax, 0x19acd(%rip)     # 0x383b0
movl $0x1, %ecx
jmp 0x1e6de
leal 0x10(%rbp), %eax
xorl %ecx, %ecx
cmpl $0xf0, %r8d
setne %cl
cmovnel %ebp, %eax
addl %ecx, %ecx
movl %eax, %ebp
movq %r15, %r13
movq %rdx, %r15
jmp 0x1e6de
cmpl $0x2, %ecx
je 0x1e915
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe9ff(%rip), %rdi      # 0x2d32a
leaq 0xe9a7(%rip), %rsi      # 0x2d2d9
leaq 0xea30(%rip), %rcx      # 0x2d369
movl $0x686, %edx            # imm = 0x686
callq 0x4200
leaq 0xe93d(%rip), %rdi      # 0x2d287
leaq 0xe988(%rip), %rsi      # 0x2d2d9
leaq 0xe998(%rip), %rcx      # 0x2d2f0
movl $0x671, %edx            # imm = 0x671
callq 0x4200