user: Converte this assembly snippet into its equivalent C code:

```asm
<y4m_422jpeg_420jpeg_helper>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %ecx,-0x78(%rsp)
  test   %edx,%edx
  jle    L14
  mov    %ecx,%ebx
  mov    %edx,%eax
  xor    %ecx,%ecx
  mov    %rsi,%r10
  test   %ebx,%ebx
  lea    -0x1(%rbx),%r8d
  lea    -0x3(%rbx),%r14d
  mov    %edx,%esi
  setg   %cl
  imul   %r8d,%eax
  mov    %r14d,-0x74(%rsp)
  add    %ecx,%ecx
  mov    %ecx,0x30(%rsp)
  cltq
  lea    (%r10,%rax,1),%rdx
  mov    %rdx,-0x58(%rsp)
  mov    %rdx,%r15
  mov    $0x2,%edx
  cmp    %edx,%ebx
  cmovle %ebx,%edx
  sub    $0x1,%edx
  imul   %esi,%edx
  movslq %edx,%rdx
  add    %r10,%rdx
  mov    %rdx,-0x60(%rsp)
  mov    $0x3,%edx
  cmp    %edx,%ebx
  cmovle %ebx,%edx
  sub    $0x1,%edx
  imul   %esi,%edx
  movslq %edx,%rdx
  add    %r10,%rdx
  mov    %rdx,-0x68(%rsp)
  mov    $0x4,%edx
  cmp    %edx,%ebx
  cmovle %ebx,%edx
  sub    $0x1,%edx
  imul   %esi,%edx
  movslq %edx,%rdx
  add    %r10,%rdx
  mov    %rdx,-0x70(%rsp)
  movslq %esi,%rdx
  add    %r10,%rdx
  mov    %rdx,-0x18(%rsp)
  lea    (%rsi,%rsi,1),%edx
  mov    %edx,0x34(%rsp)
  movslq %edx,%r11
  lea    -0x2(%rcx),%edx
  imul   %esi,%edx
  movslq %edx,%rdx
  mov    %rdx,-0x38(%rsp)
  sub    %rax,%rdx
  lea    0x3(%rcx),%eax
  imul   %esi,%eax
  mov    %rdx,0x18(%rsp)
  lea    0x2(%rcx),%edx
  cltq
  mov    %rax,-0x10(%rsp)
  lea    -0x1(%rcx),%eax
  imul   %esi,%eax
  cltq
  mov    %rax,-0x8(%rsp)
  mov    %esi,%eax
  imul   %edx,%eax
  cltq
  mov    %rax,(%rsp)
  mov    %ecx,%eax
  imul   %esi,%eax
  cltq
  mov    %rax,0x8(%rsp)
  lea    0x1(%rcx),%eax
  imul   %esi,%eax
  cltq
  mov    %rax,0x20(%rsp)
  lea    -0x4(%rbx),%eax
  sub    %ecx,%eax
  and    $0xfffffffe,%eax
  add    %edx,%eax
  cmp    %ecx,%r14d
  cmovle %ecx,%eax
  mov    %eax,%edx
  mov    %eax,-0x2c(%rsp)
  lea    -0x2(%rax),%eax
  imul   %esi,%eax
  cltq
  mov    %rax,-0x50(%rsp)
  lea    -0x1(%rdx),%eax
  imul   %esi,%eax
  cltq
  mov    %rax,0x28(%rsp)
  mov    %edx,%eax
  imul   %esi,%eax
  cltq
  mov    %rax,0x10(%rsp)
  lea    0x1(%rdx),%eax
  imul   %esi,%eax
  cmp    %ebx,%r8d
  cmovle %r8d,%ebx
  cltq
  mov    %ebx,-0x30(%rsp)
  mov    %rax,-0x40(%rsp)
  nopl   0x0(%rax)
L43:
  mov    -0x78(%rsp),%eax
  test   %eax,%eax
  jle    L67
  mov    -0x60(%rsp),%rax
  movzbl (%r10),%edx
  mov    -0x70(%rsp),%rbx
  movzbl (%rax),%eax
  shl    $0x6,%edx
  imul   $0x4e,%eax,%eax
  add    %eax,%edx
  mov    -0x68(%rsp),%rax
  movzbl (%rax),%eax
  imul   $0xffffffef,%eax,%eax
  add    %edx,%eax
  movzbl (%rbx),%edx
  lea    (%rdx,%rdx,2),%edx
  lea    0x40(%rax,%rdx,1),%eax
  mov    $0xff,%edx
  sar    $0x7,%eax
  cmp    %edx,%eax
  cmovg  %edx,%eax
  xor    %edx,%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  mov    %al,(%rdi)
L67:
  mov    0x30(%rsp),%r9d
  cmp    %r9d,-0x74(%rsp)
  jle    L72
  mov    0x18(%rsp),%rax
  mov    -0x10(%rsp),%rbp
  mov    %r8d,-0x48(%rsp)
  mov    -0x8(%rsp),%r12
  mov    (%rsp),%r13
  mov    %r10,-0x20(%rsp)
  mov    %r15,-0x28(%rsp)
  lea    (%rax,%r15,1),%rbx
  mov    0x8(%rsp),%r14
  mov    0x20(%rsp),%r15
  cs nopw 0x0(%rax,%rax,1)
L22:
  mov    %rbx,%rcx
  sub    -0x38(%rsp),%rcx
  movzbl (%rbx),%edx
  mov    %r9d,%eax
  movzbl (%rcx,%rbp,1),%r8d
  movzbl (%rcx,%r13,1),%r10d
  sar    %eax
  add    $0x2,%r9d
  imul   %esi,%eax
  add    %r8d,%edx
  lea    (%rdx,%rdx,2),%r8d
  movzbl (%rcx,%r12,1),%edx
  cltq
  add    %r10d,%edx
  imul   $0xffffffef,%edx,%edx
  add    %r8d,%edx
  movzbl (%rcx,%r14,1),%r8d
  movzbl (%rcx,%r15,1),%ecx
  add    %ecx,%r8d
  mov    $0xff,%ecx
  imul   $0x4e,%r8d,%r8d
  lea    0x40(%rdx,%r8,1),%edx
  sar    $0x7,%edx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  xor    %ecx,%ecx
  test   %edx,%edx
  cmovs  %ecx,%edx
  add    %r11,%rbx
  mov    %dl,(%rdi,%rax,1)
  cmp    -0x74(%rsp),%r9d
  jl     L22
  mov    -0x48(%rsp),%r8d
  mov    -0x28(%rsp),%r15
  mov    -0x20(%rsp),%r10
L72:
  mov    -0x2c(%rsp),%ebx
  cmp    %ebx,-0x78(%rsp)
  jle    L93
  mov    %ebx,%eax
  cmp    %ebx,%r8d
  jle    L74
  mov    -0x50(%rsp),%rbx
  mov    0x10(%rsp),%r13
  mov    0x28(%rsp),%r14
  lea    (%r10,%rbx,1),%r9
  nopw   0x0(%rax,%rax,1)
L83:
  movzbl (%r9),%ecx
  movzbl (%r15),%edx
  mov    %r9,%rbx
  sub    -0x50(%rsp),%rbx
  add    %ecx,%edx
  movzbl (%rbx,%r14,1),%r12d
  lea    (%rdx,%rdx,2),%ebp
  mov    %eax,%edx
  add    $0x2,%eax
  lea    0x1(%rdx),%ecx
  cmp    %ecx,%r8d
  mov    %r8d,%ecx
  cmovg  %eax,%ecx
  sar    %edx
  imul   %esi,%edx
  imul   %esi,%ecx
  movslq %edx,%rdx
  movslq %ecx,%rcx
  movzbl (%r10,%rcx,1),%ecx
  add    %r12d,%ecx
  imul   $0xffffffef,%ecx,%ecx
  add    %ebp,%ecx
  mov    -0x40(%rsp),%rbp
  movzbl (%rbx,%rbp,1),%ebp
  movzbl (%rbx,%r13,1),%ebx
  add    %ebx,%ebp
  mov    $0xff,%ebx
  imul   $0x4e,%ebp,%ebp
  lea    0x40(%rcx,%rbp,1),%ecx
  sar    $0x7,%ecx
  cmp    %ebx,%ecx
  cmovg  %ebx,%ecx
  xor    %ebx,%ebx
  test   %ecx,%ecx
  cmovs  %ebx,%ecx
  add    %r11,%r9
  mov    %cl,(%rdi,%rdx,1)
  cmp    -0x30(%rsp),%eax
  jl     L83
  cmp    %eax,-0x78(%rsp)
  jle    L93
L74:
  lea    -0x2(%rax),%r13d
  imul   %esi,%r13d
  movslq %r13d,%rbx
  lea    (%rsi,%r13,1),%r14d
  add    0x34(%rsp),%r13d
  mov    %rbx,-0x48(%rsp)
  lea    (%r10,%rbx,1),%r9
  movslq %r14d,%r14
  movslq %r13d,%r13
  nopw   0x0(%rax,%rax,1)
L35:
  movzbl (%r9),%ecx
  movzbl (%r15),%edx
  mov    %r9,%rbx
  sub    -0x48(%rsp),%rbx
  add    %ecx,%edx
  movzbl (%rbx,%r14,1),%r12d
  movzbl (%rbx,%r13,1),%ebx
  lea    (%rdx,%rdx,2),%ebp
  mov    %eax,%edx
  add    $0x2,%eax
  lea    0x1(%rdx),%ecx
  cmp    %ecx,%r8d
  mov    %r8d,%ecx
  cmovg  %eax,%ecx
  sar    %edx
  imul   %esi,%edx
  imul   %esi,%ecx
  movslq %edx,%rdx
  movslq %ecx,%rcx
  movzbl (%r10,%rcx,1),%ecx
  add    %r12d,%ecx
  imul   $0xffffffef,%ecx,%ecx
  add    %ebp,%ecx
  mov    -0x58(%rsp),%rbp
  movzbl 0x0(%rbp),%ebp
  add    %ebx,%ebp
  mov    $0xff,%ebx
  imul   $0x4e,%ebp,%ebp
  lea    0x40(%rcx,%rbp,1),%ecx
  sar    $0x7,%ecx
  cmp    %ebx,%ecx
  cmovg  %ebx,%ecx
  xor    %ebx,%ebx
  test   %ecx,%ecx
  cmovs  %ebx,%ecx
  add    %r11,%r9
  mov    %cl,(%rdi,%rdx,1)
  cmp    %eax,-0x78(%rsp)
  jg     L35
L93:
  addq   $0x1,-0x58(%rsp)
  add    $0x1,%r10
  add    $0x1,%rdi
  add    $0x1,%r15
  addq   $0x1,-0x60(%rsp)
  addq   $0x1,-0x68(%rsp)
  addq   $0x1,-0x70(%rsp)
  cmp    -0x18(%rsp),%r10
  jne    L43
L14:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void y4m_422jpeg_420jpeg_helper(unsigned char *_dst, const unsigned char *_src, int _c_w, int _c_h) {
  int y;
  int x;
  for (x = 0; x < _c_w; x++) {
    for (y = 0; y < ((_c_h) > (2) ? (2) : (_c_h)); y += 2) {
      _dst[(y >> 1) * _c_w] = (((0) < ((((64 * _src[0] + 78 * _src[((1) > (_c_h - 1) ? (_c_h - 1) : (1)) * _c_w] - 17 * _src[((2) > (_c_h - 1) ? (_c_h - 1) : (2)) * _c_w] + 3 * _src[((3) > (_c_h - 1) ? (_c_h - 1) : (3)) * _c_w] + 64) >> 7) > (255) ? (255) : ((64 * _src[0] + 78 * _src[((1) > (_c_h - 1) ? (_c_h - 1) : (1)) * _c_w] - 17 * _src[((2) > (_c_h - 1) ? (_c_h - 1) : (2)) * _c_w] + 3 * _src[((3) > (_c_h - 1) ? (_c_h - 1) : (3)) * _c_w] + 64) >> 7))) ? ((((64 * _src[0] + 78 * _src[((1) > (_c_h - 1) ? (_c_h - 1) : (1)) * _c_w] - 17 * _src[((2) > (_c_h - 1) ? (_c_h - 1) : (2)) * _c_w] + 3 * _src[((3) > (_c_h - 1) ? (_c_h - 1) : (3)) * _c_w] + 64) >> 7) > (255) ? (255) : ((64 * _src[0] + 78 * _src[((1) > (_c_h - 1) ? (_c_h - 1) : (1)) * _c_w] - 17 * _src[((2) > (_c_h - 1) ? (_c_h - 1) : (2)) * _c_w] + 3 * _src[((3) > (_c_h - 1) ? (_c_h - 1) : (3)) * _c_w] + 64) >> 7))) : (0)));
    }
    for (; y < _c_h - 3; y += 2) {
      _dst[(y >> 1) * _c_w] = (((0) < ((((3 * (_src[(y - 2) * _c_w] + _src[(y + 3) * _c_w]) - 17 * (_src[(y - 1) * _c_w] + _src[(y + 2) * _c_w]) + 78 * (_src[y * _c_w] + _src[(y + 1) * _c_w]) + 64) >> 7) > (255) ? (255) : ((3 * (_src[(y - 2) * _c_w] + _src[(y + 3) * _c_w]) - 17 * (_src[(y - 1) * _c_w] + _src[(y + 2) * _c_w]) + 78 * (_src[y * _c_w] + _src[(y + 1) * _c_w]) + 64) >> 7))) ? ((((3 * (_src[(y - 2) * _c_w] + _src[(y + 3) * _c_w]) - 17 * (_src[(y - 1) * _c_w] + _src[(y + 2) * _c_w]) + 78 * (_src[y * _c_w] + _src[(y + 1) * _c_w]) + 64) >> 7) > (255) ? (255) : ((3 * (_src[(y - 2) * _c_w] + _src[(y + 3) * _c_w]) - 17 * (_src[(y - 1) * _c_w] + _src[(y + 2) * _c_w]) + 78 * (_src[y * _c_w] + _src[(y + 1) * _c_w]) + 64) >> 7))) : (0)));
    }
    for (; y < _c_h; y += 2) {
      _dst[(y >> 1) * _c_w] = (((0) < ((((3 * (_src[(y - 2) * _c_w] + _src[(_c_h - 1) * _c_w]) - 17 * (_src[(y - 1) * _c_w] + _src[((y + 2) > (_c_h - 1) ? (_c_h - 1) : (y + 2)) * _c_w]) + 78 * (_src[y * _c_w] + _src[((y + 1) > (_c_h - 1) ? (_c_h - 1) : (y + 1)) * _c_w]) + 64) >> 7) > (255) ? (255) : ((3 * (_src[(y - 2) * _c_w] + _src[(_c_h - 1) * _c_w]) - 17 * (_src[(y - 1) * _c_w] + _src[((y + 2) > (_c_h - 1) ? (_c_h - 1) : (y + 2)) * _c_w]) + 78 * (_src[y * _c_w] + _src[((y + 1) > (_c_h - 1) ? (_c_h - 1) : (y + 1)) * _c_w]) + 64) >> 7))) ? ((((3 * (_src[(y - 2) * _c_w] + _src[(_c_h - 1) * _c_w]) - 17 * (_src[(y - 1) * _c_w] + _src[((y + 2) > (_c_h - 1) ? (_c_h - 1) : (y + 2)) * _c_w]) + 78 * (_src[y * _c_w] + _src[((y + 1) > (_c_h - 1) ? (_c_h - 1) : (y + 1)) * _c_w]) + 64) >> 7) > (255) ? (255) : ((3 * (_src[(y - 2) * _c_w] + _src[(_c_h - 1) * _c_w]) - 17 * (_src[(y - 1) * _c_w] + _src[((y + 2) > (_c_h - 1) ? (_c_h - 1) : (y + 2)) * _c_w]) + 78 * (_src[y * _c_w] + _src[((y + 1) > (_c_h - 1) ? (_c_h - 1) : (y + 1)) * _c_w]) + 64) >> 7))) : (0)));
    }
    _src++;
    _dst++;
  }
}
```