#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execve(char *, char **, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ pipe(int *);
char *strrchr(char *, char);
int /*<<< orphan*/ *strstr(char *, char *);
int /*<<< orphan*/ waitpid(scalar_t__, int *, int /*<<< orphan*/);
void for_2pipe(char *ip1, char *ip2, char *ip3, 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;
  }
  pid_t pid1, pid2, pid3 = 0, pid4 = 0;
  pid1 = fork();
  if (pid1 == 0) {
    int pipes[4];
    int j = 0;
    pipe(pipes);
    pipe(pipes + 2);
    pid2 = fork();
    if (pid2 == 0) {
      dup2(pipes[1], 1);
      for (j = 0; j <= 3; 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 <= 3; j++)
          close(pipes[j]);
        execve(myargv2[0], myargv2, envp);
      } else {
        pid4 = fork();
        if (pid4 == 0) {
          dup2(pipes[2], 0);
          for (j = 0; j <= 3; j++)
            close(pipes[j]);
          execve(myargv3[0], myargv3, envp);
        }
      }
    }
    for (j = 0; j <= 3; j++)
      close(pipes[j]);
    waitpid(pid2, &status, 0);
    waitpid(pid3, &status, 0);
    waitpid(pid4, &status, 0);
    exit(0);
  } else {
    waitpid(pid1, &status, 0);
    return;
  }
}


x86 assembly (clang, -O0):
<for_2pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     124e <for_2pipe+0xbe>
lea    0xe35(%rip),%rax
mov    %rax,-0x88(%rbp)
lea    0xe27(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
je     1220 <for_2pipe+0x90>
mov    -0x98(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x98(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x88(%rbp),%rax
mov    %rax,-0x78(%rbp)
movq   $0x0,-0x70(%rbp)
jmp    125e <for_2pipe+0xce>
mov    -0x8(%rbp),%rax
mov    %rax,-0x80(%rbp)
movq   $0x0,-0x78(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xd97(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     130a <for_2pipe+0x17a>
lea    0xd82(%rip),%rax
mov    %rax,-0xf8(%rbp)
lea    0xd74(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x108(%rbp)
cmpq   $0x0,-0x108(%rbp)
je     12d3 <for_2pipe+0x143>
mov    -0x108(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x108(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xf8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x100(%rbp)
mov    -0x100(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0xe8(%rbp)
movq   $0x0,-0xe0(%rbp)
jmp    1320 <for_2pipe+0x190>
mov    -0x10(%rbp),%rax
mov    %rax,-0xf0(%rbp)
movq   $0x0,-0xe8(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xcd5(%rip),%rsi
call   10b0 <strstr@plt>
cmp    $0x0,%rax
je     13cc <for_2pipe+0x23c>
lea    0xcc0(%rip),%rax
mov    %rax,-0x168(%rbp)
lea    0xcb2(%rip),%rax
mov    %rax,-0x170(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x20,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x178(%rbp)
cmpq   $0x0,-0x178(%rbp)
je     1395 <for_2pipe+0x205>
mov    -0x178(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x178(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x168(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x170(%rbp)
mov    -0x170(%rbp),%rax
mov    %rax,-0x160(%rbp)
mov    -0x168(%rbp),%rax
mov    %rax,-0x158(%rbp)
movq   $0x0,-0x150(%rbp)
jmp    13e2 <for_2pipe+0x252>
mov    -0x18(%rbp),%rax
mov    %rax,-0x160(%rbp)
movq   $0x0,-0x158(%rbp)
movq   $0x0,-0x190(%rbp)
movq   $0x0,-0x198(%rbp)
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %rax,-0x180(%rbp)
cmpq   $0x0,-0x180(%rbp)
jne    1650 <for_2pipe+0x4c0>
movl   $0x0,-0x1b4(%rbp)
lea    -0x1b0(%rbp),%rdi
call   1060 <pipe@plt>
lea    -0x1b0(%rbp),%rdi
add    $0x8,%rdi
call   1060 <pipe@plt>
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %rax,-0x188(%rbp)
cmpq   $0x0,-0x188(%rbp)
jne    14ba <for_2pipe+0x32a>
mov    -0x1ac(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x3,-0x1b4(%rbp)
jg     14a4 <for_2pipe+0x314>
movslq -0x1b4(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%edi
call   1050 <close@plt>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    1470 <for_2pipe+0x2e0>
mov    -0x80(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <execve@plt>
jmp    15d5 <for_2pipe+0x445>
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %rax,-0x190(%rbp)
cmpq   $0x0,-0x190(%rbp)
jne    154d <for_2pipe+0x3bd>
mov    -0x1b0(%rbp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    -0x1a4(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x3,-0x1b4(%rbp)
jg     1531 <for_2pipe+0x3a1>
movslq -0x1b4(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%edi
call   1050 <close@plt>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    14fd <for_2pipe+0x36d>
mov    -0xf0(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <execve@plt>
jmp    15d0 <for_2pipe+0x440>
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %rax,-0x198(%rbp)
cmpq   $0x0,-0x198(%rbp)
jne    15cb <for_2pipe+0x43b>
mov    -0x1a8(%rbp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x3,-0x1b4(%rbp)
jg     15b4 <for_2pipe+0x424>
movslq -0x1b4(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%edi
call   1050 <close@plt>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    1580 <for_2pipe+0x3f0>
mov    -0x160(%rbp),%rdi
lea    -0x160(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <execve@plt>
jmp    15d0 <for_2pipe+0x440>
jmp    15d5 <for_2pipe+0x445>
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x3,-0x1b4(%rbp)
jg     1613 <for_2pipe+0x483>
movslq -0x1b4(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%edi
call   1050 <close@plt>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    15df <for_2pipe+0x44f>
mov    -0x188(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1080 <waitpid@plt>
mov    -0x190(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1080 <waitpid@plt>
mov    -0x198(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1080 <waitpid@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    -0x180(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   1080 <waitpid@plt>
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<for_2pipe>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11d7 <for_2pipe+0x47>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     11e7 <for_2pipe+0x57>
movb   $0x0,(%rax)
add    $0x1,%rax
jmp    11ee <for_2pipe+0x5e>
mov    %rbx,0x70(%rsp)
movq   $0x0,0x78(%rsp)
jmp    1204 <for_2pipe+0x74>
lea    0xe12(%rip),%rax
mov    %rbx,0x70(%rsp)
mov    %rax,0x78(%rsp)
movq   $0x0,0x80(%rsp)
mov    %r15,%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1231 <for_2pipe+0xa1>
mov    %r15,%rdi
mov    $0x20,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     1241 <for_2pipe+0xb1>
movb   $0x0,(%rax)
add    $0x1,%rax
jmp    1248 <for_2pipe+0xb8>
mov    %r15,0x20(%rsp)
movq   $0x0,0x28(%rsp)
jmp    125b <for_2pipe+0xcb>
lea    0xdb8(%rip),%rax
mov    %r15,0x20(%rsp)
mov    %rax,0x28(%rsp)
movq   $0x0,0x30(%rsp)
mov    %r13,%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1288 <for_2pipe+0xf8>
mov    %r13,%rdi
mov    $0x20,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     129e <for_2pipe+0x10e>
movb   $0x0,(%rax)
add    $0x1,%rax
jmp    12a5 <for_2pipe+0x115>
mov    %r13,0xc0(%rsp)
movq   $0x0,0xc8(%rsp)
jmp    12c1 <for_2pipe+0x131>
lea    0xd5b(%rip),%rax
mov    %r13,0xc0(%rsp)
mov    %rax,0xc8(%rsp)
movq   $0x0,0xd0(%rsp)
xor    %eax,%eax
call   10b0 <fork@plt>
test   %rax,%rax
je     12ee <for_2pipe+0x15e>
lea    0x1c(%rsp),%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   1090 <waitpid@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%rdi
call   1070 <pipe@plt>
lea    0x8(%rsp),%rdi
call   1070 <pipe@plt>
xor    %eax,%eax
call   10b0 <fork@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1352 <for_2pipe+0x1c2>
mov    0x4(%rsp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    (%rsp),%edi
call   1060 <close@plt>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
lea    0x70(%rsp),%rsi
xor    %r12d,%r12d
mov    0x70(%rsp),%r13
jmp    13f1 <for_2pipe+0x261>
xor    %eax,%eax
call   10b0 <fork@plt>
test   %rax,%rax
jne    13a8 <for_2pipe+0x218>
mov    (%rsp),%edi
xor    %r12d,%r12d
xor    %esi,%esi
call   1030 <dup2@plt>
mov    0xc(%rsp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    (%rsp),%edi
call   1060 <close@plt>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
lea    0x20(%rsp),%rsi
mov    0x20(%rsp),%r13
jmp    13f1 <for_2pipe+0x261>
mov    %rax,%r12
xor    %eax,%eax
call   10b0 <fork@plt>
test   %rax,%rax
jne    1454 <for_2pipe+0x2c4>
mov    0x8(%rsp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    (%rsp),%edi
call   1060 <close@plt>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
lea    0xc0(%rsp),%rsi
mov    %r13,%rdi
mov    %r14,%rdx
call   1080 <execve@plt>
xor    %ebp,%ebp
mov    (%rsp),%edi
call   1060 <close@plt>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
lea    0x1c(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1090 <waitpid@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1090 <waitpid@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1090 <waitpid@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    %rax,%rbp
jmp    13fe <for_2pipe+0x26e>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @for_2pipe(i8* %0, i8* %1, i8* %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32
%10 = alloca [10 x i8*]
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca [10 x i8*]
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca [10 x i8*]
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i64
%23 = alloca i64
%24 = alloca i64
%25 = alloca i64
%26 = alloca [4 x i32]
%27 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8** %3, i8*** %8
%28 = load i8*, i8** %5
%29 = call i32* @strstr(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%30 = icmp ne i32* %29, null
br i1 %30, label %31, label %47
31: ; preds = %4
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %12
%32 = load i8*, i8** %5
%33 = call i8* @strrchr(i8* %32, i8 signext 32)
store i8* %33, i8** %13
%34 = load i8*, i8** %13
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %40
36: ; preds = %31
%37 = load i8*, i8** %13
store i8 0, i8* %37
%38 = load i8*, i8** %13
%39 = getelementptr inbounds i8, i8* %38, i64 1
store i8* %39, i8** %11
br label %40
40: ; preds = %36, %31
%41 = load i8*, i8** %5
store i8* %41, i8** %12
%42 = load i8*, i8** %12
%43 = getelementptr inbounds [10 x i8*], [10 x i8*]* %10, i64 0, i64 0
store i8* %42, i8** %43
%44 = load i8*, i8** %11
%45 = getelementptr inbounds [10 x i8*], [10 x i8*]* %10, i64 0, i64 1
store i8* %44, i8** %45
%46 = getelementptr inbounds [10 x i8*], [10 x i8*]* %10, i64 0, i64 2
store i8* null, i8** %46
br label %51
47: ; preds = %4
%48 = load i8*, i8** %5
%49 = getelementptr inbounds [10 x i8*], [10 x i8*]* %10, i64 0, i64 0
store i8* %48, i8** %49
%50 = getelementptr inbounds [10 x i8*], [10 x i8*]* %10, i64 0, i64 1
store i8* null, i8** %50
br label %51
51: ; preds = %47, %40
%52 = load i8*, i8** %6
%53 = call i32* @strstr(i8* %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%54 = icmp ne i32* %53, null
br i1 %54, label %55, label %71
55: ; preds = %51
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %15
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %16
%56 = load i8*, i8** %6
%57 = call i8* @strrchr(i8* %56, i8 signext 32)
store i8* %57, i8** %17
%58 = load i8*, i8** %17
%59 = icmp ne i8* %58, null
br i1 %59, label %60, label %64
60: ; preds = %55
%61 = load i8*, i8** %17
store i8 0, i8* %61
%62 = load i8*, i8** %17
%63 = getelementptr inbounds i8, i8* %62, i64 1
store i8* %63, i8** %15
br label %64
64: ; preds = %60, %55
%65 = load i8*, i8** %6
store i8* %65, i8** %16
%66 = load i8*, i8** %16
%67 = getelementptr inbounds [10 x i8*], [10 x i8*]* %14, i64 0, i64 0
store i8* %66, i8** %67
%68 = load i8*, i8** %15
%69 = getelementptr inbounds [10 x i8*], [10 x i8*]* %14, i64 0, i64 1
store i8* %68, i8** %69
%70 = getelementptr inbounds [10 x i8*], [10 x i8*]* %14, i64 0, i64 2
store i8* null, i8** %70
br label %75
71: ; preds = %51
%72 = load i8*, i8** %6
%73 = getelementptr inbounds [10 x i8*], [10 x i8*]* %14, i64 0, i64 0
store i8* %72, i8** %73
%74 = getelementptr inbounds [10 x i8*], [10 x i8*]* %14, i64 0, i64 1
store i8* null, i8** %74
br label %75
75: ; preds = %71, %64
%76 = load i8*, i8** %7
%77 = call i32* @strstr(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%78 = icmp ne i32* %77, null
br i1 %78, label %79, label %95
79: ; preds = %75
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %19
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %20
%80 = load i8*, i8** %7
%81 = call i8* @strrchr(i8* %80, i8 signext 32)
store i8* %81, i8** %21
%82 = load i8*, i8** %21
%83 = icmp ne i8* %82, null
br i1 %83, label %84, label %88
84: ; preds = %79
%85 = load i8*, i8** %21
store i8 0, i8* %85
%86 = load i8*, i8** %21
%87 = getelementptr inbounds i8, i8* %86, i64 1
store i8* %87, i8** %19
br label %88
88: ; preds = %84, %79
%89 = load i8*, i8** %7
store i8* %89, i8** %20
%90 = load i8*, i8** %20
%91 = getelementptr inbounds [10 x i8*], [10 x i8*]* %18, i64 0, i64 0
store i8* %90, i8** %91
%92 = load i8*, i8** %19
%93 = getelementptr inbounds [10 x i8*], [10 x i8*]* %18, i64 0, i64 1
store i8* %92, i8** %93
%94 = getelementptr inbounds [10 x i8*], [10 x i8*]* %18, i64 0, i64 2
store i8* null, i8** %94
br label %99
95: ; preds = %75
%96 = load i8*, i8** %7
%97 = getelementptr inbounds [10 x i8*], [10 x i8*]* %18, i64 0, i64 0
store i8* %96, i8** %97
%98 = getelementptr inbounds [10 x i8*], [10 x i8*]* %18, i64 0, i64 1
store i8* null, i8** %98
br label %99
99: ; preds = %95, %88
store i64 0, i64* %24
store i64 0, i64* %25
%100 = call i64 (...) @fork()
store i64 %100, i64* %22
%101 = load i64, i64* %22
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %212
103: ; preds = %99
store i32 0, i32* %27
%104 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 0
%105 = call i32 @pipe(i32* %104)
%106 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 0
%107 = getelementptr inbounds i32, i32* %106, i64 2
%108 = call i32 @pipe(i32* %107)
%109 = call i64 (...) @fork()
store i64 %109, i64* %23
%110 = load i64, i64* %23
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %134
112: ; preds = %103
%113 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 1
%114 = load i32, i32* %113
%115 = call i32 @dup2(i32 %114, i32 1)
store i32 0, i32* %27
br label %116
116: ; preds = %125, %112
%117 = load i32, i32* %27
%118 = icmp sle i32 %117, 3
br i1 %118, label %119, label %128
119: ; preds = %116
%120 = load i32, i32* %27
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 %121
%123 = load i32, i32* %122
%124 = call i32 @close(i32 %123)
br label %125
125: ; preds = %119
%126 = load i32, i32* %27
%127 = add nsw i32 %126, 1
store i32 %127, i32* %27
br label %116
128: ; preds = %116
%129 = getelementptr inbounds [10 x i8*], [10 x i8*]* %10, i64 0, i64 0
%130 = load i8*, i8** %129
%131 = getelementptr inbounds [10 x i8*], [10 x i8*]* %10, i64 0, i64 0
%132 = load i8**, i8*** %8
%133 = call i32 @execve(i8* %130, i8** %131, i8** %132)
br label %191
134: ; preds = %103
%135 = call i64 (...) @fork()
store i64 %135, i64* %24
%136 = load i64, i64* %24
%137 = icmp eq i64 %136, 0
br i1 %137, label %138, label %163
138: ; preds = %134
%139 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 0
%140 = load i32, i32* %139
%141 = call i32 @dup2(i32 %140, i32 0)
%142 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 3
%143 = load i32, i32* %142
%144 = call i32 @dup2(i32 %143, i32 1)
store i32 0, i32* %27
br label %145
145: ; preds = %154, %138
%146 = load i32, i32* %27
%147 = icmp sle i32 %146, 3
br i1 %147, label %148, label %157
148: ; preds = %145
%149 = load i32, i32* %27
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 %150
%152 = load i32, i32* %151
%153 = call i32 @close(i32 %152)
br label %154
154: ; preds = %148
%155 = load i32, i32* %27
%156 = add nsw i32 %155, 1
store i32 %156, i32* %27
br label %145
157: ; preds = %145
%158 = getelementptr inbounds [10 x i8*], [10 x i8*]* %14, i64 0, i64 0
%159 = load i8*, i8** %158
%160 = getelementptr inbounds [10 x i8*], [10 x i8*]* %14, i64 0, i64 0
%161 = load i8**, i8*** %8
%162 = call i32 @execve(i8* %159, i8** %160, i8** %161)
br label %190
163: ; preds = %134
%164 = call i64 (...) @fork()
store i64 %164, i64* %25
%165 = load i64, i64* %25
%166 = icmp eq i64 %165, 0
br i1 %166, label %167, label %189
167: ; preds = %163
%168 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 2
%169 = load i32, i32* %168
%170 = call i32 @dup2(i32 %169, i32 0)
store i32 0, i32* %27
br label %171
171: ; preds = %180, %167
%172 = load i32, i32* %27
%173 = icmp sle i32 %172, 3
br i1 %173, label %174, label %183
174: ; preds = %171
%175 = load i32, i32* %27
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 %176
%178 = load i32, i32* %177
%179 = call i32 @close(i32 %178)
br label %180
180: ; preds = %174
%181 = load i32, i32* %27
%182 = add nsw i32 %181, 1
store i32 %182, i32* %27
br label %171
183: ; preds = %171
%184 = getelementptr inbounds [10 x i8*], [10 x i8*]* %18, i64 0, i64 0
%185 = load i8*, i8** %184
%186 = getelementptr inbounds [10 x i8*], [10 x i8*]* %18, i64 0, i64 0
%187 = load i8**, i8*** %8
%188 = call i32 @execve(i8* %185, i8** %186, i8** %187)
br label %189
189: ; preds = %183, %163
br label %190
190: ; preds = %189, %157
br label %191
191: ; preds = %190, %128
store i32 0, i32* %27
br label %192
192: ; preds = %201, %191
%193 = load i32, i32* %27
%194 = icmp sle i32 %193, 3
br i1 %194, label %195, label %204
195: ; preds = %192
%196 = load i32, i32* %27
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 0, i64 %197
%199 = load i32, i32* %198
%200 = call i32 @close(i32 %199)
br label %201
201: ; preds = %195
%202 = load i32, i32* %27
%203 = add nsw i32 %202, 1
store i32 %203, i32* %27
br label %192
204: ; preds = %192
%205 = load i64, i64* %23
%206 = call i32 @waitpid(i64 %205, i32* %9, i32 0)
%207 = load i64, i64* %24
%208 = call i32 @waitpid(i64 %207, i32* %9, i32 0)
%209 = load i64, i64* %25
%210 = call i32 @waitpid(i64 %209, i32* %9, i32 0)
%211 = call i32 @exit(i32 0)
unreachable
212: ; preds = %99
%213 = load i64, i64* %22
%214 = call i32 @waitpid(i64 %213, i32* %9, i32 0)
ret void
}

LLVM IR (-O2):
@.str.1 = [1 x i8] zeroinitializer
define void @for_2pipe(i8* %0, i8* %1, i8* %2, i8** %3) {
%5 = alloca i32
%6 = alloca [10 x i8*]
%7 = alloca [10 x i8*]
%8 = alloca [10 x i8*]
%9 = alloca [4 x i32]
%10 = bitcast i32* %5 to i8*
%11 = bitcast [10 x i8*]* %6 to i8*
%12 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 32)
%13 = icmp eq i8* %12, null
br i1 %13, label %24, label %14
14: ; preds = %4
%15 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 32)
%16 = icmp eq i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %14
store i8 0, i8* %15
%18 = getelementptr inbounds i8, i8* %15, i64 1
br label %19
19: ; preds = %17, %14
%20 = phi i8* [ %18, %17 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %14 ]
%21 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 0
store i8* %0, i8** %21
%22 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 1
store i8* %20, i8** %22
%23 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 2
store i8* null, i8** %23
br label %27
24: ; preds = %4
%25 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 0
store i8* %0, i8** %25
%26 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 1
store i8* null, i8** %26
br label %27
27: ; preds = %24, %19
%28 = bitcast [10 x i8*]* %7 to i8*
%29 = tail call i8* @strchr(i8* dereferenceable(1) %1, i32 32)
%30 = icmp eq i8* %29, null
br i1 %30, label %41, label %31
31: ; preds = %27
%32 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i8 signext 32)
%33 = icmp eq i8* %32, null
br i1 %33, label %36, label %34
34: ; preds = %31
store i8 0, i8* %32
%35 = getelementptr inbounds i8, i8* %32, i64 1
br label %36
36: ; preds = %34, %31
%37 = phi i8* [ %35, %34 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %31 ]
%38 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 0
store i8* %1, i8** %38
%39 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 1
store i8* %37, i8** %39
%40 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 2
store i8* null, i8** %40
br label %44
41: ; preds = %27
%42 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 0
store i8* %1, i8** %42
%43 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 1
store i8* null, i8** %43
br label %44
44: ; preds = %41, %36
%45 = bitcast [10 x i8*]* %8 to i8*
%46 = tail call i8* @strchr(i8* dereferenceable(1) %2, i32 32)
%47 = icmp eq i8* %46, null
br i1 %47, label %58, label %48
48: ; preds = %44
%49 = tail call i8* @strrchr(i8* dereferenceable(1) %2, i8 signext 32)
%50 = icmp eq i8* %49, null
br i1 %50, label %53, label %51
51: ; preds = %48
store i8 0, i8* %49
%52 = getelementptr inbounds i8, i8* %49, i64 1
br label %53
53: ; preds = %51, %48
%54 = phi i8* [ %52, %51 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %48 ]
%55 = getelementptr inbounds [10 x i8*], [10 x i8*]* %8, i64 0, i64 0
store i8* %2, i8** %55
%56 = getelementptr inbounds [10 x i8*], [10 x i8*]* %8, i64 0, i64 1
store i8* %54, i8** %56
%57 = getelementptr inbounds [10 x i8*], [10 x i8*]* %8, i64 0, i64 2
store i8* null, i8** %57
br label %61
58: ; preds = %44
%59 = getelementptr inbounds [10 x i8*], [10 x i8*]* %8, i64 0, i64 0
store i8* %2, i8** %59
%60 = getelementptr inbounds [10 x i8*], [10 x i8*]* %8, i64 0, i64 1
store i8* null, i8** %60
br label %61
61: ; preds = %58, %53
%62 = tail call i64 (...) @fork()
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %146
64: ; preds = %61
%65 = bitcast [4 x i32]* %9 to i8*
%66 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%67 = call i32 @pipe(i32* %66)
%68 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
%69 = call i32 @pipe(i32* %68)
%70 = call i64 (...) @fork()
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %87
72: ; preds = %64
%73 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%74 = load i32, i32* %73
%75 = call i32 @dup2(i32 %74, i32 1)
%76 = load i32, i32* %66
%77 = call i32 @close(i32 %76)
%78 = load i32, i32* %73
%79 = call i32 @close(i32 %78)
%80 = load i32, i32* %68
%81 = call i32 @close(i32 %80)
%82 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%83 = load i32, i32* %82
%84 = call i32 @close(i32 %83)
%85 = getelementptr inbounds [10 x i8*], [10 x i8*]* %6, i64 0, i64 0
%86 = load i8*, i8** %85
br label %124
87: ; preds = %64
%88 = call i64 (...) @fork()
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %107
90: ; preds = %87
%91 = load i32, i32* %66
%92 = call i32 @dup2(i32 %91, i32 0)
%93 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%94 = load i32, i32* %93
%95 = call i32 @dup2(i32 %94, i32 1)
%96 = load i32, i32* %66
%97 = call i32 @close(i32 %96)
%98 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%99 = load i32, i32* %98
%100 = call i32 @close(i32 %99)
%101 = load i32, i32* %68
%102 = call i32 @close(i32 %101)
%103 = load i32, i32* %93
%104 = call i32 @close(i32 %103)
%105 = getelementptr inbounds [10 x i8*], [10 x i8*]* %7, i64 0, i64 0
%106 = load i8*, i8** %105
br label %124
107: ; preds = %87
%108 = call i64 (...) @fork()
%109 = icmp eq i64 %108, 0
br i1 %109, label %110, label %129
110: ; preds = %107
%111 = load i32, i32* %68
%112 = call i32 @dup2(i32 %111, i32 0)
%113 = load i32, i32* %66
%114 = call i32 @close(i32 %113)
%115 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%116 = load i32, i32* %115
%117 = call i32 @close(i32 %116)
%118 = load i32, i32* %68
%119 = call i32 @close(i32 %118)
%120 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%121 = load i32, i32* %120
%122 = call i32 @close(i32 %121)
%123 = getelementptr inbounds [10 x i8*], [10 x i8*]* %8, i64 0, i64 0
br label %124
124: ; preds = %72, %110, %90
%125 = phi i8** [ %105, %90 ], [ %123, %110 ], [ %85, %72 ]
%126 = phi i8* [ %106, %90 ], [ %2, %110 ], [ %86, %72 ]
%127 = phi i64 [ 0, %90 ], [ %88, %110 ], [ 0, %72 ]
%128 = call i32 @execve(i8* %126, i8** %125, i8** %3)
br label %129
129: ; preds = %124, %107
%130 = phi i64 [ %88, %107 ], [ %127, %124 ]
%131 = phi i64 [ %108, %107 ], [ 0, %124 ]
%132 = load i32, i32* %66
%133 = call i32 @close(i32 %132)
%134 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%135 = load i32, i32* %134
%136 = call i32 @close(i32 %135)
%137 = load i32, i32* %68
%138 = call i32 @close(i32 %137)
%139 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%140 = load i32, i32* %139
%141 = call i32 @close(i32 %140)
%142 = call i32 @waitpid(i64 %70, i32* %5, i32 0)
%143 = call i32 @waitpid(i64 %130, i32* %5, i32 0)
%144 = call i32 @waitpid(i64 %131, i32* %5, i32 0)
%145 = call i32 @exit(i32 0)
unreachable
146: ; preds = %61
%147 = call i32 @waitpid(i64 %62, i32* %5, i32 0)
ret void
}