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

```asm
<getcharconstant>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  je     L100
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  jmp    L13
L100:
  addq   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L242
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x37,%al
  jg     L242
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L34
L191:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L91
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x37,%al
  jg     L91
  mov    -0x18(%rbp),%eax
  lea    0x0(,%rax,8),%ecx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x18(%rbp)
  addl   $0x1,-0x14(%rbp)
L34:
  cmpl   $0x2,-0x14(%rbp)
  jle    L191
L91:
  mov    -0x18(%rbp),%eax
  jmp    L13
L242:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  jne    L88
  movl   $0x0,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L192
L149:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %eax,%eax
  je     L102
  mov    -0x18(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%ebx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L10
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  jmp    L26
L10:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  movsbl %al,%eax
  sub    $0x57,%eax
L26:
  add    %ebx,%eax
  mov    %eax,-0x18(%rbp)
  addl   $0x1,-0x14(%rbp)
L192:
  cmpl   $0x2,-0x14(%rbp)
  jle    L149
  jmp    L99
L102:
  nop
L99:
  mov    -0x18(%rbp),%eax
  jmp    L13
L88:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x61,%eax
  cmp    $0x15,%eax
  ja     L42
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D6(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D6(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x7,%eax
  jmp    L13
  mov    $0x8,%eax
  jmp    L13
  mov    $0xc,%eax
  jmp    L13
  mov    $0xa,%eax
  jmp    L13
  mov    $0xd,%eax
  jmp    L13
  mov    $0x9,%eax
  jmp    L13
  mov    $0xb,%eax
  jmp    L13
L42:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
L13:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int getcharconstant(char const *input) {
  int value, n;
  if (*input != '\\')
    return *input;
  ++input;
  if (*input >= '0' && *input <= '7') {
    value = 0;
    for (n = 0; n < 3; ++n) {
      if (input[n] < '0' || input[n] > '7')
        break;
      value = value * 8 + input[n] - '0';
    }
    return value;
  }
  if (*input == 'x') {
    value = 0;
    for (n = 1; n < 3; ++n) {
      if (!isxdigit(input[n]))
        break;
      value = value * 16 + (isdigit(input[n]) ? input[n] - '0' : tolower(input[n]) - 'a' + 10);
    }
    return value;
  }
  switch (*input) {
  case 'a':
    return '\a';
  case 'b':
    return '\b';
  case 'f':
    return '\f';
  case 'n':
    return '\n';
  case 'r':
    return '\r';
  case 't':
    return '\t';
  case 'v':
    return '\v';
  default:
    return *input;
  }
}
```