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

```asm
<hsv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x68(%rbp)
  movsd  %xmm0,-0x70(%rbp)
  movsd  %xmm1,-0x78(%rbp)
  movsd  %xmm2,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movsd  -0x70(%rbp),%xmm1
  movsd  D33(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x50(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  -0x50(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  D21(%rip),%xmm0
  subsd  -0x78(%rbp),%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x48(%rbp),%xmm1
  movsd  D21(%rip),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  D21(%rip),%xmm0
  subsd  -0x48(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x78(%rbp),%xmm1
  movsd  D21(%rip),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x50(%rbp),%xmm0
  cvttsd2si %xmm0,%ecx
  movslq %ecx,%rax
  imul   $0x2aaaaaab,%rax,%rax
  shr    $0x20,%rax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  mov    %eax,%edx
  sub    %esi,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  add    $0x6,%edx
  movslq %edx,%rax
  imul   $0x2aaaaaab,%rax,%rax
  shr    $0x20,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,-0x54(%rbp)
  mov    -0x54(%rbp),%ecx
  mov    %ecx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  lea    D26(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  mov    -0x40(%rbp,%rax,8),%rax
  movq   %rax,%xmm0
  call   <srgb@plt>
  mov    -0x68(%rbp),%rdx
  mov    %al,(%rdx)
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  lea    D2(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  mov    -0x40(%rbp,%rax,8),%rax
  mov    -0x68(%rbp),%rdx
  lea    0x1(%rdx),%rbx
  movq   %rax,%xmm0
  call   <srgb@plt>
  mov    %al,(%rbx)
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  lea    D67(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  mov    -0x40(%rbp,%rax,8),%rax
  mov    -0x68(%rbp),%rdx
  lea    0x2(%rdx),%rbx
  movq   %rax,%xmm0
  call   <srgb@plt>
  mov    %al,(%rbx)
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D33
type: f64
name: unpack_data
arguments: data_label: D21
type: byte[8]

tool: D33: 6

tool: {"D21": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void hsv(unsigned char *out, double h, double s, double v) {
  static int map[6][3] = {{0, 3, 1}, {2, 0, 1}, {1, 0, 3}, {1, 2, 0}, {3, 1, 0}, {0, 1, 2}};
  double h6 = h * 6;
  double f = h6 - (int)h6;
  double vars[4] = {v, v * (1 - s), v * (1 - (s * f)), v * (1 - (s * (1 - f)))};
  int i = ((int)h6 % 6 + 6) % 6;
  out[0] = srgb(vars[map[i][0]]);
  out[1] = srgb(vars[map[i][1]]);
  out[2] = srgb(vars[map[i][2]]);
}
```