user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x4,-0x24(%rbp)
  jg     L69
  mov    $0x1,%eax
  jmp    L64
L69:
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  lea    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  call   <fork@plt>
  test   %eax,%eax
  jne    L3
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0x1,%edi
  call   <close@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <dup@plt>
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rsi
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <execlp@plt>
L3:
  movl   $0x1,-0x20(%rbp)
  jmp    L62
L36:
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  lea    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  call   <fork@plt>
  test   %eax,%eax
  jne    L25
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0x0,%edi
  call   <close@plt>
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <dup@plt>
  mov    $0x1,%edi
  call   <close@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <dup@plt>
  mov    -0x20(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x20(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rsi
  mov    -0x20(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <execlp@plt>
L25:
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  addl   $0x1,-0x20(%rbp)
L62:
  mov    -0x20(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L36
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0x0,%edi
  call   <close@plt>
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <dup@plt>
  mov    -0x1c(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rsi
  mov    -0x1c(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    $0x0,%ecx
  mov    %rax,%rdi
  call   <execlp@plt>
  mov    $0x0,%eax
L64:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L42
  call   <__stack_chk_fail@plt>
L42:
  leave
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  if (argc < 5)
    return 1;
  int cmdc = (argc - 1) / 2 - 1;
  int fdsr[2], fdsw[2];
  pipe(fdsw);
  if (!fork()) {
    close(fdsw[0]);
    close(1);
    dup(fdsw[1]);
    execlp(argv[1], argv[1], argv[2], NULL);
  }
  for (int i = 1; i < cmdc; i++) {
    fdsr[0] = fdsw[0];
    fdsr[1] = fdsw[1];
    pipe(fdsw);
    close(fdsr[1]);
    if (!fork()) {
      close(fdsw[0]);
      close(0);
      dup(fdsr[0]);
      close(1);
      dup(fdsw[1]);
      execlp(argv[2 * i + 1], argv[2 * i + 1], argv[2 * i + 2], NULL);
    }
    close(fdsr[0]);
  }
  fdsr[0] = fdsw[0];
  fdsr[1] = fdsw[1];
  close(fdsr[1]);
  close(0);
  dup(fdsr[0]);
  execlp(argv[2 * cmdc + 1], argv[2 * cmdc + 1], argv[2 * cmdc + 2], NULL);
}
```