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

```asm
<hsva_to_rgba>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x20,%rsp
  movss  0xc(%rsi),%xmm0
  movss  (%rsi),%xmm3
  movss  0x8(%rsi),%xmm4
  movss  0x4(%rsi),%xmm1
  movss  %xmm0,0xc(%rdi)
  pxor   %xmm0,%xmm0
  movss  %xmm3,0x14(%rsp)
  movss  %xmm4,0xc(%rsp)
  call   <fmaxf@plt>
  movss  D114(%rip),%xmm0
  mov    %eax,%edi
  call   <fminf@plt>
  movss  0xc(%rsp),%xmm4
  movss  %xmm0,0x10(%rsp)
  pxor   %xmm0,%xmm0
  movaps %xmm4,%xmm1
  call   <fmaxf@plt>
  movss  D114(%rip),%xmm0
  mov    %eax,%edi
  call   <fminf@plt>
  movss  0x14(%rsp),%xmm3
  mov    $0x168,%edi
  movaps %xmm0,%xmm7
  movss  %xmm0,0xc(%rsp)
  movss  D103(%rip),%xmm0
  shufps $0xe0,%xmm7,%xmm7
  movlps %xmm7,0x18(%rsp)
  addss  %xmm3,%xmm0
  call   <fmodf@plt>
  movss  0x10(%rsp),%xmm2
  pxor   %xmm6,%xmm6
  movss  0xc(%rsp),%xmm1
  ucomiss %xmm6,%xmm2
  jp     L142
  jne    L142
  mov    0x18(%rsp),%rax
  movss  %xmm1,0x8(%rbx)
  mov    %rax,(%rbx)
L173:
  add    $0x20,%rsp
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L142:
  mulss  %xmm1,%xmm2
  mov    $0x2,%edi
  pxor   %xmm3,%xmm3
  movss  %xmm1,0x14(%rsp)
  cvtsd2ss %xmm0,%xmm3
  movaps %xmm3,%xmm0
  movss  %xmm3,0xc(%rsp)
  divss  D24(%rip),%xmm0
  movss  %xmm2,0x10(%rsp)
  call   <fmodf@plt>
  subsd  D14(%rip),%xmm0
  call   <fabsf@plt>
  movss  0x10(%rsp),%xmm2
  movss  0x14(%rsp),%xmm1
  pxor   %xmm7,%xmm7
  movaps %xmm0,%xmm4
  movss  D114(%rip),%xmm0
  movss  0xc(%rsp),%xmm3
  subss  %xmm2,%xmm1
  subss  %xmm4,%xmm0
  comiss %xmm7,%xmm3
  movaps %xmm2,%xmm4
  movaps %xmm1,%xmm5
  mulss  %xmm2,%xmm0
  shufps $0xe0,%xmm5,%xmm5
  movaps %xmm0,%xmm6
  unpcklps %xmm0,%xmm4
  unpcklps %xmm2,%xmm6
  jb     L31
  movss  D24(%rip),%xmm7
  comiss %xmm3,%xmm7
  jbe    L31
  addps  %xmm5,%xmm4
  movss  %xmm1,0x8(%rbx)
  movlps %xmm4,(%rbx)
  add    $0x20,%rsp
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L31:
  comiss D24(%rip),%xmm3
  jb     L56
  movss  D32(%rip),%xmm4
  comiss %xmm3,%xmm4
  jbe    L56
  addps  %xmm5,%xmm6
  movss  %xmm1,0x8(%rbx)
  movlps %xmm6,(%rbx)
  jmp    L173
  xchg   %ax,%ax
L56:
  comiss D32(%rip),%xmm3
  jb     L44
  movss  D163(%rip),%xmm4
  comiss %xmm3,%xmm4
  jbe    L44
  addss  %xmm1,%xmm2
  addss  %xmm1,%xmm0
  movaps %xmm1,%xmm3
  unpcklps %xmm2,%xmm3
  movss  %xmm0,0x8(%rbx)
  movlps %xmm3,(%rbx)
  jmp    L173
  nopl   0x0(%rax)
L44:
  comiss D163(%rip),%xmm3
  jb     L148
  movss  D151(%rip),%xmm4
  comiss %xmm3,%xmm4
  ja     L107
L148:
  comiss D151(%rip),%xmm3
  jb     L186
  movss  D98(%rip),%xmm4
  comiss %xmm3,%xmm4
  ja     L118
L186:
  comiss D98(%rip),%xmm3
  jb     L28
  movss  D103(%rip),%xmm6
  comiss %xmm3,%xmm6
  jbe    L28
  addss  %xmm1,%xmm2
  addss  %xmm1,%xmm0
  unpcklps %xmm1,%xmm2
  movss  %xmm0,0x8(%rbx)
  movlps %xmm2,(%rbx)
  jmp    L173
  nopw   0x0(%rax,%rax,1)
L28:
  movlps %xmm5,(%rbx)
  movss  %xmm1,0x8(%rbx)
  jmp    L173
  nopl   (%rax)
L107:
  addss  %xmm1,%xmm0
  movaps %xmm1,%xmm3
  addss  %xmm2,%xmm1
  unpcklps %xmm0,%xmm3
  movss  %xmm1,0x8(%rbx)
  movlps %xmm3,(%rbx)
  jmp    L173
  nopl   0x0(%rax,%rax,1)
L118:
  addss  %xmm1,%xmm0
  unpcklps %xmm1,%xmm0
  addss  %xmm2,%xmm1
  movlps %xmm0,(%rbx)
  movss  %xmm1,0x8(%rbx)
  jmp    L173
```

tool_calls: name: read_data
arguments: label: D114
type_guessed: f32
name: read_data
arguments: label: D103
type_guessed: f32
name: read_data
arguments: label: D24
type_guessed: f32
name: read_data
arguments: label: D14
type_guessed: f32[2]
name: read_data
arguments: label: D32
type_guessed: f32
name: read_data
arguments: label: D163
type_guessed: f32
name: read_data
arguments: label: D151
type_guessed: f32
name: read_data
arguments: label: D98
type_guessed: f32

tool: D114: 1

tool: D103: 360

tool: D24: 60

tool: {"D14": [0.0,1.875]}

tool: D32: 120

tool: D163: 180

tool: D151: 240

tool: D98: 300

assistant: ```c
void hsva_to_rgba(float *rgba, float *hsva) {
  float h = hsva[0];
  float s = hsva[1];
  float v = hsva[2];
  rgba[3] = hsva[3];
  s = fminf(1.f, fmaxf(0.f, s));
  v = fminf(1.f, fmaxf(0.f, v));
  h = fmodf(h + 360.f, 360.f);
  if (s == 0) {
    rgba[0] = rgba[1] = rgba[2] = v;
    return;
  }
  float c = v * s;
  float x = c * (1.f - fabsf(fmodf(h / 60.f, 2) - 1.0));
  float m = v - c;
  if (h >= 0.0 && h < 60.0) {
    rgba[0] = c + m;
    rgba[1] = x + m;
    rgba[2] = m;
    ;
  } else if (h >= 60.0 && h < 120.0) {
    rgba[0] = x + m;
    rgba[1] = c + m;
    rgba[2] = m;
    ;
  } else if (h >= 120.0 && h < 180.0) {
    rgba[0] = m;
    rgba[1] = c + m;
    rgba[2] = x + m;
    ;
  } else if (h >= 180.0 && h < 240.0) {
    rgba[0] = m;
    rgba[1] = x + m;
    rgba[2] = c + m;
    ;
  } else if (h >= 240.0 && h < 300.0) {
    rgba[0] = x + m;
    rgba[1] = m;
    rgba[2] = c + m;
    ;
  } else if (h >= 300.0 && h < 360.0) {
    rgba[0] = c + m;
    rgba[1] = m;
    rgba[2] = x + m;
    ;
  } else {
    rgba[0] = m;
    rgba[1] = m;
    rgba[2] = m;
    ;
  }
}
```