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

```asm
<rgb_to_yuv_2101010>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x28(%rbp)
  mov    %ecx,%eax
  mov    %al,-0x34(%rbp)
  movl   $0x74cc,D148(%rip)
  movl   $0xe54c,D33(%rip)
  movl   $0x2c88,D159(%rip)
  movl   $0x41e4,D48(%rip)
  movl   $0x8153,D73(%rip)
  movl   $0xc332,D139(%rip)
  movl   $0xc33c,D170(%rip)
  movl   $0xa37a,D16(%rip)
  movl   $0x1fc0,D80(%rip)
  movl   $0x0,-0x1c(%rbp)
  mov    -0x24(%rbp),%eax
  shr    $0x14,%eax
  and    $0x3ff,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  shr    $0xa,%eax
  and    $0x3ff,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x24(%rbp),%eax
  and    $0x3ff,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  and    $0x3ff,%eax
  mov    %eax,%edx
  mov    D148(%rip),%eax
  mov    %edx,%ecx
  imul   %eax,%ecx
  mov    -0x14(%rbp),%eax
  and    $0x3ff,%eax
  mov    %eax,%edx
  mov    D33(%rip),%eax
  imul   %edx,%eax
  add    %eax,%ecx
  mov    -0x10(%rbp),%eax
  and    $0x3ff,%eax
  mov    %eax,%edx
  mov    D159(%rip),%eax
  imul   %edx,%eax
  add    %ecx,%eax
  shr    $0x5,%eax
  mov    %eax,%eax
  imul   $0xa7c5ac5,%rax,%rax
  shr    $0x20,%rax
  shr    $0x7,%eax
  mov    %eax,-0xc(%rbp)
  mov    D48(%rip),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  and    $0x3ff,%eax
  imul   %edx,%eax
  mov    -0x14(%rbp),%edx
  mov    %edx,%ecx
  and    $0x3ff,%ecx
  mov    D73(%rip),%edx
  imul   %ecx,%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%eax
  and    $0x3ff,%eax
  mov    %eax,%edx
  mov    D139(%rip),%eax
  imul   %edx,%eax
  add    %ecx,%eax
  add    $0x30d4000,%eax
  shr    $0x5,%eax
  mov    %eax,%eax
  imul   $0xa7c5ac5,%rax,%rax
  shr    $0x20,%rax
  shr    $0x7,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x18(%rbp),%eax
  and    $0x3ff,%eax
  mov    %eax,%edx
  mov    D170(%rip),%eax
  imul   %edx,%eax
  mov    -0x14(%rbp),%edx
  mov    %edx,%ecx
  and    $0x3ff,%ecx
  mov    D16(%rip),%edx
  imul   %edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  and    $0x3ff,%eax
  mov    %eax,%ecx
  mov    D80(%rip),%eax
  imul   %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    $0x30d4000,%eax
  shr    $0x5,%eax
  mov    %eax,%eax
  imul   $0xa7c5ac5,%rax,%rax
  shr    $0x20,%rax
  shr    $0x7,%eax
  mov    %eax,-0x4(%rbp)
  cmpb   $0x0,-0x34(%rbp)
  je     L13
  mov    -0x1c(%rbp),%eax
  shl    $0x1e,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  shl    $0x14,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0xa,%eax
  or     %edx,%eax
  or     -0xc(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L19
L13:
  mov    -0x1c(%rbp),%eax
  shl    $0x1e,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  shl    $0x14,%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0xa,%eax
  or     %edx,%eax
  or     -0x4(%rbp),%eax
  mov    %eax,-0x20(%rbp)
L19:
  mov    -0x30(%rbp),%rax
  mov    -0x20(%rbp),%edx
  mov    %edx,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void rgb_to_yuv_2101010(unsigned int rgb1, unsigned int *yuv, int bpp, unsigned char swap_color) {
  static unsigned int YKr, YKg, YKb;
  static unsigned int CrKr, CrKg, CrKb;
  static unsigned int CbKr, CbKg, CbKb;
  unsigned int A, R, G, B;
  unsigned int Y, Cb, Cr;
  unsigned int yuv_pix;
  YKr = 29900;
  YKg = 58700;
  YKb = 11400;
  CbKr = 16868;
  CbKg = 33107;
  CbKb = 49970;
  CrKr = 49980;
  CrKg = 41850;
  CrKb = 8128;
  A = (rgb1 & 0xC000000) >> 30;
  R = (rgb1 & 0x3FF00000) >> 20;
  G = (rgb1 & 0x000FFC00) >> 10;
  B = (rgb1 & 0x000003FF) >> 0;
  Y = (((YKr * (R & 0x3FF)) + (YKg * (G & 0x3FF)) + (YKb * (B & 0x3FF))) / 100000);
  Cb = (((-CbKr * (R & 0x3FF)) - (CbKg * (G & 0x3FF)) + (CbKb * (B & 0x3FF)) + 51200000) / 100000);
  Cr = (((CrKr * (R & 0x3FF)) - (CrKg * (G & 0x3FF)) - (CrKb * (B & 0x3FF)) + 51200000) / 100000);
  if (swap_color)
    yuv_pix = (A << 30) | (Cr << 20) | (Cb << 10) | Y;
  else
    yuv_pix = (A << 30) | (Y << 20) | (Cb << 10) | Cr;
  *yuv = yuv_pix;
}
```