user: Converte this assembly snippet into its equivalent C code:

```asm
<temperature_to_colour>:
  endbr64
  mov    %rdi,%r9
  mov    %rsi,%r10
  mov    %rdx,%r8
  mov    %rcx,%rax
  movsd  D134(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L49
  comisd D146(%rip),%xmm0
  jbe    L2
  mov    $0x64,%esi
  mov    $0xffffff99,%edx
  mov    $0xffffff9d,%edi
  mov    $0xfffffffc,%ecx
L10:
  mov    %cl,(%r9)
  mov    %dil,(%r10)
  mov    %dl,(%r8)
  mov    %sil,(%rax)
  ret
  nopl   0x0(%rax)
L49:
  mov    $0xffffffc8,%edx
  mov    $0xffffffe6,%esi
  mov    $0xffffffc8,%ecx
  mov    %edx,%edi
L4:
  mov    %cl,(%r9)
  mov    %dil,(%r10)
  mov    %dl,(%r8)
  mov    %sil,(%rax)
  ret
L2:
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  movsd  D126(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  divsd  D65(%rip),%xmm1
  addsd  D135(%rip),%xmm1
  cvttsd2si %xmm1,%esi
  movsd  D78(%rip),%xmm1
  comisd %xmm1,%xmm0
  ja     L6
  movsd  D39(%rip),%xmm0
  movsd  D81(%rip),%xmm3
  movsd  D67(%rip),%xmm1
  mulsd  %xmm2,%xmm0
  mulsd  D107(%rip),%xmm2
  divsd  %xmm3,%xmm0
  divsd  %xmm3,%xmm2
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%ecx
  addsd  %xmm1,%xmm2
  cvttsd2si %xmm2,%edx
  mov    %edx,%edi
  jmp    L4
L6:
  subsd  %xmm1,%xmm0
  movsd  D133(%rip),%xmm2
  movsd  D115(%rip),%xmm3
  mulsd  %xmm0,%xmm2
  divsd  %xmm1,%xmm2
  addsd  D16(%rip),%xmm2
  cvttsd2si %xmm2,%ecx
  movsd  D79(%rip),%xmm2
  mulsd  %xmm0,%xmm2
  mulsd  D121(%rip),%xmm0
  divsd  %xmm1,%xmm2
  divsd  %xmm1,%xmm0
  addsd  %xmm3,%xmm2
  cvttsd2si %xmm2,%edi
  addsd  %xmm3,%xmm0
  cvttsd2si %xmm0,%edx
  jmp    L10
```

tool_calls: name: read_data
arguments: data_tag: D134
type: byte[8]
name: read_data
arguments: data_tag: D146
type: byte[16]
name: read_data
arguments: data_tag: D126
type: byte[8]
name: read_data
arguments: data_tag: D65
type: byte[8]
name: read_data
arguments: data_tag: D135
type: byte[8]
name: read_data
arguments: data_tag: D78
type: byte[8]
name: read_data
arguments: data_tag: D39
type: byte[8]
name: read_data
arguments: data_tag: D81
type: byte[8]
name: read_data
arguments: data_tag: D67
type: byte[8]
name: read_data
arguments: data_tag: D107
type: byte[8]
name: read_data
arguments: data_tag: D133
type: byte[8]
name: read_data
arguments: data_tag: D115
type: byte[8]
name: read_data
arguments: data_tag: D16
type: byte[8]
name: read_data
arguments: data_tag: D79
type: byte[8]
name: read_data
arguments: data_tag: D121
type: byte[8]

tool: {"D134": [0x00,0x00,0x00,0x00,0x00,0x40,0x7f,0x40]}

tool: {"D146": [0x00,0x00,0x00,0x00,0x00,0x00,0x99,0x40,0x00,0x00,0x00,0x00,0x00,0x40,0x60,0xc0]}

tool: {"D126": [0x00,0x00,0x00,0x00,0x00,0x40,0x60,0xc0]}

tool: {"D65": [0x00,0x00,0x00,0x00,0x00,0x30,0x91,0x40]}

tool: {"D135": [0x00,0x00,0x00,0x00,0x00,0xc0,0x6c,0x40]}

tool: {"D78": [0x00,0x00,0x00,0x00,0x00,0x00,0x89,0x40]}

tool: {"D39": [0x00,0x00,0x00,0x00,0x00,0x00,0x4a,0xc0]}

tool: {"D81": [0x00,0x00,0x00,0x00,0x00,0xc0,0x72,0x40]}

tool: {"D67": [0x00,0x00,0x00,0x00,0x00,0x00,0x69,0x40]}

tool: {"D107": [0x00,0x00,0x00,0x00,0x00,0x00,0x66,0xc0]}

tool: {"D133": [0x00,0x00,0x00,0x00,0x00,0x00,0x5a,0x40]}

tool: {"D115": [0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x40]}

tool: {"D16": [0x00,0x00,0x00,0x00,0x00,0x80,0x62,0x40]}

tool: {"D79": [0x00,0x00,0x00,0x00,0x00,0xa0,0x60,0x40]}

tool: {"D121": [0x00,0x00,0x00,0x00,0x00,0x20,0x60,0x40]}

assistant: ```c
void temperature_to_colour(double temperature, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *transparency) {
  const double max_temperature = 1600;
  const double medium_temperature = 800;
  const double min_temperature = 500;
  const int transparency_hot = 100;
  const int transparency_cold = 230;
  int colour_hot[] = {252, 157, 153};
  int colour_medium[] = {148, 24, 24};
  int colour_cold[] = {200, 200, 200};
  if (temperature < min_temperature) {
    temperature = min_temperature;
  }
  if (temperature > max_temperature) {
    temperature = max_temperature;
  }
  if (temperature > medium_temperature) {
    *r = (unsigned char)(colour_medium[0] + ((temperature - medium_temperature) * (colour_hot[0] - colour_medium[0]) / (max_temperature - medium_temperature)));
    *g = (unsigned char)(colour_medium[1] + ((temperature - medium_temperature) * (colour_hot[1] - colour_medium[1]) / (max_temperature - medium_temperature)));
    *b = (unsigned char)(colour_medium[2] + ((temperature - medium_temperature) * (colour_hot[2] - colour_medium[2]) / (max_temperature - medium_temperature)));
  } else {
    *r = (unsigned char)(colour_cold[0] + ((temperature - min_temperature) * (colour_medium[0] - colour_cold[0]) / (medium_temperature - min_temperature)));
    *g = (unsigned char)(colour_cold[1] + ((temperature - min_temperature) * (colour_medium[1] - colour_cold[1]) / (medium_temperature - min_temperature)));
    *b = (unsigned char)(colour_cold[2] + ((temperature - min_temperature) * (colour_medium[2] - colour_cold[2]) / (medium_temperature - min_temperature)));
  }
  *transparency = (unsigned char)(transparency_cold + ((temperature - min_temperature) * (transparency_hot - transparency_cold) / (max_temperature - min_temperature)));
}
```