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

```asm
<BTSHASP_GetRegId>:
  endbr64
  push   %rbp
  movzbl (%rdi),%edx
  mov    %rdi,%rbp
  lea    -0x44(%rdx),%eax
  cmp    $0x2e,%al
  ja     L48
  lea    D36(%rip),%rcx
  movzbl %al,%eax
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  cs nopw 0x0(%rax,%rax,1)
L48:
  lea    D88(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0xf,%eax
  test   %r8d,%r8d
  je     L198
  lea    D57(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x30,%eax
  test   %r8d,%r8d
  je     L198
  lea    D14(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x31,%eax
  test   %r8d,%r8d
  je     L198
  lea    D6(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x32,%eax
  test   %r8d,%r8d
  je     L198
  lea    D95(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  test   %eax,%eax
  jne    L10
  mov    $0x33,%eax
L198:
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
  and    $0xffffffdf,%edx
  mov    $0x10,%eax
  cmp    $0x44,%dl
  mov    $0x20,%edx
  cmove  %edx,%eax
  movzbl 0x2(%rdi),%edx
  cmp    $0x30,%dl
  je     L195
  cmp    $0x31,%dl
  je     L166
  sub    $0x30,%edx
  cmp    $0x9,%dl
  jbe    L7
L24:
  lea    D92(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x38,%eax
  test   %r8d,%r8d
  je     L198
  lea    D114(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x39,%eax
  test   %r8d,%r8d
  je     L198
L10:
  mov    $0xffffffff,%eax
  pop    %rbp
  ret
  nopl   0x0(%rax)
  lea    D106(%rip),%rsi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x34,%eax
  test   %r8d,%r8d
  je     L198
  lea    D115(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x35,%eax
  test   %r8d,%r8d
  jne    L10
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
  movzbl 0x1(%rdi),%eax
  cmp    $0x30,%al
  je     L213
  cmp    $0x31,%al
  jne    L126
  movzbl 0x2(%rdi),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x5,%dl
  ja     L6
  cmpb   $0x0,0x3(%rdi)
  jne    L10
  sub    $0x26,%eax
  jmp    L338
  cs nopw 0x0(%rax,%rax,1)
  lea    D82(%rip),%rsi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x36,%eax
  test   %r8d,%r8d
  je     L198
  lea    D107(%rip),%rsi
  mov    %rbp,%rdi
  call   <btshasp_stricmp@plt>
  mov    %eax,%r8d
  mov    $0x37,%eax
  test   %r8d,%r8d
  jne    L10
  pop    %rbp
  ret
  nop
L213:
  movzbl 0x2(%rdi),%edx
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  ja     L157
  cmpb   $0x0,0x3(%rdi)
  jne    L10
  jmp    L338
  nopw   0x0(%rax,%rax,1)
L195:
  movzbl 0x3(%rdi),%edx
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  ja     L223
  movsbl %cl,%ecx
  add    %ecx,%eax
  cmpb   $0x0,0x4(%rdi)
  jne    L24
  pop    %rbp
  ret
  nopl   (%rax)
L126:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L10
  cmpb   $0x0,0x2(%rdi)
  jne    L10
L338:
  movsbl %al,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L7:
  movsbl %dl,%edx
  add    %edx,%eax
  cmpb   $0x0,0x3(%rdi)
  jne    L24
  pop    %rbp
  ret
  nopl   0x0(%rax)
L223:
  test   %dl,%dl
  jne    L24
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L157:
  xor    %eax,%eax
  test   %dl,%dl
  jne    L10
  pop    %rbp
  ret
  nopl   0x0(%rax)
L6:
  test   %al,%al
  jne    L10
  mov    $0x1,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L166:
  movzbl 0x3(%rdi),%edx
  lea    -0x30(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L82
  movsbl %cl,%ecx
  cmpb   $0x0,0x4(%rdi)
  lea    0xa(%rax,%rcx,1),%eax
  jne    L24
  pop    %rbp
  ret
  nop
L82:
  add    $0x1,%eax
  test   %dl,%dl
  jne    L24
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D88
type_guessed: string
name: unpack_data
arguments: tag: D57
type_guessed: string
name: unpack_data
arguments: tag: D14
type_guessed: string
name: unpack_data
arguments: tag: D6
type_guessed: string
name: unpack_data
arguments: tag: D95
type_guessed: string
name: unpack_data
arguments: tag: D92
type_guessed: string
name: unpack_data
arguments: tag: D114
type_guessed: string
name: unpack_data
arguments: tag: D106
type_guessed: string
name: unpack_data
arguments: tag: D115
type_guessed: string
name: unpack_data
arguments: tag: D82
type_guessed: string
name: unpack_data
arguments: tag: D107
type_guessed: string

tool: D88: sp

tool: D57: sr

tool: D14: gbr

tool: D6: vbr

tool: D95: tbr

tool: D92: fpscr

tool: D114: fpul

tool: D106: mach

tool: D115: macl

tool: D82: pr

tool: D107: pc

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