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

```asm
<vobsub_palette_to_yuv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  shr    $0x10,%eax
  and    $0xff,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  shr    $0x8,%eax
  and    $0xff,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x24(%rbp),%eax
  and    $0xff,%eax
  mov    %eax,-0x10(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x18(%rbp),%xmm1
  movsd  D81(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x14(%rbp),%xmm2
  movsd  D19(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x10(%rbp),%xmm2
  movsd  D59(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <av_clip_uint8_c@plt>
  mov    %eax,-0xc(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x18(%rbp),%xmm1
  movsd  D103(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x14(%rbp),%xmm2
  movsd  D105(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x10(%rbp),%xmm2
  movsd  D20(%rip),%xmm1
  mulsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  D17(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <av_clip_uint8_c@plt>
  mov    %eax,-0x8(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x18(%rbp),%xmm1
  movsd  D62(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x14(%rbp),%xmm2
  movsd  D85(%rip),%xmm1
  mulsd  %xmm1,%xmm2
  subsd  %xmm2,%xmm0
  movapd %xmm0,%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x10(%rbp),%xmm2
  movsd  D93(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  D17(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <av_clip_uint8_c@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  imul   $0xdb,%eax,%eax
  movslq %eax,%rdx
  imul   $0xffffffff80808081,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x7,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    $0x10,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0x8,%eax
  or     %edx,%eax
  or     -0x4(%rbp),%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D81
data_type: f64
name: read_data
arguments: tag: D19
data_type: f64
name: read_data
arguments: tag: D59
data_type: f64
name: read_data
arguments: tag: D103
data_type: f64
name: read_data
arguments: tag: D105
data_type: f64
name: read_data
arguments: tag: D20
data_type: f64
name: read_data
arguments: tag: D17
data_type: byte[8]
name: read_data
arguments: tag: D62
data_type: byte[8]
name: read_data
arguments: tag: D85
data_type: f64
name: read_data
arguments: tag: D93
data_type: f64

tool: D81: 0.1494

tool: D19: 0.6061

tool: D59: 0.2445

tool: D103: 0.6066

tool: D105: 0.4322

tool: D20: 0.1744

tool: {"D17": [0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x40]}

tool: {"D62": [0xd5,0xe7,0x6a,0x2b,0xf6,0x97,0xb5,0xbf]}

tool: D85: 0.3422

tool: D93: 0.4266

assistant: ```c
unsigned int vobsub_palette_to_yuv(unsigned int pal) {
  int r, g, b, y, u, v;
  r = pal >> 16 & 0xff;
  g = pal >> 8 & 0xff;
  b = pal & 0xff;
  y = av_clip_uint8_c(0.1494 * r + 0.6061 * g + 0.2445 * b);
  u = av_clip_uint8_c(0.6066 * r - 0.4322 * g - 0.1744 * b + 128);
  v = av_clip_uint8_c(-0.08435 * r - 0.3422 * g + 0.4266 * b + 128);
  y = y * 219 / 255 + 16;
  return y << 16 | u << 8 | v;
}
```