user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<v4lconvert_spca508_to_yuv420>:
  endbr64
  test   %ecx,%ecx
  jle    L151
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rax
  mov    %rsi,%rbx
  mov    %edx,%esi
  mov    %ecx,%ebp
  mov    %ecx,%edx
  imul   %esi,%edx
  movslq %edx,%rcx
  mov    %rcx,-0x10(%rsp)
  lea    (%rdx,%rdx,4),%ecx
  lea    0x3(%rcx),%edx
  test   %ecx,%ecx
  cmovns %ecx,%edx
  sar    $0x2,%edx
  movslq %edx,%rcx
  mov    %rcx,-0x18(%rsp)
  mov    %esi,%r9d
  shr    $0x1f,%r9d
  add    %esi,%r9d
  sar    %r9d
  lea    (%rsi,%rsi,1),%ecx
  mov    %ecx,-0x4(%rsp)
  mov    %rbx,%r14
  mov    $0x0,%r11d
  mov    $0x0,%r10d
  movabs $0x8080808080808080,%rcx
  movslq %esi,%r12
  jmp    L113
L160:
  lea    0x3(%r13),%edi
  test   %r13d,%r13d
  cmovns %r13d,%edi
  sar    $0x2,%edi
  movslq %edi,%rdi
  add    -0x10(%rsp),%rdi
  add    %rbx,%rdi
  cmp    $0x1,%esi
  jg     L102
  jmp    L62
L69:
  lea    0x3(%r13),%edx
  test   %r13d,%r13d
  mov    %r13d,%edi
  cmovs  %edx,%edi
  sar    $0x2,%edi
  movslq %edi,%rdi
  add    -0x10(%rsp),%rdi
  add    %rbx,%rdi
L90:
  mov    $0x0,%edx
  cmp    $0x1,%esi
  jle    L26
L149:
  add    $0x8,%rax
  mov    %rcx,%r13
  xor    -0x8(%rax),%r13
  mov    %r13,(%rdi,%rdx,1)
  add    $0x8,%rdx
  cmp    %edx,%r9d
  jg     L149
  mov    %r12,%r15
  add    %r12,%r14
  mov    %r14,%r13
L15:
  mov    $0x0,%edx
L68:
  add    $0x8,%rax
  mov    %rcx,%rdi
  xor    -0x8(%rax),%rdi
  mov    %rdi,0x0(%r13,%rdx,1)
  add    $0x8,%rdx
  cmp    %edx,%esi
  jg     L68
L91:
  add    $0x2,%r10d
  add    -0x4(%rsp),%r11d
  add    %r15,%r14
  cmp    %r10d,%ebp
  jle    L39
L113:
  mov    %r11d,%r13d
  mov    %r14,%r15
  test   %esi,%esi
  jle    L114
  mov    $0x0,%edx
L84:
  add    $0x8,%rax
  mov    %rcx,%rdi
  xor    -0x8(%rax),%rdi
  mov    %rdi,(%r15,%rdx,1)
  add    $0x8,%rdx
  cmp    %edx,%esi
  jg     L84
L114:
  test   %r8d,%r8d
  je     L160
  lea    0x3(%r13),%edi
  test   %r13d,%r13d
  cmovns %r13d,%edi
  sar    $0x2,%edi
  movslq %edi,%rdi
  add    -0x18(%rsp),%rdi
  add    %rbx,%rdi
  cmp    $0x1,%esi
  jle    L69
L102:
  mov    $0x0,%edx
L60:
  add    $0x8,%rax
  mov    %rcx,%r15
  xor    -0x8(%rax),%r15
  mov    %r15,(%rdi,%rdx,1)
  add    $0x8,%rdx
  cmp    %edx,%r9d
  jg     L60
  test   %r8d,%r8d
  jne    L69
L62:
  lea    0x3(%r13),%edx
  test   %r13d,%r13d
  mov    %r13d,%edi
  cmovs  %edx,%edi
  sar    $0x2,%edi
  movslq %edi,%rdi
  add    -0x18(%rsp),%rdi
  add    %rbx,%rdi
  jmp    L90
L26:
  mov    %r12,%r15
  add    %r12,%r14
  mov    %r14,%r13
  test   %esi,%esi
  jle    L91
  jmp    L15
L39:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L151:
  ret
```

assistant: ```c
void v4lconvert_spca508_to_yuv420(const unsigned char *src, unsigned char *dst, int width, int height, int yvu) {
  int i, j;
  unsigned long *lsrc = (unsigned long *)src;
  for (i = 0; i < height; i += 2) {
    unsigned long *ldst = (unsigned long *)(dst + i * width);
    for (j = 0; j < width; j += sizeof(long)) {
      *ldst = *lsrc++;
      *ldst++ ^= 0x8080808080808080ULL;
    }
    if (yvu)
      ldst = (unsigned long *)(dst + (width * height * 5) / 4 + i * width / 4);
    else
      ldst = (unsigned long *)(dst + width * height + i * width / 4);
    for (j = 0; j < width / 2; j += sizeof(long)) {
      *ldst = *lsrc++;
      *ldst++ ^= 0x8080808080808080ULL;
    }
    if (yvu)
      ldst = (unsigned long *)(dst + width * height + i * width / 4);
    else
      ldst = (unsigned long *)(dst + (width * height * 5) / 4 + i * width / 4);
    for (j = 0; j < width / 2; j += sizeof(long)) {
      *ldst = *lsrc++;
      *ldst++ ^= 0x8080808080808080ULL;
    }
    ldst = (unsigned long *)(dst + i * width + width);
    for (j = 0; j < width; j += sizeof(long)) {
      *ldst = *lsrc++;
      *ldst++ ^= 0x8080808080808080ULL;
    }
  }
}
```