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

```asm
<buildargv>:
  endbr64
  push   %r15
  lea    -0x1(%rdx),%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %eax,0x4(%rsp)
  test   %eax,%eax
  jle    L175
  mov    %rsi,%rbp
  mov    %rdi,%r15
  xor    %r12d,%r12d
  nop
L145:
  mov    %rdi,%rbx
  jmp    L136
  nopl   (%rax)
L187:
  add    $0x1,%rbx
L136:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L187
  cmpb   $0x0,(%rbx)
  je     L14
  mov    %rbx,0x0(%rbp)
  movsbl (%rbx),%edi
  add    $0x1,%r12d
  test   %dil,%dil
  je     L94
  mov    %rbx,%r15
  xor    %edx,%edx
  xor    %r13d,%r13d
  xor    %r14d,%r14d
  jmp    L33
  nopl   0x0(%rax,%rax,1)
L226:
  mov    %dil,(%rbx)
  xor    %edx,%edx
  add    $0x1,%rbx
L31:
  movsbl 0x1(%r15),%edi
  add    $0x1,%r15
  test   %dil,%dil
  je     L94
L33:
  test   %edx,%edx
  jne    L226
  cmp    $0x5c,%dil
  je     L26
  test   %r14d,%r14d
  je     L253
  cmp    $0x27,%dil
  je     L88
L72:
  add    $0x1,%r15
  mov    %dil,(%rbx)
  add    $0x1,%rbx
  movsbl (%r15),%edi
  test   %dil,%dil
  jne    L33
L94:
  mov    %rbx,%r15
L14:
  mov    0x8(%rsp),%rcx
  movslq %r12d,%rax
  movb   $0x0,(%r15)
  movq   $0x0,(%rcx,%rax,8)
L137:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L26:
  mov    $0x1,%edx
  jmp    L31
  nopw   0x0(%rax,%rax,1)
L253:
  test   %r13d,%r13d
  je     L142
  cmp    $0x22,%dil
  jne    L72
  xor    %r13d,%r13d
  jmp    L31
  nopl   0x0(%rax,%rax,1)
L88:
  xor    %r14d,%r14d
  jmp    L31
L142:
  mov    %edx,(%rsp)
  call   <isspace@plt>
  test   %rax,%rax
  jne    L9
  movzbl (%r15),%eax
  mov    (%rsp),%edx
  cmp    $0x27,%al
  je     L28
  cmp    $0x22,%al
  je     L5
  mov    %al,(%rbx)
  add    $0x1,%rbx
  jmp    L31
L9:
  cmpb   $0x0,(%r15)
  lea    0x1(%r15),%rdi
  je     L94
  movb   $0x0,(%rbx)
  add    $0x8,%rbp
  cmp    0x4(%rsp),%r12d
  je     L175
  mov    %rbx,%r15
  jmp    L145
  nopl   0x0(%rax,%rax,1)
L28:
  mov    $0x1,%r14d
  jmp    L31
  nopl   0x0(%rax,%rax,1)
L5:
  mov    $0x1,%r13d
  jmp    L31
L175:
  mov    D6(%rip),%rax
  mov    $0xffffffff,%r12d
  mov    (%rax),%edx
  mov    D8(%rip),%rax
  mov    %edx,(%rax)
  jmp    L137
```

assistant: ```c
int buildargv(char *s, char *argv[], int maxargc) {
  bool squote = false;
  bool dquote = false;
  bool bsquote = false;
  char *arg = s;
  int argc = 0;
  for (;;) {
    if (argc >= maxargc - 1) {
      errno = E2BIG;
      return -1;
    }
    while (isspace((int)*s))
      s++;
    if (!*s)
      break;
    arg = s;
    argv[argc++] = arg;
    while (*s) {
      if (bsquote) {
        *arg++ = *s;
        bsquote = false;
      } else if (*s == '\\') {
        bsquote = true;
      } else if (squote) {
        if (*s == '\'')
          squote = false;
        else
          *arg++ = *s;
      } else if (dquote) {
        if (*s == '"')
          dquote = false;
        else
          *arg++ = *s;
      } else {
        if (isspace((int)*s))
          break;
        if (*s == '\'')
          squote = true;
        else if (*s == '"')
          dquote = true;
        else
          *arg++ = *s;
      }
      s++;
    }
    if (!*s++)
      break;
    *arg = 0;
  }
  *arg = 0;
  argv[argc] = NULL;
  return argc;
}
```