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

```asm
<unescape_string>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  lea    0x1(%rax),%rdi
  call   <malloc@plt>
  mov    %rax,%r8
  movzbl (%rbx),%eax
  mov    %r8,%rdx
  test   %al,%al
  je     L12
  lea    D1(%rip),%r9
  jmp    L127
  nopl   0x0(%rax)
L86:
  add    $0x1,%rbx
  mov    %al,(%rcx)
  movzbl (%rbx),%eax
  test   %al,%al
  je     L12
L127:
  mov    %rdx,%rcx
  add    $0x1,%rdx
  cmp    $0x5c,%al
  jne    L86
  movzbl 0x1(%rbx),%eax
  lea    0x2(%rbx),%rdi
  lea    -0x30(%rax),%esi
  cmp    $0x46,%sil
  ja     L174
  movzbl %sil,%esi
  movslq (%r9,%rsi,4),%rsi
  add    %r9,%rsi
  notrack jmp *%rsi
  mov    $0x8,%eax
  nopl   0x0(%rax)
L174:
  mov    %al,(%rcx)
  mov    %rdi,%rbx
L73:
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L127
L12:
  movb   $0x0,(%rdx)
  mov    %r8,%rax
  pop    %rbx
  ret
  nopl   0x0(%rax)
  movsbl 0x2(%rbx),%esi
  sub    $0x30,%eax
  movsbl %al,%eax
  lea    -0x30(%rsi),%r10d
  test   %sil,%sil
  je     L55
  movzbl 0x3(%rbx),%r11d
  sub    $0x30,%r11d
  cmp    $0x7,%r11b
  jbe    L160
L55:
  cmp    $0x7,%r10b
  ja     L174
  lea    -0x30(%rsi,%rax,8),%eax
  xor    %esi,%esi
L33:
  add    $0x1,%esi
  mov    %al,(%rcx)
  movslq %esi,%rsi
  add    %rsi,%rdi
  mov    %rdi,%rbx
  jmp    L73
  mov    $0xb,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L73
  mov    $0x9,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L73
  mov    $0xd,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L73
  mov    $0xa,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L73
  mov    $0xc,%eax
  mov    %rdi,%rbx
  mov    %al,(%rcx)
  jmp    L73
L160:
  lea    -0x30(%rsi,%rax,8),%eax
  cmp    $0x7,%r10b
  ja     L168
  movsbl 0x3(%rbx),%esi
  lea    -0x30(%rsi,%rax,8),%eax
  mov    $0x1,%esi
  jmp    L33
  mov    $0x7,%eax
  jmp    L174
L168:
  xor    %esi,%esi
  jmp    L33
```

assistant: ```c
char *unescape_string(const char *input) {
  char *result = (char *)malloc(strlen(input) + 1);
  char *p = result;
  while (*input) {
    if (*input != '\\') {
      *p = *input;
      p++;
      input++;
    } else {
      input++;
      switch (*input) {
      case '\"':
      case '\\':
      default:
        *p = *input++;
        break;
      case 'a':
        *p = '\a';
        input++;
        break;
      case 'b':
        *p = '\b';
        input++;
        break;
      case 'f':
        *p = '\f';
        input++;
        break;
      case 'n':
        *p = '\n';
        input++;
        break;
      case 'r':
        *p = '\r';
        input++;
        break;
      case 't':
        *p = '\t';
        input++;
        break;
      case 'v':
        *p = '\v';
        input++;
        break;
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7': {
        int digits = (input[1] && input[1] >= '0' && input[1] <= '7' ? 1 : 0) + (input[1] && input[2] && input[2] >= '0' && input[2] <= '7' ? 1 : 0);
        int result = *input++ - '0';
        while (digits--)
          result = result * 8 + *input++ - '0';
        *p = (char)result;
        break;
      }
      }
      p++;
    }
  }
  *p = 0;
  return result;
}
```