user: 请将以下的汇编代码转换成C语言代码:

```asm
<string_to_char>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    (%rdi),%rbx
  movzbl (%rbx),%edx
  cmp    $0x5c,%dl
  je     L216
  mov    $0x0,%eax
  cmp    $0x4d,%dl
  je     L77
L293:
  movzbl (%rbx),%edx
  cmp    $0x5e,%dl
  je     L324
  movsbl %dl,%edx
  or     %edx,%eax
  add    $0x1,%rbx
  mov    %rbx,0x0(%rbp)
  lea    0x100(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
L289:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L216:
  movzbl 0x1(%rbx),%edx
  cmp    $0x78,%dl
  jg     L220
  cmp    $0x5b,%dl
  jle    L32
  sub    $0x5c,%edx
  cmp    $0x1c,%dl
  ja     L220
  movzbl %dl,%edx
  lea    D0(%rip),%rcx
  movslq (%rcx,%rdx,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
L32:
  mov    $0x20,%eax
  cmp    $0x20,%dl
  je     L18
  lea    -0x30(%rdx),%eax
  cmp    $0x7,%al
  jbe    L90
L220:
  sub    $0x1,%rbx
  mov    $0x5c,%eax
  jmp    L18
L90:
  movsbl %dl,%edx
  movzbl 0x2(%rbx),%eax
  lea    -0x30(%rax),%ecx
  cmp    $0x7,%cl
  jbe    L102
  lea    -0x30(%rdx),%eax
  jmp    L18
  mov    $0x5c,%eax
  jmp    L18
  mov    $0xc,%eax
L18:
  add    $0x2,%rbx
  mov    %rbx,0x0(%rbp)
  jmp    L289
  mov    $0xa,%eax
  jmp    L18
  mov    $0xd,%eax
  jmp    L18
  mov    $0x9,%eax
  jmp    L18
  movzbl 0x2(%rbx),%r12d
  movzbl 0x3(%rbx),%r13d
  movsbl %r12b,%r14d
  mov    %r14d,%edi
  call   <isxdigit@plt>
  mov    %eax,%edx
  mov    $0x78,%eax
  test   %edx,%edx
  je     L18
  mov    %r14d,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L207
  sub    $0x30,%r12d
L109:
  movsbl %r13b,%r14d
  mov    %r14d,%edi
  call   <isxdigit@plt>
  mov    %eax,%edx
  movsbl %r12b,%eax
  test   %edx,%edx
  je     L18
  mov    %r14d,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L71
  lea    -0x30(%r13),%eax
L398:
  movsbl %r12b,%r12d
  shl    $0x4,%r12d
  movsbl %al,%eax
  add    %r12d,%eax
  add    $0x1,%rbx
  jmp    L18
L207:
  mov    %r14d,%edi
  call   <isupper@plt>
  mov    %eax,%edx
  lea    -0x61(%r12),%eax
  sub    $0x41,%r12d
  test   %edx,%edx
  cmove  %eax,%r12d
  jmp    L109
L71:
  mov    %r14d,%edi
  call   <isupper@plt>
  mov    %eax,%edx
  lea    -0x61(%r13),%eax
  sub    $0x41,%r13d
  test   %edx,%edx
  cmovne %r13d,%eax
  jmp    L398
L102:
  movzbl 0x3(%rbx),%ecx
  lea    -0x30(%rcx),%esi
  cmp    $0x7,%sil
  ja     L348
  movsbl %al,%eax
  lea    -0x1b0(%rax,%rdx,8),%eax
  movsbl %cl,%ecx
  lea    -0x30(%rcx,%rax,8),%eax
  add    $0x2,%rbx
  jmp    L18
L348:
  movsbl %al,%eax
  lea    -0x1b0(%rax,%rdx,8),%eax
  add    $0x1,%rbx
  jmp    L18
  mov    $0x8,%eax
  jmp    L18
L77:
  cmpb   $0x2d,0x1(%rbx)
  je     L3
  add    $0x1,%rbx
  mov    %rbx,(%rdi)
  mov    $0x4d,%eax
  jmp    L289
L3:
  add    $0x2,%rbx
  mov    $0x8000,%eax
  jmp    L293
L324:
  cmpb   $0x5c,0x1(%rbx)
  sete   %dl
  movzbl %dl,%edx
  add    %rdx,%rbx
  movzbl 0x1(%rbx),%edx
  cmp    $0x3f,%dl
  je     L151
  lea    -0x40(%rdx),%ecx
  cmp    $0x1f,%cl
  ja     L182
  movsbl %dl,%edx
  sub    $0x40,%edx
  or     %edx,%eax
  jmp    L59
L151:
  add    $0x7f,%eax
L59:
  add    $0x2,%rbx
  mov    %rbx,0x0(%rbp)
  jmp    L289
L182:
  lea    -0x61(%rdx),%eax
  cmp    $0x19,%al
  ja     L20
  movsbl %dl,%edx
  lea    -0x60(%rdx),%eax
  jmp    L59
L20:
  mov    $0x5e,%eax
  test   %dl,%dl
  je     L59
  movsbl %dl,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L273
  mov    $0x5e,%eax
  jmp    L59
L273:
  mov    $0xffffffff,%eax
  jmp    L289
```

assistant: ```c
int string_to_char(char **ptr) {
  char *str;
  int i;
  char c1, c2;
  str = *ptr;
  if (str[0] == '\\') {
    switch (str[1]) {
    case ' ':
      i = ' ';
      break;
    case '\\':
      i = '\\';
      break;
    case 'b':
      i = '\b';
      break;
    case 'f':
      i = '\f';
      break;
    case 'n':
      i = '\n';
      break;
    case 'r':
      i = '\r';
      break;
    case 't':
      i = '\t';
      break;
    case 'x':
      c1 = str[2];
      c2 = str[3];
      if (isxdigit(c1)) {
        if (isdigit(c1))
          c1 -= '0';
        else if (isupper(c1))
          c1 -= 'A';
        else
          c1 -= 'a';
        if (isxdigit(c2)) {
          if (isdigit(c2))
            c2 -= '0';
          else if (isupper(c2))
            c2 -= 'A';
          else
            c2 -= 'a';
          i = c1 * 0x10 + c2;
          str++;
        } else
          i = c1;
      } else
        i = 'x';
      break;
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
      if (str[2] >= '0' && str[2] <= '7') {
        if (str[3] >= '0' && str[3] <= '7') {
          i = (str[1] - '0') * 0100 + (str[2] - '0') * 010 + (str[3] - '0');
          str += 2;
        } else {
          i = (str[1] - '0') * 010 + (str[2] - '0');
          str++;
        }
      } else
        i = str[1] - '0';
      break;
    default:
      i = str[0];
      --str;
      break;
    }
    str += 2;
    *ptr = str;
    return i;
  }
  if (str[0] == 'M' && str[1] == '-') {
    i = 0x8000;
    str += 2;
  } else
    i = 0;
  if (str[0] == '^') {
    if (str[1] == '\\')
      ++str;
    if (str[1] == '?')
      i += 0x7f;
    else if (str[1] >= '@' && str[1] <= '_')
      i |= str[1] - '@';
    else if (str[1] >= 'a' && str[1] <= 'z')
      i = str[1] - 'a' + 1;
    else if (str[1] == '\0' || isspace(str[1]))
      i = '^';
    else
      return -1;
    str += 2;
  } else {
    i |= str[0];
    str++;
  }
  *ptr = str;
  if (i < 0)
    i += 256;
  return i;
}
```