// File: /workspace/github_c_makefile_star2_O0/patriciogonzalezvivo[P]tprint/include/std/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;
               } else if (x != 0) {
                  return stbi__err("junk before marker", "Corrupt JPEG");
               }
            }
            // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
         }
      } else {
         if (!stbi__process_marker(j, m)) return 0;
      }
      m = stbi__get_marker(j);
   }
   if (j->progressive)
      stbi__jpeg_finish(j);
   return 1;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
cmpl $0x4, 0x4(%rsp)
jge 0x22473
movq 0x8(%rsp), %rax
addq $0x45a0, %rax           # imm = 0x45A0
movslq 0x4(%rsp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x38(%rax)
movq 0x8(%rsp), %rax
addq $0x45a0, %rax           # imm = 0x45A0
movslq 0x4(%rsp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x40(%rax)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x22421
movq 0x8(%rsp), %rax
movl $0x0, 0x475c(%rax)
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x1f940
cmpl $0x0, %eax
jne 0x224a0
movl $0x0, 0x14(%rsp)
jmp 0x225ea
movq 0x8(%rsp), %rdi
callq 0x205f0
movzbl %al, %eax
movl %eax, 0x4(%rsp)
cmpl $0xd9, 0x4(%rsp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x224c7
jmp 0x225ca
cmpl $0xda, 0x4(%rsp)
jne 0x22595
movq 0x8(%rsp), %rdi
callq 0x22a80
cmpl $0x0, %eax
jne 0x224f1
movl $0x0, 0x14(%rsp)
jmp 0x225ea
movq 0x8(%rsp), %rdi
callq 0x22df0
cmpl $0x0, %eax
jne 0x2250d
movl $0x0, 0x14(%rsp)
jmp 0x225ea
movq 0x8(%rsp), %rax
movzbl 0x4728(%rax), %eax
cmpl $0xff, %eax
jne 0x22593
jmp 0x22522
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x20b60
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2253d
jmp 0x22591
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x21530
movzbl %al, %eax
movl %eax, (%rsp)
cmpl $0xff, (%rsp)
jne 0x22575
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x21530
movb %al, %cl
movq 0x8(%rsp), %rax
movb %cl, 0x4728(%rax)
jmp 0x22591
cmpl $0x0, (%rsp)
je 0x2258d
leaq 0xb5d7(%rip), %rdi      # 0x2db59
callq 0x1a190
movl %eax, 0x14(%rsp)
jmp 0x225ea
jmp 0x2258f
jmp 0x22522
jmp 0x22593
jmp 0x225b4
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x20690
cmpl $0x0, %eax
jne 0x225b2
movl $0x0, 0x14(%rsp)
jmp 0x225ea
jmp 0x225b4
movq 0x8(%rsp), %rdi
callq 0x205f0
movzbl %al, %eax
movl %eax, 0x4(%rsp)
jmp 0x224b1
movq 0x8(%rsp), %rax
cmpl $0x0, 0x4730(%rax)
je 0x225e2
movq 0x8(%rsp), %rdi
callq 0x23ab0
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)