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

```asm
<HSBtoRGB>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %rcx,-0x28(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jne    L46
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L78
L46:
  mov    $0xff,%eax
  sub    -0x18(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x14(%rbp),%edx
  movslq %edx,%rax
  imul   $0xffffffffb60b60b7,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x8,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x168,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    $0x5,%eax
  ja     L11
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D15(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D15(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    -0x4(%rbp),%eax
  imul   -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L11
  mov    -0x1c(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x3c,%edx,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    $0x3c,%eax
  sub    %edx,%eax
  imul   %ecx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L11
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x3c,%edx,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %ecx,%eax
  imul   %edx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L11
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x3c,%edx,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    $0x3c,%eax
  sub    %edx,%eax
  imul   %ecx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L11
  mov    -0x1c(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x3c,%edx,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %ecx,%eax
  imul   %edx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L11
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x3c,%edx,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    $0x3c,%eax
  sub    %edx,%eax
  imul   %ecx,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  nop
L11:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  mov    %rax,(%rdx)
  mov    -0x28(%rbp),%rax
  lea    0x10(%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  mov    %rax,(%rdx)
L78:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void HSBtoRGB(int32_t hue, int32_t sat, int32_t val, uint8_t out[]) {
  int r = 0, g = 0, b = 0;
  int base;
  if (sat == 0) {
    r = g = b = val;
  } else {
    base = ((255 - sat) * val) >> 8;
    switch ((hue % 360) / 60) {
    case 0:
      r = val;
      g = (((val - base) * hue) / 60) + base;
      b = base;
      break;
    case 1:
      r = (((val - base) * (60 - (hue % 60))) / 60) + base;
      g = val;
      b = base;
      break;
    case 2:
      r = base;
      g = val;
      b = (((val - base) * (hue % 60)) / 60) + base;
      break;
    case 3:
      r = base;
      g = (((val - base) * (60 - (hue % 60))) / 60) + base;
      b = val;
      break;
    case 4:
      r = (((val - base) * (hue % 60)) / 60) + base;
      g = base;
      b = val;
      break;
    case 5:
      r = val;
      g = base;
      b = (((val - base) * (60 - (hue % 60))) / 60) + base;
      break;
    }
    out[0] = (uint8_t)r;
    out[1] = (uint8_t)g;
    out[2] = (uint8_t)b;
  }
}
```