// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__create_png_image
static int stbi__create_png_image(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, int interlaced)
{
   stbi_uc *final;
   int p;
   if (!interlaced)
      return stbi__create_png_image_raw(a, raw, raw_len, out_n, a->s->img_x, a->s->img_y);

   // de-interlacing
   final = (stbi_uc *) stbi__malloc(a->s->img_x * a->s->img_y * out_n);
   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) {
         if (!stbi__create_png_image_raw(a, raw, raw_len, out_n, x, y)) {
            free(final);
            return 0;
         }
         for (j=0; j < y; ++j)
            for (i=0; i < x; ++i)
               memcpy(final + (j*yspc[p]+yorig[p])*a->s->img_x*out_n + (i*xspc[p]+xorig[p])*out_n,
                      a->out + (j*x+i)*out_n, out_n);
         free(a->out);
         raw += (x*out_n+1)*y;
         raw_len -= (x*out_n+1)*y;
      }
   }
   a->out = final;

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x419a63
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
callq 0x41a220
movl %eax, -0x4(%rbp)
jmp 0x419d5e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imull 0x4(%rcx), %eax
imull -0x20(%rbp), %eax
movl %eax, %eax
movl %eax, %edi
callq 0x412250
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x7, -0x34(%rbp)
jge 0x419d4b
movq 0xcb8b0(%rip), %rax     # 0x4e5350
movq %rax, -0x50(%rbp)
movq 0xcb8ad(%rip), %rax     # 0x4e5358
movq %rax, -0x48(%rbp)
movq 0xcb8aa(%rip), %rax     # 0x4e5360
movq %rax, -0x40(%rbp)
movl 0xcb8a8(%rip), %eax     # 0x4e5368
movl %eax, -0x38(%rbp)
movq 0xcb8a6(%rip), %rax     # 0x4e5370
movq %rax, -0x70(%rbp)
movq 0xcb8a3(%rip), %rax     # 0x4e5378
movq %rax, -0x68(%rbp)
movq 0xcb8a0(%rip), %rax     # 0x4e5380
movq %rax, -0x60(%rbp)
movl 0xcb89e(%rip), %eax     # 0x4e5388
movl %eax, -0x58(%rbp)
movq 0xcb89c(%rip), %rax     # 0x4e5390
movq %rax, -0x90(%rbp)
movq 0xcb896(%rip), %rax     # 0x4e5398
movq %rax, -0x88(%rbp)
movq 0xcb890(%rip), %rax     # 0x4e53a0
movq %rax, -0x80(%rbp)
movl 0xcb88e(%rip), %eax     # 0x4e53a8
movl %eax, -0x78(%rbp)
movq 0xcb88c(%rip), %rax     # 0x4e53b0
movq %rax, -0xb0(%rbp)
movq 0xcb886(%rip), %rax     # 0x4e53b8
movq %rax, -0xa8(%rbp)
movq 0xcb880(%rip), %rax     # 0x4e53c0
movq %rax, -0xa0(%rbp)
movl 0xcb87b(%rip), %eax     # 0x4e53c8
movl %eax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movslq -0x34(%rbp), %rcx
subl -0x50(%rbp,%rcx,4), %eax
movslq -0x34(%rbp), %rcx
addl -0x90(%rbp,%rcx,4), %eax
subl $0x1, %eax
movslq -0x34(%rbp), %rcx
xorl %edx, %edx
divl -0x90(%rbp,%rcx,4)
movl %eax, -0xbc(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
movslq -0x34(%rbp), %rcx
subl -0x70(%rbp,%rcx,4), %eax
movslq -0x34(%rbp), %rcx
addl -0xb0(%rbp,%rcx,4), %eax
subl $0x1, %eax
movslq -0x34(%rbp), %rcx
xorl %edx, %edx
divl -0xb0(%rbp,%rcx,4)
movl %eax, -0xc0(%rbp)
cmpl $0x0, -0xbc(%rbp)
je 0x419d3b
cmpl $0x0, -0xc0(%rbp)
je 0x419d3b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0xbc(%rbp), %r8d
movl -0xc0(%rbp), %r9d
callq 0x41a220
cmpl $0x0, %eax
jne 0x419c0d
movq -0x30(%rbp), %rdi
callq 0x453060
movl $0x0, -0x4(%rbp)
jmp 0x419d5e
movl $0x0, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
cmpl -0xc0(%rbp), %eax
jge 0x419cf0
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0xbc(%rbp), %eax
jge 0x419cda
movq -0x30(%rbp), %rdi
movl -0xb8(%rbp), %eax
movslq -0x34(%rbp), %rcx
imull -0xb0(%rbp,%rcx,4), %eax
movslq -0x34(%rbp), %rcx
addl -0x70(%rbp,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imull (%rcx), %eax
imull -0x20(%rbp), %eax
movl %eax, %eax
addq %rax, %rdi
movl -0xb4(%rbp), %eax
movslq -0x34(%rbp), %rcx
imull -0x90(%rbp,%rcx,4), %eax
movslq -0x34(%rbp), %rcx
addl -0x50(%rbp,%rcx,4), %eax
imull -0x20(%rbp), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0xb8(%rbp), %eax
imull -0xbc(%rbp), %eax
addl -0xb4(%rbp), %eax
imull -0x20(%rbp), %eax
cltq
addq %rax, %rsi
movslq -0x20(%rbp), %rdx
callq 0x401058
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x419c33
jmp 0x419cdc
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x419c17
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x453060
movl -0xbc(%rbp), %ecx
imull -0x20(%rbp), %ecx
addl $0x1, %ecx
imull -0xc0(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0xbc(%rbp), %ecx
imull -0x20(%rbp), %ecx
addl $0x1, %ecx
imull -0xc0(%rbp), %ecx
movl -0x1c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
jmp 0x419d3d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x419a8f
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)