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

```asm
<runPipe>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x640,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <trim@plt>
  mov    -0x44(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    -0x20(%rbp),%rdx
  lea    D1(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoken@plt>
  mov    %rax,-0x18(%rbp)
  lea    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  cmpl   $0x0,-0x44(%rbp)
  jne    L49
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x20(%rbp),%ecx
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <cmd_binary@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L43
L49:
  call   <fork@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0xffffffff,-0x1c(%rbp)
  jne    L68
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <perror@plt>
  jmp    L43
L68:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L53
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0xc(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <dup2@plt>
  subl   $0x1,-0x44(%rbp)
  mov    -0x44(%rbp),%edx
  mov    -0x40(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <runPipe>
  jmp    L43
L53:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x10(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <dup2@plt>
  lea    -0x24(%rbp),%rcx
  mov    -0x1c(%rbp),%eax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <waitpid@plt>
  cmp    %eax,-0x1c(%rbp)
  je     L44
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L44:
  mov    -0x20(%rbp),%ecx
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <cmd_binary@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L43:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L61
  call   <__stack_chk_fail@plt>
L61:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D1
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D21
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D10
type_infered: string

tool: D1:  

tool: D21: unable to fork child


tool: D10: error in waitpid. Error no is %d


assistant: ```c
int runPipe(char *tokens[], char *envp[], int pipes) {
  int fd[2], pid, status;
  int param_len;
  char **params = (char **)malloc(200 * sizeof(char *));
  trim(tokens[pipes]);
  params = strtoken(tokens[pipes], " ", &param_len);
  pipe(fd);
  if (pipes == 0) {
    close(fd[0]);
    cmd_binary(params, param_len, envp);
    exit(0);
  } else {
    pid = fork();
    if (pid == -1)
      perror("unable to fork child\n");
    else if (pid == 0) {
      close(fd[0]);
      dup2(fd[1], 1);
      runPipe(tokens, envp, --pipes);
    } else {
      close(fd[1]);
      dup2(fd[0], 0);
      if (pid == waitpid(pid, &status, 0)) {
        ;
      } else {
        perror("error in waitpid. Error no is %d\n", status);
        exit(1);
      }
      cmd_binary(params, param_len, envp);
      exit(0);
    }
  }
  return 0;
}
```