user: What would the C source look like for the assembly code provided here?

```asm
<chroma_smooth_3x3>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xe8,%rsp
  mov    %edi,0x50(%rsp)
  mov    %rdx,0x78(%rsp)
  mov    %rcx,0x58(%rsp)
  mov    %r9,0x60(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  lea    -0x5(%rsi),%eax
  mov    %eax,0x70(%rsp)
  cmp    $0x4,%eax
  jle    L41
  lea    (%rdi,%rdi,1),%esi
  lea    0x0(,%rdi,4),%eax
  mov    %edi,%ebx
  mov    %r8,%r14
  mov    %eax,0x34(%rsp)
  mov    %esi,%eax
  movslq %esi,%rdi
  lea    0x80(%rsp),%r9
  add    %ebx,%eax
  mov    %esi,0x74(%rsp)
  mov    %r9,%r13
  lea    0x0(,%rdi,4),%r8
  cltq
  mov    %rdi,0x68(%rsp)
  mov    %rax,0x40(%rsp)
  lea    -0x9(%rbx),%eax
  mov    %r8,%rbx
  and    $0xfffffffe,%eax
  mov    %rdi,0x48(%rsp)
  add    $0x4,%eax
  mov    %esi,0x54(%rsp)
  movl   $0x4,0x38(%rsp)
  mov    %eax,0x20(%rsp)
  nopl   0x0(%rax)
L88:
  cmpl   $0x8,0x50(%rsp)
  jle    L6
  movslq 0x34(%rsp),%rax
  mov    0x50(%rsp),%esi
  mov    $0x2,%r8d
  movslq 0x54(%rsp),%rdi
  mov    0x78(%rsp),%rdx
  add    %eax,%esi
  mov    0x40(%rsp),%r9
  sub    0x48(%rsp),%r9
  mov    %esi,0x3c(%rsp)
  sub    %rdi,%rax
  movslq %esi,%rsi
  lea    0x8(%rdx,%rdi,4),%r12
  mov    %rdi,0x8(%rsp)
  shl    $0x2,%r9
  mov    %rsi,0x18(%rsp)
  mov    %rax,0x10(%rsp)
  jmp    L42
  nopl   0x0(%rax)
L98:
  add    $0x8,%r12
  add    $0x2,%r8d
  cmp    %r8d,0x20(%rsp)
  je     L6
L42:
  mov    0x10(%rsp),%rax
  mov    0x18(%rsp),%rdx
  sub    0x8(%rsp),%rdx
  movslq 0xc(%r12,%rax,4),%rax
  movslq 0x8(%r12,%rdx,4),%rdx
  mov    (%r14,%rdx,4),%r15d
  add    (%r14,%rax,4),%r15d
  cmp    $0x1ffff,%r15d
  jle    L98
  mov    %r12,%r11
  mov    $0x3,%r10d
  lea    0xb0(%rsp),%rbp
L25:
  lea    -0x3(%r10),%rdx
  lea    (%r9,%r11,1),%rdi
  mov    %r11,%rsi
L2:
  movslq 0x4(%rsi),%rax
  movslq (%rdi),%rcx
  mov    (%r14,%rcx,4),%ecx
  add    (%r14,%rax,4),%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  movslq (%rsi),%rcx
  add    %rbx,%rsi
  sar    %eax
  mov    (%r14,%rcx,4),%ecx
  sub    %eax,%ecx
  mov    %ecx,0x0(%r13,%rdx,4)
  movslq 0x4(%rdi),%rcx
  add    %rbx,%rdi
  mov    (%r14,%rcx,4),%ecx
  sub    %eax,%ecx
  mov    %ecx,0x0(%rbp,%rdx,4)
  add    $0x1,%rdx
  cmp    %rdx,%r10
  jne    L2
  add    $0x3,%r10
  add    $0x8,%r11
  cmp    $0xc,%r10
  jne    L25
  mov    %r15d,%edx
  mov    %r13,%rdi
  mov    %r8d,0x30(%rsp)
  sar    %edx
  mov    %r9,0x28(%rsp)
  mov    %edx,0x24(%rsp)
  call   <opt_med9@plt>
  mov    %rbp,%rdi
  mov    %eax,%r15d
  call   <opt_med9@plt>
  mov    0x24(%rsp),%edx
  mov    0x28(%rsp),%r9
  mov    0x30(%rsp),%r8d
  add    %edx,%r15d
  cmp    $0x8000,%r15d
  jle    L98
  add    %edx,%eax
  cmp    $0x8000,%eax
  jle    L98
  movslq %r15d,%rdx
  mov    $0x1bfffc,%ecx
  mov    0x34(%rsp),%esi
  mov    0x60(%rsp),%rdi
  shl    $0x2,%rdx
  cmp    $0x6ffff,%r15d
  mov    0x120(%rsp),%r11d
  cmovge %rcx,%rdx
  lea    0x2(%rsi,%r8,1),%esi
  movslq %esi,%rsi
  add    (%rdi,%rdx,1),%r11d
  mov    %r11d,%edx
  mov    0x58(%rsp),%r11
  mov    %edx,(%r11,%rsi,4)
  movslq %eax,%rdx
  mov    0x120(%rsp),%esi
  shl    $0x2,%rdx
  cmp    $0x6ffff,%eax
  mov    0x3c(%rsp),%eax
  cmovge %rcx,%rdx
  add    $0x8,%r12
  lea    0x3(%rax,%r8,1),%eax
  add    $0x2,%r8d
  cltq
  add    (%rdi,%rdx,1),%esi
  mov    %esi,(%r11,%rax,4)
  cmp    %r8d,0x20(%rsp)
  jne    L42
  nop
L6:
  mov    0x74(%rsp),%edi
  addl   $0x2,0x38(%rsp)
  add    %edi,0x34(%rsp)
  mov    0x38(%rsp),%eax
  add    %edi,0x54(%rsp)
  mov    0x68(%rsp),%rdi
  add    %rdi,0x48(%rsp)
  add    %rdi,0x40(%rsp)
  cmp    %eax,0x70(%rsp)
  jg     L88
L41:
  mov    0xd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  add    $0xe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void chroma_smooth_3x3(int w, int h, uint32_t *inp, uint32_t *out, int *raw2ev, int *ev2raw, int black) {
  int x, y;
  for (y = 4; y < h - 5; y += 2) {
    for (x = 4; x < w - 4; x += 2) {
      int g1 = inp[x + 1 + y * w];
      int g2 = inp[x + (y + 1) * w];
      int ge = (raw2ev[g1] + raw2ev[g2]) / 2;
      if (ge < 2 * 32768)
        continue;
      int i, j;
      int k = 0;
      int med_r[9];
      int med_b[9];
      for (i = -2; i <= 2; i += 2) {
        for (j = -2; j <= 2; j += 2) {
          int r = inp[x + i + (y + j) * w];
          int g1 = inp[x + i + 1 + (y + j) * w];
          int g2 = inp[x + i + (y + j + 1) * w];
          int b = inp[x + i + 1 + (y + j + 1) * w];
          int ge = (raw2ev[g1] + raw2ev[g2]) / 2;
          med_r[k] = raw2ev[r] - ge;
          med_b[k] = raw2ev[b] - ge;
          k++;
        }
      }
      int dr = opt_med9(med_r);
      int db = opt_med9(med_b);
      if (ge + dr <= 32768)
        continue;
      if (ge + db <= 32768)
        continue;
      out[x + y * w] = ev2raw[(((((((ge + dr)) < ((14 * 32768 - 1))) ? ((ge + dr)) : ((14 * 32768 - 1)))) > ((0))) ? (((((ge + dr)) < ((14 * 32768 - 1))) ? ((ge + dr)) : ((14 * 32768 - 1)))) : ((0)))] + black;
      out[x + 1 + (y + 1) * w] = ev2raw[(((((((ge + db)) < ((14 * 32768 - 1))) ? ((ge + db)) : ((14 * 32768 - 1)))) > ((0))) ? (((((ge + db)) < ((14 * 32768 - 1))) ? ((ge + db)) : ((14 * 32768 - 1)))) : ((0)))] + black;
    }
  }
}
```