user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<xcflRGBToHSLInt>:
  endbr64
  mov    (%rdi),%eax
  mov    (%rsi),%ecx
  mov    %rdx,%r8
  mov    (%rdx),%edx
  cmp    %ecx,%eax
  jle    L100
  cmp    %edx,%eax
  mov    %edx,%r9d
  mov    %edx,%r10d
  cmovge %eax,%r9d
  cmp    %edx,%ecx
  cmovle %ecx,%r10d
L24:
  lea    (%r10,%r9,1),%r11d
  pxor   %xmm4,%xmm4
  movsd  D59(%rip),%xmm2
  cvtsi2sd %r11d,%xmm4
  movapd %xmm4,%xmm1
  mulsd  %xmm2,%xmm1
  cmp    %r9d,%r10d
  je     L43
  mov    %r9d,%r11d
  pxor   %xmm6,%xmm6
  movsd  D58(%rip),%xmm0
  movsd  D19(%rip),%xmm5
  sub    %r10d,%r11d
  cvtsi2sd %r11d,%xmm6
  comisd %xmm1,%xmm0
  movapd %xmm6,%xmm3
  mulsd  %xmm5,%xmm3
  jbe    L66
  divsd  %xmm4,%xmm3
  cmp    %eax,%r9d
  je     L59
L77:
  cmp    %ecx,%r9d
  je     L3
  sub    %ecx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  divsd  %xmm6,%xmm0
  addsd  D16(%rip),%xmm0
L31:
  mulsd  D24(%rip),%xmm0
  pxor   %xmm4,%xmm4
  comisd %xmm0,%xmm4
  ja     L53
  comisd %xmm5,%xmm0
  ja     L69
L108:
  addsd  %xmm2,%xmm0
  addsd  %xmm2,%xmm3
  addsd  %xmm2,%xmm1
  cvttsd2si %xmm3,%eax
  cvttsd2si %xmm0,%edx
  mov    %edx,(%rdi)
  mov    %eax,(%rsi)
  cvttsd2si %xmm1,%eax
  mov    %eax,(%r8)
  ret
  cs nopw 0x0(%rax,%rax,1)
L66:
  mov    $0x1ff,%r11d
  pxor   %xmm4,%xmm4
  sub    %r9d,%r11d
  sub    %r10d,%r11d
  cvtsi2sd %r11d,%xmm4
  divsd  %xmm4,%xmm3
  cmp    %eax,%r9d
  jne    L77
L59:
  sub    %edx,%ecx
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  divsd  %xmm6,%xmm0
  jmp    L31
  nopw   0x0(%rax,%rax,1)
L100:
  cmp    %edx,%ecx
  mov    %edx,%r9d
  mov    %edx,%r10d
  cmovge %ecx,%r9d
  cmp    %edx,%eax
  cmovle %eax,%r10d
  jmp    L24
  nop
L43:
  addsd  %xmm2,%xmm1
  xor    %eax,%eax
  xor    %edx,%edx
  mov    %edx,(%rdi)
  mov    %eax,(%rsi)
  cvttsd2si %xmm1,%eax
  mov    %eax,(%r8)
  ret
  nopl   0x0(%rax)
L53:
  addsd  %xmm5,%xmm0
  jmp    L108
  nopl   0x0(%rax)
L69:
  subsd  %xmm5,%xmm0
  jmp    L108
  nopl   0x0(%rax)
L3:
  sub    %eax,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  divsd  %xmm6,%xmm0
  addsd  D0(%rip),%xmm0
  jmp    L31
```

tool_calls: name: unpack_data
arguments: label: D59
data_type: f64
name: unpack_data
arguments: label: D58
data_type: f64
name: unpack_data
arguments: label: D19
data_type: f64
name: unpack_data
arguments: label: D16
data_type: f64
name: unpack_data
arguments: label: D24
data_type: f64
name: unpack_data
arguments: label: D0
data_type: f64

tool: D59: 0.5

tool: D58: 128

tool: D19: 255

tool: D16: 4

tool: D24: 42.5

tool: D0: 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));
}
```