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

```asm
<rgb_to_yuv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %edx,%edi
  sub    $0x88,%rsp
  mov    %edx,0x60(%rsp)
  imul   %ecx,%edx
  mov    %rsi,0x40(%rsp)
  movslq %edx,%rax
  test   %edx,%edx
  lea    (%rbx,%rax,1),%rsi
  lea    0x3(%rdx),%eax
  cmovns %edx,%eax
  mov    %rsi,0x50(%rsp)
  sar    $0x2,%eax
  cltq
  add    %rsi,%rax
  mov    %rax,0x58(%rsp)
  test   %ecx,%ecx
  jle    L14
  lea    (%rdi,%rdi,2),%eax
  sub    $0x1,%ecx
  movl   $0x0,0x3c(%rsp)
  movss  D101(%rip),%xmm6
  cltq
  and    $0xfffffffe,%ecx
  movss  D0(%rip),%xmm5
  movslq %edi,%r12
  mov    %rax,0x48(%rsp)
  lea    0x2(%rcx),%eax
  movss  D10(%rip),%xmm4
  mov    %eax,0x64(%rsp)
  lea    -0x1(%rdi),%eax
  shr    %eax
  lea    0x1(%rax),%ecx
  lea    (%rcx,%rcx,1),%rax
  mov    %rcx,0x70(%rsp)
  mov    %rax,0x68(%rsp)
  add    %rcx,%rax
  add    %rax,%rax
  mov    %rax,0x78(%rsp)
  nopw   0x0(%rax,%rax,1)
L8:
  mov    0x60(%rsp),%eax
  test   %eax,%eax
  jle    L41
  mov    0x40(%rsp),%r15
  mov    0x48(%rsp),%r13
  mov    0x68(%rsp),%rax
  mov    0x58(%rsp),%r14
  add    %r15,%r13
  mov    0x50(%rsp),%rbp
  add    %rbx,%rax
  mov    %rax,0x30(%rsp)
  mov    %r13,%rax
  mov    %r14,%r13
  mov    %rax,%r14
  nopl   0x0(%rax)
L45:
  movzbl (%r15),%eax
  pxor   %xmm1,%xmm1
  pxor   %xmm2,%xmm2
  add    $0x2,%rbx
  pxor   %xmm10,%xmm10
  pxor   %xmm9,%xmm9
  pxor   %xmm13,%xmm13
  add    $0x1,%rbp
  cvtsi2ss %eax,%xmm1
  movzbl 0x2(%r15),%eax
  pxor   %xmm8,%xmm8
  pxor   %xmm12,%xmm12
  pxor   %xmm11,%xmm11
  add    $0x1,%r13
  add    $0x6,%r15
  add    $0x6,%r14
  cvtsi2ss %eax,%xmm2
  movzbl -0x5(%r15),%eax
  cvtsi2ss %eax,%xmm10
  movaps %xmm1,%xmm0
  movzbl -0x3(%r15),%eax
  movss  %xmm1,0x38(%rsp)
  mulss  %xmm5,%xmm0
  cvtsi2ss %eax,%xmm9
  movzbl -0x1(%r15),%eax
  movss  %xmm2,0x2c(%rsp)
  mulss  %xmm6,%xmm10
  cvtsi2ss %eax,%xmm13
  movzbl -0x2(%r15),%eax
  movaps %xmm9,%xmm7
  movss  %xmm9,0x28(%rsp)
  mulss  %xmm5,%xmm7
  movss  %xmm13,0x24(%rsp)
  addss  %xmm0,%xmm10
  movaps %xmm2,%xmm0
  mulss  %xmm4,%xmm0
  addss  %xmm0,%xmm10
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movzbl -0x6(%r14),%eax
  cvtsi2ss %eax,%xmm8
  movzbl -0x4(%r14),%eax
  movss  %xmm10,0x10(%rsp)
  mulss  %xmm6,%xmm0
  cvtsi2ss %eax,%xmm12
  movzbl -0x5(%r14),%eax
  movss  %xmm8,0x20(%rsp)
  movss  %xmm12,0x1c(%rsp)
  addss  %xmm7,%xmm0
  movaps %xmm13,%xmm7
  mulss  %xmm4,%xmm7
  addss  %xmm7,%xmm0
  movaps %xmm8,%xmm7
  mulss  %xmm5,%xmm7
  movss  %xmm0,0x4(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movzbl -0x3(%r14),%eax
  mulss  %xmm6,%xmm0
  addss  %xmm7,%xmm0
  movaps %xmm12,%xmm7
  mulss  %xmm4,%xmm7
  movaps %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  addss  %xmm7,%xmm1
  pxor   %xmm7,%xmm7
  cvtsi2ss %eax,%xmm7
  movzbl -0x1(%r14),%eax
  cvtsi2ss %eax,%xmm11
  movzbl -0x2(%r14),%eax
  movss  %xmm1,0x8(%rsp)
  cvtsi2ss %eax,%xmm0
  movaps %xmm7,%xmm14
  movss  %xmm7,0x18(%rsp)
  mulss  %xmm5,%xmm14
  movss  %xmm11,0x14(%rsp)
  mulss  %xmm6,%xmm0
  addss  %xmm14,%xmm0
  movaps %xmm11,%xmm14
  mulss  %xmm4,%xmm14
  movaps %xmm0,%xmm6
  movaps %xmm10,%xmm0
  addss  %xmm14,%xmm6
  movss  %xmm6,0xc(%rsp)
  call   <cl255@plt>
  movss  0x4(%rsp),%xmm0
  mov    %al,-0x2(%rbx)
  call   <cl255@plt>
  movss  0x8(%rsp),%xmm0
  mov    %al,-0x1(%rbx)
  call   <cl255@plt>
  movss  0xc(%rsp),%xmm0
  mov    %al,-0x2(%rbx,%r12,1)
  call   <cl255@plt>
  movss  0x10(%rsp),%xmm10
  movss  0x2c(%rsp),%xmm2
  movss  0x24(%rsp),%xmm13
  subss  0x4(%rsp),%xmm13
  mov    %al,-0x1(%rbx,%r12,1)
  subss  %xmm10,%xmm2
  movss  D103(%rip),%xmm3
  movss  0x1c(%rsp),%xmm12
  subss  0x8(%rsp),%xmm12
  movss  0x14(%rsp),%xmm11
  mulss  %xmm3,%xmm13
  subss  0xc(%rsp),%xmm11
  movss  D46(%rip),%xmm0
  mulss  %xmm3,%xmm2
  mulss  %xmm3,%xmm12
  mulss  %xmm3,%xmm11
  addss  %xmm13,%xmm2
  addss  %xmm12,%xmm2
  addss  %xmm11,%xmm2
  mulss  %xmm2,%xmm0
  addss  D102(%rip),%xmm0
  call   <cl255@plt>
  movss  0x10(%rsp),%xmm10
  movss  0x38(%rsp),%xmm1
  movss  0x28(%rsp),%xmm9
  subss  0x4(%rsp),%xmm9
  mov    %al,-0x1(%rbp)
  subss  %xmm10,%xmm1
  movss  D103(%rip),%xmm3
  movss  0x20(%rsp),%xmm8
  subss  0x8(%rsp),%xmm8
  movss  0x18(%rsp),%xmm7
  mulss  %xmm3,%xmm9
  subss  0xc(%rsp),%xmm7
  movss  D46(%rip),%xmm0
  mulss  %xmm3,%xmm1
  mulss  %xmm3,%xmm8
  mulss  %xmm3,%xmm7
  addss  %xmm9,%xmm1
  addss  %xmm8,%xmm1
  addss  %xmm7,%xmm1
  mulss  %xmm1,%xmm0
  addss  D102(%rip),%xmm0
  call   <cl255@plt>
  movss  D10(%rip),%xmm4
  movss  D0(%rip),%xmm5
  mov    %al,-0x1(%r13)
  cmp    0x30(%rsp),%rbx
  movss  D101(%rip),%xmm6
  jne    L45
  mov    0x70(%rsp),%rsi
  mov    0x78(%rsp),%rcx
  add    %rsi,0x50(%rsp)
  add    %rsi,0x58(%rsp)
  add    %rcx,0x40(%rsp)
L33:
  mov    0x30(%rsp),%rbx
  addl   $0x2,0x3c(%rsp)
  mov    0x48(%rsp),%rdi
  mov    0x3c(%rsp),%eax
  add    %rdi,0x40(%rsp)
  add    %r12,%rbx
  cmp    0x64(%rsp),%eax
  jne    L8
L14:
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L41:
  mov    %rbx,0x30(%rsp)
  jmp    L33
```

tool_calls: name: extract_symbolic_data
arguments: tag: D101
type_guessed: byte[4]
name: extract_symbolic_data
arguments: tag: D0
type_guessed: byte[4]
name: extract_symbolic_data
arguments: tag: D10
type_guessed: byte[4]
name: extract_symbolic_data
arguments: tag: D103
type_guessed: byte[4]
name: extract_symbolic_data
arguments: tag: D46
type_guessed: byte[4]
name: extract_symbolic_data
arguments: tag: D102
type_guessed: byte[4]

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

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

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

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

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

tool: {"D102": [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;
  }
}
```