user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<fh_cli_cmd_parse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  movl   $0x0,-0x2c(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L148
L5:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L193
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x28(%rbp)
  je     L193
  cmpq   $0x0,-0x18(%rbp)
  je     L80
  cmpl   $0x0,-0x28(%rbp)
  jne    L80
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L193
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7c,%al
  jne    L80
L193:
  cmpq   $0x0,-0x18(%rbp)
  je     L3
  mov    -0x20(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x40(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    (%rbx),%rax
  mov    -0x24(%rbp),%edx
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x2c(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  add    %rdx,%rax
  movb   $0x0,(%rax)
L3:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L140
  cmpl   $0x0,-0x28(%rbp)
  je     L97
  addq   $0x1,-0x20(%rbp)
L97:
  movl   $0x0,-0x28(%rbp)
  movq   $0x0,-0x18(%rbp)
  jmp    L148
L80:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L29
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x27,%al
  jne    L146
L29:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L148
L146:
  cmpq   $0x0,-0x18(%rbp)
  jne    L30
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7c,%al
  jne    L141
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x2c(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,(%rbx)
  jmp    L30
L141:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L30
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x18(%rbp)
L30:
  addq   $0x1,-0x20(%rbp)
L148:
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L5
  jmp    L188
L140:
  nop
L188:
  mov    -0x2c(%rbp),%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D5
datatype: string

tool: D5: |

assistant: ```c
int fh_cli_cmd_parse(char *cmd, char *args[], int max_args) {
  int nargs = 0;
  char *p = cmd;
  char *arg_start = cmd;
  int inquote = 0;
  while (nargs < max_args - 1) {
    if (!*p || *p == inquote || (arg_start && !inquote && (isspace(*p) || *p == '|'))) {
      if (arg_start) {
        int len = p - arg_start;
        memcpy(args[nargs] = malloc(len + 1), arg_start, len);
        args[nargs++][len] = 0;
      }
      if (!*p) {
        break;
      }
      if (inquote) {
        p++;
      }
      inquote = 0;
      arg_start = 0;
    } else if (*p == '"' || *p == '\'') {
      inquote = *p++;
      arg_start = p;
    } else {
      if (!arg_start) {
        if (*p == '|') {
          args[nargs++] = strdup("|");
        } else if (!isspace(*p)) {
          arg_start = p;
        }
      }
      p++;
    }
  }
  return nargs;
}
```