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

```asm
<yuv_to_mono>:
  endbr64
  push   %r15
  mov    %ecx,%eax
  mov    $0x1,%r9d
  mov    %r8d,%ecx
  push   %r14
  shl    %cl,%r9d
  push   %r13
  sub    $0x1,%r9d
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  lea    -0x1(%rdx),%esi
  push   %rbx
  mov    %esi,-0x38(%rsp)
  cmp    $0x1,%esi
  jle    L111
  lea    -0x3(%rax),%r8d
  lea    -0x1(%rax),%r12d
  movd   %r9d,%xmm6
  mov    %rdi,%rbx
  lea    -0x2(%rax),%edi
  mov    %r8d,-0x18(%rsp)
  pshufd $0x0,%xmm6,%xmm2
  mov    $0x1,%r11d
  mov    %rdi,%r10
  mov    %r8,-0x30(%rsp)
  lea    0x4(%rbx),%r8
  pxor   %xmm4,%xmm4
  mov    %r10d,%edx
  mov    %r10d,%r15d
  mov    %r8,-0x28(%rsp)
  lea    -0x6(%rax,%rax,2),%r8d
  shr    $0x2,%edx
  and    $0xfffffffc,%r15d
  mov    %rdi,-0x48(%rsp)
  lea    (%rdi,%rdi,2),%rdi
  sub    $0x1,%edx
  lea    (%r15,%r15,2),%esi
  mov    %rdi,-0x40(%rsp)
  lea    0x2(%r15),%edi
  shl    $0x4,%rdx
  mov    %esi,-0x34(%rsp)
  lea    0x3(%r15),%esi
  lea    0x10(%rdx),%rax
  mov    %edi,-0x14(%rsp)
  xor    %edi,%edi
  mov    %rax,-0x20(%rsp)
  mov    %esi,-0xc(%rsp)
  xor    %esi,%esi
  nopw   0x0(%rax,%rax,1)
L98:
  cmp    $0x1,%r12d
  jle    L49
  cmp    $0x10,%ecx
  jg     L143
  movslq %edi,%r14
  movslq %esi,%r13
  lea    0x0(%rbp,%r14,4),%rax
  add    -0x40(%rsp),%r14
  lea    (%rbx,%r13,4),%rdx
  lea    -0x8(%rbp,%r14,4),%r14
  cmp    %r14,%rdx
  mov    -0x48(%rsp),%r14
  setae  -0xd(%rsp)
  add    %r13,%r14
  lea    (%rbx,%r14,4),%r14
  cmp    %r14,%rax
  setae  %r14b
  cmp    $0x8,%ecx
  jle    L136
  or     -0xd(%rsp),%r14b
  je     L159
  cmpl   $0x4,-0x18(%rsp)
  jbe    L159
  mov    -0x20(%rsp),%r14
  lea    (%rdx,%r14,1),%r13
  nop
L110:
  movd   (%rax),%xmm0
  movdqa %xmm2,%xmm3
  add    $0x10,%rdx
  add    $0x30,%rax
  movd   -0x18(%rax),%xmm1
  movd   -0xc(%rax),%xmm5
  movd   -0x24(%rax),%xmm6
  punpckldq %xmm5,%xmm1
  punpckldq %xmm6,%xmm0
  punpcklqdq %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm3
  pandn  %xmm0,%xmm1
  por    %xmm3,%xmm1
  movdqa %xmm4,%xmm3
  pcmpgtd %xmm0,%xmm3
  pandn  %xmm1,%xmm3
  movups %xmm3,-0x10(%rdx)
  cmp    %r13,%rdx
  jne    L110
  mov    -0x34(%rsp),%edx
  lea    (%rsi,%r15,1),%eax
  add    %edi,%edx
  cmp    %r15d,%r10d
  je     L143
  movslq %edx,%r13
  mov    0x0(%rbp,%r13,4),%r14d
  mov    %r9d,%r13d
  cmp    %r9d,%r14d
  cmovle %r14d,%r13d
L226:
  test   %r14d,%r14d
  mov    $0x0,%r14d
  cmovs  %r14d,%r13d
  movslq %eax,%r14
  add    $0x3,%edx
  add    $0x1,%eax
  mov    %r13d,(%rbx,%r14,4)
  cmp    -0x14(%rsp),%r12d
  jle    L143
  movslq %edx,%rdx
  cltq
  mov    0x0(%rbp,%rdx,4),%r14d
  lea    0x0(,%rdx,4),%r13
  cmp    %r14d,%r9d
  mov    %r14d,%edx
  cmovle %r9d,%edx
  test   %r14d,%r14d
  mov    $0x0,%r14d
  cmovs  %r14d,%edx
  lea    0x0(,%rax,4),%r14
  mov    %edx,(%rbx,%rax,4)
  cmp    -0xc(%rsp),%r12d
  jle    L143
  mov    0xc(%rbp,%r13,1),%edx
  cmp    %edx,%r9d
  mov    %edx,%eax
  cmovle %r9d,%eax
  test   %edx,%edx
  mov    $0x0,%edx
  cmovs  %edx,%eax
  mov    %eax,0x4(%rbx,%r14,1)
L143:
  add    %r10d,%esi
  add    %r8d,%edi
L49:
  add    $0x1,%r11d
  cmp    -0x38(%rsp),%r11d
  jne    L98
L111:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L159:
  mov    -0x28(%rsp),%r14
  add    -0x30(%rsp),%r13
  lea    (%r14,%r13,4),%r14
L212:
  mov    (%rax),%r13d
  test   %r13d,%r13d
  js     L19
L65:
  cmp    %r13d,%r9d
  cmovle %r9d,%r13d
  add    $0x4,%rdx
  add    $0xc,%rax
  mov    %r13d,-0x4(%rdx)
  cmp    %r14,%rdx
  je     L143
  mov    (%rax),%r13d
  test   %r13d,%r13d
  jns    L65
L19:
  movl   $0x0,(%rdx)
  add    $0x4,%rdx
  add    $0xc,%rax
  cmp    %rdx,%r14
  jne    L212
  jmp    L143
  nopl   (%rax)
L136:
  or     -0xd(%rsp),%r14b
  je     L85
  cmpl   $0x4,-0x18(%rsp)
  jbe    L85
  mov    -0x20(%rsp),%r14
  lea    (%rdx,%r14,1),%r13
  nop
L234:
  movd   (%rax),%xmm0
  movdqa %xmm2,%xmm3
  add    $0x10,%rdx
  add    $0x30,%rax
  movd   -0x18(%rax),%xmm1
  movd   -0xc(%rax),%xmm7
  movd   -0x24(%rax),%xmm5
  punpckldq %xmm7,%xmm1
  punpckldq %xmm5,%xmm0
  punpcklqdq %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm3
  pandn  %xmm0,%xmm1
  por    %xmm3,%xmm1
  movdqa %xmm4,%xmm3
  pcmpgtd %xmm0,%xmm3
  pandn  %xmm1,%xmm3
  movups %xmm3,-0x10(%rdx)
  cmp    %r13,%rdx
  jne    L234
  mov    -0x34(%rsp),%edx
  lea    (%rsi,%r15,1),%eax
  add    %edi,%edx
  cmp    %r15d,%r10d
  je     L143
  movslq %edx,%r13
  mov    0x0(%rbp,%r13,4),%r14d
  cmp    %r14d,%r9d
  mov    %r14d,%r13d
  cmovle %r9d,%r13d
  jmp    L226
L85:
  mov    -0x28(%rsp),%r14
  add    -0x30(%rsp),%r13
  lea    (%r14,%r13,4),%r14
L112:
  mov    (%rax),%r13d
  test   %r13d,%r13d
  js     L61
L101:
  cmp    %r13d,%r9d
  cmovle %r9d,%r13d
  add    $0x4,%rdx
  add    $0xc,%rax
  mov    %r13d,-0x4(%rdx)
  cmp    %r14,%rdx
  je     L143
  mov    (%rax),%r13d
  test   %r13d,%r13d
  jns    L101
L61:
  movl   $0x0,(%rdx)
  add    $0x4,%rdx
  add    $0xc,%rax
  cmp    %r14,%rdx
  jne    L112
  jmp    L143
```

assistant: ```c
void yuv_to_mono(void *img_mono, const int16_t *img_yuv, const int height, const int width, const int bit_channel) {
  int y, x, index_mono, index_yuv;
  int8_t *out8 = img_mono;
  int16_t *out16 = img_mono;
  const int pix_max = (1 << bit_channel) - 1;
  int value;
  index_mono = 0;
  index_yuv = 0;
  for (y = 1; y < (height - 1); y++) {
    for (x = 1; x < (width - 1); x++) {
      value = img_yuv[index_yuv];
      if (value < 0) {
        value = 0;
      } else if (value > pix_max) {
        value = pix_max;
      }
      if (bit_channel <= 8) {
        out8[index_mono] = value;
      } else if (bit_channel <= 16) {
        out16[index_mono] = value;
      }
      index_mono++;
      index_yuv += 3;
    }
  }
}
```