user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<split_cmdline>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %rsi,(%rsp)
  mov    $0x80,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    %r12,(%rax)
  movzbl (%r12),%ebx
  test   %bl,%bl
  je     L13
  mov    $0x0,%r13d
  movl   $0x10,0x8(%rsp)
  mov    $0x1,%r15d
  mov    $0x0,%r14d
  mov    $0x0,%ebp
  jmp    L127
L95:
  movsbl %bl,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L202
  cmp    $0x27,%bl
  je     L102
  cmp    $0x22,%bl
  jne    L3
L102:
  add    $0x1,%ebp
  mov    %ebx,%r13d
  jmp    L194
L202:
  lea    0x1(%r14),%eax
  mov    %eax,0xc(%rsp)
  movslq %r14d,%r14
  movb   $0x0,(%r12,%r14,1)
  lea    0x1(%rbp),%ebx
  movslq %ebx,%rbx
L87:
  mov    %ebx,%ebp
  movzbl (%r12,%rbx,1),%edi
  test   %dil,%dil
  je     L116
  movsbl %dil,%edi
  call   <isspace@plt>
  add    $0x1,%rbx
  test   %rax,%rax
  jne    L87
L116:
  cmp    0x8(%rsp),%r15d
  jge    L73
L152:
  movslq %r15d,%rcx
  mov    (%rsp),%rax
  mov    (%rax),%rdx
  mov    0xc(%rsp),%r14d
  movslq %r14d,%rax
  add    %r12,%rax
  mov    %rax,(%rdx,%rcx,8)
  lea    0x1(%r15),%r15d
  jmp    L194
L73:
  addl   $0x10,0x8(%rsp)
  mov    0x8(%rsp),%eax
  lea    0x0(,%rax,8),%esi
  mov    (%rsp),%rbx
  mov    (%rbx),%rdi
  call   <realloc@plt>
  mov    %rax,(%rbx)
  jmp    L152
L8:
  add    $0x1,%ebp
  mov    $0x0,%r13d
  jmp    L194
L85:
  movslq %r14d,%rax
  mov    %bl,(%r12,%rax,1)
  add    $0x1,%ebp
  lea    0x1(%r14),%r14d
L194:
  movslq %ebp,%rax
  movzbl (%r12,%rax,1),%ebx
  test   %bl,%bl
  je     L58
L127:
  test   %r13b,%r13b
  je     L95
L3:
  cmp    %r13b,%bl
  je     L8
  cmp    $0x5c,%bl
  jne    L85
  cmp    $0x27,%r13b
  je     L85
  add    $0x1,%ebp
  movslq %ebp,%rax
  movzbl (%r12,%rax,1),%ebx
  test   %bl,%bl
  jne    L85
  mov    (%rsp),%rdi
  call   <zfree@plt>
  lea    D12(%rip),%rdi
  call   <error@plt>
  mov    %eax,%r15d
  jmp    L80
L58:
  movslq %r14d,%r14
  movb   $0x0,(%r12,%r14,1)
  test   %r13b,%r13b
  jne    L173
L80:
  mov    %r15d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L173:
  mov    (%rsp),%rdi
  call   <zfree@plt>
  lea    D1(%rip),%rdi
  call   <error@plt>
  mov    %eax,%r15d
  jmp    L80
L13:
  mov    $0x1,%r15d
  jmp    L80
```

tool_calls: name: parse_data
arguments: data_label: D12
type: string
name: parse_data
arguments: data_label: D1
type: string

tool: D12: cmdline ends with \

tool: D1: unclosed quote

assistant: ```c
int split_cmdline(char *cmdline, const char ***argv) {
  int src, dst, count = 0, size = 16;
  char quoted = 0;
  *argv = malloc(sizeof(char *) * size);
  (*argv)[count++] = cmdline;
  for (src = dst = 0; cmdline[src];) {
    char c = cmdline[src];
    if (!quoted && isspace(c)) {
      cmdline[dst++] = 0;
      while (cmdline[++src] && isspace(cmdline[src]))
        ;
      if (count >= size) {
        size += 16;
        *argv = realloc(*argv, sizeof(char *) * size);
      }
      (*argv)[count++] = cmdline + dst;
    } else if (!quoted && (c == '\'' || c == '"')) {
      quoted = c;
      src++;
    } else if (c == quoted) {
      quoted = 0;
      src++;
    } else {
      if (c == '\\' && quoted != '\'') {
        src++;
        c = cmdline[src];
        if (!c) {
          zfree(argv);
          return error("cmdline ends with \\");
        }
      }
      cmdline[dst++] = c;
      src++;
    }
  }
  cmdline[dst] = 0;
  if (quoted) {
    zfree(argv);
    return error("unclosed quote");
  }
  return count;
}
```