user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<rainbowRGB>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  movsd  %xmm0,0x8(%rsp)
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  comisd D45(%rip),%xmm0
  ja     L17
L26:
  movsd  0x8(%rsp),%xmm2
  movapd %xmm2,%xmm0
  mulsd  D85(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  movapd %xmm2,%xmm1
  mulsd  D138(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm2,%xmm1
  mulsd  D103(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm2,%xmm1
  mulsd  D107(%rip),%xmm1
  addsd  %xmm1,%xmm0
  addsd  D87(%rip),%xmm0
  call   <fabs@plt>
  mov    %eax,(%r12)
  movsd  0x8(%rsp),%xmm2
  movapd %xmm2,%xmm0
  mulsd  D2(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  movapd %xmm2,%xmm1
  mulsd  D29(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm2,%xmm1
  mulsd  D33(%rip),%xmm1
  addsd  %xmm1,%xmm0
  addsd  D78(%rip),%xmm0
  call   <fabs@plt>
  mov    %eax,0x0(%rbp)
  movsd  0x8(%rsp),%xmm2
  movapd %xmm2,%xmm0
  mulsd  D23(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  movapd %xmm2,%xmm1
  mulsd  D47(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm2,%xmm1
  mulsd  D57(%rip),%xmm1
  addsd  %xmm1,%xmm0
  addsd  D92(%rip),%xmm0
  call   <fabs@plt>
  mov    %eax,(%rbx)
  cmpl   $0xff,(%r12)
  jle    L23
  movl   $0xff,(%r12)
L23:
  cmpl   $0xff,0x0(%rbp)
  jle    L22
  movl   $0xff,0x0(%rbp)
L22:
  mov    (%rbx),%eax
  mov    $0xff,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,(%rbx)
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L17:
  lea    D115(%rip),%rdi
  call   <error2@plt>
  jmp    L26
```

tool_calls: name: retrieve_data
arguments: data_label: D45
datatype: f64[2]
name: retrieve_data
arguments: data_label: D85
datatype: byte[8]
name: retrieve_data
arguments: data_label: D138
datatype: f64
name: retrieve_data
arguments: data_label: D103
datatype: f64
name: retrieve_data
arguments: data_label: D107
datatype: f64
name: retrieve_data
arguments: data_label: D87
datatype: f64
name: retrieve_data
arguments: data_label: D2
datatype: byte[8]
name: retrieve_data
arguments: data_label: D29
datatype: f64
name: retrieve_data
arguments: data_label: D33
datatype: f64
name: retrieve_data
arguments: data_label: D78
datatype: f64
name: retrieve_data
arguments: data_label: D23
datatype: f64
name: retrieve_data
arguments: data_label: D47
datatype: f64
name: retrieve_data
arguments: data_label: D57
datatype: f64
name: retrieve_data
arguments: data_label: D92
datatype: f64
name: retrieve_data
arguments: data_label: D115
datatype: string

tool: {"D45": [1.0,-5157.3]}

tool: {"D85": [0xcd,0xcc,0xcc,0xcc,0x4c,0x25,0xb4,0xc0]}

tool: D138: 9681.4

tool: D103: 5491.9

tool: D107: 1137.7

tool: D87: 6.2168

tool: {"D2": [0x9a,0x99,0x99,0x99,0x99,0x75,0x92,0xc0]}

tool: D29: 964.8

tool: D33: 203.66

tool: D78: 1.2028

tool: D23: 92.463

tool: D47: 595.92

tool: D57: 481.11

tool: D92: 21.769

tool: D115: temperature rescaling needed.

assistant: ```c
void rainbowRGB(double temperature, int *R, int *G, int *B) {
  double T = temperature, maxT = 1;
  if (T > maxT)
    error2("temperature rescaling needed.");
  *R = (int)fabs(-5157.3 * T * T * T * T + 9681.4 * T * T * T - 5491.9 * T * T + 1137.7 * T + 6.2168);
  *G = (int)fabs(-1181.4 * T * T * T + 964.8 * T * T + 203.66 * T + 1.2028);
  *B = (int)fabs(92.463 * T * T * T - 595.92 * T * T + 481.11 * T + 21.769);
  if (*R > 255)
    *R = 255;
  if (*G > 255)
    *G = 255;
  if (*B > 255)
    *B = 255;
}
```