// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./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 0x16a94
cmpl $0x4, -0x2c(%rbp)
jle 0x16ab4
leaq 0x9eac(%rip), %rdi      # 0x20947
callq 0x2680
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x16c38
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %edx
xorl %esi, %esi
callq 0x16c50
cmpl $0x0, %eax
je 0x16be5
movq -0x10(%rbp), %rax
cmpl $0x8, 0x20(%rax)
jge 0x16ae1
movq -0x38(%rbp), %rax
movl $0x8, (%rax)
jmp 0x16aee
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 0x16bad
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0xc(%rcx), %eax
je 0x16bad
movq -0x38(%rbp), %rax
cmpl $0x8, (%rax)
jne 0x16b5c
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 0x179c0
movq %rax, -0x40(%rbp)
jmp 0x16b8a
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 0x17f60
movq %rax, -0x40(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0xc(%rax)
cmpq $0x0, -0x40(%rbp)
jne 0x16bab
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x16c38
jmp 0x16bad
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 0x16be3
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0x16be5
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x22a0
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x22a0
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x22a0
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)