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

```asm
<str2argv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movb   $0x0,-0x16(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  mov    $0x0,%eax
  call   <argv_init@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L315
L113:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  movsbl -0x15(%rbp),%eax
  cmp    $0x5c,%eax
  je     L263
  cmp    $0x5c,%eax
  jg     L300
  cmp    $0x27,%eax
  je     L316
  cmp    $0x27,%eax
  jg     L300
  cmp    $0x22,%eax
  je     L316
  cmp    $0x22,%eax
  jg     L300
  cmp    $0xa,%eax
  jg     L349
  cmp    $0x9,%eax
  jge    L64
  jmp    L300
L349:
  cmp    $0x20,%eax
  jne    L300
L64:
  cmpl   $0x0,-0x14(%rbp)
  je     L10
  cmpl   $0x0,-0x10(%rbp)
  je     L179
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <argv_token_addch@plt>
  jmp    L348
L179:
  cmpl   $0x0,-0xc(%rbp)
  je     L21
  movl   $0x0,-0xc(%rbp)
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <argv_token_addch@plt>
  jmp    L348
L21:
  movl   $0x0,-0x14(%rbp)
  mov    $0x0,%eax
  call   <argv_token_finish@plt>
  jmp    L348
L316:
  cmpl   $0x0,-0xc(%rbp)
  je     L126
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <argv_token_addch@plt>
  movl   $0x0,-0xc(%rbp)
  jmp    L348
L126:
  cmpl   $0x0,-0x14(%rbp)
  jne    L95
  movl   $0x1,-0x14(%rbp)
  movl   $0x1,-0x10(%rbp)
  movzbl -0x15(%rbp),%eax
  mov    %al,-0x16(%rbp)
  jmp    L348
L95:
  cmpl   $0x0,-0x10(%rbp)
  je     L171
  movzbl -0x15(%rbp),%eax
  cmp    -0x16(%rbp),%al
  jne    L345
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    $0x0,%eax
  call   <argv_token_finish@plt>
  jmp    L348
L345:
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <argv_token_addch@plt>
  jmp    L348
L171:
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L348
L263:
  cmpl   $0x0,-0x10(%rbp)
  je     L63
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x16(%rbp)
  je     L63
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <argv_token_addch@plt>
  jmp    L348
L63:
  cmpl   $0x0,-0xc(%rbp)
  je     L265
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <argv_token_addch@plt>
  jmp    L348
L265:
  movl   $0x1,-0xc(%rbp)
  jmp    L348
L300:
  cmpl   $0x0,-0x14(%rbp)
  jne    L99
  movl   $0x1,-0x14(%rbp)
L99:
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <argv_token_addch@plt>
  jmp    L348
L10:
  nop
L348:
  addl   $0x1,-0x8(%rbp)
L315:
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L113
  cmpl   $0x0,-0x10(%rbp)
  je     L368
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L368:
  cmpl   $0x0,-0xc(%rbp)
  je     L361
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L361:
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D10
type: string
name: unpack_data
arguments: data_tag: D2
type: string
name: unpack_data
arguments: data_tag: D1
type: string

tool: D10: Parse Error! Bad quotes


tool: D2: Parse Error! Still in container


tool: D1: Parse Error! Unused escape (\)


assistant: ```c
void str2argv(char *s) {
  bool in_token;
  bool in_container;
  bool escaped;
  char container_start;
  char c;
  int len;
  int i;
  container_start = 0;
  in_token = false;
  in_container = false;
  escaped = false;
  len = strlen(s);
  argv_init();
  for (i = 0; i < len; i++) {
    c = s[i];
    switch (c) {
    case ' ':
    case '\t':
    case '\n':
      if (!in_token)
        continue;
      if (in_container) {
        argv_token_addch(c);
        continue;
      }
      if (escaped) {
        escaped = false;
        argv_token_addch(c);
        continue;
      }
      in_token = false;
      argv_token_finish();
      break;
    case '\'':
    case '\"':
      if (escaped) {
        argv_token_addch(c);
        escaped = false;
        continue;
      }
      if (!in_token) {
        in_token = true;
        in_container = true;
        container_start = c;
        continue;
      }
      if (in_container) {
        if (c == container_start) {
          in_container = false;
          in_token = false;
          argv_token_finish();
          continue;
        } else {
          argv_token_addch(c);
          continue;
        }
      }
      printf("Parse Error! Bad quotes\n");
      break;
    case '\\':
      if (in_container && s[i + 1] != container_start) {
        argv_token_addch(c);
        continue;
      }
      if (escaped) {
        argv_token_addch(c);
        continue;
      }
      escaped = true;
      break;
    default:
      if (!in_token) {
        in_token = true;
      }
      argv_token_addch(c);
    }
  }
  if (in_container)
    printf("Parse Error! Still in container\n");
  if (escaped)
    printf("Parse Error! Unused escape (\\)\n");
}
```