// File: /workspace/github_c_makefile_star2_O1/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__create_png_image_raw
static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y)
{
   stbi__context *s = a->s;
   stbi__uint32 i,j,stride = x*out_n;
   int k;
   int img_n = s->img_n; // copy it into a local for later
   STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);
   a->out = (stbi_uc *) stbi__malloc(x * y * out_n);
   if (!a->out) return stbi__err("outofmem", "Out of memory");
   if (s->img_x == x && s->img_y == y) {
      if (raw_len != (img_n * x + 1) * y) return stbi__err("not enough pixels","Corrupt PNG");
   } else { // interlaced:
      if (raw_len < (img_n * x + 1) * y) return stbi__err("not enough pixels","Corrupt PNG");
   }
   for (j=0; j < y; ++j) {
      stbi_uc *cur = a->out + stride*j;
      stbi_uc *prior = cur - stride;
      int filter = *raw++;
      if (filter > 4) return stbi__err("invalid filter","Corrupt PNG");
      // if first row, use special filter that doesn't sample previous row
      if (j == 0) filter = first_row_filter[filter];
      // handle first pixel explicitly
      for (k=0; k < img_n; ++k) {
         switch (filter) {
            case STBI__F_none       : cur[k] = raw[k]; break;
            case STBI__F_sub        : cur[k] = raw[k]; break;
            case STBI__F_up         : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
            case STBI__F_avg        : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break;
            case STBI__F_paeth      : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break;
            case STBI__F_avg_first  : cur[k] = raw[k]; break;
            case STBI__F_paeth_first: cur[k] = raw[k]; break;
         }
      }
      if (img_n != out_n) cur[img_n] = 255;
      raw += img_n;
      cur += out_n;
      prior += out_n;
      // this is a little gross, so that we don't switch per-pixel or per-component
      if (img_n == out_n) {
         #define CASE(f) \
             case f:     \
                for (i=x-1; i >= 1; --i, raw+=img_n,cur+=img_n,prior+=img_n) \
                   for (k=0; k < img_n; ++k)
         switch (filter) {
            CASE(STBI__F_none)         cur[k] = raw[k]; break;
            CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-img_n]); break;
            CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
            CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-img_n])>>1)); break;
            CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-img_n],prior[k],prior[k-img_n])); break;
            CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-img_n] >> 1)); break;
            CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-img_n],0,0)); break;
         }
         #undef CASE
      } else {
         STBI_ASSERT(img_n+1 == out_n);
         #define CASE(f) \
             case f:     \
                for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \
                   for (k=0; k < img_n; ++k)
         switch (filter) {
            CASE(STBI__F_none)         cur[k] = raw[k]; break;
            CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-out_n]); break;
            CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
            CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-out_n])>>1)); break;
            CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
            CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-out_n] >> 1)); break;
            CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],0,0)); break;
         }
         #undef CASE
      }
   }
   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, 0x20(%rsp)
movl %ecx, %edx
movq (%rdi), %rbx
movl 0x8(%rbx), %r15d
cmpl %ecx, %r15d
sete %al
leal 0x1(%r15), %ecx
movl %ecx, 0x3c(%rsp)
cmpl %edx, %ecx
sete %cl
orb %al, %cl
je 0x411d08
movl %r9d, %r12d
movl %r8d, %ebp
movq %rsi, %r14
movq %rdi, %r13
movl %r8d, %eax
movl %edx, 0x10(%rsp)
imull %edx, %eax
movl %eax, 0x14(%rsp)
movl %eax, %edi
imull %r9d, %edi
callq 0x4449d0
movq %rax, 0x18(%r13)
testq %rax, %rax
je 0x411ce2
movl %r15d, %ecx
movslq %r15d, %rax
movq %rax, 0x30(%rsp)
cmpl %ebp, (%rbx)
jne 0x4116a8
cmpl %r12d, 0x4(%rbx)
jne 0x4116a8
movl %ecx, %eax
imull %ebp, %eax
incl %eax
imull %r12d, %eax
cmpl 0x20(%rsp), %eax
movl 0x10(%rsp), %edx
je 0x4116c0
leaq 0xc6454(%rip), %rax     # 0x4d7af7
jmp 0x411ce9
movq 0x30(%rsp), %rax
imull %ebp, %eax
incl %eax
imull %r12d, %eax
cmpl 0x20(%rsp), %eax
movl 0x10(%rsp), %edx
ja 0x41169c
movl $0x1, %eax
testl %r12d, %r12d
je 0x411cf2
movq %r13, 0x50(%rsp)
movl 0x14(%rsp), %eax
movslq %edx, %r13
decl %ebp
movl %ebp, 0x4(%rsp)
movl %r12d, %esi
movq %rsi, 0x58(%rsp)
movq %r13, %rdi
movq 0x30(%rsp), %r12
subq %r12, %rdi
movq %rdi, 0x18(%rsp)
subq %rax, %rdi
movq %rdi, 0x48(%rsp)
negq %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
leaq 0xc5c73(%rip), %r11     # 0x4d7384
xorl %edi, %edi
movq %r13, 0x40(%rsp)
movl %eax, %eax
movzbl (%r14), %r8d
incq %r14
cmpq $0x5, %r8
movq %rax, 0x8(%rsp)
movq %rdi, 0x20(%rsp)
movq %r8, 0x60(%rsp)
jae 0x411811
movl %r8d, %esi
testq %rdi, %rdi
jne 0x41174d
leaq 0xc5dc3(%rip), %rax     # 0x4d750c
movb (%r8,%rax), %sil
movq 0x50(%rsp), %rax
movq 0x18(%rax), %r8
movzbl %sil, %r15d
testl %r12d, %r12d
jle 0x4117a2
movq 0x8(%rsp), %rax
addq %r8, %rax
movq 0x28(%rsp), %rdi
leaq (%rax,%rdi), %r9
xorl %ebp, %ebp
cmpb $0x6, %sil
ja 0x41179a
movslq (%r11,%r15,4), %rdi
addq %r11, %rdi
jmpq *%rdi
movb (%r14,%rbp), %bl
jmp 0x411797
movb (%r9,%rbp), %bl
jmp 0x411793
movb (%r9,%rbp), %bl
shrb %bl
addb (%r14,%rbp), %bl
movb %bl, (%rax,%rbp)
incq %rbp
cmpq %rbp, %rcx
jne 0x411772
movl 0x14(%rsp), %eax
movl %eax, %r9d
imull 0x20(%rsp), %r9d
addq %r8, %r9
cmpl %edx, %ecx
je 0x4117bb
movb $-0x1, (%r9,%r12)
movq 0x28(%rsp), %rax
addq %r9, %rax
addq %r12, %r14
addq %r13, %r9
addq %r13, %rax
cmpl %edx, %r12d
jne 0x41184f
cmpb $0x6, %sil
ja 0x41181f
leaq 0xc5bde(%rip), %rdx     # 0x4d73bc
movslq (%rdx,%r15,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x41181f
testl %ecx, %ecx
jle 0x411805
xorl %esi, %esi
movb (%r14,%rsi), %dil
movb %dil, (%r9,%rsi)
incq %rsi
cmpq %rsi, %rcx
jne 0x4117f5
addq %r12, %r14
addq %r12, %r9
decl %eax
jne 0x4117ef
jmp 0x41181f
leaq 0xc62f1(%rip), %rax     # 0x4d7b09
movq %rax, 0x109d21(%rip)    # 0x51b540
cmpb $0x5, 0x60(%rsp)
jae 0x411cf0
movq 0x20(%rsp), %rdi
incq %rdi
movq 0x8(%rsp), %rax
addl 0x14(%rsp), %eax
cmpq 0x58(%rsp), %rdi
movl 0x10(%rsp), %edx
jne 0x411718
jmp 0x411d01
cmpl %edx, 0x3c(%rsp)
jne 0x411d27
cmpb $0x6, %sil
ja 0x41181f
leaq 0xc5b3a(%rip), %rsi     # 0x4d73a0
movslq (%rsi,%r15,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x41181f
testl %ecx, %ecx
jle 0x41188d
xorl %esi, %esi
movb (%r14,%rsi), %dl
movb %dl, (%r9,%rsi)
incq %rsi
cmpq %rsi, %rcx
jne 0x41187d
movb $-0x1, (%r9,%r12)
addq %r12, %r14
addq %r13, %r9
decl %eax
jne 0x411877
jmp 0x41181f
movl 0x4(%rsp), %r15d
testl %r15d, %r15d
je 0x41181f
movq 0x18(%rsp), %rdx
leaq (%r8,%rdx), %rsi
movq 0x8(%rsp), %rdx
addq %rdx, %rsi
addq 0x48(%rsp), %r8
addq %rdx, %r8
testl %r12d, %r12d
jle 0x41192e
xorl %ebp, %ebp
movzbl (%rsi,%rbp), %ebx
movzbl (%rax,%rbp), %r10d
movzbl (%r8,%rbp), %r12d
leal (%r10,%rbx), %edi
subl %r12d, %edi
movl %edi, %edx
subl %ebx, %edx
movl %edx, %r11d
negl %r11d
cmovsl %edx, %r11d
movl %edi, %edx
subl %r10d, %edx
movl %edx, %r13d
negl %r13d
cmovsl %edx, %r13d
subl %r12d, %edi
movl %edi, %edx
negl %edx
cmovsl %edi, %edx
cmpl %edx, %r13d
ja 0x411910
movl %r10d, %r12d
cmpl %edx, %r11d
cmoval %r12d, %ebx
cmpl %r13d, %r11d
cmoval %r12d, %ebx
addb (%r14,%rbp), %bl
movb %bl, (%r9,%rbp)
incq %rbp
cmpq %rbp, %rcx
jne 0x4118cc
movq 0x30(%rsp), %r12
addq %r12, %r14
addq %r12, %r9
addq %r12, %rax
addq %r12, %rsi
addq %r12, %r8
decl %r15d
movq 0x40(%rsp), %r13
leaq 0xc5a33(%rip), %r11     # 0x4d7384
jne 0x4118c5
jmp 0x41181f
movl 0x4(%rsp), %edx
movl %edx, %esi
testl %edx, %edx
je 0x41181f
testl %ecx, %ecx
jle 0x411985
xorl %r8d, %r8d
movb (%rax,%r8), %dil
addb (%r14,%r8), %dil
movb %dil, (%r9,%r8)
incq %r8
cmpq %r8, %rcx
jne 0x411971
addq %r12, %r14
addq %r12, %r9
addq %r12, %rax
decl %esi
jne 0x41196a
jmp 0x41181f
movl 0x4(%rsp), %esi
testl %esi, %esi
je 0x41181f
addq 0x18(%rsp), %r8
addq 0x8(%rsp), %r8
testl %ecx, %ecx
jle 0x4119d4
xorl %r10d, %r10d
movzbl (%rax,%r10), %edi
movzbl (%r8,%r10), %r11d
addl %edi, %r11d
shrl %r11d
addb (%r14,%r10), %r11b
movb %r11b, (%r9,%r10)
incq %r10
cmpq %r10, %rcx
jne 0x4119b4
addq %r12, %r14
addq %r12, %r9
addq %r12, %rax
addq %r12, %r8
decl %esi
leaq 0xc599b(%rip), %r11     # 0x4d7384
jne 0x4119ad
jmp 0x41181f
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x41181f
addq 0x18(%rsp), %r8
addq 0x8(%rsp), %r8
testl %ecx, %ecx
jle 0x411a20
xorl %esi, %esi
movb (%r8,%rsi), %dil
addb (%r14,%rsi), %dil
movb %dil, (%r9,%rsi)
incq %rsi
cmpq %rsi, %rcx
jne 0x411a0c
addq %r12, %r14
addq %r12, %r9
addq %r12, %r8
decl %eax
jne 0x411a06
jmp 0x41181f
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x41181f
addq 0x18(%rsp), %r8
addq 0x8(%rsp), %r8
testl %r12d, %r12d
jle 0x411a65
xorl %esi, %esi
movb (%r8,%rsi), %dl
shrb %dl
addb (%r14,%rsi), %dl
movb %dl, (%r9,%rsi)
incq %rsi
cmpq %rsi, %rcx
jne 0x411a4f
addq %r12, %r14
addq %r12, %r9
addq %r12, %r8
decl %eax
jne 0x411a48
jmp 0x41181f
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x41181f
addq 0x18(%rsp), %r8
addq 0x8(%rsp), %r8
testl %ecx, %ecx
jle 0x411aa7
xorl %esi, %esi
movb (%r8,%rsi), %dl
addb (%r14,%rsi), %dl
movb %dl, (%r9,%rsi)
incq %rsi
cmpq %rsi, %rcx
jne 0x411a93
addq %r12, %r14
addq %r12, %r9
addq %r12, %r8
decl %eax
jne 0x411a8d
jmp 0x41181f
movl 0x4(%rsp), %r15d
testl %r15d, %r15d
je 0x41181f
addq 0x8(%rsp), %r8
movq 0x28(%rsp), %rdx
leaq (%r8,%rdx), %rsi
testl %ecx, %ecx
jle 0x411b3e
xorl %ebp, %ebp
movzbl (%r8,%rbp), %ebx
movzbl (%rax,%rbp), %r10d
movzbl (%rsi,%rbp), %r12d
leal (%r10,%rbx), %edx
subl %r12d, %edx
movl %edx, %edi
subl %ebx, %edi
movl %edi, %r11d
negl %r11d
cmovsl %edi, %r11d
movl %edx, %edi
subl %r10d, %edi
movl %edi, %r13d
negl %r13d
cmovsl %edi, %r13d
subl %r12d, %edx
movl %edx, %edi
negl %edi
cmovsl %edx, %edi
cmpl %edi, %r13d
ja 0x411b20
movl %r10d, %r12d
cmpl %edi, %r11d
cmoval %r12d, %ebx
cmpl %r13d, %r11d
cmoval %r12d, %ebx
addb (%r14,%rbp), %bl
movb %bl, (%r9,%rbp)
incq %rbp
cmpq %rbp, %rcx
jne 0x411adb
movq 0x30(%rsp), %r12
movb $-0x1, (%r9,%r12)
addq %r12, %r14
movq 0x40(%rsp), %r13
addq %r13, %r9
addq %r13, %rax
addq %r13, %r8
addq %r13, %rsi
decl %r15d
leaq 0xc581e(%rip), %r11     # 0x4d7384
jne 0x411ad5
jmp 0x41181f
movl 0x4(%rsp), %edx
movl %edx, %eax
testl %edx, %edx
je 0x41181f
testl %r12d, %r12d
jle 0x411ba4
movq 0x28(%rsp), %rdx
leaq (%r9,%rdx), %rsi
xorl %r8d, %r8d
movb (%rsi,%r8), %dl
addb (%r14,%r8), %dl
movb %dl, (%r9,%r8)
incq %r8
cmpq %r8, %rcx
jne 0x411b90
movb $-0x1, (%r9,%r12)
addq %r12, %r14
addq %r13, %r9
decl %eax
jne 0x411b7f
jmp 0x41181f
movl 0x4(%rsp), %edx
movl %edx, %esi
testl %edx, %edx
je 0x41181f
testl %ecx, %ecx
jle 0x411bf1
xorl %r8d, %r8d
movzbl (%rax,%r8), %edx
movq %r8, %rdi
subq %r13, %rdi
movzbl (%r9,%rdi), %edi
addl %edx, %edi
shrl %edi
addb (%r14,%r8), %dil
movb %dil, (%r9,%r8)
incq %r8
cmpq %rcx, %r8
jne 0x411bcd
movb $-0x1, (%r9,%r12)
addq %r12, %r14
addq %r13, %r9
addq %r13, %rax
decl %esi
jne 0x411bc6
jmp 0x41181f
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x41181f
addq 0x8(%rsp), %r8
testl %r12d, %r12d
jle 0x411c39
leaq (%r8,%r13), %rsi
xorl %r10d, %r10d
movb (%r8,%r10), %dl
addb (%r14,%r10), %dl
movb %dl, (%rsi,%r10)
incq %r10
cmpq %r10, %rcx
jne 0x411c25
movb $-0x1, (%r9,%r12)
addq %r12, %r14
addq %r13, %r9
addq %r13, %r8
decl %eax
jne 0x411c19
jmp 0x41181f
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x41181f
addq 0x8(%rsp), %r8
testl %r12d, %r12d
jle 0x411c83
leaq (%r8,%r13), %rsi
xorl %r10d, %r10d
movb (%r8,%r10), %dl
shrb %dl
addb (%r14,%r10), %dl
movb %dl, (%rsi,%r10)
incq %r10
cmpq %r10, %rcx
jne 0x411c6d
movb $-0x1, (%r9,%r12)
addq %r12, %r14
addq %r13, %r9
addq %r13, %r8
decl %eax
jne 0x411c61
jmp 0x41181f
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x41181f
addq 0x8(%rsp), %r8
testl %r12d, %r12d
jle 0x411ccb
leaq (%r8,%r13), %rsi
xorl %r10d, %r10d
movb (%r8,%r10), %dl
addb (%r14,%r10), %dl
movb %dl, (%rsi,%r10)
incq %r10
cmpq %r10, %rcx
jne 0x411cb7
movb $-0x1, (%r9,%r12)
addq %r12, %r14
addq %r13, %r9
addq %r13, %r8
decl %eax
jne 0x411cab
jmp 0x41181f
leaq 0xc5b76(%rip), %rax     # 0x4d785f
movq %rax, 0x109850(%rip)    # 0x51b540
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %eax
jmp 0x411cf2
leaq 0xc5d59(%rip), %rdi     # 0x4d7a68
leaq 0xc5c18(%rip), %rsi     # 0x4d792e
leaq 0xc5d74(%rip), %rcx     # 0x4d7a91
movl $0x86b, %edx            # imm = 0x86B
callq 0x41fae0
leaq 0xc5dea(%rip), %rdi     # 0x4d7b18
leaq 0xc5bf9(%rip), %rsi     # 0x4d792e
leaq 0xc5d55(%rip), %rcx     # 0x4d7a91
movl $0x89b, %edx            # imm = 0x89B
callq 0x41fae0