user: Please show me the C implementation that matches the assembly code listed below:

```asm
<rgb_to_yuv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %edx,-0x74(%rbp)
  mov    %ecx,-0x78(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x74(%rbp),%eax
  imul   -0x78(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x74(%rbp),%eax
  imul   -0x78(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x60(%rbp)
  jmp    L14
L39:
  movl   $0x0,-0x5c(%rbp)
  jmp    L26
L33:
  mov    -0x70(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movss  D143(%rip),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x70(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  D103(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm0,%xmm1
  mov    -0x70(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  D136(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x58(%rbp)
  mov    -0x70(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movaps %xmm0,%xmm1
  subss  -0x58(%rbp),%xmm1
  movss  D212(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x54(%rbp)
  mov    -0x70(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movaps %xmm0,%xmm1
  subss  -0x58(%rbp),%xmm1
  movss  D212(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x50(%rbp)
  mov    -0x70(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movss  D143(%rip),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x70(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  D103(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm0,%xmm1
  mov    -0x70(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  D136(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x4c(%rbp)
  mov    -0x70(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movaps %xmm0,%xmm1
  subss  -0x4c(%rbp),%xmm1
  movss  D212(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x48(%rbp)
  mov    -0x70(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movaps %xmm0,%xmm1
  subss  -0x4c(%rbp),%xmm1
  movss  D212(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x44(%rbp)
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movss  D143(%rip),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  D103(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm0,%xmm1
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  D136(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x40(%rbp)
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movaps %xmm0,%xmm1
  subss  -0x40(%rbp),%xmm1
  movss  D212(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x3c(%rbp)
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movaps %xmm0,%xmm1
  subss  -0x40(%rbp),%xmm1
  movss  D212(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x38(%rbp)
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x3(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movss  D143(%rip),%xmm0
  mulss  %xmm0,%xmm1
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x4(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  D103(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm0,%xmm1
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x5(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  D136(%rip),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x34(%rbp)
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x5(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movaps %xmm0,%xmm1
  subss  -0x34(%rbp),%xmm1
  movss  D212(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x30(%rbp)
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x3(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movaps %xmm0,%xmm1
  subss  -0x34(%rbp),%xmm1
  movss  D212(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  mov    -0x58(%rbp),%eax
  movd   %eax,%xmm0
  call   <cl255@plt>
  mov    -0x28(%rbp),%rdx
  mov    %al,(%rdx)
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rbx
  mov    -0x4c(%rbp),%eax
  movd   %eax,%xmm0
  call   <cl255@plt>
  mov    %al,(%rbx)
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x40(%rbp),%eax
  movd   %eax,%xmm0
  call   <cl255@plt>
  mov    %al,(%rbx)
  mov    -0x74(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x34(%rbp),%eax
  movd   %eax,%xmm0
  call   <cl255@plt>
  mov    %al,(%rbx)
  movss  -0x54(%rbp),%xmm0
  addss  -0x48(%rbp),%xmm0
  addss  -0x3c(%rbp),%xmm0
  movaps %xmm0,%xmm1
  addss  -0x30(%rbp),%xmm1
  movss  D206(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movss  D155(%rip),%xmm0
  addss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <cl255@plt>
  mov    -0x20(%rbp),%rdx
  mov    %al,(%rdx)
  movss  -0x50(%rbp),%xmm0
  addss  -0x44(%rbp),%xmm0
  addss  -0x38(%rbp),%xmm0
  movaps %xmm0,%xmm1
  addss  -0x2c(%rbp),%xmm1
  movss  D206(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movss  D155(%rip),%xmm0
  addss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <cl255@plt>
  mov    -0x18(%rbp),%rdx
  mov    %al,(%rdx)
  addq   $0x2,-0x28(%rbp)
  addq   $0x1,-0x20(%rbp)
  addq   $0x1,-0x18(%rbp)
  addq   $0x6,-0x70(%rbp)
  addl   $0x2,-0x5c(%rbp)
L26:
  mov    -0x5c(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jl     L33
  mov    -0x74(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
  mov    -0x74(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  add    %rax,-0x70(%rbp)
  addl   $0x2,-0x60(%rbp)
L14:
  mov    -0x60(%rbp),%eax
  cmp    -0x78(%rbp),%eax
  jl     L39
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D143
datatype: byte[4]
name: extract_symbolic_data
arguments: label: D103
datatype: byte[4]
name: extract_symbolic_data
arguments: label: D136
datatype: byte[4]
name: extract_symbolic_data
arguments: label: D212
datatype: byte[4]
name: extract_symbolic_data
arguments: label: D206
datatype: byte[4]
name: extract_symbolic_data
arguments: label: D155
datatype: byte[4]

tool: {"D143": [0x87,0x16,0x99,0x3e]}

tool: {"D103": [0xa2,0x45,0x16,0x3f]}

tool: {"D136": [0xd5,0x78,0xe9,0x3d]}

tool: {"D212": [0x6d,0xe7,0xfb,0x3e]}

tool: {"D206": [0x00,0x00,0x80,0x3e]}

tool: {"D155": [0x00,0x00,0x00,0x43]}

assistant: ```c
void rgb_to_yuv(unsigned char *oot, unsigned char const *d, int xs, int ys) {
  unsigned char *y = oot;
  unsigned char *u = y + xs * ys;
  unsigned char *v = u + xs * ys / 4;
  for (int r = 0; r < ys; r += 2) {
    for (int c = 0; c < xs; c += 2) {
      float y0 = d[0] * 0.299f + d[1] * 0.587f + d[2] * 0.114f;
      float u0 = 0.492f * (d[2] - y0);
      float v0 = 0.492f * (d[0] - y0);
      float y1 = d[3] * 0.299f + d[4] * 0.587f + d[5] * 0.114f;
      float u1 = 0.492f * (d[5] - y1);
      float v1 = 0.492f * (d[3] - y1);
      float y2 = d[xs * 3 + 0] * 0.299f + d[xs * 3 + 1] * 0.587f + d[xs * 3 + 2] * 0.114f;
      float u2 = 0.492f * (d[xs * 3 + 2] - y2);
      float v2 = 0.492f * (d[xs * 3 + 0] - y2);
      float y3 = d[xs * 3 + 3] * 0.299f + d[xs * 3 + 4] * 0.587f + d[xs * 3 + 5] * 0.114f;
      float u3 = 0.492f * (d[xs * 3 + 5] - y3);
      float v3 = 0.492f * (d[xs * 3 + 3] - y3);
      y[0] = cl255(y0);
      y[1] = cl255(y1);
      y[xs] = cl255(y2);
      y[xs + 1] = cl255(y3);
      u[0] = cl255((u0 + u1 + u2 + u3) * 0.25f + 128);
      v[0] = cl255((v0 + v1 + v2 + v3) * 0.25f + 128);
      y += 2;
      u += 1;
      v += 1;
      d += 6;
    }
    y += xs;
    d += xs * 3;
  }
}
```