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

```asm
<colorMap_rainbow>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  movsd  %xmm0,-0x38(%rbp)
  mov    %rdi,-0x40(%rbp)
  movsd  D73(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x28(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  D50(%rip),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movsd  D23(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    $0x3,%edx
  mov    %edx,%ebx
  sub    %eax,%ebx
  movsd  -0x20(%rbp),%xmm0
  movsd  D150(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  cmp    $0xffffffff,%eax
  jl     L26
  movsd  -0x20(%rbp),%xmm0
  movsd  D23(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    $0x3,%edx
  mov    %edx,%ebx
  sub    %eax,%ebx
  movsd  -0x20(%rbp),%xmm0
  movsd  D150(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  jmp    L60
L26:
  pxor   %xmm0,%xmm0
L60:
  mov    -0x40(%rbp),%rax
  movsd  %xmm0,(%rax)
  movsd  -0x20(%rbp),%xmm0
  movsd  D5(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    $0x4,%edx
  mov    %edx,%ebx
  sub    %eax,%ebx
  movsd  -0x20(%rbp),%xmm0
  movsd  D23(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  cmp    $0xffffffff,%eax
  jl     L104
  movsd  -0x20(%rbp),%xmm0
  movsd  D5(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    $0x4,%edx
  mov    %edx,%ebx
  sub    %eax,%ebx
  movsd  -0x20(%rbp),%xmm0
  movsd  D23(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  jmp    L89
L104:
  pxor   %xmm0,%xmm0
L89:
  mov    -0x40(%rbp),%rax
  add    $0x8,%rax
  movsd  %xmm0,(%rax)
  movsd  -0x20(%rbp),%xmm0
  movsd  D40(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    $0x3,%edx
  mov    %edx,%ebx
  sub    %eax,%ebx
  movsd  -0x20(%rbp),%xmm0
  movsd  D5(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  cmp    $0xffffffff,%eax
  jl     L74
  movsd  -0x20(%rbp),%xmm0
  movsd  D40(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    $0x3,%edx
  mov    %edx,%ebx
  sub    %eax,%ebx
  movsd  -0x20(%rbp),%xmm0
  movsd  D5(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  jmp    L90
L74:
  pxor   %xmm0,%xmm0
L90:
  mov    -0x40(%rbp),%rax
  add    $0x10,%rax
  movsd  %xmm0,(%rax)
  movl   $0x0,-0x2c(%rbp)
  jmp    L79
L58:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L50
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  jmp    L106
L50:
  pxor   %xmm0,%xmm0
L106:
  movsd  %xmm0,-0x18(%rbp)
  movsd  D40(%rip),%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L70
  movsd  -0x18(%rbp),%xmm0
  jmp    L13
L70:
  movsd  D40(%rip),%xmm0
L13:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x2c(%rbp)
L79:
  cmpl   $0x2,-0x2c(%rbp)
  jle    L58
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D73
type_infered: f64
name: retrieve_data
arguments: tag: D50
type_infered: f64
name: retrieve_data
arguments: tag: D23
type_infered: f32[2]
name: retrieve_data
arguments: tag: D150
type_infered: f32[2]
name: retrieve_data
arguments: tag: D5
type_infered: f64
name: retrieve_data
arguments: tag: D40
type_infered: f64

tool: D73: 0.1

tool: D50: 6

tool: {"D23": [0.0,2.25]}

tool: {"D150": [0.0,2.3125]}

tool: D5: 2

tool: D40: 1

assistant: ```c
void colorMap_rainbow(GLfloat fin, GLfloat *fcol) {
  int i;
  GLfloat xmin, xmax;
  GLfloat dx = 0.10;
  GLfloat ga = (6.0 - 2.0 * dx) * fin + dx;
  fcol[0] = ((0) > ((3 - fabs(ga - 4) - fabs(ga - 5)) / 2) ? (0) : ((3 - fabs(ga - 4) - fabs(ga - 5)) / 2));
  fcol[1] = ((0) > ((4 - fabs(ga - 2) - fabs(ga - 4)) / 2) ? (0) : ((4 - fabs(ga - 2) - fabs(ga - 4)) / 2));
  fcol[2] = ((0) > ((3 - fabs(ga - 1) - fabs(ga - 2)) / 2) ? (0) : ((3 - fabs(ga - 1) - fabs(ga - 2)) / 2));
  for (i = 0; i < 3; i++) {
    xmin = ((fcol[i]) > (0.0) ? (fcol[i]) : (0.0));
    fcol[i] = ((xmin) < (1.0) ? (xmin) : (1.0));
  }
}
```