user: 请将以下的汇编代码转换成C语言代码:

```asm
<gen_argv_from_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x30(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  movq   $0x0,(%rax)
  jmp    L205
L36:
  cmpl   $0x0,-0x10(%rbp)
  jne    L143
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L143
  movl   $0x1,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L230
L143:
  cmpl   $0x0,-0x14(%rbp)
  je     L19
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  jne    L19
  jmp    L243
L172:
  addl   $0x1,-0x18(%rbp)
L243:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L222
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L172
L222:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L205
L19:
  cmpl   $0x0,-0x10(%rbp)
  jne    L42
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L114
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L114
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L114
L42:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L78
L114:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L79
  movl   $0x1,-0x14(%rbp)
  jmp    L130
L79:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L130
  movl   $0x1,-0xc(%rbp)
L130:
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  je     L169
  mov    -0x18(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <strndup@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    $0x1,%edx
  mov    $0x5c,%esi
  mov    %rax,%rdi
  call   <strip_char@plt>
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    -0x38(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x30(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x3,%rax
  lea    (%rsi,%rax,1),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L169:
  addl   $0x1,-0x1c(%rbp)
  jmp    L230
L78:
  cmpl   $0x0,-0x14(%rbp)
  je     L160
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L160
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L160
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L160
  movl   $0x0,-0x14(%rbp)
L160:
  movl   $0x0,-0x10(%rbp)
L230:
  addl   $0x1,-0x18(%rbp)
L205:
  cmpl   $0x0,-0xc(%rbp)
  je     L36
  mov    $0x0,%eax
  leave
  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;
}
```