user: What is the c source code of the assembly code below?

```asm
<png_defilter>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    $0xffffffff,%r13d
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  mov    %edx,%edi
  mov    %r9d,%edx
  push   %rbx
  mov    %rsi,%rbx
  mov    %r8d,%esi
  sub    $0x38,%rsp
  mov    %ecx,(%rsp)
  mov    %r9d,0x4(%rsp)
  call   <png_get_scanline_len@plt>
  mov    %eax,%r14d
  cmp    $0x7,%r12d
  jle    L313
  test   %r12d,%r12d
  lea    0x7(%r12),%r13d
  mov    0x4(%rsp),%r9d
  cmovns %r12d,%r13d
  sar    $0x3,%r13d
  neg    %r13d
  imul   %r9d,%r13d
L313:
  mov    %r14d,%eax
  xor    %r12d,%r12d
  neg    %eax
  mov    %eax,0x18(%rsp)
  lea    0x0(%r13,%r14,1),%eax
  mov    %eax,0x4(%rsp)
  mov    %r13d,%eax
  sub    %r14d,%eax
  cltq
  mov    %rax,0x10(%rsp)
  mov    (%rsp),%eax
  test   %eax,%eax
  jg     L296
  jmp    L292
  nopl   0x0(%rax)
L302:
  cmp    $0x1,%al
  je     L248
  cmp    $0x2,%al
  je     L77
  cmp    $0x3,%al
  je     L54
  mov    %r10,%rbx
  mov    %r9,%rbp
  cmp    $0x4,%al
  je     L174
L67:
  add    $0x1,%r12d
  cmp    %r12d,(%rsp)
  je     L292
L296:
  movzbl 0x0(%rbp),%eax
  lea    0x1(%rbp),%r9
  lea    0x1(%rbx),%r10
  mov    %al,(%rbx)
  test   %al,%al
  jne    L302
  cmp    $0x1,%r14d
  jle    L241
  mov    %r14d,%ecx
  mov    $0x1,%eax
  nopl   0x0(%rax)
L342:
  movzbl 0x0(%rbp,%rax,1),%edx
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L342
  lea    -0x1(%r14),%ebx
  lea    (%r9,%rbx,1),%rbp
  add    %r10,%rbx
L308:
  add    $0x1,%r12d
  cmp    %r12d,(%rsp)
  jne    L296
L292:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L248:
  cmp    $0x1,%r14d
  jle    L241
  movslq %r13d,%rdi
  mov    %r14d,%esi
  mov    $0x1,%eax
  add    %rbx,%rdi
  nopl   0x0(%rax,%rax,1)
L150:
  lea    0x0(%r13,%rax,1),%ecx
  xor    %edx,%edx
  test   %ecx,%ecx
  jle    L258
  movzbl (%rdi,%rax,1),%edx
L258:
  add    0x0(%rbp,%rax,1),%dl
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L150
  lea    -0x1(%r14),%ebx
  lea    (%r9,%rbx,1),%rbp
  add    %r10,%rbx
  jmp    L308
  nopl   0x0(%rax)
L77:
  cmp    $0x1,%r14d
  jle    L241
  movslq 0x18(%rsp),%rsi
  mov    %r14d,%ecx
  mov    $0x1,%eax
  add    %rbx,%rsi
  nopw   0x0(%rax,%rax,1)
L187:
  xor    %edx,%edx
  test   %r12d,%r12d
  je     L162
  movzbl (%rsi,%rax,1),%edx
L162:
  add    0x0(%rbp,%rax,1),%dl
  mov    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L187
  lea    -0x1(%r14),%ebx
  lea    (%r9,%rbx,1),%rbp
  add    %r10,%rbx
  jmp    L308
  nopl   0x0(%rax,%rax,1)
L54:
  cmp    $0x1,%r14d
  jle    L241
  movslq 0x18(%rsp),%rdi
  movslq %r13d,%rax
  mov    %r14d,%esi
  mov    $0x1,%edx
  lea    (%rbx,%rax,1),%r8
  add    %rbx,%rdi
  nopl   0x0(%rax)
L283:
  lea    0x0(%r13,%rdx,1),%ecx
  xor    %eax,%eax
  test   %ecx,%ecx
  jle    L303
  movzbl (%r8,%rdx,1),%eax
L303:
  test   %r12d,%r12d
  je     L318
  movzbl (%rdi,%rdx,1),%ecx
  add    %ecx,%eax
L318:
  shr    %eax
  add    0x0(%rbp,%rdx,1),%al
  mov    %al,(%rbx,%rdx,1)
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L283
  lea    -0x1(%r14),%ebx
  lea    (%r9,%rbx,1),%rbp
  add    %r10,%rbx
  jmp    L308
  nopl   (%rax)
L174:
  cmp    $0x1,%r14d
  jle    L67
  movslq 0x18(%rsp),%rax
  lea    0x1(%r13),%ecx
  mov    %r14d,0x1c(%rsp)
  mov    %r10,%rbp
  mov    %r9,0x20(%rsp)
  mov    %r9,%r14
  mov    %ecx,%ebx
  mov    %rax,0x8(%rsp)
  mov    %r10,0x28(%rsp)
  jmp    L16
  nopl   0x0(%rax)
L255:
  movslq %r13d,%rax
  movzbl 0x0(%rbp,%rax,1),%edi
  test   %r12d,%r12d
  je     L83
  mov    0x8(%rsp),%rax
  movzbl 0x0(%rbp,%rax,1),%esi
  mov    0x10(%rsp),%rax
  movzbl 0x0(%rbp,%rax,1),%edx
L126:
  movzbl (%r14),%r15d
  add    $0x1,%rbp
  add    $0x1,%r14
  add    $0x1,%ebx
  call   <png_paeth_predictor@plt>
  add    %eax,%r15d
  mov    %r15b,-0x1(%rbp)
  cmp    0x4(%rsp),%ebx
  je     L346
L16:
  test   %ebx,%ebx
  jg     L255
  test   %r12d,%r12d
  je     L192
  mov    0x8(%rsp),%rax
  xor    %edi,%edi
  xor    %edx,%edx
  movzbl 0x0(%rbp,%rax,1),%esi
  jmp    L126
  nopl   0x0(%rax,%rax,1)
L241:
  mov    %r10,%rbx
  mov    %r9,%rbp
  jmp    L67
  nopl   0x0(%rax,%rax,1)
L192:
  xor    %edi,%edi
L83:
  xor    %esi,%esi
  xor    %edx,%edx
  jmp    L126
  nopl   0x0(%rax,%rax,1)
L346:
  mov    0x1c(%rsp),%r14d
  mov    0x20(%rsp),%r9
  mov    0x28(%rsp),%r10
  lea    -0x1(%r14),%ebx
  lea    (%r9,%rbx,1),%rbp
  add    %r10,%rbx
  jmp    L67
```

assistant: ```c
void png_defilter(const unsigned char *data, unsigned char *image, int width, int height, int depth, int sample_per_pixel) {
  unsigned char type;
  int i, j;
  int ap, bp;
  unsigned int a, b, c, k;
  int scanline_len;
  scanline_len = png_get_scanline_len(width, depth, sample_per_pixel);
  if (depth < 8)
    ap = -1;
  else
    ap = -(depth / 8 * sample_per_pixel);
  bp = -scanline_len;
  for (i = 0; i < height; i++) {
    { type = (uint8_t) * (data)++; };
    *image++ = type;
    if (type == 0) {
      for (j = 1; j < scanline_len; j++) {
        { k = (uint8_t) * (data)++; };
        *image++ = k;
      }
    } else if (type == 1) {
      for (j = 1; j < scanline_len; j++) {
        a = (j + ap > 0) ? image[ap] : 0;
        { k = (uint8_t) * (data)++; };
        *image++ = k + a;
      }
    } else if (type == 2) {
      for (j = 1; j < scanline_len; j++) {
        b = (i > 0) ? image[bp] : 0;
        { k = (uint8_t) * (data)++; };
        *image++ = k + b;
      }
    } else if (type == 3) {
      for (j = 1; j < scanline_len; j++) {
        a = (j + ap > 0) ? image[ap] : 0;
        b = (i > 0) ? image[bp] : 0;
        { k = (uint8_t) * (data)++; };
        *image++ = k + (a + b) / 2;
      }
    } else if (type == 4) {
      for (j = 1; j < scanline_len; j++) {
        a = (j + ap > 0) ? image[ap] : 0;
        b = (i > 0) ? image[bp] : 0;
        c = (i > 0 && j + ap > 0) ? image[ap + bp] : 0;
        { k = (uint8_t) * (data)++; };
        *image++ = k + png_paeth_predictor(a, b, c);
      }
    }
  }
}
```