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

```asm
<HexToDec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x24(%rbp)
  jmp    L157
L119:
  mov    -0x24(%rbp),%eax
  cltq
  movl   $0x0,-0x18(%rbp,%rax,4)
  addl   $0x1,-0x24(%rbp)
L157:
  cmpl   $0x2,-0x24(%rbp)
  jle    L119
  movl   $0x1,-0x24(%rbp)
  jmp    L171
L78:
  movl   $0x0,-0x20(%rbp)
  jmp    L40
L116:
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%eax
  cltq
  mov    %dl,-0xb(%rbp,%rax,1)
  addl   $0x1,-0x20(%rbp)
L40:
  cmpl   $0x1,-0x20(%rbp)
  jle    L116
  movb   $0x0,-0x9(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L92
L134:
  mov    $0x1,%eax
  sub    -0x20(%rbp),%eax
  cltq
  movzbl -0xb(%rbp,%rax,1),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x36,%eax
  ja     L93
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D3(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D3(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x1,%eax
  sub    -0x20(%rbp),%eax
  cltq
  movzbl -0xb(%rbp,%rax,1),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L93
  movl   $0xa,-0x1c(%rbp)
  jmp    L93
  movl   $0xb,-0x1c(%rbp)
  jmp    L93
  movl   $0xc,-0x1c(%rbp)
  jmp    L93
  movl   $0xd,-0x1c(%rbp)
  jmp    L93
  movl   $0xe,-0x1c(%rbp)
  jmp    L93
  movl   $0xf,-0x1c(%rbp)
  nop
L93:
  cmpl   $0x0,-0x20(%rbp)
  jne    L129
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  movslq %ecx,%rax
  mov    -0x18(%rbp,%rax,4),%edx
  mov    -0x1c(%rbp),%eax
  add    %eax,%edx
  movslq %ecx,%rax
  mov    %edx,-0x18(%rbp,%rax,4)
  jmp    L85
L129:
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%ecx
  movslq %ecx,%rax
  mov    -0x18(%rbp,%rax,4),%edx
  mov    -0x1c(%rbp),%eax
  imul   -0x20(%rbp),%eax
  shl    $0x4,%eax
  add    %eax,%edx
  movslq %ecx,%rax
  mov    %edx,-0x18(%rbp,%rax,4)
L85:
  addl   $0x1,-0x20(%rbp)
L92:
  cmpl   $0x1,-0x20(%rbp)
  jle    L134
  addl   $0x2,-0x24(%rbp)
L171:
  cmpl   $0x6,-0x24(%rbp)
  jle    L78
  mov    -0x18(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%edx
  mov    -0x50(%rbp),%rax
  mov    %edx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L12
  call   <__stack_chk_fail@plt>
L12:
  leave
  ret
```

assistant: ```c
void HexToDec(char *hRGB, int *dR, int *dG, int *dB) {
  char tempCh[3];
  int i, j, rgb[3], tempI;
  for (i = 0; i < 3; i++) {
    rgb[i] = 0;
  }
  for (i = 1; i < 7; i += 2) {
    for (j = 0; j < 2; j++)
      tempCh[j] = hRGB[i + j];
    tempCh[2] = '\0';
    for (j = 0; j < 2; j++) {
      switch (tempCh[1 - j]) {
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        tempI = tempCh[1 - j] - '0';
        break;
      case 'A':
      case 'a':
        tempI = 10;
        break;
      case 'B':
      case 'b':
        tempI = 11;
        break;
      case 'C':
      case 'c':
        tempI = 12;
        break;
      case 'D':
      case 'd':
        tempI = 13;
        break;
      case 'E':
      case 'e':
        tempI = 14;
        break;
      case 'F':
      case 'f':
        tempI = 15;
        break;
      }
      if (j == 0)
        rgb[(i - 1) / 2] += tempI;
      else
        rgb[(i - 1) / 2] += tempI * 16 * j;
    }
  }
  *dR = rgb[0];
  *dG = rgb[1];
  *dB = rgb[2];
}
```