user: 请从给定的汇编指令推导出C源代码:

```asm
<YUV422_to_RGB>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r8d,-0x18(%rsp)
  mov    %r9d,-0x14(%rsp)
  test   %r9d,%r9d
  jle    L66
  lea    -0x1(%r8),%eax
  mov    %rdi,%r11
  mov    %rsi,%rbx
  mov    %rdx,%rbp
  shr    %eax
  mov    %rcx,%r12
  xor    %r14d,%r14d
  mov    $0xffffffff,%r10d
  lea    0x1(%rax),%r13d
  lea    0x0(%r13,%r13,1),%rax
  mov    %rax,-0x10(%rsp)
  add    %r13,%rax
  add    %rax,%rax
  mov    %rax,-0x8(%rsp)
  nopl   (%rax)
L31:
  mov    -0x18(%rsp),%ecx
  mov    %r12,%rdx
  xor    %eax,%eax
  test   %ecx,%ecx
  jle    L98
  nopl   0x0(%rax)
L13:
  movzbl (%rbx,%rax,1),%edi
  movzbl 0x0(%rbp,%rax,1),%esi
  movzbl (%r11,%rax,2),%r8d
  add    $0xffffff80,%edi
  add    $0xffffff80,%esi
  imul   $0x12a,%r8d,%r8d
  imul   $0xffffff9c,%edi,%r9d
  imul   $0xffffff30,%esi,%r15d
  imul   $0x199,%esi,%ecx
  add    %r8d,%r9d
  lea    0x80(%r9,%r15,1),%r9d
  imul   $0x204,%edi,%r15d
  lea    0x80(%r8,%rcx,1),%ecx
  sar    $0x8,%r9d
  lea    0x80(%r8,%r15,1),%r8d
  xor    %r15d,%r15d
  sar    $0x8,%r8d
  sar    $0x8,%ecx
  js     L84
  cmp    $0xff,%ecx
  mov    %ecx,%r15d
  cmovg  %r10d,%r15d
L84:
  mov    %r15b,(%rdx)
  xor    %ecx,%ecx
  test   %r9d,%r9d
  js     L34
  cmp    $0xff,%r9d
  mov    %r9d,%ecx
  cmovg  %r10d,%ecx
L34:
  mov    %cl,0x1(%rdx)
  xor    %ecx,%ecx
  test   %r8d,%r8d
  js     L12
  cmp    $0xff,%r8d
  mov    %r8d,%ecx
  cmovg  %r10d,%ecx
L12:
  mov    %cl,0x2(%rdx)
  movzbl (%rbx,%rax,1),%ecx
  movzbl 0x1(%r11,%rax,2),%r9d
  lea    -0x80(%rdi,%rcx,1),%ecx
  movzbl 0x0(%rbp,%rax,1),%edi
  sar    %ecx
  imul   $0x12a,%r9d,%r9d
  imul   $0xffffff9c,%ecx,%r8d
  lea    -0x80(%rsi,%rdi,1),%esi
  sar    %esi
  imul   $0x199,%esi,%edi
  imul   $0xffffff30,%esi,%esi
  add    %r9d,%r8d
  lea    0x80(%r9,%rdi,1),%edi
  lea    0x80(%r8,%rsi,1),%r9d
  imul   $0x268,%ecx,%esi
  sar    $0x8,%r9d
  lea    0x80(%r8,%rsi,1),%esi
  xor    %r8d,%r8d
  sar    $0x8,%esi
  sar    $0x8,%edi
  js     L0
  cmp    $0xff,%edi
  mov    %edi,%r8d
  cmovg  %r10d,%r8d
L0:
  mov    %r8b,0x3(%rdx)
  xor    %ecx,%ecx
  test   %r9d,%r9d
  js     L5
  cmp    $0xff,%r9d
  mov    %r9d,%ecx
  cmovg  %r10d,%ecx
L5:
  mov    %cl,0x4(%rdx)
  xor    %ecx,%ecx
  test   %esi,%esi
  js     L79
  cmp    $0xff,%esi
  mov    %esi,%ecx
  cmovg  %r10d,%ecx
L79:
  add    $0x1,%rax
  add    $0x6,%rdx
  mov    %cl,-0x1(%rdx)
  cmp    %rax,%r13
  jne    L13
  add    -0x10(%rsp),%r11
  add    %r13,%rbx
  add    %r13,%rbp
  add    -0x8(%rsp),%r12
L98:
  add    $0x1,%r14d
  cmp    %r14d,-0x14(%rsp)
  jne    L31
L66:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int YUV422_to_RGB(unsigned char *y_input, unsigned char *u_input, unsigned char *v_input, unsigned char *rgb_output, int width, int height) {
  int R, G, B;
  int Y, U, V;
  int row;
  int col;
  for (row = 0; row < height; row++) {
    for (col = 0; col < width; col = col + 2) {
      Y = (int)(*(y_input++));
      U = (int)(*(u_input)) - 128;
      V = (int)(*(v_input)) - 128;
      R = ((298 * Y + 409 * V + 128) >> 8);
      G = ((298 * Y - 100 * U - 208 * V + 128) >> 8);
      B = ((298 * Y + 516 * U + 128) >> 8);
      *(rgb_output++) = (unsigned char)((R < 0) ? 0 : ((R > 255) ? 255 : R));
      *(rgb_output++) = (unsigned char)((G < 0) ? 0 : ((G > 255) ? 255 : G));
      *(rgb_output++) = (unsigned char)((B < 0) ? 0 : ((B > 255) ? 255 : B));
      Y = (int)(*(y_input++));
      U = (U + (int)(*(u_input++)) - 128) >> 1;
      V = (V + (int)(*(v_input++)) - 128) >> 1;
      R = ((298 * Y + 409 * V + 128) >> 8);
      G = ((298 * Y - 100 * U - 208 * V + 128) >> 8);
      B = ((298 * Y + 516 * U + 128) >> 8);
      *(rgb_output++) = (unsigned char)((R < 0) ? 0 : ((R > 255) ? 255 : R));
      *(rgb_output++) = (unsigned char)((G < 0) ? 0 : ((G > 255) ? 255 : G));
      *(rgb_output++) = (unsigned char)((B < 0) ? 0 : ((B > 255) ? 255 : B));
    }
  }
  return 0;
}
```