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

```asm
<scan_text>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %rdi,%rax
  mov    %fs:0x28,%rcx
  mov    %rcx,0x108(%rsp)
  xor    %ecx,%ecx
  movzbl (%rdi),%ecx
  cmp    $0x20,%cl
  je     L164
  cmp    $0x9,%cl
  jne    L20
L164:
  add    $0x1,%rax
  movzbl (%rax),%ecx
  cmp    $0x20,%cl
  je     L164
  cmp    $0x9,%cl
  je     L164
L20:
  cmp    $0x28,%cl
  je     L46
  movzbl (%rax),%ecx
  test   %cl,%cl
  je     L351
  cmp    $0xa,%cl
  setne  %r8b
  mov    %rsp,%rdi
  test   %r8b,%r8b
  jne    L347
L351:
  mov    $0x0,%ebx
  jmp    L348
L46:
  lea    0x1(%rax),%rcx
  mov    $0x1,%r9d
  mov    %rsp,%rdi
  lea    D4(%rip),%r10
  jmp    L176
L81:
  cmp    $0x5c,%dl
  jne    L395
  lea    0x2(%rcx),%r11
  movzbl 0x1(%rcx),%edx
  cmp    $0x74,%dl
  jg     L48
  cmp    $0x61,%dl
  jle    L350
  lea    -0x62(%rdx),%eax
  cmp    $0x12,%al
  ja     L48
  movzbl %al,%eax
  movslq (%r10,%rax,4),%rax
  add    %r10,%rax
  notrack jmp *%rax
L350:
  test   %dl,%dl
  je     L334
  lea    -0x30(%rdx),%eax
  cmp    $0x7,%al
  ja     L48
  movsbl %dl,%edx
  sub    $0x30,%edx
  movzbl 0x2(%rcx),%edi
  movsbl %dil,%eax
  sub    $0x30,%eax
  cmp    $0x7,%eax
  jbe    L171
L17:
  mov    %dl,-0x1(%r8)
  mov    %r11,%rax
  jmp    L395
  movb   $0xa,-0x1(%r8)
  mov    %r11,%rax
  jmp    L395
  movb   $0xd,-0x1(%r8)
  mov    %r11,%rax
  jmp    L395
  movb   $0x9,-0x1(%r8)
  mov    %r11,%rax
  jmp    L395
  movb   $0x8,-0x1(%r8)
  mov    %r11,%rax
  jmp    L395
  movb   $0xc,-0x1(%r8)
  mov    %r11,%rax
  jmp    L395
L171:
  movsbl %dil,%edi
  lea    -0x30(%rdi,%rdx,8),%edx
  movzbl 0x3(%rcx),%edi
  movsbl %dil,%eax
  sub    $0x30,%eax
  lea    0x3(%rcx),%r11
  cmp    $0x7,%eax
  ja     L17
  movsbl %dil,%edi
  lea    -0x30(%rdi,%rdx,8),%edx
  lea    0x4(%rcx),%r11
  jmp    L17
L48:
  mov    %dl,-0x1(%r8)
  mov    %r11,%rax
  jmp    L395
L2:
  sub    $0x1,%r9d
  je     L334
L395:
  mov    %r8,%rdi
  mov    %rax,%rcx
L176:
  lea    0x1(%rcx),%rax
  lea    0x1(%rdi),%r8
  movzbl (%rcx),%edx
  mov    %dl,-0x1(%r8)
  cmp    $0x29,%dl
  je     L2
  jg     L81
  test   %dl,%dl
  je     L334
  cmp    $0x28,%dl
  jne    L395
  add    $0x1,%r9d
  jmp    L395
L199:
  add    $0x1,%rax
  add    $0x1,%rdi
  mov    %cl,-0x1(%rdi)
  movzbl (%rax),%ecx
  test   %cl,%cl
  je     L375
  cmp    $0xa,%cl
  je     L375
L347:
  test   %edx,%edx
  jne    L199
  cmp    $0x20,%cl
  je     L375
  cmp    $0x9,%cl
  jne    L199
L375:
  mov    %rsp,%rdx
  cmp    %rdx,%rdi
  je     L161
L334:
  movb   $0x0,(%rdi)
  test   %rsi,%rsi
  je     L128
  mov    %rax,(%rsi)
L128:
  mov    %rsp,%rbp
  sub    %rbp,%rdi
  add    $0x1,%edi
  call   <dsc_malloc@plt>
  mov    %rax,%rbx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L348:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L210
  mov    %rbx,%rax
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  ret
L161:
  mov    $0x0,%ebx
  jmp    L348
L210:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
const char *scan_text(const char *line, const char **endp, int rest) {
  char buf[258];
  const char *lp = line;
  char *bp = buf;
  char *arg;
  while (*lp == ' ' || *lp == '\t')
    lp++;
  if (*lp == '(') {
    int level = 1;
    lp++;
    for (;;)
      switch (*bp++ = *lp++) {
      case '\\':
        switch (*lp++) {
        case 'n':
          bp[-1] = '\n';
          break;
        case 'r':
          bp[-1] = '\r';
          break;
        case 't':
          bp[-1] = '\t';
          break;
        case 'b':
          bp[-1] = '\b';
          break;
        case 'f':
          bp[-1] = '\f';
          break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7': {
          int c = lp[-1] - '0';
          int d = *lp;
          if (d >= '0' && d <= '7') {
            c = (c << 3) + d - '0';
            d = *++lp;
            if (d >= '0' && d <= '7') {
              c = (c << 3) + d - '0';
              lp++;
            }
          }
          bp[-1] = c;
          break;
        }
        case 0:
          lp--;
          goto out;
        default:
          bp[-1] = lp[-1];
        }
        break;
      case '(':
        ++level;
        break;
      case ')':
        if (--level)
          break;
      case 0:
        goto out;
      default:;
      }
  out:
    --bp;
  } else {
    while (!(*lp == 0 || *lp == '\n' || (!rest && (*lp == ' ' || *lp == '\t'))))
      *bp++ = *lp++;
    if (bp == buf)
      return NULL;
  }
  *bp = 0;
  if (endp)
    *endp = lp;
  arg = dsc_malloc(bp - buf + 1);
  strcpy(arg, buf);
  return arg;
}
```