// File: /workspace/github_c_makefile_star2_O3/DavidSM64[P]n64graphics_ci/./stb/stb_image_write.h
// Function: stbiw__encode_png_line
static void stbiw__encode_png_line(unsigned char *pixels, int stride_bytes, int width, int height, int y, int n, int filter_type, signed char *line_buffer)
{
   static int mapping[] = { 0,1,2,3,4 };
   static int firstmap[] = { 0,1,0,5,6 };
   int *mymap = (y != 0) ? mapping : firstmap;
   int i;
   int type = mymap[filter_type];
   unsigned char *z = pixels + stride_bytes * (stbi__flip_vertically_on_write ? height-1-y : y);
   int signed_stride = stbi__flip_vertically_on_write ? -stride_bytes : stride_bytes;
   for (i = 0; i < n; ++i) {
      switch (type) {
         case 0: line_buffer[i] = z[i]; break;
         case 1: line_buffer[i] = z[i]; break;
         case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break;
         case 3: line_buffer[i] = z[i] - (z[i-signed_stride]>>1); break;
         case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-signed_stride],0)); break;
         case 5: line_buffer[i] = z[i]; break;
         case 6: line_buffer[i] = z[i]; break;
      }
   }
   for (i=n; i < width*n; ++i) {
      switch (type) {
         case 0: line_buffer[i] = z[i]; break;
         case 1: line_buffer[i] = z[i] - z[i-n]; break;
         case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break;
         case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-signed_stride])>>1); break;
         case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-signed_stride], z[i-signed_stride-n]); break;
         case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break;
         case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x18(%rbp), %rax
movslq 0x10(%rbp), %r10
testl %r8d, %r8d
leaq 0xc693(%rip), %r11      # 0x12a30
leaq 0xc66c(%rip), %rbx      # 0x12a10
cmoveq %r11, %rbx
movl (%rbx,%r10,4), %r10d
movl %r8d, %r11d
notl %r11d
addl %ecx, %r11d
movl %esi, %ecx
negl %ecx
cmpl $0x0, 0x12e24(%rip)     # 0x191e4
cmovel %r8d, %r11d
cmovel %esi, %ecx
imull %esi, %r11d
movslq %r11d, %rsi
movq %rsi, -0x30(%rbp)
addq %rdi, %rsi
movslq %ecx, %rbx
movl %r10d, %r8d
testl %r9d, %r9d
jle 0x642f
movl %r9d, %r11d
movq -0x30(%rbp), %r14
subq %rbx, %r14
addq %rdi, %r14
xorl %r15d, %r15d
leaq 0xbe39(%rip), %r12      # 0x12230
cmpl $0x6, %r10d
ja 0x6427
movslq (%r12,%r8,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movb (%rsi,%r15), %r13b
jmp 0x6423
movb (%rsi,%r15), %r13b
subb (%r14,%r15), %r13b
jmp 0x6423
movb (%rsi,%r15), %r13b
movb (%r14,%r15), %cl
shrb %cl
subb %cl, %r13b
movb %r13b, (%rax,%r15)
incq %r15
cmpq %r15, %r11
jne 0x63f7
imull %r9d, %edx
cmpl %r9d, %edx
jle 0x654c
movslq %r9d, %rcx
movslq %edx, %rdx
addq %rcx, %rax
movq -0x30(%rbp), %r9
leaq (%rcx,%r9), %r11
leaq (%rdi,%r11), %r15
subq %rbx, %r9
addq %rdi, %r9
movq %r9, -0x30(%rbp)
subq %rbx, %r11
addq %rdi, %r11
subq %rcx, %rdx
xorl %edi, %edi
leaq 0xbddf(%rip), %rbx      # 0x1224c
movq %r11, -0x40(%rbp)
movq %r15, -0x38(%rbp)
cmpl $0x6, %r10d
ja 0x6540
movslq (%rbx,%r8,4), %rcx
addq %rbx, %rcx
jmpq *%rcx
movb (%r15,%rdi), %r14b
subb (%rsi,%rdi), %r14b
jmp 0x653c
movb (%r15,%rdi), %r14b
movb (%rsi,%rdi), %cl
shrb %cl
subb %cl, %r14b
jmp 0x653c
movb (%r15,%rdi), %r14b
movzbl (%rsi,%rdi), %ecx
movzbl (%r11,%rdi), %r9d
addl %ecx, %r9d
shrl %r9d
subb %r9b, %r14b
jmp 0x653c
movzbl (%rsi,%rdi), %r15d
movzbl (%r11,%rdi), %r14d
movq -0x30(%rbp), %rcx
movzbl (%rcx,%rdi), %r12d
leal (%r14,%r15), %r9d
subl %r12d, %r9d
movl %r9d, %ecx
subl %r15d, %ecx
movl %ecx, %r13d
negl %r13d
cmovsl %ecx, %r13d
movl %r9d, %r11d
subl %r14d, %r11d
movl %r11d, %ecx
negl %ecx
cmovsl %r11d, %ecx
subl %r12d, %r9d
movl %r9d, %r11d
negl %r11d
cmovsl %r9d, %r11d
cmpl %r11d, %ecx
ja 0x650c
movl %r14d, %r12d
movq -0x38(%rbp), %r9
movb (%r9,%rdi), %r14b
cmpl %r11d, %r13d
cmoval %r12d, %r15d
cmpl %ecx, %r13d
cmoval %r12d, %r15d
subb %r15b, %r14b
movq %r9, %r15
movq -0x40(%rbp), %r11
jmp 0x653c
movb (%r15,%rdi), %r14b
jmp 0x653c
movb (%r15,%rdi), %r14b
subb (%r11,%rdi), %r14b
movb %r14b, (%rax,%rdi)
incq %rdi
cmpq %rdi, %rdx
jne 0x6475
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq