user: Demonstrate the C code that generates the assembly output below:

```asm
<chroma_smooth_2x2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %edi,-0x84(%rbp)
  mov    %esi,-0x88(%rbp)
  mov    %rdx,-0x90(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0xa0(%rbp)
  mov    %r9,-0xa8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x4,-0x78(%rbp)
  jmp    L177
L75:
  movl   $0x4,-0x7c(%rbp)
  jmp    L103
L133:
  mov    -0x7c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x78(%rbp),%eax
  imul   -0x84(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x68(%rbp)
  mov    -0x78(%rbp),%eax
  add    $0x1,%eax
  imul   -0x84(%rbp),%eax
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x68(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0xa0(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x60(%rbp)
  cmpl   $0xffff,-0x60(%rbp)
  jle    L164
  movl   $0x0,-0x6c(%rbp)
  movl   $0xfffffffe,-0x74(%rbp)
  jmp    L173
L199:
  movl   $0xfffffffe,-0x70(%rbp)
  jmp    L128
L179:
  mov    -0x74(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,%ecx
  mov    -0x70(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  add    %ecx,%eax
  cmp    $0x4,%eax
  je     L14
  mov    -0x7c(%rbp),%edx
  mov    -0x74(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x78(%rbp),%edx
  mov    -0x70(%rbp),%eax
  add    %edx,%eax
  imul   -0x84(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x54(%rbp)
  mov    -0x7c(%rbp),%edx
  mov    -0x74(%rbp),%eax
  add    %edx,%eax
  lea    0x1(%rax),%ecx
  mov    -0x78(%rbp),%edx
  mov    -0x70(%rbp),%eax
  add    %edx,%eax
  imul   -0x84(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x7c(%rbp),%edx
  mov    -0x74(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x78(%rbp),%edx
  mov    -0x70(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  imul   -0x84(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x7c(%rbp),%edx
  mov    -0x74(%rbp),%eax
  add    %edx,%eax
  lea    0x1(%rax),%ecx
  mov    -0x78(%rbp),%edx
  mov    -0x70(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  imul   -0x84(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0xa0(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x44(%rbp)
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    -0x6c(%rbp),%eax
  cltq
  mov    %edx,-0x40(%rbp,%rax,4)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sub    -0x44(%rbp),%eax
  mov    %eax,%edx
  mov    -0x6c(%rbp),%eax
  cltq
  mov    %edx,-0x20(%rbp,%rax,4)
  addl   $0x1,-0x6c(%rbp)
  jmp    L141
L14:
  nop
L141:
  addl   $0x2,-0x70(%rbp)
L128:
  cmpl   $0x2,-0x70(%rbp)
  jle    L179
  addl   $0x2,-0x74(%rbp)
L173:
  cmpl   $0x2,-0x74(%rbp)
  jle    L199
  lea    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <opt_med5@plt>
  mov    %eax,-0x5c(%rbp)
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <opt_med5@plt>
  mov    %eax,-0x58(%rbp)
  mov    -0x60(%rbp),%edx
  mov    -0x5c(%rbp),%eax
  add    %edx,%eax
  cmp    $0x8000,%eax
  jle    L38
  mov    -0x60(%rbp),%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cmp    $0x8000,%eax
  jle    L8
  mov    -0x60(%rbp),%edx
  mov    -0x5c(%rbp),%eax
  add    %edx,%eax
  test   %eax,%eax
  jle    L121
  mov    -0x60(%rbp),%edx
  mov    -0x5c(%rbp),%eax
  add    %edx,%eax
  cmp    $0x6fffe,%eax
  jg     L212
  mov    -0x60(%rbp),%edx
  mov    -0x5c(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  jmp    L132
L212:
  mov    $0x1bfffc,%eax
  jmp    L132
L121:
  mov    $0x0,%eax
L132:
  mov    -0xa8(%rbp),%rdx
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x78(%rbp),%eax
  imul   -0x84(%rbp),%eax
  mov    %eax,%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  mov    0x10(%rbp),%edx
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x60(%rbp),%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  test   %eax,%eax
  jle    L113
  mov    -0x60(%rbp),%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cmp    $0x6fffe,%eax
  jg     L28
  mov    -0x60(%rbp),%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  jmp    L34
L28:
  mov    $0x1bfffc,%eax
  jmp    L34
L113:
  mov    $0x0,%eax
L34:
  mov    -0xa8(%rbp),%rdx
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x7c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x78(%rbp),%eax
  add    $0x1,%eax
  imul   -0x84(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  mov    0x10(%rbp),%edx
  add    %ecx,%edx
  mov    %edx,(%rax)
  jmp    L31
L164:
  nop
  jmp    L31
L38:
  nop
  jmp    L31
L8:
  nop
L31:
  addl   $0x2,-0x7c(%rbp)
L103:
  mov    -0x84(%rbp),%eax
  sub    $0x4,%eax
  cmp    %eax,-0x7c(%rbp)
  jl     L133
  addl   $0x2,-0x78(%rbp)
L177:
  mov    -0x88(%rbp),%eax
  sub    $0x5,%eax
  cmp    %eax,-0x78(%rbp)
  jl     L75
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L53
  call   <__stack_chk_fail@plt>
L53:
  leave
  ret
```

assistant: ```c
void chroma_smooth_2x2(int w, int h, uint16_t *inp, uint16_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[5];
      int med_b[5];
      for (i = -2; i <= 2; i += 2) {
        for (j = -2; j <= 2; j += 2) {
          if (((i) > 0 ? (i) : -(i)) + ((j) > 0 ? (j) : -(j)) == 4)
            continue;
          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_med5(med_r);
      int db = opt_med5(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;
    }
  }
}
```