user: 请将以下的汇编代码转换成C语言代码:

```asm
<rgb2uyvy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  mov    %rdi,-0x30(%rbp)
  mov    %rsi,-0x38(%rbp)
  mov    %rdx,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  lea    (%rax,%rax,1),%edx
  mov    -0x40(%rbp),%rax
  add    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,%ebx
  mov    -0x40(%rbp),%rax
  add    %eax,%eax
  sub    $0x1,%eax
  mov    %eax,%r12d
  jmp    L1
L13:
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%r13d
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%r14d
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%r15d
  imul   $0x132,%r15d,%edx
  imul   $0x259,%r14d,%eax
  add    %eax,%edx
  imul   $0x75,%r13d,%eax
  add    %edx,%eax
  sar    $0xa,%eax
  mov    %eax,%esi
  imul   $0xffffff54,%r15d,%edx
  imul   $0xfffffeac,%r14d,%eax
  add    %eax,%edx
  mov    %r13d,%eax
  shl    $0x9,%eax
  add    %edx,%eax
  sar    $0xa,%eax
  lea    0x80(%rax),%ecx
  mov    %r15d,%edx
  shl    $0x9,%edx
  imul   $0xfffffe53,%r14d,%eax
  add    %eax,%edx
  imul   $0xffffffad,%r13d,%eax
  add    %edx,%eax
  sar    $0xa,%eax
  lea    0x80(%rax),%edx
  mov    $0x0,%eax
  test   %esi,%esi
  cmovns %esi,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  test   %ecx,%ecx
  cmovns %ecx,%eax
  mov    %eax,%ecx
  mov    $0x0,%eax
  test   %edx,%edx
  cmovns %edx,%eax
  mov    %eax,%esi
  mov    $0xff,%eax
  cmp    %eax,%edi
  cmovle %edi,%eax
  mov    %eax,%r8d
  mov    $0xff,%eax
  cmp    %eax,%ecx
  cmovle %ecx,%eax
  mov    %eax,%edi
  mov    $0xff,%eax
  cmp    %eax,%esi
  cmovle %esi,%eax
  mov    %eax,%r9d
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%r13d
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%r14d
  mov    %ebx,%eax
  lea    -0x1(%rax),%ebx
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%r15d
  imul   $0x132,%r15d,%edx
  imul   $0x259,%r14d,%eax
  add    %eax,%edx
  imul   $0x75,%r13d,%eax
  add    %edx,%eax
  sar    $0xa,%eax
  mov    %eax,%ecx
  imul   $0xffffff54,%r15d,%edx
  imul   $0xfffffeac,%r14d,%eax
  add    %eax,%edx
  mov    %r13d,%eax
  shl    $0x9,%eax
  add    %edx,%eax
  sar    $0xa,%eax
  lea    0x80(%rax),%r10d
  mov    %r15d,%edx
  shl    $0x9,%edx
  imul   $0xfffffe53,%r14d,%eax
  add    %eax,%edx
  imul   $0xffffffad,%r13d,%eax
  add    %edx,%eax
  sar    $0xa,%eax
  lea    0x80(%rax),%r13d
  mov    $0x0,%eax
  test   %ecx,%ecx
  cmovns %ecx,%eax
  mov    %eax,%esi
  mov    $0x0,%eax
  test   %r10d,%r10d
  cmovns %r10d,%eax
  mov    %eax,%ecx
  mov    $0x0,%eax
  test   %r13d,%r13d
  cmovs  %eax,%r13d
  mov    $0xff,%eax
  cmp    %eax,%esi
  cmovle %esi,%eax
  mov    %eax,%esi
  mov    $0xff,%eax
  cmp    %eax,%ecx
  cmovle %ecx,%eax
  mov    %eax,%r11d
  mov    $0xff,%eax
  cmp    %eax,%r13d
  cmovg  %eax,%r13d
  lea    (%r9,%r13,1),%eax
  sar    %eax
  mov    %eax,%ecx
  mov    %r12d,%eax
  lea    -0x1(%rax),%r12d
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    %r12d,%eax
  lea    -0x1(%rax),%r12d
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %r8d,%edx
  mov    %dl,(%rax)
  mov    %edi,%eax
  add    %r11d,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    %r12d,%eax
  lea    -0x1(%rax),%r12d
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    %r12d,%eax
  lea    -0x1(%rax),%r12d
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %esi,%edx
  mov    %dl,(%rax)
L1:
  test   %ebx,%ebx
  jg     L13
  nop
  nop
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void rgb2uyvy(unsigned char *src, unsigned char *dest, unsigned long long int NumPixels) {
  register int i = NumPixels + (NumPixels << 1) - 1;
  register int j = (NumPixels << 1) - 1;
  register int y0, y1, u0, u1, v0, v1;
  register int r, g, b;
  while (i > 0) {
    b = (unsigned char)src[i--];
    g = (unsigned char)src[i--];
    r = (unsigned char)src[i--];
    y0 = (306 * r + 601 * g + 117 * b) >> 10;
    u0 = ((-172 * r - 340 * g + 512 * b) >> 10) + 128;
    v0 = ((512 * r - 429 * g - 83 * b) >> 10) + 128;
    y0 = y0 < 0 ? 0 : y0;
    u0 = u0 < 0 ? 0 : u0;
    v0 = v0 < 0 ? 0 : v0;
    y0 = y0 > 255 ? 255 : y0;
    u0 = u0 > 255 ? 255 : u0;
    v0 = v0 > 255 ? 255 : v0;
    b = (unsigned char)src[i--];
    g = (unsigned char)src[i--];
    r = (unsigned char)src[i--];
    y1 = (306 * r + 601 * g + 117 * b) >> 10;
    u1 = ((-172 * r - 340 * g + 512 * b) >> 10) + 128;
    v1 = ((512 * r - 429 * g - 83 * b) >> 10) + 128;
    y1 = y1 < 0 ? 0 : y1;
    u1 = u1 < 0 ? 0 : u1;
    v1 = v1 < 0 ? 0 : v1;
    y1 = y1 > 255 ? 255 : y1;
    u1 = u1 > 255 ? 255 : u1;
    v1 = v1 > 255 ? 255 : v1;
    dest[j--] = (v0 + v1) >> 1;
    dest[j--] = y0;
    dest[j--] = (u0 + u1) >> 1;
    dest[j--] = y1;
  }
}
```