// File: /workspace/github_c_makefile_star2_O1/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__pnm_info(stbi__context*, int*, int*, int*)
static int      stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
{
   int maxv, dummy;
   char c, p, t;

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

   stbi__rewind(s);

   // Get identifier
   p = (char) stbi__get8(s);
   t = (char) stbi__get8(s);
   if (p != 'P' || (t != '5' && t != '6')) {
       stbi__rewind(s);
       return 0;
   }

   *comp = (t == '6') ? 3 : 1;  // '5' is 1-component .pgm; '6' is 3-component .ppm

   c = (char) stbi__get8(s);
   stbi__pnm_skip_whitespace(s, &c);

   *x = stbi__pnm_getinteger(s, &c); // read width
   stbi__pnm_skip_whitespace(s, &c);

   *y = stbi__pnm_getinteger(s, &c); // read height
   stbi__pnm_skip_whitespace(s, &c);

   maxv = stbi__pnm_getinteger(s, &c);  // read max value

   if (maxv > 255)
      return stbi__err("max value > 255", "PPM image not 8-bit");
   else
      return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0xc8(%rdi), %rax
movq 0xd0(%rdi), %rcx
movq %rax, 0xb8(%rdi)
movq %rcx, 0xc0(%rdi)
cmpq %rcx, %rax
jb 0x14b97
cmpl $0x0, 0x30(%rbx)
je 0x14b6e
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r13
movl 0x34(%rbx), %edx
movq %r13, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x14b73
movq %r13, 0xb8(%rbx)
cltq
addq %r13, %rax
movq %rax, 0xc0(%rbx)
jmp 0x14b90
movb $0x1, %bpl
jmp 0x14ba9
movl $0x0, 0x30(%rbx)
movq %r13, 0xb8(%rbx)
leaq 0x39(%rbx), %rax
movq %rax, 0xc0(%rbx)
movb $0x0, 0x38(%rbx)
movq 0xb8(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbx)
cmpb $0x50, (%rax)
setne %bpl
movq 0xb8(%rbx), %rax
cmpq 0xc0(%rbx), %rax
jb 0x14c11
cmpl $0x0, 0x30(%rbx)
je 0x14be9
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r13
movl 0x34(%rbx), %edx
movq %r13, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x14bed
movq %r13, 0xb8(%rbx)
cltq
addq %r13, %rax
movq %rax, 0xc0(%rbx)
jmp 0x14c0a
xorl %eax, %eax
jmp 0x14c1e
movl $0x0, 0x30(%rbx)
movq %r13, 0xb8(%rbx)
leaq 0x39(%rbx), %rax
movq %rax, 0xc0(%rbx)
movb $0x0, 0x38(%rbx)
movq 0xb8(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbx)
movb (%rax), %al
leal -0x37(%rax), %ecx
cmpb $-0x2, %cl
setae %cl
notb %bpl
testb %cl, %bpl
jne 0x14c42
movups 0xc8(%rbx), %xmm0
movups %xmm0, 0xb8(%rbx)
jmp 0x14d50
testq %r12, %r12
je 0x14c59
xorl %ecx, %ecx
cmpb $0x36, %al
sete %cl
leal 0x1(,%rcx,2), %eax
movl %eax, (%r12)
movq 0xb8(%rbx), %rax
cmpq 0xc0(%rbx), %rax
jb 0x14cc1
cmpl $0x0, 0x30(%rbx)
je 0x14c99
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r12
movl 0x34(%rbx), %edx
movq %r12, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x14c9d
movq %r12, 0xb8(%rbx)
cltq
addq %r12, %rax
movq %rax, 0xc0(%rbx)
jmp 0x14cba
xorl %eax, %eax
jmp 0x14cce
movl $0x0, 0x30(%rbx)
movq %r12, 0xb8(%rbx)
leaq 0x39(%rbx), %rax
movq %rax, 0xc0(%rbx)
movb $0x0, 0x38(%rbx)
movq 0xb8(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%rbx)
movb (%rax), %al
leaq 0x7(%rsp), %r12
movb %al, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14d61
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14f40
testq %r15, %r15
je 0x14cf5
movl %eax, (%r15)
leaq 0x7(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x14d61
movq %rbx, %rdi
movq %r15, %rsi
callq 0x14f40
testq %r14, %r14
je 0x14d18
movl %eax, (%r14)
leaq 0x7(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14d61
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14f40
movl %eax, %ecx
movl $0x1, %eax
cmpl $0x100, %ecx            # imm = 0x100
jl 0x14d52
leaq 0x3455(%rip), %rax      # 0x1819e
movq %rax, 0x74d8(%rip)      # 0x1c228
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq