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

```asm
<for_3pipe>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x198,%rsp
  mov    %rdi,%r14
  mov    %rsi,%r13
  mov    %rdx,%r12
  mov    %rcx,%rbx
  mov    %r8,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x188(%rsp)
  xor    %eax,%eax
  mov    $0x20,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L103
  mov    $0x20,%esi
  mov    %r14,%rdi
  call   <strrchr@plt>
  lea    D14(%rip),%rdx
  test   %rax,%rax
  je     L247
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rdx
L247:
  mov    %r14,0x40(%rsp)
  mov    %rdx,0x48(%rsp)
  movq   $0x0,0x50(%rsp)
L108:
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L256
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <strrchr@plt>
  lea    D14(%rip),%rdx
  test   %rax,%rax
  je     L73
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rdx
L73:
  mov    %r13,0x90(%rsp)
  mov    %rdx,0x98(%rsp)
  movq   $0x0,0xa0(%rsp)
L179:
  mov    $0x20,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L215
  mov    $0x20,%esi
  mov    %r12,%rdi
  call   <strrchr@plt>
  lea    D14(%rip),%rdx
  test   %rax,%rax
  je     L84
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rdx
L84:
  mov    %r12,0xe0(%rsp)
  mov    %rdx,0xe8(%rsp)
  movq   $0x0,0xf0(%rsp)
L174:
  mov    $0x20,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L244
  mov    $0x20,%esi
  mov    %rbx,%rdi
  call   <strrchr@plt>
  lea    D14(%rip),%rdx
  test   %rax,%rax
  je     L235
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rdx
L235:
  mov    %rbx,0x130(%rsp)
  mov    %rdx,0x138(%rsp)
  movq   $0x0,0x140(%rsp)
L132:
  mov    $0x0,%eax
  call   <fork@plt>
  test   %rax,%rax
  jne    L82
  lea    0x20(%rsp),%rdi
  call   <pipe@plt>
  lea    0x28(%rsp),%rdi
  call   <pipe@plt>
  lea    0x30(%rsp),%rdi
  call   <pipe@plt>
  mov    $0x0,%eax
  call   <fork@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L35
  mov    $0x1,%esi
  mov    0x24(%rsp),%edi
  call   <dup2@plt>
  lea    0x20(%rsp),%r12
  lea    0x38(%rsp),%r13
L74:
  mov    (%r12),%edi
  call   <close@plt>
  add    $0x4,%r12
  cmp    %r13,%r12
  jne    L74
  lea    0x40(%rsp),%rsi
  mov    %rbp,%rdx
  mov    0x40(%rsp),%rdi
  call   <execve@plt>
  mov    %rbx,%r14
  mov    %rbx,%r13
  mov    %rbx,%r12
L130:
  lea    0x20(%rsp),%rbp
  lea    0x38(%rsp),%r15
L31:
  mov    0x0(%rbp),%edi
  call   <close@plt>
  add    $0x4,%rbp
  cmp    %r15,%rbp
  jne    L31
  lea    0x1c(%rsp),%rbp
  mov    $0x0,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <waitpid@plt>
  mov    $0x0,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <waitpid@plt>
  mov    $0x0,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <waitpid@plt>
  mov    $0x0,%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <waitpid@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L180:
  mov    0x188(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L209
  add    $0x198,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L103:
  mov    %r14,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  jmp    L108
L256:
  mov    %r13,0x90(%rsp)
  movq   $0x0,0x98(%rsp)
  jmp    L179
L215:
  mov    %r12,0xe0(%rsp)
  movq   $0x0,0xe8(%rsp)
  jmp    L174
L244:
  mov    %rbx,0x130(%rsp)
  movq   $0x0,0x138(%rsp)
  jmp    L132
L35:
  mov    $0x0,%eax
  call   <fork@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L88
  mov    $0x0,%esi
  mov    0x20(%rsp),%edi
  call   <dup2@plt>
  mov    $0x1,%esi
  mov    0x2c(%rsp),%edi
  call   <dup2@plt>
  lea    0x20(%rsp),%r13
  lea    0x38(%rsp),%r14
L30:
  mov    0x0(%r13),%edi
  call   <close@plt>
  add    $0x4,%r13
  cmp    %r14,%r13
  jne    L30
  lea    0x90(%rsp),%rsi
  mov    %rbp,%rdx
  mov    0x90(%rsp),%rdi
  call   <execve@plt>
  mov    %r12,%r14
  mov    %r12,%r13
  jmp    L130
L88:
  mov    $0x0,%eax
  call   <fork@plt>
  mov    %rax,%r13
  test   %rax,%rax
  jne    L89
  mov    $0x0,%esi
  mov    0x28(%rsp),%edi
  call   <dup2@plt>
  mov    $0x1,%esi
  mov    0x34(%rsp),%edi
  call   <dup2@plt>
  lea    0x20(%rsp),%r14
  lea    0x38(%rsp),%r15
L93:
  mov    (%r14),%edi
  call   <close@plt>
  add    $0x4,%r14
  cmp    %r15,%r14
  jne    L93
  lea    0xe0(%rsp),%rsi
  mov    %rbp,%rdx
  mov    0xe0(%rsp),%rdi
  call   <execve@plt>
  mov    %r13,%r14
  jmp    L130
L89:
  mov    $0x0,%eax
  call   <fork@plt>
  mov    %rax,%r14
  test   %rax,%rax
  jne    L130
  mov    $0x0,%esi
  mov    0x30(%rsp),%edi
  call   <dup2@plt>
  lea    0x20(%rsp),%r15
  lea    0x38(%rsp),%rax
  mov    %rax,0x8(%rsp)
L124:
  mov    (%r15),%edi
  call   <close@plt>
  add    $0x4,%r15
  cmp    0x8(%rsp),%r15
  jne    L124
  lea    0x130(%rsp),%rsi
  mov    %rbp,%rdx
  mov    0x130(%rsp),%rdi
  call   <execve@plt>
  jmp    L130
L82:
  lea    0x1c(%rsp),%rsi
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <waitpid@plt>
  jmp    L180
L209:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D14
data_type: string

tool: 

assistant: ```c
void for_3pipe(char *ip1, char *ip2, char *ip3, char *ip4, char *envp[]) {
  int status;
  char *myargv1[10];
  if (strstr(ip1, " ") != NULL) {
    char *a1 = {""}, *a2 = {""};
    char *tmp = strrchr(ip1, ' ');
    if (tmp != NULL) {
      *tmp = '\0';
      a1 = tmp + 1;
    }
    a2 = ip1;
    myargv1[0] = a2;
    myargv1[1] = a1;
    myargv1[2] = NULL;
  } else {
    myargv1[0] = ip1;
    myargv1[1] = NULL;
  }
  char *myargv2[10];
  if (strstr(ip2, " ") != NULL) {
    char *a3 = {""}, *a4 = {""};
    char *tmp = strrchr(ip2, ' ');
    if (tmp != NULL) {
      *tmp = '\0';
      a3 = tmp + 1;
    }
    a4 = ip2;
    myargv2[0] = a4;
    myargv2[1] = a3;
    myargv2[2] = NULL;
  } else {
    myargv2[0] = ip2;
    myargv2[1] = NULL;
  }
  char *myargv3[10];
  if (strstr(ip3, " ") != NULL) {
    char *a5 = {""}, *a6 = {""};
    char *tmp = strrchr(ip3, ' ');
    if (tmp != NULL) {
      *tmp = '\0';
      a5 = tmp + 1;
    }
    a6 = ip3;
    myargv3[0] = a6;
    myargv3[1] = a5;
    myargv3[2] = NULL;
  } else {
    myargv3[0] = ip3;
    myargv3[1] = NULL;
  }
  char *myargv4[10];
  if (strstr(ip4, " ") != NULL) {
    char *a7 = {""}, *a8 = {""};
    char *tmp = strrchr(ip4, ' ');
    if (tmp != NULL) {
      *tmp = '\0';
      a7 = tmp + 1;
    }
    a8 = ip4;
    myargv4[0] = a8;
    myargv4[1] = a7;
    myargv4[2] = NULL;
  } else {
    myargv4[0] = ip4;
    myargv4[1] = NULL;
  }
  pid_t pid1, pid2, pid3 = 0, pid4 = 0, pid5 = 0;
  pid1 = fork();
  if (pid1 == 0) {
    int pipes[6];
    int j = 0;
    pipe(pipes);
    pipe(pipes + 2);
    pipe(pipes + 4);
    pid2 = fork();
    if (pid2 == 0) {
      dup2(pipes[1], 1);
      for (j = 0; j <= 5; j++)
        close(pipes[j]);
      execve(myargv1[0], myargv1, envp);
    } else {
      pid3 = fork();
      if (pid3 == 0) {
        dup2(pipes[0], 0);
        dup2(pipes[3], 1);
        for (j = 0; j <= 5; j++)
          close(pipes[j]);
        execve(myargv2[0], myargv2, envp);
      } else {
        pid4 = fork();
        if (pid4 == 0) {
          dup2(pipes[2], 0);
          dup2(pipes[5], 1);
          for (j = 0; j <= 5; j++)
            close(pipes[j]);
          execve(myargv3[0], myargv3, envp);
        } else {
          pid5 = fork();
          if (pid5 == 0) {
            dup2(pipes[4], 0);
            for (j = 0; j <= 5; j++)
              close(pipes[j]);
            execve(myargv4[0], myargv4, envp);
          }
        }
      }
    }
    for (j = 0; j <= 5; j++)
      close(pipes[j]);
    waitpid(pid2, &status, 0);
    waitpid(pid3, &status, 0);
    waitpid(pid4, &status, 0);
    waitpid(pid5, &status, 0);
    exit(0);
  } else {
    waitpid(pid1, &status, 0);
    return;
  }
}
```