// File: /workspace/github_c_makefile_star2_O3/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 0x30e5(%rip), %rsi      # 0x19230
callq 0x14f06
testl %eax, %eax
je 0x16215
cmpq $0x0, 0x10(%r14)
je 0x1618e
movq 0xb8(%r14), %rax
movq 0xc0(%r14), %rdx
movl %edx, %ecx
subl %eax, %ecx
cmpl $0x57, %ecx
jg 0x16195
movq %rdx, 0xb8(%r14)
movq 0x28(%r14), %rdi
movl $0x58, %esi
subl %ecx, %esi
callq *0x18(%r14)
jmp 0x161a0
movq 0xb8(%r14), %rax
addq $0x58, %rax
movq %rax, 0xb8(%r14)
movq %r14, %rdi
callq 0xfc21
movl %eax, %ebp
testq %r12, %r12
je 0x161b3
movl %ebp, (%r12)
movq %r14, %rdi
callq 0xfc21
testq %r15, %r15
je 0x161c5
movl %eax, (%r15)
jmp 0x161c7
movl %eax, %ebp
cmpq $0x0, 0x10(%r14)
je 0x161e1
movq 0x28(%r14), %rdi
callq *0x20(%r14)
testl %eax, %eax
je 0x161f1
cmpl $0x0, 0x30(%r14)
je 0x16215
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jae 0x16215
movl %ebp, %ecx
testq %r12, %r12
je 0x161fc
movl (%r12), %ecx
testl %ecx, %ecx
je 0x16236
movl $0x10000000, %eax       # imm = 0x10000000
xorl %edx, %edx
idivl %ecx
testq %r15, %r15
je 0x16211
movl (%r15), %ebp
cmpl %ebp, %eax
jge 0x16236
movups 0xc8(%r14), %xmm0
movups %xmm0, 0xb8(%r14)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x10(%r14)
movq %rbx, 0x8(%rsp)
je 0x16271
movq 0xb8(%r14), %rax
movq 0xc0(%r14), %rdx
movl %edx, %ecx
subl %eax, %ecx
cmpl $0x7, %ecx
jg 0x16278
movq %rdx, 0xb8(%r14)
movq 0x28(%r14), %rdi
movl $0x8, %esi
subl %ecx, %esi
callq *0x18(%r14)
jmp 0x16283
movq 0xb8(%r14), %rax
addq $0x8, %rax
movq %rax, 0xb8(%r14)
leaq 0x38(%r14), %r15
leaq 0x39(%r14), %r13
movl $0xb, %ebx
xorl %r12d, %r12d
movq %r15, 0x10(%rsp)
decl %ebx
je 0x16225
movq 0xb8(%r14), %rcx
movq 0xc0(%r14), %rax
cmpq %rax, %rcx
jae 0x162c5
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %cl
movl %ecx, 0x4(%rsp)
movq %rdx, %rcx
jmp 0x16320
cmpl $0x0, 0x30(%r14)
je 0x162ed
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x162f7
cltq
addq %r15, %rax
movb (%r15), %cl
movl %ecx, 0x4(%rsp)
jmp 0x1630f
movl $0x0, 0x4(%rsp)
jmp 0x16320
movl $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
movl $0x0, 0x4(%rsp)
movq %r13, %rax
movq %rax, 0xc0(%r14)
movq %r13, 0xb8(%r14)
movq %r13, %rcx
cmpq %rax, %rcx
jae 0x16338
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %bpl
movq %rdx, %rcx
jmp 0x16383
cmpl $0x0, 0x30(%r14)
je 0x1635c
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x16360
cltq
addq %r15, %rax
movb (%r15), %bpl
jmp 0x16372
xorl %ebp, %ebp
jmp 0x16383
movl $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
xorl %ebp, %ebp
movq %r13, %rax
movq %rax, 0xc0(%r14)
movq %r13, 0xb8(%r14)
movq %r13, %rcx
cmpq %rax, %rcx
jae 0x1638d
incq %rcx
jmp 0x163c8
cmpl $0x0, 0x30(%r14)
je 0x163cf
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x163ae
cltq
addq %r15, %rax
jmp 0x163be
movl $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
movq %r13, %rax
movq %rax, 0xc0(%r14)
movq %r13, %rcx
movq %rcx, 0xb8(%r14)
cmpq %rax, %rcx
jae 0x163e7
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r14)
movb (%rcx), %r15b
movq %rdx, %rcx
jmp 0x16434
cmpl $0x0, 0x30(%r14)
je 0x1640b
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x16410
cltq
addq %r15, %rax
movb (%r15), %r15b
jmp 0x16423
xorl %r15d, %r15d
jmp 0x16434
movl $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
xorl %r15d, %r15d
movq %r13, %rax
movq %rax, 0xc0(%r14)
movq %r13, 0xb8(%r14)
movq %r13, %rcx
cmpq $0x0, 0x10(%r14)
je 0x16460
movq 0x28(%r14), %rdi
callq *0x20(%r14)
testl %eax, %eax
je 0x16469
cmpl $0x0, 0x30(%r14)
je 0x16215
movq 0xb8(%r14), %rcx
movq 0xc0(%r14), %rax
cmpq %rax, %rcx
jae 0x16215
cmpb $0x8, %bpl
jne 0x16215
movzbl %r15b, %eax
orl %eax, %r12d
cmpb $0x0, 0x4(%rsp)
movq 0x10(%rsp), %r15
jne 0x16298
movl $0x1, %eax
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x16227
andl $0x10, %r12d
cmpl $0x1, %r12d
movl $0x4, %edx
sbbl $0x0, %edx
movl %edx, (%rcx)
jmp 0x16227