// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/include/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), %rdx
movq 0xd0(%rdi), %rax
movq %rdx, 0xb8(%rdi)
movq %rax, 0xc0(%rdi)
cmpq %rax, %rdx
jae 0x37011
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%rbx)
movb (%rdx), %bpl
movq %rcx, %rdx
jmp 0x3705e
cmpl $0x0, 0x30(%rbx)
je 0x37037
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r13
movl 0x34(%rbx), %edx
movq %r13, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x3703b
cltq
addq %r13, %rax
movb (%r13), %bpl
jmp 0x3704c
xorl %ebp, %ebp
jmp 0x3705e
movl $0x0, 0x30(%rbx)
leaq 0x39(%rbx), %rax
movb $0x0, 0x38(%rbx)
xorl %ebp, %ebp
movq %rax, 0xc0(%rbx)
leaq 0x39(%rbx), %rdx
movq %rdx, 0xb8(%rbx)
cmpq %rax, %rdx
jae 0x37072
leaq 0x1(%rdx), %rcx
movq %rcx, 0xb8(%rbx)
movb (%rdx), %dl
jmp 0x370bb
cmpl $0x0, 0x30(%rbx)
je 0x370f7
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r13
movl 0x34(%rbx), %edx
movq %r13, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x37098
cltq
addq %r13, %rax
movb (%r13), %dl
jmp 0x370a9
movl $0x0, 0x30(%rbx)
leaq 0x39(%rbx), %rax
movb $0x0, 0x38(%rbx)
xorl %edx, %edx
movq %rax, 0xc0(%rbx)
leaq 0x39(%rbx), %rcx
movq %rcx, 0xb8(%rbx)
cmpb $0x50, %bpl
jne 0x370f7
leal -0x37(%rdx), %esi
cmpb $-0x3, %sil
jbe 0x370f7
testq %r12, %r12
je 0x370e3
xorl %esi, %esi
cmpb $0x36, %dl
sete %sil
leal 0x1(,%rsi,2), %edx
movl %edx, (%r12)
cmpq %rax, %rcx
jae 0x3710a
leaq 0x1(%rcx), %rax
movq %rax, 0xb8(%rbx)
movb (%rcx), %al
jmp 0x37158
movups 0xc8(%rbx), %xmm0
movups %xmm0, 0xb8(%rbx)
jmp 0x371da
cmpl $0x0, 0x30(%rbx)
je 0x37131
movq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %r12
movl 0x34(%rbx), %edx
movq %r12, %rsi
callq *0x10(%rbx)
testl %eax, %eax
je 0x37135
movslq %eax, %rcx
addq %r12, %rcx
movb (%r12), %al
jmp 0x37146
xorl %eax, %eax
jmp 0x37158
movl $0x0, 0x30(%rbx)
leaq 0x39(%rbx), %rcx
movb $0x0, 0x38(%rbx)
xorl %eax, %eax
movq %rcx, 0xc0(%rbx)
leaq 0x39(%rbx), %rcx
movq %rcx, 0xb8(%rbx)
leaq 0x7(%rsp), %r12
movb %al, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x371eb
movq %rbx, %rdi
movq %r12, %rsi
callq 0x373b5
testq %r15, %r15
je 0x3717f
movl %eax, (%r15)
leaq 0x7(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x371eb
movq %rbx, %rdi
movq %r15, %rsi
callq 0x373b5
testq %r14, %r14
je 0x371a2
movl %eax, (%r14)
leaq 0x7(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x371eb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x373b5
movl %eax, %ecx
movl $0x1, %eax
cmpl $0x100, %ecx            # imm = 0x100
jl 0x371dc
leaq 0x8e5e(%rip), %rax      # 0x40031
movq %rax, 0x182ee(%rip)     # 0x4f4c8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq