// File: alan0201tw[P]RayTracer/include/stb_image.h
// Function: stbi__do_png(stbi__png*, int*, int*, int*, int, stbi__result_info*)
static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp, stbi__result_info *ri)
{
   void *result=NULL;
   if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
   if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {
      if (p->depth < 8)
         ri->bits_per_channel = 8;
      else
         ri->bits_per_channel = p->depth;
      result = p->out;
      p->out = NULL;
      if (req_comp && req_comp != p->s->img_out_n) {
         if (ri->bits_per_channel == 8)
            result = stbi__convert_format((unsigned char *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
         else
            result = stbi__convert_format16((stbi__uint16 *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
         p->s->img_out_n = req_comp;
         if (result == NULL) return result;
      }
      *x = p->s->img_x;
      *y = p->s->img_y;
      if (n) *n = p->s->img_n;
   }
   STBI_FREE(p->out);      p->out      = NULL;
   STBI_FREE(p->expanded); p->expanded = NULL;
   STBI_FREE(p->idata);    p->idata    = NULL;

   return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x69934
cmpl $0x4, -0x2c(%rbp)
jle 0x69954
leaq 0x177d0(%rip), %rdi     # 0x8110b
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x69ad8
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %edx
xorl %esi, %esi
callq 0x69af0
cmpl $0x0, %eax
je 0x69a85
movq -0x10(%rbp), %rax
cmpl $0x8, 0x20(%rax)
jge 0x69981
movq -0x38(%rbp), %rax
movl $0x8, (%rax)
jmp 0x6998e
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x69a4d
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0xc(%rcx), %eax
je 0x69a4d
movq -0x38(%rbp), %rax
cmpl $0x8, (%rax)
jne 0x699fc
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0xc(%rax), %esi
movl -0x2c(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %r8d
callq 0x6a860
movq %rax, -0x40(%rbp)
jmp 0x69a2a
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0xc(%rax), %esi
movl -0x2c(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %r8d
callq 0x6ae00
movq %rax, -0x40(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0xc(%rax)
cmpq $0x0, -0x40(%rbp)
jne 0x69a4b
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x69ad8
jmp 0x69a4d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x69a83
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0x69a85
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x75e0
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x75e0
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x75e0
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)