user: Translate the below assembly code into C programming language:

```asm
<BTSHASP_GetRegId>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  movzbl (%rdi),%edx
  lea    -0x44(%rdx),%eax
  cmp    $0x2e,%al
  ja     L278
  movzbl %al,%eax
  lea    D75(%rip),%rcx
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  and    $0xffffffdf,%edx
  cmp    $0x44,%dl
  mov    $0x10,%eax
  mov    $0x20,%edx
  cmove  %edx,%eax
  movzbl 0x2(%rdi),%edx
  cmp    $0x30,%dl
  je     L98
  cmp    $0x31,%dl
  je     L38
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  ja     L15
  movsbl %dl,%edx
  lea    -0x30(%rax,%rdx,1),%eax
  cmpb   $0x0,0x3(%rdi)
  je     L14
L15:
  lea    D53(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%edx
  mov    $0x38,%eax
  test   %edx,%edx
  je     L14
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  cmp    $0x1,%eax
  sbb    %eax,%eax
  and    $0x3a,%eax
  sub    $0x1,%eax
  jmp    L14
L98:
  movzbl 0x3(%rdi),%edx
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  ja     L284
  movsbl %dl,%edx
  lea    -0x30(%rax,%rdx,1),%eax
  cmpb   $0x0,0x4(%rdi)
  jne    L15
  jmp    L14
L284:
  test   %dl,%dl
  je     L14
  jmp    L15
L38:
  movzbl 0x3(%rdi),%edx
  lea    -0x30(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L307
  movsbl %dl,%edx
  lea    -0x26(%rax,%rdx,1),%eax
  cmpb   $0x0,0x4(%rdi)
  jne    L15
  jmp    L14
L307:
  add    $0x1,%eax
  test   %dl,%dl
  je     L14
  jmp    L15
  movzbl 0x1(%rdi),%edx
  cmp    $0x30,%dl
  je     L1
  cmp    $0x31,%dl
  jne    L340
  movzbl 0x2(%rdi),%edx
  lea    -0x30(%rdx),%eax
  cmp    $0x5,%al
  ja     L280
  mov    $0xffffffff,%eax
  cmpb   $0x0,0x3(%rdi)
  jne    L14
  movsbl %dl,%edx
  lea    -0x26(%rdx),%eax
  jmp    L14
L1:
  movzbl 0x2(%rdi),%ecx
  lea    -0x30(%rcx),%eax
  cmp    $0x9,%al
  ja     L77
  movsbl %cl,%ecx
  lea    -0x30(%rcx),%eax
  cmpb   $0x0,0x3(%rdi)
  jne    L251
  jmp    L14
L77:
  mov    $0x0,%eax
  test   %cl,%cl
  je     L14
  jmp    L251
L280:
  cmp    $0x1,%dl
  sbb    %eax,%eax
  and    $0x2,%eax
  sub    $0x1,%eax
  jmp    L14
L340:
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  ja     L356
L251:
  cmpb   $0x0,0x2(%rbx)
  jne    L365
  movsbl %dl,%edx
  lea    -0x30(%rdx),%eax
  jmp    L14
  lea    D59(%rip),%rsi
  call   <btshasp_stricmp@plt>
  mov    %eax,%edx
  mov    $0x34,%eax
  test   %edx,%edx
  je     L14
  lea    D18(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  cmp    $0x1,%eax
  sbb    %eax,%eax
  and    $0x36,%eax
  sub    $0x1,%eax
L14:
  pop    %rbx
  ret
  lea    D77(%rip),%rsi
  call   <btshasp_stricmp@plt>
  mov    %eax,%edx
  mov    $0x36,%eax
  test   %edx,%edx
  je     L14
  lea    D65(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  cmp    $0x1,%eax
  sbb    %eax,%eax
  and    $0x38,%eax
  sub    $0x1,%eax
  jmp    L14
L278:
  lea    D72(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%edx
  mov    $0xf,%eax
  test   %edx,%edx
  je     L14
  lea    D99(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%edx
  mov    $0x30,%eax
  test   %edx,%edx
  je     L14
  lea    D102(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%edx
  mov    $0x31,%eax
  test   %edx,%edx
  je     L14
  lea    D85(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%edx
  mov    $0x32,%eax
  test   %edx,%edx
  je     L14
  lea    D0(%rip),%rsi
  mov    %rbx,%rdi
  call   <btshasp_stricmp@plt>
  cmp    $0x1,%eax
  sbb    %eax,%eax
  and    $0x34,%eax
  sub    $0x1,%eax
  jmp    L14
L356:
  mov    $0xffffffff,%eax
  jmp    L14
L365:
  mov    $0xffffffff,%eax
  jmp    L14
```

tool_calls: name: read_data
arguments: tag: D53
datatype: string
name: read_data
arguments: tag: D56
datatype: string
name: read_data
arguments: tag: D59
datatype: string
name: read_data
arguments: tag: D18
datatype: string
name: read_data
arguments: tag: D77
datatype: string
name: read_data
arguments: tag: D65
datatype: string
name: read_data
arguments: tag: D72
datatype: string
name: read_data
arguments: tag: D99
datatype: string
name: read_data
arguments: tag: D102
datatype: string
name: read_data
arguments: tag: D85
datatype: string
name: read_data
arguments: tag: D0
datatype: string

tool: D53: fpscr

tool: D56: fpul

tool: D59: mach

tool: D18: macl

tool: D77: pr

tool: D65: pc

tool: D72: sp

tool: D99: sr

tool: D102: gbr

tool: D85: vbr

tool: D0: tbr

assistant: ```c
int BTSHASP_GetRegId(char *str) {
  int i, t;
  switch (str[0]) {
  case 'F':
  case 'f':
  case 'D':
  case 'd':
    t = 0x10;
    if ((str[0] == 'D') || (str[0] == 'd'))
      t = 0x20;
    if (str[2] == '0') {
      if ((str[3] >= '0') && (str[3] <= '9') && !str[4]) {
        return (t + (str[3] - '0'));
      }
      if (!str[3])
        return (t);
    } else if (str[2] == '1') {
      if ((str[3] >= '0') && (str[3] <= '5') && !str[4]) {
        return (t + 10 + (str[3] - '0'));
      }
      if (!str[3])
        return (t + 1);
    } else if ((str[2] >= '0') && (str[2] <= '9') && !str[3]) {
      return (t + (str[2] - '0'));
    }
    if (!btshasp_stricmp(str, "fpscr"))
      return (0x38);
    if (!btshasp_stricmp(str, "fpul"))
      return (0x39);
    break;
  case 'R':
  case 'r':
    t = 0x00;
    if (str[1] == '0') {
      if ((str[2] >= '0') && (str[2] <= '9') && !str[3]) {
        return (t + (str[2] - '0'));
      }
      if (!str[2])
        return (t);
    }
    if (str[1] == '1') {
      if ((str[2] >= '0') && (str[2] <= '5') && !str[3]) {
        return (t + 10 + (str[2] - '0'));
      }
      if (!str[2]) {
        return (t + 1);
      }
    } else if ((str[1] >= '0') && (str[1] <= '9') && !str[2]) {
      return (t + (str[1] - '0'));
    }
    break;
  case 'M':
  case 'm':
    if (!btshasp_stricmp(str, "mach"))
      return (0x34);
    if (!btshasp_stricmp(str, "macl"))
      return (0x35);
    break;
  case 'P':
  case 'p':
    if (!btshasp_stricmp(str, "pr"))
      return (0x36);
    if (!btshasp_stricmp(str, "pc"))
      return (0x37);
    break;
  default:
    if (!btshasp_stricmp(str, "sp"))
      return (0x0F);
    if (!btshasp_stricmp(str, "sr"))
      return (0x30);
    if (!btshasp_stricmp(str, "gbr"))
      return (0x31);
    if (!btshasp_stricmp(str, "vbr"))
      return (0x32);
    if (!btshasp_stricmp(str, "tbr"))
      return (0x33);
    break;
  }
  return (-1);
}
```