// File: alan0201tw[P]RayTracer/include/stb_image.h
// Function: stbi__hdr_info(stbi__context*, int*, int*, int*)
static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
{
   char buffer[STBI__HDR_BUFLEN];
   char *token;
   int valid = 0;
   int dummy;

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

   if (stbi__hdr_test(s) == 0) {
       stbi__rewind( s );
       return 0;
   }

   for(;;) {
      token = stbi__hdr_gettoken(s,buffer);
      if (token[0] == 0) break;
      if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
   }

   if (!valid) {
       stbi__rewind( s );
       return 0;
   }
   token = stbi__hdr_gettoken(s,buffer);
   if (strncmp(token, "-Y ", 3)) {
       stbi__rewind( s );
       return 0;
   }
   token += 3;
   *y = (int) strtol(token, &token, 10);
   while (*token == ' ') ++token;
   if (strncmp(token, "+X ", 3)) {
       stbi__rewind( s );
       return 0;
   }
   token += 3;
   *x = (int) strtol(token, NULL, 10);
   *comp = 3;
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x43c(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x71767
leaq -0x440(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x71779
leaq -0x440(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x7178b
leaq -0x440(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x56dc0
cmpl $0x0, %eax
jne 0x717ae
movq -0x10(%rbp), %rdi
callq 0x5ebe0
movl $0x0, -0x4(%rbp)
jmp 0x71927
jmp 0x717b0
movq -0x10(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x6f900
movq %rax, -0x438(%rbp)
movq -0x438(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x717d8
jmp 0x717fc
movq -0x438(%rbp), %rdi
leaq 0xffeb(%rip), %rsi      # 0x817d1
callq 0x76a0
cmpl $0x0, %eax
jne 0x717fa
movl $0x1, -0x43c(%rbp)
jmp 0x717b0
cmpl $0x0, -0x43c(%rbp)
jne 0x7181a
movq -0x10(%rbp), %rdi
callq 0x5ebe0
movl $0x0, -0x4(%rbp)
jmp 0x71927
movq -0x10(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x6f900
movq %rax, -0x438(%rbp)
movq -0x438(%rbp), %rdi
leaq 0xffbc(%rip), %rsi      # 0x817fb
movl $0x3, %edx
callq 0x7240
cmpl $0x0, %eax
je 0x71863
movq -0x10(%rbp), %rdi
callq 0x5ebe0
movl $0x0, -0x4(%rbp)
jmp 0x71927
movq -0x438(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x438(%rbp)
movq -0x438(%rbp), %rdi
leaq -0x438(%rbp), %rsi
movl $0xa, %edx
callq 0x76c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x438(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x718b8
movq -0x438(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x438(%rbp)
jmp 0x71895
movq -0x438(%rbp), %rdi
leaq 0xff51(%rip), %rsi      # 0x81817
movl $0x3, %edx
callq 0x7240
cmpl $0x0, %eax
je 0x718e7
movq -0x10(%rbp), %rdi
callq 0x5ebe0
movl $0x0, -0x4(%rbp)
jmp 0x71927
movq -0x438(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x438(%rbp)
movq -0x438(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x76c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movl $0x3, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
nopw %cs:(%rax,%rax)