// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__decode_jpeg_image(stbi__jpeg*)
static int stbi__decode_jpeg_image(stbi__jpeg *j)
{
   int m;
   for (m = 0; m < 4; m++) {
      j->img_comp[m].raw_data = NULL;
      j->img_comp[m].raw_coeff = NULL;
   }
   j->restart_interval = 0;
   if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0;
   m = stbi__get_marker(j);
   while (!stbi__EOI(m)) {
      if (stbi__SOS(m)) {
         if (!stbi__process_scan_header(j)) return 0;
         if (!stbi__parse_entropy_coded_data(j)) return 0;
         if (j->marker == STBI__MARKER_none ) {
            // handle 0s at the end of image data from IP Kamera 9060
            while (!stbi__at_eof(j->s)) {
               int x = stbi__get8(j->s);
               if (x == 255) {
                  j->marker = stbi__get8(j->s);
                  break;
               }
            }
            // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
         }
      } else if (stbi__DNL(m)) {
         int Ld = stbi__get16be(j->s);
         stbi__uint32 NL = stbi__get16be(j->s);
         if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG");
         if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG");
      } else {
         if (!stbi__process_marker(j, m)) return 0;
      }
      m = stbi__get_marker(j);
   }
   if (j->progressive)
      stbi__jpeg_finish(j);
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x1456e
movq -0x10(%rbp), %rax
addq $0x46a0, %rax           # imm = 0x46A0
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
addq $0x46a0, %rax           # imm = 0x46A0
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x40(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x14523
movq -0x10(%rbp), %rax
movl $0x0, 0x4868(%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xbbd0
cmpl $0x0, %eax
jne 0x14598
movl $0x0, -0x4(%rbp)
jmp 0x14715
movq -0x10(%rbp), %rdi
callq 0x11e50
movzbl %al, %eax
movl %eax, -0x14(%rbp)
cmpl $0xd9, -0x14(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x145bc
jmp 0x146f8
cmpl $0xda, -0x14(%rbp)
jne 0x14666
movq -0x10(%rbp), %rdi
callq 0x14a50
cmpl $0x0, %eax
jne 0x145e3
movl $0x0, -0x4(%rbp)
jmp 0x14715
movq -0x10(%rbp), %rdi
callq 0x14d80
cmpl $0x0, %eax
jne 0x145fd
movl $0x0, -0x4(%rbp)
jmp 0x14715
movq -0x10(%rbp), %rax
movzbl 0x4828(%rax), %eax
cmpl $0xff, %eax
jne 0x14664
jmp 0x14611
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x12530
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1462b
jmp 0x14662
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x12e60
movzbl %al, %eax
movl %eax, -0x18(%rbp)
cmpl $0xff, -0x18(%rbp)
jne 0x14660
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x12e60
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x4828(%rax)
jmp 0x14662
jmp 0x14611
jmp 0x14664
jmp 0x146e4
cmpl $0xdc, -0x14(%rbp)
jne 0x146c6
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x12fa0
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x12fa0
movl %eax, -0x20(%rbp)
cmpl $0x4, -0x1c(%rbp)
je 0x146a4
leaq 0xc2ba(%rip), %rdi      # 0x20954
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x14715
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x4(%rcx), %eax
je 0x146c4
leaq 0xc2a6(%rip), %rdi      # 0x20960
callq 0x2680
movl %eax, -0x4(%rbp)
jmp 0x14715
jmp 0x146e2
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x11ee0
cmpl $0x0, %eax
jne 0x146e0
movl $0x0, -0x4(%rbp)
jmp 0x14715
jmp 0x146e2
jmp 0x146e4
movq -0x10(%rbp), %rdi
callq 0x11e50
movzbl %al, %eax
movl %eax, -0x14(%rbp)
jmp 0x145a7
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4830(%rax)
je 0x1470e
movq -0x10(%rbp), %rdi
callq 0x15900
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop