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

```asm
<YUVtoHSV>:
  endbr64
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  pxor   %xmm4,%xmm4
  mov    %rsi,%rax
  cvtss2sd 0x4(%rdi),%xmm0
  movsd  D103(%rip),%xmm3
  cvtss2sd (%rdi),%xmm1
  movsd  D90(%rip),%xmm5
  subsd  D70(%rip),%xmm1
  mulsd  D137(%rip),%xmm1
  cvtss2sd 0x8(%rdi),%xmm4
  subsd  %xmm3,%xmm0
  subsd  %xmm3,%xmm4
  movsd  D12(%rip),%xmm2
  mulsd  %xmm0,%xmm5
  mulsd  %xmm4,%xmm2
  movapd %xmm1,%xmm3
  mulsd  D106(%rip),%xmm4
  mulsd  D50(%rip),%xmm0
  subsd  %xmm5,%xmm3
  addsd  %xmm1,%xmm2
  subsd  %xmm4,%xmm3
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm2,%xmm2
  cvtsd2ss %xmm3,%xmm3
  movaps %xmm3,%xmm1
  cvtsd2ss %xmm0,%xmm0
  movaps %xmm0,%xmm7
  maxss  %xmm2,%xmm1
  movaps %xmm3,%xmm6
  minss  %xmm2,%xmm6
  maxss  %xmm1,%xmm7
  movaps %xmm7,%xmm1
  movaps %xmm0,%xmm7
  minss  %xmm6,%xmm7
  ucomiss %xmm1,%xmm7
  movaps %xmm7,%xmm6
  jp     L77
  jne    L77
  movl   $0x0,(%rdx)
  pxor   %xmm4,%xmm4
L122:
  ucomiss %xmm4,%xmm1
  jp     L76
  jne    L76
L3:
  movss  %xmm4,0x4(%rdx)
  divss  D2(%rip),%xmm1
  movss  %xmm1,0x8(%rdx)
  movss  %xmm2,(%rax)
  movss  %xmm3,0x4(%rax)
  movss  %xmm0,0x8(%rax)
  ret
  nopl   0x0(%rax)
L77:
  ucomiss %xmm2,%xmm1
  movaps %xmm1,%xmm4
  subss  %xmm6,%xmm4
  jp     L54
  jne    L54
  movaps %xmm3,%xmm5
  subss  %xmm0,%xmm5
  divss  %xmm4,%xmm5
  pxor   %xmm4,%xmm4
  addss  %xmm4,%xmm5
  mulss  D122(%rip),%xmm5
L41:
  comiss %xmm5,%xmm4
  jbe    L53
  addss  D138(%rip),%xmm5
L53:
  movss  %xmm5,(%rdx)
  jmp    L122
  nopl   0x0(%rax)
L76:
  movaps %xmm1,%xmm4
  subss  %xmm6,%xmm4
  divss  %xmm1,%xmm4
  jmp    L3
  nopl   (%rax)
L54:
  ucomiss %xmm3,%xmm1
  jp     L72
  jne    L72
  movaps %xmm0,%xmm5
  subss  %xmm2,%xmm5
  divss  %xmm4,%xmm5
  pxor   %xmm4,%xmm4
  addss  D87(%rip),%xmm5
  mulss  D122(%rip),%xmm5
  jmp    L41
L72:
  movaps %xmm2,%xmm5
  subss  %xmm3,%xmm5
  divss  %xmm4,%xmm5
  pxor   %xmm4,%xmm4
  addss  D129(%rip),%xmm5
  mulss  D122(%rip),%xmm5
  jmp    L41
```

tool_calls: name: unpack_data
arguments: label: D103
datatype: f64
name: unpack_data
arguments: label: D90
datatype: f64
name: unpack_data
arguments: label: D70
datatype: f64
name: unpack_data
arguments: label: D137
datatype: f64
name: unpack_data
arguments: label: D12
datatype: f64
name: unpack_data
arguments: label: D106
datatype: f64
name: unpack_data
arguments: label: D50
datatype: f64
name: unpack_data
arguments: label: D2
datatype: byte[4]
name: unpack_data
arguments: label: D122
datatype: byte[4]
name: unpack_data
arguments: label: D138
datatype: f32
name: unpack_data
arguments: label: D87
datatype: byte[4]
name: unpack_data
arguments: label: D129
datatype: byte[4]

tool: D103: 128

tool: D90: 0.813

tool: D70: 16

tool: D137: 1.1644

tool: D12: 1.596

tool: D106: 0.391

tool: D50: 2.018

tool: {"D2": [0x00,0x00,0x7f,0x43]}

tool: {"D122": [0x00,0x00,0x70,0x42]}

tool: D138: 360

tool: {"D87": [0x00,0x00,0x00,0x40]}

tool: {"D129": [0x00,0x00,0x80,0x40]}

assistant: ```c
void YUVtoHSV(float *yuv, float *rgb, float *hsv) {
  float red, green, blue;
  float rgbmin, rgbmax;
  red = 1.1644 * (yuv[0] - 16.0) + 1.596 * (yuv[2] - 128.0);
  green = 1.1644 * (yuv[0] - 16.0) - 0.813 * (yuv[1] - 128.0) - 0.391 * (yuv[2] - 128.0);
  blue = 1.1644 * (yuv[0] - 16.0) + 2.018 * (yuv[1] - 128.0);
  rgbmax = red;
  (rgbmax < green) && (rgbmax = green);
  (rgbmax < blue) && (rgbmax = blue);
  rgbmin = red;
  (rgbmin > green) && (rgbmin = green);
  (rgbmin > blue) && (rgbmin = blue);
  if (rgbmax == rgbmin) {
    hsv[0] = 0.0;
  } else if (rgbmax == red) {
    hsv[0] = 60 * (0 + (green - blue) / (rgbmax - rgbmin));
  } else if (rgbmax == green) {
    hsv[0] = 60 * (2 + (blue - red) / (rgbmax - rgbmin));
  } else {
    hsv[0] = 60 * (4 + (red - green) / (rgbmax - rgbmin));
  }
  if (hsv[0] < 0) {
    hsv[0] = hsv[0] + 360.0;
  }
  (rgbmax == 0) ? hsv[1] = 0 : (hsv[1] = (rgbmax - rgbmin) / rgbmax);
  hsv[2] = rgbmax / 255;
  rgb[0] = red;
  rgb[1] = green;
  rgb[2] = blue;
}
```