user: Please show me the C implementation that matches the assembly code listed below:

```asm
<gen_argv_from_string>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r15
  mov    %rdx,(%rsp)
  movl   $0x0,(%rsi)
  movq   $0x0,(%rdx)
  mov    $0x0,%r13d
  mov    $0x1,%r12d
  mov    $0x0,%ebx
  mov    $0x0,%eax
  jmp    L69
L264:
  cmp    $0xa,%dl
  jne    L223
  mov    %r13d,%r14d
  mov    $0x1,%r12d
L96:
  cmp    %ebx,%eax
  jne    L2
L36:
  lea    0x1(%rbx),%eax
L111:
  add    $0x1,%ebx
  test   %r14d,%r14d
  jne    L266
L69:
  test   %r13d,%r13d
  jne    L214
  movslq %ebx,%rdx
  cmpb   $0x5c,0x0(%rbp,%rdx,1)
  je     L112
  test   %r12d,%r12d
  jne    L85
L199:
  movslq %ebx,%rdx
  movzbl 0x0(%rbp,%rdx,1),%edx
  lea    -0x9(%rdx),%ecx
  cmp    $0x1,%cl
  jbe    L264
  cmp    $0x20,%dl
  je     L264
  jmp    L256
L223:
  test   %dl,%dl
  sete   %r14b
  movzbl %r14b,%r14d
  jmp    L96
L208:
  mov    $0x1,%r14d
  jmp    L96
L114:
  mov    %r13d,%r14d
  jmp    L96
L2:
  mov    %ebx,%esi
  sub    %eax,%esi
  cltq
  lea    0x0(%rbp,%rax,1),%rdi
  call   <strndup@plt>
  mov    $0x1,%edx
  mov    $0x5c,%esi
  mov    %rax,0x8(%rsp)
  mov    %rax,%rdi
  call   <strip_char@plt>
  mov    (%r15),%eax
  lea    0x8(,%rax,8),%esi
  mov    (%rsp),%rax
  mov    (%rax),%rdi
  call   <realloc@plt>
  mov    (%rsp),%rcx
  mov    %rax,(%rcx)
  mov    (%r15),%edx
  lea    0x1(%rdx),%ecx
  mov    %ecx,(%r15)
  movslq %edx,%rdx
  mov    0x8(%rsp),%rdi
  mov    %rdi,(%rax,%rdx,8)
  jmp    L36
L112:
  mov    %r13d,%r14d
  mov    %r13d,%r12d
  mov    $0x1,%r13d
  jmp    L111
L197:
  mov    %r12d,%r14d
  mov    %r12d,%r13d
  jmp    L111
L214:
  test   %r12d,%r12d
  jne    L101
  movslq %ebx,%rdx
  cmpb   $0x0,0x0(%rbp,%rdx,1)
  je     L114
  mov    %r12d,%r14d
  mov    %r12d,%r13d
  jmp    L111
L85:
  movslq %ebx,%rdx
  cmpb   $0x23,0x0(%rbp,%rdx,1)
  jne    L199
L167:
  lea    0x1(%rbx),%eax
  cltq
L34:
  mov    %eax,%ebx
  movzbl 0x0(%rbp,%rax,1),%edx
  add    $0x1,%rax
  test   %dl,%dl
  je     L16
  cmp    $0xa,%dl
  jne    L34
L16:
  mov    %ebx,%eax
  mov    $0x0,%r12d
  jmp    L69
L101:
  movslq %ebx,%rdx
  cmpb   $0x23,0x0(%rbp,%rdx,1)
  je     L167
L256:
  movslq %ebx,%rdx
  movzbl 0x0(%rbp,%rdx,1),%edx
  test   %dl,%dl
  je     L208
  test   %r12d,%r12d
  je     L197
  lea    -0x9(%rdx),%ecx
  cmp    $0x1,%cl
  seta   %r12b
  cmp    $0x20,%dl
  setne  %dl
  and    %edx,%r12d
  xor    $0x1,%r12d
  movzbl %r12b,%r12d
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  jmp    L111
L266:
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int gen_argv_from_string(const char *str, int *argc, char ***argv) {
  int i = 0, k = 0, n = 1, esc = 0, end = 0;
  char *tmp;
  *argc = 0;
  *argv = NULL;
  while (!end) {
    if (!esc && str[k] == '\\') {
      esc = 1;
      n = 0;
    } else if (n && str[k] == '#') {
      while (str[k] != '\0' && str[k] != '\n')
        ++k;
      i = k;
      n = 0;
      continue;
    } else if ((!esc && (str[k] == ' ' || str[k] == '\t' || str[k] == '\n')) || str[k] == '\0') {
      if (str[k] == '\n')
        n = 1;
      else if (str[k] == '\0')
        end = 1;
      if (i != k) {
        tmp = strndup(&str[i], k - i);
        strip_char(tmp, '\\', 1);
        *argv = realloc(*argv, (*argc + 1) * sizeof(char *));
        (*argv)[(*argc)++] = tmp;
        i = k;
      }
      ++i;
    } else {
      if (n && !(str[k] == ' ' || str[k] == '\t' || str[k] == '\n'))
        n = 0;
      esc = 0;
    }
    ++k;
  }
  return 0;
}
```