user: Translate the below assembly code into C programming language:

```asm
<rgb2yuv>:
  endbr64
  test   %esi,%esi
  jle    L2
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x10,%rsp
  movsd  D136(%rip),%xmm4
  movsd  D20(%rip),%xmm3
  jmp    L10
  nopl   0x0(%rax)
L72:
  pxor   %xmm5,%xmm5
  comisd %xmm3,%xmm2
  maxsd  %xmm0,%xmm5
  movapd %xmm5,%xmm0
  ja     L53
L20:
  pxor   %xmm6,%xmm6
  comisd %xmm3,%xmm1
  maxsd  %xmm2,%xmm6
  movapd %xmm6,%xmm2
  ja     L85
L46:
  pxor   %xmm5,%xmm5
  maxsd  %xmm1,%xmm5
  movapd %xmm5,%xmm1
L81:
  movsd  %xmm1,0x8(%rsp)
  add    $0x3,%r12d
  add    $0x3,%rbp
  movsd  %xmm2,(%rsp)
  call   <round@plt>
  movsd  (%rsp),%xmm2
  mov    %al,-0x3(%rbp)
  movapd %xmm2,%xmm0
  call   <round@plt>
  movsd  0x8(%rsp),%xmm1
  mov    %al,-0x2(%rbp)
  movapd %xmm1,%xmm0
  call   <round@plt>
  mov    %al,-0x1(%rbp)
  mov    D20(%rip),%rax
  cmp    %r12d,%ebx
  movq   %rax,%xmm3
  mov    D136(%rip),%rax
  movq   %rax,%xmm4
  jle    L14
L10:
  movzbl 0x0(%rbp),%ecx
  movzbl 0x1(%rbp),%edx
  pxor   %xmm1,%xmm1
  pxor   %xmm6,%xmm6
  movsd  D94(%rip),%xmm0
  movsd  D79(%rip),%xmm2
  pxor   %xmm5,%xmm5
  shl    $0x10,%ecx
  shl    $0x10,%edx
  movzbl 0x2(%rbp),%eax
  movsd  D129(%rip),%xmm7
  sub    $0x8000,%ecx
  sub    $0x8000,%edx
  cvtsi2sd %ecx,%xmm1
  shl    $0x10,%eax
  cvtsi2sd %edx,%xmm6
  sub    $0x8000,%eax
  cvtsi2sd %eax,%xmm5
  mulsd  %xmm1,%xmm0
  mulsd  %xmm6,%xmm2
  mulsd  %xmm6,%xmm7
  mulsd  D45(%rip),%xmm6
  addsd  %xmm2,%xmm0
  movsd  D95(%rip),%xmm2
  mulsd  %xmm5,%xmm2
  addsd  %xmm2,%xmm0
  movsd  D74(%rip),%xmm2
  mulsd  %xmm1,%xmm2
  mulsd  D63(%rip),%xmm1
  divsd  %xmm4,%xmm0
  subsd  %xmm7,%xmm2
  movsd  D63(%rip),%xmm7
  subsd  %xmm6,%xmm1
  mulsd  %xmm5,%xmm7
  mulsd  D144(%rip),%xmm5
  addsd  %xmm7,%xmm2
  subsd  %xmm5,%xmm1
  divsd  %xmm4,%xmm2
  addsd  D51(%rip),%xmm0
  comisd %xmm3,%xmm0
  divsd  %xmm4,%xmm1
  addsd  D67(%rip),%xmm2
  addsd  D67(%rip),%xmm1
  jbe    L72
  comisd %xmm3,%xmm2
  movapd %xmm3,%xmm0
  jbe    L20
L53:
  comisd %xmm3,%xmm1
  movapd %xmm3,%xmm2
  jbe    L46
L85:
  movapd %xmm3,%xmm1
  jmp    L81
  nopl   0x0(%rax,%rax,1)
L14:
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L2:
  ret
```

tool_calls: name: parse_data
arguments: tag: D136
type: byte[8]
name: parse_data
arguments: tag: D20
type: byte[8]
name: parse_data
arguments: tag: D94
type: f64
name: parse_data
arguments: tag: D79
type: f64
name: parse_data
arguments: tag: D129
type: f64
name: parse_data
arguments: tag: D45
type: f64
name: parse_data
arguments: tag: D95
type: f64
name: parse_data
arguments: tag: D74
type: byte[8]
name: parse_data
arguments: tag: D63
type: f64
name: parse_data
arguments: tag: D144
type: f64
name: parse_data
arguments: tag: D51
type: byte[8]
name: parse_data
arguments: tag: D67
type: byte[8]

tool: {"D136": [0x00,0x00,0x00,0x00,0x50,0xa1,0xf2,0x40]}

tool: {"D20": [0x00,0x00,0x00,0x00,0x00,0xe0,0x6f,0x40]}

tool: D94: 0.2124997

tool: D79: 0.7153988

tool: D129: 0.3942953

tool: D45: 0.4645915

tool: D95: 0.0721015

tool: {"D74": [0x5f,0x73,0xb3,0xe4,0x96,0xfb,0xbd,0xbf]}

tool: D63: 0.5114155

tool: D144: 0.0468239

tool: {"D51": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x40]}

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

assistant: ```c
void rgb2yuv(unsigned char *img, int size) {
  int r, g, b, i;
  double y, u, v;
  for (i = 0; i < size; i += 3) {
    r = (int)img[i];
    g = (int)img[i + 1];
    b = (int)img[i + 2];
    r = (r << 16) - 32768;
    g = (g << 16) - 32768;
    b = (b << 16) - 32768;
    y = (0.2124997 * r + 0.7153988 * g + 0.0721015 * b) / 76309 + 16;
    u = (-0.1171202 * r - 0.3942953 * g + 0.5114155 * b) / 76309 + 128;
    v = (0.5114155 * r - 0.4645915 * g - 0.0468239 * b) / 76309 + 128;
    if (y > 255)
      y = 255;
    if (y < 0)
      y = 0;
    if (u > 255)
      u = 255;
    if (u < 0)
      u = 0;
    if (v > 255)
      v = 255;
    if (v < 0)
      v = 0;
    img[i] = (unsigned char)round(y);
    img[i + 1] = (unsigned char)round(u);
    img[i + 2] = (unsigned char)round(v);
  }
}
```