user: What would the C source look like for the assembly code provided here?

```asm
<hsv_to_rgb>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x18,%rsp
  mov    %edi,-0x64(%rbp)
  movsd  %xmm0,-0x70(%rbp)
  movsd  %xmm1,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %rdx,-0x88(%rbp)
  mov    %rcx,-0x90(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x70(%rbp),%xmm0
  jbe    L136
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x70(%rbp)
L136:
  pxor   %xmm0,%xmm0
  comisd -0x78(%rbp),%xmm0
  jbe    L123
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x78(%rbp)
L123:
  movsd  -0x70(%rbp),%xmm0
  movsd  D96(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L18
  movsd  D96(%rip),%xmm0
  movsd  %xmm0,-0x70(%rbp)
L18:
  movsd  -0x78(%rbp),%xmm0
  movsd  D96(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L6
  movsd  D96(%rip),%xmm0
  movsd  %xmm0,-0x78(%rbp)
L6:
  movsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x78(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x64(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffffb60b60b7,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x8,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x168,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  movsd  D72(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x28(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x54(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x54(%rbp),%xmm1
  movsd  -0x28(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D96(%rip),%xmm0
  subsd  -0x38(%rbp),%xmm0
  movsd  -0x30(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x20(%rbp),%xmm1
  movsd  D96(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  -0x30(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  D96(%rip),%xmm0
  subsd  -0x20(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x38(%rbp),%xmm1
  movsd  D96(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  -0x30(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmpl   $0x0,-0x54(%rbp)
  jne    L10
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L128
L10:
  cmpl   $0x1,-0x54(%rbp)
  jne    L13
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L128
L13:
  cmpl   $0x2,-0x54(%rbp)
  jne    L113
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L128
L113:
  cmpl   $0x3,-0x54(%rbp)
  jne    L132
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L128
L132:
  cmpl   $0x4,-0x54(%rbp)
  jne    L33
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L128
L33:
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
L128:
  movsd  -0x50(%rbp),%xmm1
  movsd  D1(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edx
  mov    -0x80(%rbp),%rax
  mov    %dx,(%rax)
  movsd  -0x48(%rbp),%xmm1
  movsd  D1(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edx
  mov    -0x88(%rbp),%rax
  mov    %dx,(%rax)
  movsd  -0x40(%rbp),%xmm1
  movsd  D1(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edx
  mov    -0x90(%rbp),%rax
  mov    %dx,(%rax)
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D96
datatype: byte[8]
name: retrieve_data
arguments: tag: D72
datatype: f64
name: retrieve_data
arguments: tag: D1
datatype: byte[8]

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

tool: D72: 60

tool: {"D1": [0x00,0x00,0x00,0x00,0xe0,0xff,0xef,0x40]}

assistant: ```c
void hsv_to_rgb(int h, double s, double v, unsigned short *r, unsigned short *g, unsigned short *b) {
  double H, S, V, R, G, B;
  double p1, p2, p3;
  double f;
  int i;
  if (s < 0)
    s = 0;
  if (v < 0)
    v = 0;
  if (s > 1)
    s = 1;
  if (v > 1)
    v = 1;
  S = s;
  V = v;
  H = (h % 360) / 60.0;
  i = H;
  f = H - i;
  p1 = V * (1 - S);
  p2 = V * (1 - (S * f));
  p3 = V * (1 - (S * (1 - f)));
  if (i == 0) {
    R = V;
    G = p3;
    B = p1;
  } else if (i == 1) {
    R = p2;
    G = V;
    B = p1;
  } else if (i == 2) {
    R = p1;
    G = V;
    B = p3;
  } else if (i == 3) {
    R = p1;
    G = p2;
    B = V;
  } else if (i == 4) {
    R = p3;
    G = p1;
    B = V;
  } else {
    R = V;
    G = p1;
    B = p2;
  }
  *r = R * 65535;
  *g = G * 65535;
  *b = B * 65535;
}
```