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

```asm
<main>:
  endbr64
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rdi
  call   <pipe@plt>
  cmp    $0xffffffff,%eax
  je     L86
L7:
  mov    $0x0,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L23
L18:
  mov    $0x0,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L80
L63:
  mov    $0x0,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L26
L25:
  mov    0x8(%rsp),%edi
  call   <close@plt>
  mov    0xc(%rsp),%edi
  call   <close@plt>
  mov    $0x0,%edi
  call   <wait@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  mov    $0x0,%eax
  add    $0x30,%rsp
  pop    %rbx
  ret
L86:
  lea    D51(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L7
L23:
  mov    $0x1,%edi
  call   <close@plt>
  mov    $0x1,%esi
  mov    0xc(%rsp),%edi
  call   <dup2@plt>
  mov    0x8(%rsp),%edi
  call   <close@plt>
  mov    0xc(%rsp),%edi
  call   <close@plt>
  lea    D9(%rip),%rdi
  mov    %rdi,0x10(%rsp)
  lea    D16(%rip),%rax
  mov    %rax,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  lea    0x10(%rsp),%rbx
  mov    %rbx,%rsi
  call   <execvp@plt>
  mov    %rbx,%rsi
  mov    0x10(%rsp),%rdi
  call   <execvp@plt>
  lea    D71(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L18
L80:
  mov    $0x0,%edi
  call   <close@plt>
  mov    $0x1,%edi
  call   <close@plt>
  mov    $0x0,%esi
  mov    0x8(%rsp),%edi
  call   <dup2@plt>
  mov    $0x1,%esi
  mov    0xc(%rsp),%edi
  call   <dup2@plt>
  mov    0x8(%rsp),%edi
  call   <close@plt>
  mov    0xc(%rsp),%edi
  call   <close@plt>
  lea    D85(%rip),%rdi
  mov    %rdi,0x10(%rsp)
  lea    D23(%rip),%rax
  mov    %rax,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  lea    0x10(%rsp),%rsi
  call   <execvp@plt>
  lea    D50(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L63
L26:
  mov    $0x0,%edi
  call   <close@plt>
  mov    $0x0,%esi
  mov    0x8(%rsp),%edi
  call   <dup2@plt>
  mov    0x8(%rsp),%edi
  call   <close@plt>
  mov    0xc(%rsp),%edi
  call   <close@plt>
  lea    D15(%rip),%rdi
  mov    %rdi,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  lea    0x10(%rsp),%rsi
  call   <execvp@plt>
  lea    D50(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L25
L53:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D51
type_guessed: string
name: disassemble_data
arguments: tag: D9
type_guessed: string
name: disassemble_data
arguments: tag: D16
type_guessed: string
name: disassemble_data
arguments: tag: D71
type_guessed: string
name: disassemble_data
arguments: tag: D85
type_guessed: string
name: disassemble_data
arguments: tag: D23
type_guessed: string
name: disassemble_data
arguments: tag: D50
type_guessed: string
name: disassemble_data
arguments: tag: D15
type_guessed: string

tool: D51: Pipe failed

tool: D9: ls

tool: D16: -l

tool: D71: execvp of ls failed

tool: D85: grup

tool: D23: list

tool: D50: execvp of wc failed

tool: D15: sort

assistant: ```c
int main(int argc, char **argv) {
  int pipen = 0;
  int argn = 0;
  int des_p[2];
  if (pipe(des_p) == -1) {
    perror("Pipe failed");
    exit(1);
  }
  if (fork() == 0) {
    close(1);
    dup2(des_p[1], 1);
    close(des_p[0]);
    close(des_p[1]);
    const char *prog1[] = {"ls", "-l", 0};
    execvp(prog1[0], prog1);
    execvp(prog1[0], prog1);
    perror("execvp of ls failed");
    exit(1);
  }
  if (fork() == 0) {
    close(0);
    close(1);
    dup2(des_p[0], 0);
    dup2(des_p[1], 1);
    close(des_p[0]);
    close(des_p[1]);
    const char *prog2[] = {"grup", "list", 0};
    execvp(prog2[0], prog2);
    perror("execvp of wc failed");
    exit(1);
  }
  if (fork() == 0) {
    close(0);
    dup2(des_p[0], 0);
    close(des_p[0]);
    close(des_p[1]);
    const char *prog3[] = {"sort", 0};
    execvp(prog3[0], prog3);
    perror("execvp of wc failed");
    exit(1);
  }
  close(des_p[0]);
  close(des_p[1]);
  wait(0);
  return 0;
}
```