// File: /workspace/github_c_makefile_star2_O3/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__pic_info(stbi__context*, int*, int*, int*)
static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
{
   int act_comp=0,num_packets=0,chained;
   stbi__pic_packet packets[10];

   stbi__skip(s, 92);

   *x = stbi__get16be(s);
   *y = stbi__get16be(s);
   if (stbi__at_eof(s))  return 0;
   if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) {
       stbi__rewind( s );
       return 0;
   }

   stbi__skip(s, 8);

   do {
      stbi__pic_packet *packet;

      if (num_packets==sizeof(packets)/sizeof(packets[0]))
         return 0;

      packet = &packets[num_packets++];
      chained = stbi__get8(s);
      packet->size    = stbi__get8(s);
      packet->type    = stbi__get8(s);
      packet->channel = stbi__get8(s);
      act_comp |= packet->channel;

      if (stbi__at_eof(s)) {
          stbi__rewind( s );
          return 0;
      }
      if (packet->size != 8) {
          stbi__rewind( s );
          return 0;
      }
   } while (chained);

   *comp = (act_comp & 0x10 ? 4 : 3);

   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
cmpq $0x0, 0x10(%rdi)
je 0x1ee1e
movq 0xb8(%r14), %rax
movq 0xc0(%r14), %rdx
movl %edx, %ecx
subl %eax, %ecx
cmpl $0x5b, %ecx
jg 0x1ee25
movq %rdx, 0xb8(%r14)
movq 0x28(%r14), %rdi
movl $0x5c, %esi
subl %ecx, %esi
callq *0x18(%r14)
jmp 0x1ee30
movq 0xb8(%r14), %rax
addq $0x5c, %rax
movq %rax, 0xb8(%r14)
movq %r14, %rdi
callq 0x1a2af
movl %eax, (%r12)
movq %r14, %rdi
callq 0x1a2af
movl %eax, (%r15)
cmpq $0x0, 0x10(%r14)
je 0x1ee65
movq 0x28(%r14), %rdi
callq *0x20(%r14)
testl %eax, %eax
je 0x1ee79
cmpl $0x0, 0x30(%r14)
je 0x1f11c
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jae 0x1f11c
movl (%r12), %ecx
testl %ecx, %ecx
je 0x1eea4
xorl %esi, %esi
movl $0x10000000, %eax       # imm = 0x10000000
xorl %edx, %edx
idivl %ecx
cmpl (%r15), %eax
jge 0x1eea4
movq 0xc8(%r14), %rax
movq %rax, 0xb8(%r14)
jmp 0x1f11e
cmpq $0x0, 0x10(%r14)
movq %rbx, 0x8(%rsp)
je 0x1eedf
movq 0xb8(%r14), %rax
movq 0xc0(%r14), %rdx
movl %edx, %ecx
subl %eax, %ecx
cmpl $0x7, %ecx
jg 0x1eee6
movq %rdx, 0xb8(%r14)
movq 0x28(%r14), %rdi
movl $0x8, %esi
subl %ecx, %esi
callq *0x18(%r14)
jmp 0x1eef1
movq 0xb8(%r14), %rax
addq $0x8, %rax
movq %rax, 0xb8(%r14)
leaq 0x38(%r14), %r15
leaq 0x39(%r14), %r12
movl $0xb, %ebx
xorl %r13d, %r13d
movq %r15, 0x10(%rsp)
decl %ebx
je 0x1f11c
movq 0xb8(%r14), %rcx
movq 0xc0(%r14), %rax
cmpq %rax, %rcx
jae 0x1ef37
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %cl
movl %ecx, 0x4(%rsp)
movq %rdx, %rcx
jmp 0x1ef92
cmpl $0x0, 0x30(%r14)
je 0x1ef5f
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1ef69
cltq
addq %r15, %rax
movb (%r15), %cl
movl %ecx, 0x4(%rsp)
jmp 0x1ef81
movl $0x0, 0x4(%rsp)
jmp 0x1ef92
movl $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
movl $0x0, 0x4(%rsp)
movq %r12, %rax
movq %rax, 0xc0(%r14)
movq %r12, 0xb8(%r14)
movq %r12, %rcx
cmpq %rax, %rcx
jae 0x1efaa
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %bpl
movq %rdx, %rcx
jmp 0x1eff5
cmpl $0x0, 0x30(%r14)
je 0x1efce
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1efd2
cltq
addq %r15, %rax
movb (%r15), %bpl
jmp 0x1efe4
xorl %ebp, %ebp
jmp 0x1eff5
movl $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
xorl %ebp, %ebp
movq %r12, %rax
movq %rax, 0xc0(%r14)
movq %r12, 0xb8(%r14)
movq %r12, %rcx
cmpq %rax, %rcx
jae 0x1efff
incq %rcx
jmp 0x1f03a
cmpl $0x0, 0x30(%r14)
je 0x1f041
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1f020
cltq
addq %r15, %rax
jmp 0x1f030
movl $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
movq %r12, %rax
movq %rax, 0xc0(%r14)
movq %r12, %rcx
movq %rcx, 0xb8(%r14)
cmpq %rax, %rcx
jae 0x1f059
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %r15b
movq %rdx, %rcx
jmp 0x1f0a6
cmpl $0x0, 0x30(%r14)
je 0x1f07d
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1f082
cltq
addq %r15, %rax
movb (%r15), %r15b
jmp 0x1f095
xorl %r15d, %r15d
jmp 0x1f0a6
movl $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
xorl %r15d, %r15d
movq %r12, %rax
movq %rax, 0xc0(%r14)
movq %r12, 0xb8(%r14)
movq %r12, %rcx
cmpq $0x0, 0x10(%r14)
je 0x1f0ce
movq 0x28(%r14), %rdi
callq *0x20(%r14)
testl %eax, %eax
je 0x1f0d3
cmpl $0x0, 0x30(%r14)
je 0x1f10e
movq 0xb8(%r14), %rcx
movq 0xc0(%r14), %rax
cmpq %rax, %rcx
jae 0x1f10e
cmpb $0x8, %bpl
jne 0x1f10e
movzbl %r15b, %eax
orl %eax, %r13d
cmpb $0x0, 0x4(%rsp)
movq 0x10(%rsp), %r15
jne 0x1ef06
andl $0x10, %r13d
cmpl $0x1, %r13d
movl $0x4, %eax
sbbl $0x0, %eax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movl $0x1, %esi
jmp 0x1f11e
movq 0xc8(%r14), %rax
movq %rax, 0xb8(%r14)
xorl %esi, %esi
movl %esi, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq