// File: /workspace/github_c_makefile_star2_O1/zhiyb[P]png2tlg/./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,dummy;
   stbi__pic_packet packets[10];

   if (!x) x = &dummy;
   if (!y) y = &dummy;
   if (!comp) comp = &dummy;

   if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) {
      stbi__rewind(s);
      return 0;
   }

   stbi__skip(s, 88);

   *x = stbi__get16be(s);
   *y = stbi__get16be(s);
   if (stbi__at_eof(s)) {
      stbi__rewind( 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
leaq 0x2910(%rip), %rsi      # 0x18180
callq 0x14943
testl %eax, %eax
je 0x15930
cmpq $0x0, 0x10(%r14)
je 0x158b3
movq 0xc0(%r14), %rcx
movl 0xb8(%r14), %edx
movl %ecx, %eax
subl %edx, %eax
cmpl $0x57, %eax
jg 0x158b3
movq %rcx, 0xb8(%r14)
movq 0x28(%r14), %rdi
movl $0x58, %esi
subl %eax, %esi
callq *0x18(%r14)
jmp 0x158bb
addq $0x58, 0xb8(%r14)
movq %r14, %rdi
callq 0xf497
movl %eax, %ebp
testq %r12, %r12
je 0x158ce
movl %ebp, (%r12)
movq %r14, %rdi
callq 0xf497
testq %r15, %r15
je 0x158e0
movl %eax, (%r15)
jmp 0x158e2
movl %eax, %ebp
cmpq $0x0, 0x10(%r14)
je 0x158fc
movq 0x28(%r14), %rdi
callq *0x20(%r14)
testl %eax, %eax
je 0x1590c
cmpl $0x0, 0x30(%r14)
je 0x15930
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jae 0x15930
movl %ebp, %ecx
testq %r12, %r12
je 0x15917
movl (%r12), %ecx
testl %ecx, %ecx
je 0x15953
movl $0x10000000, %eax       # imm = 0x10000000
xorl %edx, %edx
idivl %ecx
testq %r15, %r15
je 0x1592c
movl (%r15), %ebp
cmpl %ebp, %eax
jge 0x15953
movups 0xc8(%r14), %xmm0
movups %xmm0, 0xb8(%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x10(%r14)
movq %rbx, 0x10(%rsp)
je 0x1598e
movq 0xc0(%r14), %rcx
movl 0xb8(%r14), %edx
movl %ecx, %eax
subl %edx, %eax
cmpl $0x7, %eax
jg 0x1598e
movq %rcx, 0xb8(%r14)
movq 0x28(%r14), %rdi
movl $0x8, %esi
subl %eax, %esi
callq *0x18(%r14)
jmp 0x15996
addq $0x8, 0xb8(%r14)
leaq 0x38(%r14), %r15
leaq 0x39(%r14), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpl $0xa, %ebx
je 0x15be8
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x15a23
cmpl $0x0, 0x30(%r14)
je 0x159f7
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x159fc
movq %r15, 0xb8(%r14)
cltq
addq %r15, %rax
movq %rax, 0xc0(%r14)
jmp 0x15a1c
xorl %r13d, %r13d
jmp 0x15a32
movl $0x0, 0x30(%r14)
movq %r15, 0xb8(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movzbl (%rax), %r13d
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x15a9d
cmpl $0x0, 0x30(%r14)
je 0x15a71
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x15a76
movq %r15, 0xb8(%r14)
cltq
addq %r15, %rax
movq %rax, 0xc0(%r14)
jmp 0x15a96
xorl %r12d, %r12d
jmp 0x15aaf
movl $0x0, 0x30(%r14)
movq %r15, 0xb8(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
cmpb $0x8, (%rax)
sete %r12b
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x15b15
cmpl $0x0, 0x30(%r14)
je 0x15b1f
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x15aee
movq %r15, 0xb8(%r14)
cltq
addq %r15, %rax
movq %rax, 0xc0(%r14)
jmp 0x15b0e
movl $0x0, 0x30(%r14)
movq %r15, 0xb8(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
incq %rax
movq %rax, 0xb8(%r14)
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x15b89
cmpl $0x0, 0x30(%r14)
je 0x15b5e
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x15b62
movq %r15, 0xb8(%r14)
cltq
addq %r15, %rax
movq %rax, 0xc0(%r14)
jmp 0x15b82
xorl %eax, %eax
jmp 0x15b97
movl $0x0, 0x30(%r14)
movq %r15, 0xb8(%r14)
movq 0x8(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movzbl (%rax), %eax
incl %ebx
orl %eax, 0x4(%rsp)
cmpq $0x0, 0x10(%r14)
je 0x15bb7
movq 0x28(%r14), %rdi
callq *0x20(%r14)
testl %eax, %eax
je 0x15bd1
cmpl $0x0, 0x30(%r14)
je 0x15bd8
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jae 0x15bd8
xorb $0x1, %r12b
movb $0x1, %al
je 0x15bea
jmp 0x15bd8
movb $0x1, %al
testb %r12b, %r12b
jne 0x15bea
movups 0xc8(%r14), %xmm0
movups %xmm0, 0xb8(%r14)
xorl %eax, %eax
testb %al, %al
je 0x15942
testl %r13d, %r13d
jne 0x159af
movl $0x1, %ebp
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x15942
movl 0x4(%rsp), %eax
andl $0x10, %eax
cmpl $0x1, %eax
movl $0x4, %eax
sbbl $0x0, %eax
movl %eax, (%rcx)
jmp 0x15942