user: 请从给定的汇编指令推导出C源代码:

```asm
<text_area_process_string>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %esi,%ebp
  mov    %edx,%r12d
  test   %rdi,%rdi
  je     L144
L266:
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x2(%rax),%rdi
  call   <xmalloc@plt>
  mov    %rax,%rbx
  mov    %r13,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  movzbl (%rbx),%edx
  test   %dl,%dl
  je     L81
  mov    %rbx,%rax
  jmp    L57
L144:
  cmpb   $0x0,0x0
  jne    L266
  lea    D0(%rip),%rdi
  call   <xstrdup@plt>
  mov    %rax,%rbx
  jmp    L256
L91:
  movzbl %dl,%ecx
  cmp    %ebp,%ecx
  je     L306
  cmp    $0x7f,%dl
  je     L96
L180:
  add    $0x1,%rax
  movzbl (%rax),%edx
  test   %dl,%dl
  je     L39
L57:
  cmp    $0x1f,%dl
  ja     L91
  cmp    $0xa,%dl
  je     L91
  movb   $0x20,(%rax)
  jmp    L180
L306:
  mov    %r12b,(%rax)
  jmp    L180
L96:
  movb   $0x20,(%rax)
  jmp    L180
L39:
  cmp    %rax,%rbx
  jae    L299
L92:
  cmpb   $0x20,-0x1(%rax)
  jne    L330
  sub    $0x1,%rax
  cmp    %rax,%rbx
  jne    L92
  movb   $0x0,(%rax)
  mov    %rax,%rbx
  jmp    L256
L330:
  movb   $0x0,(%rax)
  cmp    %rax,%rbx
  je     L217
  jae    L29
  cmpb   $0xa,-0x1(%rax)
  je     L29
  movb   $0xa,(%rax)
  movb   $0x0,0x1(%rax)
L29:
  movzbl (%rbx),%edx
  mov    %rbx,%rsi
  mov    %rbx,%rcx
  mov    %rbx,%rax
  test   %dl,%dl
  jne    L287
  jmp    L164
L187:
  mov    %rax,%rcx
L287:
  lea    0x1(%rcx),%rax
  mov    %dl,(%rcx)
  add    $0x1,%rsi
  movzbl (%rsi),%edx
  test   %dl,%dl
  je     L188
  cmp    %rax,%rbx
  jae    L187
  cmp    $0xa,%dl
  jne    L187
L239:
  cmpb   $0x20,-0x1(%rax)
  jne    L187
  sub    $0x1,%rax
  cmp    %rax,%rbx
  jb     L239
  jmp    L187
L188:
  movb   $0x0,0x1(%rcx)
  cmp    %rax,%rbx
  jae    L164
L291:
  cmpb   $0xa,-0x1(%rax)
  jne    L23
  sub    $0x1,%rax
  cmp    %rax,%rbx
  jne    L291
L164:
  mov    %rax,%rdx
  jmp    L258
L23:
  cmp    %rax,%rbx
  jae    L55
  lea    0x1(%rax),%rdx
  movb   $0xa,(%rax)
L258:
  movb   $0x0,(%rdx)
L256:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L55:
  mov    %rax,%rdx
  jmp    L258
L217:
  mov    %rax,%rbx
  jmp    L256
L81:
  movb   $0x0,(%rbx)
  jmp    L256
L299:
  movb   $0x0,(%rax)
  jne    L29
  mov    %rax,%rbx
  jmp    L256
```

tool_calls: name: parse_data
arguments: data_label: D0
datatype: string

tool: 

assistant: ```c
unsigned char *text_area_process_string(const unsigned char *s, int sep, int sep_repl) {
  unsigned char *p, *q, *out;
  if (!s && !*s)
    return xstrdup("");
  out = (unsigned char *)xmalloc(strlen(s) + 2);
  strcpy(out, s);
  for (p = out; *p; p++) {
    if (*p < ' ' && *p != '\n')
      *p = ' ';
    else if (*p == sep)
      *p = sep_repl;
    else if (*p == 127)
      *p = ' ';
  }
  while (p > out && p[-1] == ' ')
    p--;
  *p = 0;
  if (p == out)
    return out;
  if (p > out && p[-1] != '\n') {
    *p++ = '\n';
    *p = 0;
  }
  for (p = q = out; *p; p++) {
    while (*p == '\n' && q > out && q[-1] == ' ')
      q--;
    *q++ = *p;
  }
  *q = 0;
  while (q > out && q[-1] == '\n')
    q--;
  if (q > out)
    *q++ = '\n';
  *q = 0;
  return out;
}
```