user: Converte this assembly snippet into its equivalent C code:

```asm
<split_cmdline>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    $0x80,%edi
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x28,%rsp
  mov    %rsi,0x18(%rsp)
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    %r12,(%rax)
  movzbl (%r12),%ebx
  test   %bl,%bl
  je     L133
  movl   $0x10,0x14(%rsp)
  xor    %r13d,%r13d
  xor    %ecx,%ecx
  xor    %r14d,%r14d
  movl   $0x1,0x10(%rsp)
  jmp    L189
  nopl   0x0(%rax)
L21:
  cmp    %bl,%r13b
  jne    L176
  mov    %ebp,%r14d
  xor    %r13d,%r13d
L174:
  movzbl (%r15),%ebx
  test   %bl,%bl
  je     L17
L189:
  lea    0x1(%r14),%ebp
  movslq %ebp,%rdx
  lea    (%r12,%rdx,1),%r15
  test   %r13b,%r13b
  jne    L21
  movsbl %bl,%edi
  mov    %ecx,0xc(%rsp)
  call   <isspace@plt>
  mov    0xc(%rsp),%ecx
  test   %rax,%rax
  jne    L192
  cmp    $0x27,%bl
  je     L186
  cmp    $0x22,%bl
  je     L186
L176:
  cmp    $0x5c,%bl
  jne    L78
  cmp    $0x27,%r13b
  je     L78
  movzbl (%r15),%ebx
  test   %bl,%bl
  je     L134
  add    $0x1,%ebp
L78:
  movslq %ebp,%rdx
  movslq %ecx,%rax
  add    $0x1,%ecx
  lea    (%r12,%rdx,1),%r15
  mov    %bl,(%r12,%rax,1)
  mov    %rdx,%r14
  movzbl (%r15),%ebx
  test   %bl,%bl
  jne    L189
L17:
  movslq %ecx,%rsi
  movb   $0x0,(%r12,%rsi,1)
  test   %r13b,%r13b
  jne    L34
L108:
  mov    0x10(%rsp),%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L186:
  mov    %ebx,%r13d
  mov    %ebp,%r14d
  jmp    L174
  nopl   0x0(%rax,%rax,1)
L192:
  lea    0x1(%rcx),%eax
  movslq %ecx,%rsi
  movslq %r14d,%rcx
  lea    0x1(%r12,%rcx,1),%rbx
  mov    %eax,0xc(%rsp)
  movb   $0x0,(%r12,%rsi,1)
  sub    %ebx,%ebp
  jmp    L87
  nopl   0x0(%rax,%rax,1)
L66:
  call   <isspace@plt>
  add    $0x1,%rbx
  test   %rax,%rax
  je     L97
L87:
  movsbl (%rbx),%edi
  lea    0x0(%rbp,%rbx,1),%r14d
  mov    %rbx,%r15
  test   %dil,%dil
  jne    L66
L97:
  mov    0x18(%rsp),%rax
  mov    0x10(%rsp),%esi
  mov    (%rax),%rdi
  cmp    %esi,0x14(%rsp)
  jle    L9
L127:
  movslq 0xc(%rsp),%rcx
  movslq 0x10(%rsp),%rax
  mov    %rcx,%rdx
  add    %r12,%rcx
  mov    %rcx,(%rdi,%rax,8)
  lea    0x1(%rax),%eax
  mov    %edx,%ecx
  mov    %eax,0x10(%rsp)
  jmp    L174
  nopw   0x0(%rax,%rax,1)
L9:
  addl   $0x10,0x14(%rsp)
  mov    0x14(%rsp),%eax
  lea    0x0(,%rax,8),%esi
  call   <realloc@plt>
  mov    %rax,%rdi
  mov    0x18(%rsp),%rax
  mov    %rdi,(%rax)
  jmp    L127
  nopw   0x0(%rax,%rax,1)
L134:
  mov    0x18(%rsp),%rdi
  call   <zfree@plt>
  lea    D1(%rip),%rdi
L165:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10c0 <error@plt>
  nopl   0x0(%rax)
L34:
  mov    0x18(%rsp),%rdi
  call   <zfree@plt>
  lea    D16(%rip),%rdi
  jmp    L165
L133:
  movl   $0x1,0x10(%rsp)
  jmp    L108
```

tool_calls: name: retrieve_data
arguments: label: D1
type_guessed: string
name: retrieve_data
arguments: label: D16
type_guessed: string

tool: D1: cmdline ends with \

tool: D16: 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;
}
```