user: Please show me the C implementation that matches the assembly code listed below:

```asm
<hsv2rgb>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x20(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  sar    $0x8,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x20(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  and    $0xff,%eax
  mov    %eax,-0x10(%rbp)
  mov    $0x100,%eax
  sub    -0x1c(%rbp),%eax
  imul   -0x18(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    $0x100,%eax
  sub    %edx,%eax
  imul   -0x18(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,-0x8(%rbp)
  mov    $0x100,%eax
  sub    -0x10(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    $0x100,%eax
  sub    %edx,%eax
  imul   -0x18(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x6,-0x14(%rbp)
  ja     L49
  mov    -0x14(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D5(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D5(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x38(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L49
  mov    -0x38(%rbp),%rax
  mov    -0x8(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L49
  mov    -0x38(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L49
  mov    -0x38(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    -0x8(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L49
  mov    -0x38(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L49
  mov    -0x38(%rbp),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    -0x8(%rbp),%edx
  mov    %edx,(%rax)
  nop
L49:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void hsv2rgb(uint8_t h, uint8_t s, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b) {
  uint16_t hh = h, ss = s, vv = v;
  uint8_t i = (hh * 6) >> 8;
  uint16_t f = (hh * 6) & 0xFF;
  uint16_t p = (vv * (0x100 - ss)) >> 8;
  uint16_t q = (vv * (0x100 - ((f * ss) >> 8))) >> 8;
  uint16_t t = (vv * (0x100 - (((0x100 - f) * ss) >> 8))) >> 8;
  switch (i) {
  case 0:
  case 6:
    *r = vv;
    *g = t;
    *b = p;
    break;
  case 1:
    *r = q;
    *g = vv;
    *b = p;
    break;
  case 2:
    *r = p;
    *g = vv;
    *b = t;
    break;
  case 3:
    *r = p;
    *g = q;
    *b = vv;
    break;
  case 4:
    *r = t;
    *g = p;
    *b = vv;
    break;
  case 5:
    *r = vv;
    *g = p;
    *b = q;
    break;
  }
}
```