user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<read_chat>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%rbx
  test   %rbx,%rbx
  je     L232
  mov    %rdi,%r12
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  jle    L344
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L204
  mov    %ebp,%eax
  shr    $0x1f,%eax
  add    %ebp,%eax
  sar    %eax
  lea    0x8(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,(%rsp)
  test   %rax,%rax
  je     L204
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  mov    %r14,%rdi
  lea    D14(%rip),%rsi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L30
  mov    $0x1,%r13d
  lea    D10(%rip),%r15
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  jmp    L313
L106:
  lea    0x1(%rax),%rdx
  mov    %rdx,0x10(%rsp)
  movzbl 0x1(%rax),%edx
  test   %dl,%dl
  je     L24
  lea    -0x30(%rdx),%ecx
  cmp    $0x48,%cl
  ja     L86
  ja     L86
  movzbl %cl,%ecx
  movslq (%r15,%rcx,4),%rcx
  add    %r15,%rcx
  notrack jmp *%rcx
  movb   $0x7,(%rbx)
  lea    0x1(%rbx),%rbx
L324:
  addq   $0x1,0x10(%rsp)
  cmpb   $0x0,(%rbx)
  je     L128
L283:
  mov    0x10(%rsp),%rax
  movzbl (%rax),%edx
  cmp    $0x5c,%dl
  je     L106
  mov    %dl,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  movb   $0xd,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  movb   $0xa,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  movb   $0xc,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  movb   $0x8,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  movb   $0x1b,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  movb   $0x9,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  movb   $0xff,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  movb   $0x20,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
  add    $0x2,%rax
  mov    %rax,0x10(%rsp)
  mov    $0x2,%edx
  mov    $0x10,%esi
  mov    0x8(%rsp),%rdi
  call   <getdigit@plt>
  mov    %al,(%rbx)
  subq   $0x1,0x10(%rsp)
  lea    0x1(%rbx),%rbx
  jmp    L324
  add    $0x2,%rax
  mov    %rax,0x10(%rsp)
  mov    $0x3,%edx
  mov    $0x8,%esi
  mov    0x8(%rsp),%rdi
  call   <getdigit@plt>
  mov    %al,(%rbx)
  subq   $0x1,0x10(%rsp)
  lea    0x1(%rbx),%rbx
  jmp    L324
L86:
  mov    %dl,(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L324
L24:
  mov    %rax,0x10(%rsp)
  jmp    L324
L128:
  movzbl 0x0(%rbp),%esi
  cmp    $0x22,%sil
  je     L337
  cmp    $0x27,%sil
  je     L337
L5:
  mov    %r13d,%ebx
  mov    (%rsp),%rax
  mov    %rbp,-0x8(%rax,%r13,8)
  lea    D14(%rip),%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rbp
  add    $0x1,%r13
  test   %rax,%rax
  je     L238
L313:
  mov    %rbp,0x10(%rsp)
  cmpb   $0x0,0x0(%rbp)
  je     L128
  mov    %rbp,%rbx
  jmp    L283
L337:
  lea    0x1(%rbp),%rbx
  movsbl %sil,%esi
  mov    %rbx,%rdi
  call   <strrchr@plt>
  mov    %rax,0x10(%rsp)
  test   %rax,%rax
  je     L5
  movzbl (%rax),%ecx
  movsbl 0x0(%rbp),%edx
  cmp    %edx,%ecx
  jne    L5
  cmpb   $0x0,0x1(%rax)
  jne    L5
  movb   $0x0,(%rax)
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  jmp    L5
L30:
  mov    $0x0,%ebx
L238:
  movslq %ebx,%rbx
  mov    (%rsp),%rax
  movq   $0x0,(%rax,%rbx,8)
  mov    %r14,(%r12)
  mov    %rax,%rbx
  jmp    L232
L344:
  mov    $0x0,%r14d
L204:
  mov    %r14,%rdi
  call   <free@plt>
  mov    $0x0,%ebx
L232:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L118
  mov    %rbx,%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L118:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char **read_chat(char **chatstr) {
  char *str = *chatstr;
  char **res = NULL;
  if (str != NULL) {
    char *tmp = NULL;
    int l;
    if ((l = strlen(str)) > 0 && (tmp = malloc(l + 1)) != NULL && (res = malloc((l / 2 + 1) * sizeof(char *))) != NULL) {
      static char ws[] = " \t";
      char *p;
      for (l = 0, p = strtok(strcpy(tmp, str), ws); p != NULL; p = strtok(NULL, ws)) {
        unsigned char *q, *r;
        for (q = r = (unsigned char *)p; *r; ++q) {
          if (*q == '\\') {
            switch (*++q) {
            case 'a':
              *r++ = '\a';
              break;
            case 'r':
              *r++ = '\r';
              break;
            case 'n':
              *r++ = '\n';
              break;
            case 'f':
              *r++ = '\f';
              break;
            case 'b':
              *r++ = '\b';
              break;
            case 'e':
              *r++ = 27;
              break;
            case 't':
              *r++ = '\t';
              break;
            case 'p':
              *r++ = (unsigned char)'\xff';
              break;
            case 's':
            case 'S':
              *r++ = ' ';
              break;
            case 'x':
              ++q;
              *r++ = getdigit(&q, 16, 2);
              --q;
              break;
            case '0':
              ++q;
              *r++ = getdigit(&q, 8, 3);
              --q;
              break;
            default:
              *r++ = *q;
              break;
            case 0:
              --q;
              break;
            }
          } else {
            *r++ = *q;
          }
        }
        if (*p == '"' || *p == '\'') {
          q = strrchr(p + 1, *p);
          if (q != NULL && *q == *p && q[1] == '\0') {
            *q = '\0';
            strcpy(p, p + 1);
          }
        }
        res[l++] = p;
      }
      res[l] = NULL;
      *chatstr = tmp;
      return res;
    }
    free(tmp);
  }
  return res;
}
```