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

```asm
<xcflRGBToHSLInt>:
  endbr64
  push   %rbx
  mov    %rsi,%r8
  mov    %rdx,%r9
  mov    (%rdi),%eax
  mov    (%rsi),%ecx
  mov    (%rdx),%edx
  cmp    %ecx,%eax
  jle    L65
  cmp    %edx,%eax
  mov    %edx,%ebx
  cmovge %eax,%ebx
  cmp    %edx,%ecx
  mov    %edx,%esi
  cmovle %ecx,%esi
L116:
  lea    (%rsi,%rbx,1),%r10d
  pxor   %xmm2,%xmm2
  cvtsi2sd %r10d,%xmm2
  movapd %xmm2,%xmm3
  mulsd  D26(%rip),%xmm3
  cmp    %ebx,%esi
  je     L103
  mov    %ebx,%r11d
  sub    %esi,%r11d
  movsd  D107(%rip),%xmm0
  comisd %xmm3,%xmm0
  jbe    L90
  pxor   %xmm1,%xmm1
  cvtsi2sd %r11d,%xmm1
  mulsd  D12(%rip),%xmm1
  divsd  %xmm2,%xmm1
L35:
  cmp    %eax,%ebx
  je     L53
  cmp    %ecx,%ebx
  je     L114
  sub    %ecx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sd %r11d,%xmm2
  divsd  %xmm2,%xmm0
  addsd  D117(%rip),%xmm0
L42:
  mulsd  D103(%rip),%xmm0
  pxor   %xmm2,%xmm2
  comisd %xmm0,%xmm2
  ja     L3
  comisd D12(%rip),%xmm0
  jbe    L19
  subsd  D12(%rip),%xmm0
  jmp    L19
L65:
  cmp    %edx,%ecx
  mov    %edx,%ebx
  cmovge %ecx,%ebx
  cmp    %edx,%eax
  mov    %edx,%esi
  cmovle %eax,%esi
  jmp    L116
L90:
  pxor   %xmm1,%xmm1
  cvtsi2sd %r11d,%xmm1
  mulsd  D12(%rip),%xmm1
  mov    $0x1ff,%r10d
  sub    %ebx,%r10d
  sub    %esi,%r10d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r10d,%xmm0
  divsd  %xmm0,%xmm1
  jmp    L35
L53:
  sub    %edx,%ecx
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sd %r11d,%xmm2
  divsd  %xmm2,%xmm0
  jmp    L42
L114:
  sub    %eax,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sd %r11d,%xmm2
  divsd  %xmm2,%xmm0
  addsd  D97(%rip),%xmm0
  jmp    L42
L3:
  addsd  D12(%rip),%xmm0
L19:
  movsd  D26(%rip),%xmm2
  addsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%edx
  addsd  %xmm2,%xmm1
  cvttsd2si %xmm1,%eax
L50:
  mov    %edx,(%rdi)
  mov    %eax,(%r8)
  addsd  D26(%rip),%xmm3
  cvttsd2si %xmm3,%eax
  mov    %eax,(%r9)
  pop    %rbx
  ret
L103:
  mov    $0x0,%edx
  mov    $0x0,%eax
  jmp    L50
```

tool_calls: name: parse_data
arguments: data_tag: D26
type_infered: f64
name: parse_data
arguments: data_tag: D107
type_infered: f64
name: parse_data
arguments: data_tag: D12
type_infered: f64[2]
name: parse_data
arguments: data_tag: D117
type_infered: f64
name: parse_data
arguments: data_tag: D103
type_infered: f64
name: parse_data
arguments: data_tag: D97
type_infered: f64

tool: D26: 0.5

tool: D107: 128

tool: {"D12": [255.0,2.0]}

tool: D117: 4

tool: D103: 42.5

tool: D97: 2

assistant: ```c
void xcflRGBToHSLInt(int *pRed, int *pGreen, int *pBlue) {
  int r, g, b;
  double h, s, l;
  int Min, Max, Delta;
  r = *pRed;
  g = *pGreen;
  b = *pBlue;
  if (r > g) {
    Max = ((r) > (b) ? (r) : (b));
    Min = ((g) < (b) ? (g) : (b));
  } else {
    Max = ((g) > (b) ? (g) : (b));
    Min = ((r) < (b) ? (r) : (b));
  }
  l = (Max + Min) / 2.0;
  if (Max == Min) {
    *pRed = 0;
    *pGreen = 0;
  } else {
    Delta = Max - Min;
    if (l < 128.0)
      s = 255.0 * (double)Delta / (double)(Max + Min);
    else
      s = 255.0 * (double)Delta / (double)(511 - Max - Min);
    if (r == Max)
      h = (double)(g - b) / (double)Delta;
    else if (g == Max)
      h = 2.0 + (double)(b - r) / (double)Delta;
    else
      h = 4.0 + (double)(r - g) / (double)Delta;
    h *= 42.5;
    if (h < 0.0)
      h += 255.0;
    else if (h > 255.0)
      h -= 255.0;
    *pRed = ((int)((h) + 0.5));
    *pGreen = ((int)((s) + 0.5));
  }
  *pBlue = ((int)((l) + 0.5));
}
```