user: What is the c source code of the assembly code below:

```asm
<__imlib_rgb_to_hls>:
  endbr64
  mov    %rcx,%rax
  pxor   %xmm0,%xmm0
  cvtsi2ss %edi,%xmm0
  movss  D24(%rip),%xmm3
  divss  %xmm3,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2ss %esi,%xmm2
  divss  %xmm3,%xmm2
  pxor   %xmm1,%xmm1
  cvtsi2ss %edx,%xmm1
  divss  %xmm3,%xmm1
  comiss %xmm0,%xmm2
  ja     L65
  movaps %xmm2,%xmm4
  movaps %xmm0,%xmm3
  mov    $0x0,%edx
L29:
  comiss %xmm3,%xmm1
  ja     L21
  movaps %xmm1,%xmm6
  minss  %xmm4,%xmm6
  movaps %xmm6,%xmm4
L137:
  movaps %xmm3,%xmm7
  subss  %xmm4,%xmm7
  movaps %xmm3,%xmm6
  addss  %xmm4,%xmm6
  movaps %xmm6,%xmm5
  mulss  D70(%rip),%xmm5
  movss  %xmm5,(%r8)
  ucomiss D85(%rip),%xmm7
  jp     L71
  jne    L71
  movl   $0x0,(%r9)
  movl   $0x0,(%rax)
  ret
L65:
  movaps %xmm0,%xmm4
  movaps %xmm2,%xmm3
  mov    $0x1,%edx
  jmp    L29
L21:
  movaps %xmm1,%xmm3
  mov    $0x2,%edx
  jmp    L137
L71:
  movss  D70(%rip),%xmm8
  comiss %xmm5,%xmm8
  jbe    L10
  movaps %xmm7,%xmm4
  divss  %xmm6,%xmm4
L105:
  movss  %xmm4,(%r9)
  cmp    $0x1,%edx
  je     L104
  cmp    $0x2,%edx
  je     L13
  test   %edx,%edx
  je     L138
L39:
  movss  D13(%rip),%xmm0
  mulss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comiss %xmm0,%xmm1
  ja     L114
  movss  %xmm0,(%rax)
  ret
L10:
  movss  D78(%rip),%xmm5
  subss  %xmm3,%xmm5
  subss  %xmm4,%xmm5
  movaps %xmm7,%xmm4
  divss  %xmm5,%xmm4
  jmp    L105
L138:
  subss  %xmm1,%xmm2
  divss  %xmm7,%xmm2
  movss  %xmm2,(%rax)
  jmp    L39
L104:
  subss  %xmm0,%xmm1
  divss  %xmm7,%xmm1
  addss  D78(%rip),%xmm1
  movss  %xmm1,(%rax)
  jmp    L39
L13:
  subss  %xmm2,%xmm0
  divss  %xmm7,%xmm0
  addss  D87(%rip),%xmm0
  movss  %xmm0,(%rax)
  jmp    L39
L114:
  addss  D73(%rip),%xmm0
  movss  %xmm0,(%rax)
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D24
datatype: f32
name: retrieve_data
arguments: data_label: D70
datatype: f32
name: retrieve_data
arguments: data_label: D85
datatype: f64
name: retrieve_data
arguments: data_label: D13
datatype: f32
name: retrieve_data
arguments: data_label: D78
datatype: byte[4]
name: retrieve_data
arguments: data_label: D87
datatype: byte[4]
name: retrieve_data
arguments: data_label: D73
datatype: f32

tool: D24: 255

tool: D70: 0.5

tool: D85: 2

tool: D13: 60

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

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

tool: D73: 360

assistant: ```c
void __imlib_rgb_to_hls(int r, int g, int b, float *hue, float *lightness, float *saturation) {
  int f;
  float i, j, k, max, min, d;
  i = ((float)r) / 255.0;
  j = ((float)g) / 255.0;
  k = ((float)b) / 255.0;
  f = 0;
  max = min = i;
  if (j > max) {
    max = j;
    f = 1;
  } else
    min = j;
  if (k > max) {
    max = k;
    f = 2;
  } else if (k < min)
    min = k;
  d = max - min;
  *lightness = (max + min) / 2.0;
  if (d == 0) {
    *saturation = 0;
    *hue = 0;
  } else {
    if (*lightness < 0.5)
      *saturation = d / (max + min);
    else
      *saturation = d / (2 - max - min);
    switch (f) {
    case 0:
      *hue = (j - k) / d;
      break;
    case 1:
      *hue = 2 + (k - i) / d;
      break;
    case 2:
      *hue = 4 + (i - j) / d;
      break;
    }
    *hue *= 60.0;
    if (*hue < 0)
      *hue += 360.0;
  }
}
```