// File: /workspace/github_c_makefile_star2_O0/patriciogonzalezvivo[P]tprint/include/std/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)
{
   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(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) {
         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_n + out_x*out_n,
                      a->out + (j*x+i)*out_n, out_n);
            }
         }
         STBI_FREE(a->out);
         image_data += img_len;
         image_data_len -= img_len;
      }
   }
   a->out = final;

   return 1;
}

// Assembly:
subq $0xe8, %rsp
movl 0xf0(%rsp), %eax
movq %rdi, 0xd8(%rsp)
movq %rsi, 0xd0(%rsp)
movl %edx, 0xcc(%rsp)
movl %ecx, 0xc8(%rsp)
movl %r8d, 0xc4(%rsp)
movl %r9d, 0xc0(%rsp)
cmpl $0x0, 0xf0(%rsp)
jne 0x26409
movq 0xd8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl 0xcc(%rsp), %edx
movl 0xc8(%rsp), %ecx
movq 0xd8(%rsp), %rax
movq (%rax), %rax
movl (%rax), %r8d
movq 0xd8(%rsp), %rax
movq (%rax), %rax
movl 0x4(%rax), %r9d
movl 0xc4(%rsp), %r10d
movl 0xc0(%rsp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x26d30
movl %eax, 0xe4(%rsp)
jmp 0x267b5
movq 0xd8(%rsp), %rax
movq (%rax), %rax
movl (%rax), %eax
movq 0xd8(%rsp), %rcx
movq (%rcx), %rcx
imull 0x4(%rcx), %eax
imull 0xc8(%rsp), %eax
movl %eax, %eax
movl %eax, %edi
callq 0x1ac80
movq %rax, 0xb8(%rsp)
movl $0x0, 0xb4(%rsp)
cmpl $0x7, 0xb4(%rsp)
jge 0x26796
movq 0x7552(%rip), %rax      # 0x2d9b0
movq %rax, 0x90(%rsp)
movq 0x754b(%rip), %rax      # 0x2d9b8
movq %rax, 0x98(%rsp)
movq 0x7544(%rip), %rax      # 0x2d9c0
movq %rax, 0xa0(%rsp)
movl 0x753e(%rip), %eax      # 0x2d9c8
movl %eax, 0xa8(%rsp)
movq 0x7538(%rip), %rax      # 0x2d9d0
movq %rax, 0x70(%rsp)
movq 0x7534(%rip), %rax      # 0x2d9d8
movq %rax, 0x78(%rsp)
movq 0x7530(%rip), %rax      # 0x2d9e0
movq %rax, 0x80(%rsp)
movl 0x752a(%rip), %eax      # 0x2d9e8
movl %eax, 0x88(%rsp)
movq 0x7524(%rip), %rax      # 0x2d9f0
movq %rax, 0x50(%rsp)
movq 0x7520(%rip), %rax      # 0x2d9f8
movq %rax, 0x58(%rsp)
movq 0x751c(%rip), %rax      # 0x2da00
movq %rax, 0x60(%rsp)
movl 0x7519(%rip), %eax      # 0x2da08
movl %eax, 0x68(%rsp)
movq 0x7516(%rip), %rax      # 0x2da10
movq %rax, 0x30(%rsp)
movq 0x7512(%rip), %rax      # 0x2da18
movq %rax, 0x38(%rsp)
movq 0x750e(%rip), %rax      # 0x2da20
movq %rax, 0x40(%rsp)
movl 0x750b(%rip), %eax      # 0x2da28
movl %eax, 0x48(%rsp)
movq 0xd8(%rsp), %rax
movq (%rax), %rax
movl (%rax), %eax
movslq 0xb4(%rsp), %rcx
subl 0x90(%rsp,%rcx,4), %eax
movslq 0xb4(%rsp), %rcx
addl 0x50(%rsp,%rcx,4), %eax
subl $0x1, %eax
movslq 0xb4(%rsp), %rcx
xorl %edx, %edx
divl 0x50(%rsp,%rcx,4)
movl %eax, 0x24(%rsp)
movq 0xd8(%rsp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
movslq 0xb4(%rsp), %rcx
subl 0x70(%rsp,%rcx,4), %eax
movslq 0xb4(%rsp), %rcx
addl 0x30(%rsp,%rcx,4), %eax
subl $0x1, %eax
movslq 0xb4(%rsp), %rcx
xorl %edx, %edx
divl 0x30(%rsp,%rcx,4)
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x24(%rsp)
je 0x2677e
cmpl $0x0, 0x20(%rsp)
je 0x2677e
movq 0xd8(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
imull 0x24(%rsp), %eax
imull 0xc4(%rsp), %eax
addl $0x7, %eax
sarl $0x3, %eax
addl $0x1, %eax
imull 0x20(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0xd8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl 0xcc(%rsp), %edx
movl 0xc8(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl 0x20(%rsp), %r9d
movl 0xc4(%rsp), %r10d
movl 0xc0(%rsp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x26d30
cmpl $0x0, %eax
jne 0x26642
movq 0xb8(%rsp), %rdi
callq 0xd4e0
movl $0x0, 0xe4(%rsp)
jmp 0x267b5
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
cmpl 0x20(%rsp), %eax
jge 0x26740
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x2672e
movl 0x28(%rsp), %eax
movslq 0xb4(%rsp), %rcx
imull 0x30(%rsp,%rcx,4), %eax
movslq 0xb4(%rsp), %rcx
addl 0x70(%rsp,%rcx,4), %eax
movl %eax, 0x18(%rsp)
movl 0x2c(%rsp), %eax
movslq 0xb4(%rsp), %rcx
imull 0x50(%rsp,%rcx,4), %eax
movslq 0xb4(%rsp), %rcx
addl 0x90(%rsp,%rcx,4), %eax
movl %eax, 0x14(%rsp)
movq 0xb8(%rsp), %rdi
movl 0x18(%rsp), %eax
movq 0xd8(%rsp), %rcx
movq (%rcx), %rcx
imull (%rcx), %eax
imull 0xc8(%rsp), %eax
movl %eax, %eax
addq %rax, %rdi
movl 0x14(%rsp), %eax
imull 0xc8(%rsp), %eax
cltq
addq %rax, %rdi
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rsi
movl 0x28(%rsp), %eax
imull 0x24(%rsp), %eax
addl 0x2c(%rsp), %eax
imull 0xc8(%rsp), %eax
cltq
addq %rax, %rsi
movslq 0xc8(%rsp), %rdx
callq 0xd330
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x26660
jmp 0x26730
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x2664a
movq 0xd8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xd4e0
movl 0x1c(%rsp), %ecx
movq 0xd0(%rsp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, 0xd0(%rsp)
movl 0x1c(%rsp), %ecx
movl 0xcc(%rsp), %eax
subl %ecx, %eax
movl %eax, 0xcc(%rsp)
jmp 0x26780
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x26449
movq 0xb8(%rsp), %rcx
movq 0xd8(%rsp), %rax
movq %rcx, 0x18(%rax)
movl $0x1, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
addq $0xe8, %rsp
retq
nopw %cs:(%rax,%rax)