// File: /workspace/github_c_makefile_star2_O0/zhiyb[P]png2tlg/./stb_image.h
// Function: stbi__create_png_image(stbi__png*, unsigned char*, unsigned int, int, int, int, int)
static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced)
{
   int bytes = (depth == 16 ? 2 : 1);
   int out_bytes = out_n * bytes;
   stbi_uc *final;
   int p;
   if (!interlaced)
      return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color);

   // de-interlacing
   final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0);
   for (p=0; p < 7; ++p) {
      int xorig[] = { 0,4,0,2,0,1,0 };
      int yorig[] = { 0,0,4,0,2,0,1 };
      int xspc[]  = { 8,8,4,4,2,2,1 };
      int yspc[]  = { 8,8,8,4,4,2,2 };
      int i,j,x,y;
      // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1
      x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];
      y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
      if (x && y) {
         stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;
         if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) {
            STBI_FREE(final);
            return 0;
         }
         for (j=0; j < y; ++j) {
            for (i=0; i < x; ++i) {
               int out_y = j*yspc[p]+yorig[p];
               int out_x = i*xspc[p]+xorig[p];
               memcpy(final + out_y*a->s->img_x*out_bytes + out_x*out_bytes,
                      a->out + (j*x+i)*out_bytes, out_bytes);
            }
         }
         STBI_FREE(a->out);
         image_data += img_len;
         image_data_len -= img_len;
      }
   }
   a->out = final;

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movl -0x24(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x10, %edx
cmovel %ecx, %eax
movl %eax, -0x2c(%rbp)
movl -0x20(%rbp), %eax
imull -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, 0x10(%rbp)
jne 0x18769
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %r8d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %r9d
movl -0x24(%rbp), %r10d
movl -0x28(%rbp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x190e0
movl %eax, -0x4(%rbp)
jmp 0x18a9b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %esi
movl -0x30(%rbp), %edx
xorl %ecx, %ecx
callq 0x13640
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x7, -0x3c(%rbp)
jge 0x18a88
movq 0x7bee(%rip), %rax      # 0x20390
movq %rax, -0x60(%rbp)
movq 0x7beb(%rip), %rax      # 0x20398
movq %rax, -0x58(%rbp)
movq 0x7be8(%rip), %rax      # 0x203a0
movq %rax, -0x50(%rbp)
movl 0x7be6(%rip), %eax      # 0x203a8
movl %eax, -0x48(%rbp)
movq 0x7be4(%rip), %rax      # 0x203b0
movq %rax, -0x80(%rbp)
movq 0x7be1(%rip), %rax      # 0x203b8
movq %rax, -0x78(%rbp)
movq 0x7bde(%rip), %rax      # 0x203c0
movq %rax, -0x70(%rbp)
movl 0x7bdc(%rip), %eax      # 0x203c8
movl %eax, -0x68(%rbp)
movq 0x7bda(%rip), %rax      # 0x203d0
movq %rax, -0xa0(%rbp)
movq 0x7bd4(%rip), %rax      # 0x203d8
movq %rax, -0x98(%rbp)
movq 0x7bce(%rip), %rax      # 0x203e0
movq %rax, -0x90(%rbp)
movl 0x7bc9(%rip), %eax      # 0x203e8
movl %eax, -0x88(%rbp)
movq 0x7bc4(%rip), %rax      # 0x203f0
movq %rax, -0xc0(%rbp)
movq 0x7bbe(%rip), %rax      # 0x203f8
movq %rax, -0xb8(%rbp)
movq 0x7bb8(%rip), %rax      # 0x20400
movq %rax, -0xb0(%rbp)
movl 0x7bb3(%rip), %eax      # 0x20408
movl %eax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movslq -0x3c(%rbp), %rcx
subl -0x60(%rbp,%rcx,4), %eax
movslq -0x3c(%rbp), %rcx
addl -0xa0(%rbp,%rcx,4), %eax
subl $0x1, %eax
movslq -0x3c(%rbp), %rcx
xorl %edx, %edx
divl -0xa0(%rbp,%rcx,4)
movl %eax, -0xcc(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
movslq -0x3c(%rbp), %rcx
subl -0x80(%rbp,%rcx,4), %eax
movslq -0x3c(%rbp), %rcx
addl -0xc0(%rbp,%rcx,4), %eax
subl $0x1, %eax
movslq -0x3c(%rbp), %rcx
xorl %edx, %edx
divl -0xc0(%rbp,%rcx,4)
movl %eax, -0xd0(%rbp)
cmpl $0x0, -0xcc(%rbp)
je 0x18a78
cmpl $0x0, -0xd0(%rbp)
je 0x18a78
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
imull -0xcc(%rbp), %eax
imull -0x24(%rbp), %eax
addl $0x7, %eax
sarl $0x3, %eax
addl $0x1, %eax
imull -0xd0(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0xcc(%rbp), %r8d
movl -0xd0(%rbp), %r9d
movl -0x24(%rbp), %r10d
movl -0x28(%rbp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x190e0
cmpl $0x0, %eax
jne 0x1894f
movq -0x38(%rbp), %rdi
callq 0x22a0
movl $0x0, -0x4(%rbp)
jmp 0x18a9b
movl $0x0, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
cmpl -0xd0(%rbp), %eax
jge 0x18a4a
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0xcc(%rbp), %eax
jge 0x18a34
movl -0xc8(%rbp), %eax
movslq -0x3c(%rbp), %rcx
imull -0xc0(%rbp,%rcx,4), %eax
movslq -0x3c(%rbp), %rcx
addl -0x80(%rbp,%rcx,4), %eax
movl %eax, -0xd8(%rbp)
movl -0xc4(%rbp), %eax
movslq -0x3c(%rbp), %rcx
imull -0xa0(%rbp,%rcx,4), %eax
movslq -0x3c(%rbp), %rcx
addl -0x60(%rbp,%rcx,4), %eax
movl %eax, -0xdc(%rbp)
movq -0x38(%rbp), %rdi
movl -0xd8(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imull (%rcx), %eax
imull -0x30(%rbp), %eax
movl %eax, %eax
addq %rax, %rdi
movl -0xdc(%rbp), %eax
imull -0x30(%rbp), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0xc8(%rbp), %eax
imull -0xcc(%rbp), %eax
addl -0xc4(%rbp), %eax
imull -0x30(%rbp), %eax
cltq
addq %rax, %rsi
movslq -0x30(%rbp), %rdx
callq 0x21b0
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x18975
jmp 0x18a36
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x18959
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x22a0
movl -0xd4(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0xd4(%rbp), %ecx
movl -0x1c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
jmp 0x18a7a
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x18791
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopw (%rax,%rax)