#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 */

/* Variables and functions */
int O_APPEND;
int O_CREAT;
int O_RDONLY;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execvp(char *, char **);
scalar_t__ fork();
int /*<<< orphan*/ open(char *, int, ...);
int /*<<< orphan*/ pipe(int *);
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
char *strtok(char *, char *);
int /*<<< orphan*/ wait(int *);
void processPipe(char commandA[512], char commandB[512]) {
  char *Aargs[512], *Bargs[512], *cmd, *arg;
  int pd[2], pid, i = 1, statusA, statusB;
  int redirA = 0, rediriA = 0, redirB = 0, rediriB = 0;
  cmd = strtok(commandA, " ");
  Aargs[0] = cmd;
  arg = strtok(0, " ");
  while (arg) {
    if (arg[strlen(arg) - 1] == '\n')
      arg[strlen(arg) - 1] = '\0';
    Aargs[i] = arg;
    if (strcmp(arg, "<") == 0) {
      rediriA = i;
      redirA = 1;
    } else if (strcmp(arg, ">") == 0) {
      rediriA = i;
      redirA = 2;
    } else if (strcmp(arg, ">>") == 0) {
      rediriA = i;
      redirA = 3;
    }
    arg = strtok(0, " ");
    i++;
  }
  if (!rediriA)
    Aargs[i] = NULL;
  else
    Aargs[rediriA] = NULL;
  cmd = strtok(commandB, " ");
  Bargs[0] = cmd;
  arg = strtok(0, " ");
  i = 1;
  while (arg) {
    if (arg[strlen(arg) - 1] == '\n')
      arg[strlen(arg) - 1] = '\0';
    Bargs[i] = arg;
    if (strcmp(arg, "<") == 0) {
      rediriB = i;
      redirB = 1;
    } else if (strcmp(arg, ">") == 0) {
      rediriB = i;
      redirB = 2;
    } else if (strcmp(arg, ">>") == 0) {
      rediriB = i;
      redirB = 3;
    }
    arg = strtok(0, " ");
    i++;
  }
  if (!redirB)
    Bargs[i] = NULL;
  else
    Bargs[rediriB] = NULL;
  pipe(pd);
  if (fork() == 0) {
    dup2(pd[1], 1);
    close(pd[0]);
    close(pd[1]);
    if (redirA == 1) {
      close(0);
      open(Aargs[i - 1], O_RDONLY);
    } else if (redirA == 2) {
      close(1);
      open(Aargs[i - 1], O_WRONLY | O_CREAT, 0644);
    } else if (redirA == 3) {
      close(1);
      open(Aargs[i - 1], O_WRONLY | O_APPEND);
    }
    execvp(Aargs[0], Aargs);
  }
  if (fork() == 0) {
    dup2(pd[0], 0);
    close(pd[0]);
    close(pd[1]);
    if (redirB == 1) {
      close(0);
      open(Bargs[i - 1], O_RDONLY);
    } else if (redirB == 2) {
      close(1);
      open(Bargs[i - 1], O_WRONLY | O_CREAT, 0644);
    } else if (redirB == 3) {
      close(1);
      open(Bargs[i - 1], O_WRONLY | O_APPEND);
    }
    execvp(Bargs[0], Bargs);
  }
  close(pd[0]);
  close(pd[1]);
  wait(&statusA);
  wait(&statusB);
  printf("Command 1 Exit: %d, Command 2 Exit: %d\n", statusA, statusB);
}


x86 assembly (clang, -O0):
<processPipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2070,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x2030(%rbp)
movl   $0x0,-0x203c(%rbp)
movl   $0x0,-0x2040(%rbp)
movl   $0x0,-0x2044(%rbp)
movl   $0x0,-0x2048(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe00(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2018(%rbp)
mov    -0x2018(%rbp),%rax
mov    %rax,-0x1010(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xddb(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2020(%rbp)
cmpq   $0x0,-0x2020(%rbp)
je     1390 <processPipe+0x1e0>
mov    -0x2020(%rbp),%rax
mov    %rax,-0x2050(%rbp)
mov    -0x2020(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2050(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    12a2 <processPipe+0xf2>
mov    -0x2020(%rbp),%rax
mov    %rax,-0x2058(%rbp)
mov    -0x2020(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2058(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x2020(%rbp),%rcx
movslq -0x2030(%rbp),%rax
mov    %rcx,-0x1010(%rbp,%rax,8)
ff
mov    -0x2020(%rbp),%rdi
lea    0xd3c(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12f0 <processPipe+0x140>
mov    -0x2030(%rbp),%eax
mov    %eax,-0x2040(%rbp)
movl   $0x1,-0x203c(%rbp)
jmp    1365 <processPipe+0x1b5>
mov    -0x2020(%rbp),%rdi
lea    0xd07(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1328 <processPipe+0x178>
mov    -0x2030(%rbp),%eax
mov    %eax,-0x2040(%rbp)
movl   $0x2,-0x203c(%rbp)
jmp    1360 <processPipe+0x1b0>
mov    -0x2020(%rbp),%rdi
lea    0xcce(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    135b <processPipe+0x1ab>
mov    -0x2030(%rbp),%eax
mov    %eax,-0x2040(%rbp)
movl   $0x3,-0x203c(%rbp)
jmp    1360 <processPipe+0x1b0>
jmp    1365 <processPipe+0x1b5>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc90(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2020(%rbp)
mov    -0x2030(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2030(%rbp)
jmp    1231 <processPipe+0x81>
cmpl   $0x0,-0x2040(%rbp)
jne    13b5 <processPipe+0x205>
movslq -0x2030(%rbp),%rax
movq   $0x0,-0x1010(%rbp,%rax,8)
jmp    13c8 <processPipe+0x218>
movslq -0x2040(%rbp),%rax
movq   $0x0,-0x1010(%rbp,%rax,8)
mov    -0x10(%rbp),%rdi
lea    0xc2d(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2018(%rbp)
mov    -0x2018(%rbp),%rax
mov    %rax,-0x2010(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc08(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2020(%rbp)
movl   $0x1,-0x2030(%rbp)
cmpq   $0x0,-0x2020(%rbp)
je     156d <processPipe+0x3bd>
mov    -0x2020(%rbp),%rax
mov    %rax,-0x2060(%rbp)
mov    -0x2020(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2060(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    147f <processPipe+0x2cf>
mov    -0x2020(%rbp),%rax
mov    %rax,-0x2068(%rbp)
mov    -0x2020(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2068(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x2020(%rbp),%rcx
movslq -0x2030(%rbp),%rax
mov    %rcx,-0x2010(%rbp,%rax,8)
ff
mov    -0x2020(%rbp),%rdi
lea    0xb5f(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    14cd <processPipe+0x31d>
mov    -0x2030(%rbp),%eax
mov    %eax,-0x2048(%rbp)
movl   $0x1,-0x2044(%rbp)
jmp    1542 <processPipe+0x392>
mov    -0x2020(%rbp),%rdi
lea    0xb2a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1505 <processPipe+0x355>
mov    -0x2030(%rbp),%eax
mov    %eax,-0x2048(%rbp)
movl   $0x2,-0x2044(%rbp)
jmp    153d <processPipe+0x38d>
mov    -0x2020(%rbp),%rdi
lea    0xaf1(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1538 <processPipe+0x388>
mov    -0x2030(%rbp),%eax
mov    %eax,-0x2048(%rbp)
movl   $0x3,-0x2044(%rbp)
jmp    153d <processPipe+0x38d>
jmp    1542 <processPipe+0x392>
xor    %eax,%eax
mov    %eax,%edi
lea    0xab3(%rip),%rsi
call   10a0 <strtok@plt>
mov    %rax,-0x2020(%rbp)
mov    -0x2030(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2030(%rbp)
jmp    140e <processPipe+0x25e>
cmpl   $0x0,-0x2044(%rbp)
jne    1592 <processPipe+0x3e2>
movslq -0x2030(%rbp),%rax
movq   $0x0,-0x2010(%rbp,%rax,8)
jmp    15a5 <processPipe+0x3f5>
movslq -0x2048(%rbp),%rax
movq   $0x0,-0x2010(%rbp,%rax,8)
lea    -0x2028(%rbp),%rdi
call   1070 <pipe@plt>
mov    $0x0,%al
call   10d0 <fork@plt>
cmp    $0x0,%rax
jne    16d1 <processPipe+0x521>
mov    -0x2024(%rbp),%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
mov    -0x2028(%rbp),%edi
call   1060 <close@plt>
mov    -0x2024(%rbp),%edi
call   1060 <close@plt>
cmpl   $0x1,-0x203c(%rbp)
jne    1624 <processPipe+0x474>
xor    %edi,%edi
call   1060 <close@plt>
mov    -0x2030(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1010(%rbp,%rax,8),%rdi
ff
mov    0x29ca(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1090 <open@plt>
jmp    16be <processPipe+0x50e>
cmpl   $0x2,-0x203c(%rbp)
jne    1671 <processPipe+0x4c1>
mov    $0x1,%edi
call   1060 <close@plt>
mov    -0x2030(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1010(%rbp,%rax,8),%rdi
ff
mov    0x2973(%rip),%rax
mov    (%rax),%esi
mov    0x299a(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
mov    $0x0,%al
call   1090 <open@plt>
jmp    16b9 <processPipe+0x509>
cmpl   $0x3,-0x203c(%rbp)
jne    16b4 <processPipe+0x504>
mov    $0x1,%edi
call   1060 <close@plt>
mov    -0x2030(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1010(%rbp,%rax,8),%rdi
ff
mov    0x2926(%rip),%rax
mov    (%rax),%esi
mov    0x2915(%rip),%rax
or     (%rax),%esi
mov    $0x0,%al
call   1090 <open@plt>
jmp    16b9 <processPipe+0x509>
jmp    16be <processPipe+0x50e>
mov    -0x1010(%rbp),%rdi
lea    -0x1010(%rbp),%rsi
call   10b0 <execvp@plt>
mov    $0x0,%al
call   10d0 <fork@plt>
cmp    $0x0,%rax
jne    17ee <processPipe+0x63e>
mov    -0x2028(%rbp),%edi
xor    %esi,%esi
call   1040 <dup2@plt>
mov    -0x2028(%rbp),%edi
call   1060 <close@plt>
mov    -0x2024(%rbp),%edi
call   1060 <close@plt>
cmpl   $0x1,-0x2044(%rbp)
jne    1741 <processPipe+0x591>
xor    %edi,%edi
call   1060 <close@plt>
mov    -0x2030(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x2010(%rbp,%rax,8),%rdi
ff
mov    0x28ad(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1090 <open@plt>
jmp    17db <processPipe+0x62b>
cmpl   $0x2,-0x2044(%rbp)
jne    178e <processPipe+0x5de>
mov    $0x1,%edi
call   1060 <close@plt>
mov    -0x2030(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x2010(%rbp,%rax,8),%rdi
ff
mov    0x2856(%rip),%rax
mov    (%rax),%esi
mov    0x287d(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
mov    $0x0,%al
call   1090 <open@plt>
jmp    17d6 <processPipe+0x626>
cmpl   $0x3,-0x2044(%rbp)
jne    17d1 <processPipe+0x621>
mov    $0x1,%edi
call   1060 <close@plt>
mov    -0x2030(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x2010(%rbp,%rax,8),%rdi
ff
mov    0x2809(%rip),%rax
mov    (%rax),%esi
mov    0x27f8(%rip),%rax
or     (%rax),%esi
mov    $0x0,%al
call   1090 <open@plt>
jmp    17d6 <processPipe+0x626>
jmp    17db <processPipe+0x62b>
mov    -0x2010(%rbp),%rdi
lea    -0x2010(%rbp),%rsi
call   10b0 <execvp@plt>
mov    -0x2028(%rbp),%edi
call   1060 <close@plt>
mov    -0x2024(%rbp),%edi
call   1060 <close@plt>
lea    -0x2034(%rbp),%rdi
call   10c0 <wait@plt>
lea    -0x2038(%rbp),%rdi
call   10c0 <wait@plt>
mov    -0x2034(%rbp),%esi
mov    -0x2038(%rbp),%edx
lea    0x7d8(%rip),%rdi
call   1050 <printf@plt>
add    $0x2070,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processPipe>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2028,%rsp
mov    %rsi,%rbx
lea    0xe35(%rip),%rbp
mov    %rbp,%rsi
call   10a0 <strtok@plt>
mov    %rax,0x1020(%rsp)
xor    %r13d,%r13d
xor    %edi,%edi
mov    %rbp,%rsi
call   10a0 <strtok@plt>
test   %rax,%rax
je     12cf <processPipe+0x11f>
mov    %rax,%rbp
mov    %rbx,0x18(%rsp)
xor    %r12d,%r12d
mov    $0x1,%r14d
lea    0xdf9(%rip),%r15
lea    0xdf0(%rip),%rbx
xor    %r13d,%r13d
jmp    123f <processPipe+0x8f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%r13d
mov    %r14d,%r12d
xor    %edi,%edi
mov    %rbx,%rsi
call   10a0 <strtok@plt>
mov    %rax,%rbp
add    $0x1,%r14
test   %rax,%rax
je     12bb <processPipe+0x10b>
mov    %rbp,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbp,1)
jne    125f <processPipe+0xaf>
mov    %rbp,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbp,0x1020(%rsp,%r14,8)
mov    %rbp,%rdi
mov    %r15,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1220 <processPipe+0x70>
mov    %rbp,%rdi
lea    0xd84(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12b0 <processPipe+0x100>
mov    %rbp,%rdi
lea    0xd6f(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
mov    $0x3,%eax
cmove  %eax,%r13d
cmove  %r14d,%r12d
jmp    1229 <processPipe+0x79>
nop
mov    $0x2,%r13d
jmp    1226 <processPipe+0x76>
mov    %r14d,%ecx
test   %r12d,%r12d
movslq %r12d,%rax
cmove  %rcx,%rax
mov    0x18(%rsp),%rbx
jmp    12d4 <processPipe+0x124>
mov    $0x1,%eax
movq   $0x0,0x1020(%rsp,%rax,8)
lea    0xd19(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10a0 <strtok@plt>
mov    %rax,0x20(%rsp)
xor    %r14d,%r14d
xor    %edi,%edi
mov    %rbp,%rsi
call   10a0 <strtok@plt>
test   %rax,%rax
je     13d5 <processPipe+0x225>
mov    %rax,%rbp
mov    $0x1,%r12d
lea    0xce3(%rip),%rbx
xor    %r15d,%r15d
jmp    134f <processPipe+0x19f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%r15d
mov    %r12d,%r14d
xor    %edi,%edi
mov    %rbx,%rsi
call   10a0 <strtok@plt>
mov    %rax,%rbp
add    $0x1,%r12
test   %rax,%rax
je     13cb <processPipe+0x21b>
mov    %rbp,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbp,1)
jne    136f <processPipe+0x1bf>
mov    %rbp,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    %rbp,0x20(%rsp,%r12,8)
mov    %rbp,%rdi
lea    0xc84(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1330 <processPipe+0x180>
mov    %rbp,%rdi
lea    0xc73(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     13c0 <processPipe+0x210>
mov    %rbp,%rdi
lea    0xc5e(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
mov    $0x3,%eax
cmove  %eax,%r15d
cmove  %r12d,%r14d
jmp    1339 <processPipe+0x189>
mov    $0x2,%r15d
jmp    1336 <processPipe+0x186>
test   %r15d,%r15d
je     13db <processPipe+0x22b>
movslq %r14d,%rax
jmp    13e1 <processPipe+0x231>
mov    $0x1,%r12d
mov    %r12d,%eax
xor    %r15d,%r15d
movq   $0x0,0x20(%rsp,%rax,8)
lea    0x8(%rsp),%rdi
call   1070 <pipe@plt>
xor    %eax,%eax
call   10d0 <fork@plt>
test   %rax,%rax
jne    14cf <processPipe+0x31f>
mov    0xc(%rsp),%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
cmp    $0x3,%r13d
je     1457 <processPipe+0x2a7>
cmp    $0x2,%r13d
je     1487 <processPipe+0x2d7>
cmp    $0x1,%r13d
jne    14ba <processPipe+0x30a>
xor    %edi,%edi
call   1060 <close@plt>
movslq %r12d,%rax
mov    0x1018(%rsp,%rax,8),%rdi
mov    0x2b8d(%rip),%rax
mov    (%rax),%esi
jmp    147e <processPipe+0x2ce>
mov    $0x1,%edi
call   1060 <close@plt>
movslq %r12d,%rax
mov    0x1018(%rsp,%rax,8),%rdi
mov    0x2b55(%rip),%rax
mov    0x2b46(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
xor    %eax,%eax
call   1090 <open@plt>
jmp    14ba <processPipe+0x30a>
mov    $0x1,%edi
call   1060 <close@plt>
movslq %r12d,%rax
mov    0x1018(%rsp,%rax,8),%rdi
mov    0x2b25(%rip),%rax
mov    0x2b4e(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1a4,%edx
xor    %eax,%eax
call   1090 <open@plt>
mov    0x1020(%rsp),%rdi
lea    0x1020(%rsp),%rsi
call   10b0 <execvp@plt>
xor    %eax,%eax
call   10d0 <fork@plt>
test   %rax,%rax
jne    1594 <processPipe+0x3e4>
mov    0x8(%rsp),%edi
xor    %esi,%esi
call   1040 <dup2@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
cmp    $0x3,%r15d
je     1528 <processPipe+0x378>
cmp    $0x2,%r15d
je     1555 <processPipe+0x3a5>
cmp    $0x1,%r15d
jne    1585 <processPipe+0x3d5>
xor    %edi,%edi
call   1060 <close@plt>
movslq %r12d,%rax
mov    0x18(%rsp,%rax,8),%rdi
mov    0x2abc(%rip),%rax
mov    (%rax),%esi
jmp    154c <processPipe+0x39c>
mov    $0x1,%edi
call   1060 <close@plt>
movslq %r12d,%rax
mov    0x18(%rsp,%rax,8),%rdi
mov    0x2a87(%rip),%rax
mov    0x2a78(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
xor    %eax,%eax
call   1090 <open@plt>
jmp    1585 <processPipe+0x3d5>
mov    $0x1,%edi
call   1060 <close@plt>
movslq %r12d,%rax
mov    0x18(%rsp,%rax,8),%rdi
mov    0x2a5a(%rip),%rax
mov    0x2a83(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1a4,%edx
xor    %eax,%eax
call   1090 <open@plt>
mov    0x20(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   10b0 <execvp@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
lea    0x14(%rsp),%rdi
call   10c0 <wait@plt>
lea    0x10(%rsp),%rdi
call   10c0 <wait@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
lea    0xa3e(%rip),%rdi
call   1050 <printf@plt>
add    $0x2028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"<\00"
@.str.2 = [2 x i8] c">\00"
@.str.3 = [3 x i8] c">>\00"
@O_RDONLY = global i32 0
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@.str.4 = [40 x i8] c"Command 1 Exit: %d, Command 2 Exit: %d\0A\00"
define void @processPipe(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [512 x i8*]
%6 = alloca [512 x i8*]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [2 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 1, i32* %11
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
%18 = load i8*, i8** %3
%19 = call i8* @strtok(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 0
store i8* %20, i8** %21
%22 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %22, i8** %8
br label %23
23: ; preds = %67, %2
%24 = load i8*, i8** %8
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %71
26: ; preds = %23
%27 = load i8*, i8** %8
%28 = load i8*, i8** %8
%29 = call i32 @strlen(i8* %28)
%30 = sub nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %27, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 10
br i1 %35, label %36, label %43
36: ; preds = %26
%37 = load i8*, i8** %8
%38 = load i8*, i8** %8
%39 = call i32 @strlen(i8* %38)
%40 = sub nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %37, i64 %41
store i8 0, i8* %42
br label %43
43: ; preds = %36, %26
%44 = load i8*, i8** %8
%45 = load i32, i32* %11
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 %46
store i8* %44, i8** %47
%48 = load i8*, i8** %8
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %43
%52 = load i32, i32* %11
store i32 %52, i32* %15
store i32 1, i32* %14
br label %67
53: ; preds = %43
%54 = load i8*, i8** %8
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = load i32, i32* %11
store i32 %58, i32* %15
store i32 2, i32* %14
br label %66
59: ; preds = %53
%60 = load i8*, i8** %8
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = load i32, i32* %11
store i32 %64, i32* %15
store i32 3, i32* %14
br label %65
65: ; preds = %63, %59
br label %66
66: ; preds = %65, %57
br label %67
67: ; preds = %66, %51
%68 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %68, i8** %8
%69 = load i32, i32* %11
%70 = add nsw i32 %69, 1
store i32 %70, i32* %11
br label %23
71: ; preds = %23
%72 = load i32, i32* %15
%73 = icmp ne i32 %72, 0
br i1 %73, label %78, label %74
74: ; preds = %71
%75 = load i32, i32* %11
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 %76
store i8* null, i8** %77
br label %82
78: ; preds = %71
%79 = load i32, i32* %15
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 %80
store i8* null, i8** %81
br label %82
82: ; preds = %78, %74
%83 = load i8*, i8** %4
%84 = call i8* @strtok(i8* %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %84, i8** %7
%85 = load i8*, i8** %7
%86 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 0
store i8* %85, i8** %86
%87 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %87, i8** %8
store i32 1, i32* %11
br label %88
88: ; preds = %132, %82
%89 = load i8*, i8** %8
%90 = icmp ne i8* %89, null
br i1 %90, label %91, label %136
91: ; preds = %88
%92 = load i8*, i8** %8
%93 = load i8*, i8** %8
%94 = call i32 @strlen(i8* %93)
%95 = sub nsw i32 %94, 1
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %92, i64 %96
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 10
br i1 %100, label %101, label %108
101: ; preds = %91
%102 = load i8*, i8** %8
%103 = load i8*, i8** %8
%104 = call i32 @strlen(i8* %103)
%105 = sub nsw i32 %104, 1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %102, i64 %106
store i8 0, i8* %107
br label %108
108: ; preds = %101, %91
%109 = load i8*, i8** %8
%110 = load i32, i32* %11
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 %111
store i8* %109, i8** %112
%113 = load i8*, i8** %8
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %108
%117 = load i32, i32* %11
store i32 %117, i32* %17
store i32 1, i32* %16
br label %132
118: ; preds = %108
%119 = load i8*, i8** %8
%120 = call i64 @strcmp(i8* %119, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %124
122: ; preds = %118
%123 = load i32, i32* %11
store i32 %123, i32* %17
store i32 2, i32* %16
br label %131
124: ; preds = %118
%125 = load i8*, i8** %8
%126 = call i64 @strcmp(i8* %125, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%127 = icmp eq i64 %126, 0
br i1 %127, label %128, label %130
128: ; preds = %124
%129 = load i32, i32* %11
store i32 %129, i32* %17
store i32 3, i32* %16
br label %130
130: ; preds = %128, %124
br label %131
131: ; preds = %130, %122
br label %132
132: ; preds = %131, %116
%133 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %133, i8** %8
%134 = load i32, i32* %11
%135 = add nsw i32 %134, 1
store i32 %135, i32* %11
br label %88
136: ; preds = %88
%137 = load i32, i32* %16
%138 = icmp ne i32 %137, 0
br i1 %138, label %143, label %139
139: ; preds = %136
%140 = load i32, i32* %11
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 %141
store i8* null, i8** %142
br label %147
143: ; preds = %136
%144 = load i32, i32* %17
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 %145
store i8* null, i8** %146
br label %147
147: ; preds = %143, %139
%148 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%149 = call i32 @pipe(i32* %148)
%150 = call i64 (...) @fork()
%151 = icmp eq i64 %150, 0
br i1 %151, label %152, label %208
152: ; preds = %147
%153 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%154 = load i32, i32* %153
%155 = call i32 @dup2(i32 %154, i32 1)
%156 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%157 = load i32, i32* %156
%158 = call i32 @close(i32 %157)
%159 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%160 = load i32, i32* %159
%161 = call i32 @close(i32 %160)
%162 = load i32, i32* %14
%163 = icmp eq i32 %162, 1
br i1 %163, label %164, label %173
164: ; preds = %152
%165 = call i32 @close(i32 0)
%166 = load i32, i32* %11
%167 = sub nsw i32 %166, 1
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 %168
%170 = load i8*, i8** %169
%171 = load i32, i32* @O_RDONLY
%172 = call i32 (i8*, i32, ...) @open(i8* %170, i32 %171)
br label %203
173: ; preds = %152
%174 = load i32, i32* %14
%175 = icmp eq i32 %174, 2
br i1 %175, label %176, label %187
176: ; preds = %173
%177 = call i32 @close(i32 1)
%178 = load i32, i32* %11
%179 = sub nsw i32 %178, 1
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 %180
%182 = load i8*, i8** %181
%183 = load i32, i32* @O_WRONLY
%184 = load i32, i32* @O_CREAT
%185 = or i32 %183, %184
%186 = call i32 (i8*, i32, ...) @open(i8* %182, i32 %185, i32 420)
br label %202
187: ; preds = %173
%188 = load i32, i32* %14
%189 = icmp eq i32 %188, 3
br i1 %189, label %190, label %201
190: ; preds = %187
%191 = call i32 @close(i32 1)
%192 = load i32, i32* %11
%193 = sub nsw i32 %192, 1
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 %194
%196 = load i8*, i8** %195
%197 = load i32, i32* @O_WRONLY
%198 = load i32, i32* @O_APPEND
%199 = or i32 %197, %198
%200 = call i32 (i8*, i32, ...) @open(i8* %196, i32 %199)
br label %201
201: ; preds = %190, %187
br label %202
202: ; preds = %201, %176
br label %203
203: ; preds = %202, %164
%204 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 0
%205 = load i8*, i8** %204
%206 = getelementptr inbounds [512 x i8*], [512 x i8*]* %5, i64 0, i64 0
%207 = call i32 @execvp(i8* %205, i8** %206)
br label %208
208: ; preds = %203, %147
%209 = call i64 (...) @fork()
%210 = icmp eq i64 %209, 0
br i1 %210, label %211, label %267
211: ; preds = %208
%212 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%213 = load i32, i32* %212
%214 = call i32 @dup2(i32 %213, i32 0)
%215 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%216 = load i32, i32* %215
%217 = call i32 @close(i32 %216)
%218 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%219 = load i32, i32* %218
%220 = call i32 @close(i32 %219)
%221 = load i32, i32* %16
%222 = icmp eq i32 %221, 1
br i1 %222, label %223, label %232
223: ; preds = %211
%224 = call i32 @close(i32 0)
%225 = load i32, i32* %11
%226 = sub nsw i32 %225, 1
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 %227
%229 = load i8*, i8** %228
%230 = load i32, i32* @O_RDONLY
%231 = call i32 (i8*, i32, ...) @open(i8* %229, i32 %230)
br label %262
232: ; preds = %211
%233 = load i32, i32* %16
%234 = icmp eq i32 %233, 2
br i1 %234, label %235, label %246
235: ; preds = %232
%236 = call i32 @close(i32 1)
%237 = load i32, i32* %11
%238 = sub nsw i32 %237, 1
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 %239
%241 = load i8*, i8** %240
%242 = load i32, i32* @O_WRONLY
%243 = load i32, i32* @O_CREAT
%244 = or i32 %242, %243
%245 = call i32 (i8*, i32, ...) @open(i8* %241, i32 %244, i32 420)
br label %261
246: ; preds = %232
%247 = load i32, i32* %16
%248 = icmp eq i32 %247, 3
br i1 %248, label %249, label %260
249: ; preds = %246
%250 = call i32 @close(i32 1)
%251 = load i32, i32* %11
%252 = sub nsw i32 %251, 1
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 %253
%255 = load i8*, i8** %254
%256 = load i32, i32* @O_WRONLY
%257 = load i32, i32* @O_APPEND
%258 = or i32 %256, %257
%259 = call i32 (i8*, i32, ...) @open(i8* %255, i32 %258)
br label %260
260: ; preds = %249, %246
br label %261
261: ; preds = %260, %235
br label %262
262: ; preds = %261, %223
%263 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 0
%264 = load i8*, i8** %263
%265 = getelementptr inbounds [512 x i8*], [512 x i8*]* %6, i64 0, i64 0
%266 = call i32 @execvp(i8* %264, i8** %265)
br label %267
267: ; preds = %262, %208
%268 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%269 = load i32, i32* %268
%270 = call i32 @close(i32 %269)
%271 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%272 = load i32, i32* %271
%273 = call i32 @close(i32 %272)
%274 = call i32 @wait(i32* %12)
%275 = call i32 @wait(i32* %13)
%276 = load i32, i32* %12
%277 = load i32, i32* %13
%278 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %276, i32 %277)
ret void
}

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