user: 请从给定的汇编指令推导出C源代码：

```asm
<rgb_to_yuv>:
  endbr64
  push   %r15
  mov    %edx,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x88,%rsp
  mov    %rsi,0x50(%rsp)
  mov    %edx,%esi
  imul   %ecx,%esi
  movslq %esi,%r15
  lea    0x3(%rsi),%edx
  add    %r15,%rdi
  test   %esi,%esi
  cmovns %esi,%edx
  mov    %rdi,0x40(%rsp)
  sar    $0x2,%edx
  movslq %edx,%rdx
  add    %rdi,%rdx
  mov    %rdx,0x48(%rsp)
  test   %ecx,%ecx
  jle    L6
  lea    (%rax,%rax,2),%edx
  movslq %eax,%r12
  movslq %edx,%rsi
  mov    %rsi,0x58(%rsp)
  test   %eax,%eax
  jle    L6
  sub    $0x1,%ecx
  sub    $0x1,%eax
  movl   $0x0,0x60(%rsp)
  movss  D26(%rip),%xmm6
  and    $0xfffffffe,%ecx
  shr    %eax
  movss  D71(%rip),%xmm5
  movss  D56(%rip),%xmm4
  lea    0x2(%rcx),%edx
  mov    %edx,0x64(%rsp)
  lea    0x1(%rax),%edx
  lea    (%rdx,%rdx,1),%rax
  mov    %rdx,0x70(%rsp)
  mov    %rax,0x68(%rsp)
  add    %rdx,%rax
  lea    (%rsi,%rax,2),%rax
  mov    %rax,0x78(%rsp)
  nopw   0x0(%rax,%rax,1)
L32:
  mov    0x50(%rsp),%r15
  mov    0x58(%rsp),%r13
  mov    0x68(%rsp),%rax
  mov    0x48(%rsp),%r14
  add    %r15,%r13
  mov    0x40(%rsp),%rbp
  add    %rbx,%rax
  mov    %rax,0x38(%rsp)
  mov    %r13,%rax
  mov    %r14,%r13
  mov    %rax,%r14
  nopl   (%rax)
L36:
  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,0x34(%rsp)
  mulss  %xmm5,%xmm0
  cvtsi2ss %eax,%xmm9
  movzbl -0x1(%r15),%eax
  movss  %xmm2,0x30(%rsp)
  mulss  %xmm6,%xmm10
  cvtsi2ss %eax,%xmm13
  movzbl -0x2(%r15),%eax
  movaps %xmm9,%xmm7
  movss  %xmm9,0x2c(%rsp)
  mulss  %xmm5,%xmm7
  movss  %xmm13,0x28(%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,0x14(%rsp)
  mulss  %xmm6,%xmm0
  cvtsi2ss %eax,%xmm12
  movzbl -0x5(%r14),%eax
  movss  %xmm8,0x24(%rsp)
  movss  %xmm12,0x20(%rsp)
  addss  %xmm7,%xmm0
  movaps %xmm13,%xmm7
  mulss  %xmm4,%xmm7
  addss  %xmm7,%xmm0
  movaps %xmm8,%xmm7
  mulss  %xmm5,%xmm7
  movss  %xmm0,0x8(%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,0xc(%rsp)
  cvtsi2ss %eax,%xmm0
  movaps %xmm7,%xmm14
  movss  %xmm7,0x1c(%rsp)
  mulss  %xmm5,%xmm14
  movss  %xmm11,0x18(%rsp)
  mulss  %xmm6,%xmm0
  addss  %xmm14,%xmm0
  movaps %xmm11,%xmm14
  mulss  %xmm4,%xmm14
  movaps %xmm0,%xmm6
  movaps %xmm10,%xmm0
  addss  %xmm14,%xmm6
  movss  %xmm6,0x10(%rsp)
  call   <cl255@plt>
  movss  0x8(%rsp),%xmm0
  mov    %al,-0x2(%rbx)
  call   <cl255@plt>
  movss  0xc(%rsp),%xmm0
  mov    %al,-0x1(%rbx)
  call   <cl255@plt>
  movss  0x10(%rsp),%xmm0
  mov    %al,-0x2(%rbx,%r12,1)
  call   <cl255@plt>
  movss  0x14(%rsp),%xmm10
  movss  0x30(%rsp),%xmm2
  movss  0x28(%rsp),%xmm13
  subss  0x8(%rsp),%xmm13
  mov    %al,-0x1(%rbx,%r12,1)
  subss  %xmm10,%xmm2
  movss  D8(%rip),%xmm3
  movss  0x20(%rsp),%xmm12
  subss  0xc(%rsp),%xmm12
  movss  0x18(%rsp),%xmm11
  mulss  %xmm3,%xmm13
  subss  0x10(%rsp),%xmm11
  movss  D87(%rip),%xmm0
  mulss  %xmm3,%xmm2
  mulss  %xmm3,%xmm12
  mulss  %xmm3,%xmm11
  addss  %xmm13,%xmm2
  addss  %xmm12,%xmm2
  addss  %xmm11,%xmm2
  mulss  %xmm2,%xmm0
  addss  D65(%rip),%xmm0
  call   <cl255@plt>
  movss  0x14(%rsp),%xmm10
  movss  0x34(%rsp),%xmm1
  movss  0x2c(%rsp),%xmm9
  subss  0x8(%rsp),%xmm9
  mov    %al,-0x1(%rbp)
  subss  %xmm10,%xmm1
  movss  D8(%rip),%xmm3
  movss  0x24(%rsp),%xmm8
  subss  0xc(%rsp),%xmm8
  movss  0x1c(%rsp),%xmm7
  mulss  %xmm3,%xmm9
  subss  0x10(%rsp),%xmm7
  movss  D87(%rip),%xmm0
  mulss  %xmm3,%xmm1
  mulss  %xmm3,%xmm8
  mulss  %xmm3,%xmm7
  addss  %xmm9,%xmm1
  addss  %xmm8,%xmm1
  addss  %xmm7,%xmm1
  mulss  %xmm1,%xmm0
  addss  D65(%rip),%xmm0
  call   <cl255@plt>
  movss  D56(%rip),%xmm4
  movss  D71(%rip),%xmm5
  mov    %al,-0x1(%r13)
  cmp    0x38(%rsp),%rbx
  movss  D26(%rip),%xmm6
  jne    L36
  mov    0x70(%rsp),%rdi
  addl   $0x2,0x60(%rsp)
  add    %r12,%rbx
  mov    0x78(%rsp),%rsi
  add    %rdi,0x40(%rsp)
  add    %rdi,0x48(%rsp)
  mov    0x60(%rsp),%eax
  add    %rsi,0x50(%rsp)
  cmp    0x64(%rsp),%eax
  jne    L32
L6:
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: label: D26
datatype: byte[4]
name: parse_data
arguments: label: D71
datatype: byte[4]
name: parse_data
arguments: label: D56
datatype: byte[4]
name: parse_data
arguments: label: D8
datatype: byte[4]
name: parse_data
arguments: label: D87
datatype: byte[4]
name: parse_data
arguments: label: D65
datatype: byte[4]

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

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

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

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

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

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