#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 /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int /*<<< orphan*/);
int /*<<< orphan*/ execlp(char *, char *, char *, ...);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ free(char *);
char *malloc(int);
int pipe(int *);
int /*<<< orphan*/ printf(char *);
int read(int, char *, int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main(int argc, char **argv) {
  if (argc < 3) {
    printf("Error! I must get two arguments!\n");
    exit(-1);
  }
  int pfd1[2], pfd2[2], pfd3[2];
  if (pipe(pfd1) == -1) {
    printf("Error! Could not open pipe!\n");
    exit(-3);
  };
  if (fork() == 0) {
    close(pfd1[0]);
    dup2(pfd1[1], STDOUT_FILENO);
    execlp("ls", "ls", argv[1], NULL);
    printf("Error calling ls!\n");
    exit(-10);
  }
  close(pfd1[1]);
  if (pipe(pfd2) == -1) {
    printf("Error! Could not open pipe!\n");
    exit(-3);
  };
  close(pfd2[1]);
  if (fork() == 0) {
    close(pfd2[0]);
    dup2(pfd1[0], STDIN_FILENO);
    dup2(pfd2[1], STDOUT_FILENO);
    execlp("grep", "grep", argv[2], NULL);
    printf("Error calling grep!\n");
    exit(-10);
  }
  if (pipe(pfd3) == -1) {
    printf("Error! Could not open pipe!\n");
    exit(-3);
  };
  if (fork() == 0) {
    close(pfd2[1]);
    close(pfd1[0]);
    dup2(pfd2[0], STDIN_FILENO);
    dup2(pfd3[1], STDOUT_FILENO);
    execlp("sort", "sort", NULL);
    printf("Error calling sort!\n");
    exit(-10);
  }
  close(pfd3[1]);
  char *buf = malloc(100);
  int rr;
  while ((rr = read(pfd3[0], buf, 100)) > 0) {
    write(STDOUT_FILENO, buf, rr);
  }
  free(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11e6 <main+0x36>
lea    0xe29(%rip),%rdi
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
lea    -0x18(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
jne    120e <main+0x5e>
lea    0xe23(%rip),%rdi
call   1060 <printf@plt>
mov    $0xfffffffd,%edi
call   10b0 <exit@plt>
mov    $0x0,%al
call   10d0 <fork@plt>
cmp    $0x0,%rax
jne    126b <main+0xbb>
mov    -0x18(%rbp),%edi
call   1070 <close@plt>
mov    -0x14(%rbp),%edi
mov    0x2dbf(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdf8(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
mov    $0x0,%al
call   10c0 <execlp@plt>
lea    0xde6(%rip),%rdi
call   1060 <printf@plt>
mov    $0xfffffff6,%edi
call   10b0 <exit@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
lea    -0x20(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
jne    129b <main+0xeb>
lea    0xd96(%rip),%rdi
call   1060 <printf@plt>
mov    $0xfffffffd,%edi
call   10b0 <exit@plt>
mov    -0x1c(%rbp),%edi
call   1070 <close@plt>
mov    $0x0,%al
call   10d0 <fork@plt>
cmp    $0x0,%rax
jne    1311 <main+0x161>
mov    -0x20(%rbp),%edi
call   1070 <close@plt>
mov    -0x18(%rbp),%edi
mov    0x2d12(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
mov    -0x1c(%rbp),%edi
mov    0x2d19(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd68(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
mov    $0x0,%al
call   10c0 <execlp@plt>
lea    0xd58(%rip),%rdi
call   1060 <printf@plt>
mov    $0xfffffff6,%edi
call   10b0 <exit@plt>
lea    -0x28(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1339 <main+0x189>
lea    0xcf8(%rip),%rdi
call   1060 <printf@plt>
mov    $0xfffffffd,%edi
call   10b0 <exit@plt>
mov    $0x0,%al
call   10d0 <fork@plt>
cmp    $0x0,%rax
jne    13a7 <main+0x1f7>
mov    -0x1c(%rbp),%edi
call   1070 <close@plt>
mov    -0x18(%rbp),%edi
call   1070 <close@plt>
mov    -0x20(%rbp),%edi
mov    0x2c74(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
mov    -0x24(%rbp),%edi
mov    0x2c7b(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
lea    0xcec(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
mov    $0x0,%al
call   10c0 <execlp@plt>
lea    0xcdc(%rip),%rdi
call   1060 <printf@plt>
mov    $0xfffffff6,%edi
call   10b0 <exit@plt>
mov    -0x24(%rbp),%edi
call   1070 <close@plt>
mov    $0x64,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    $0x64,%edx
call   1090 <read@plt>
mov    %eax,-0x34(%rbp)
cmp    $0x0,%eax
jle    13f4 <main+0x244>
mov    0x2c0f(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   1040 <write@plt>
jmp    13bd <main+0x20d>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jle    12ba <main+0x10a>
mov    %rsi,%rbx
lea    0x8(%rsp),%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
je     12a4 <main+0xf4>
xor    %eax,%eax
call   10d0 <fork@plt>
test   %rax,%rax
je     12d0 <main+0x120>
mov    0xc(%rsp),%edi
call   1070 <close@plt>
mov    %rsp,%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
je     12a4 <main+0xf4>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
xor    %eax,%eax
call   10d0 <fork@plt>
test   %rax,%rax
je     130e <main+0x15e>
lea    0x10(%rsp),%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
je     12a4 <main+0xf4>
xor    %eax,%eax
call   10d0 <fork@plt>
test   %rax,%rax
je     135a <main+0x1aa>
mov    0x14(%rsp),%edi
call   1070 <close@plt>
mov    $0x64,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    0x10(%rsp),%edi
mov    %rax,%rsi
mov    $0x64,%edx
call   1090 <read@plt>
test   %eax,%eax
jle    1292 <main+0xe2>
mov    0x2d82(%rip),%r14
xchg   %ax,%ax
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    0x10(%rsp),%edi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1090 <read@plt>
test   %eax,%eax
jg     1270 <main+0xc0>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
lea    0xd9c(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffffffd,%edi
call   10b0 <exit@plt>
lea    0xda2(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
mov    0xc(%rsp),%edi
mov    0x2d0c(%rip),%rax
mov    (%rax),%esi
call   1060 <dup2@plt>
mov    0x8(%rbx),%rdx
lea    0xd0a(%rip),%rdi
mov    %rdi,%rsi
xor    %ecx,%ecx
xor    %eax,%eax
call   10c0 <execlp@plt>
lea    0xd2c(%rip),%rdi
jmp    13a9 <main+0x1f9>
mov    (%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%edi
mov    0x2cb7(%rip),%rax
mov    (%rax),%esi
call   1060 <dup2@plt>
mov    0x4(%rsp),%edi
mov    0x2cbd(%rip),%rax
mov    (%rax),%esi
call   1060 <dup2@plt>
mov    0x10(%rbx),%rdx
lea    0xcbe(%rip),%rdi
mov    %rdi,%rsi
xor    %ecx,%ecx
xor    %eax,%eax
call   10c0 <execlp@plt>
lea    0xcc9(%rip),%rdi
jmp    13a9 <main+0x1f9>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
mov    (%rsp),%edi
mov    0x2c62(%rip),%rax
mov    (%rax),%esi
call   1060 <dup2@plt>
mov    0x14(%rsp),%edi
mov    0x2c68(%rip),%rax
mov    (%rax),%esi
call   1060 <dup2@plt>
lea    0xc72(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   10c0 <execlp@plt>
lea    0xc64(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffffff6,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Error! I must get two arguments!\0A\00"
@.str.1 = [29 x i8] c"Error! Could not open pipe!\0A\00"
@STDOUT_FILENO = global i32 0
@.str.2 = [3 x i8] c"ls\00"
@.str.3 = [19 x i8] c"Error calling ls!\0A\00"
@STDIN_FILENO = global i32 0
@.str.4 = [5 x i8] c"grep\00"
@.str.5 = [21 x i8] c"Error calling grep!\0A\00"
@.str.6 = [5 x i8] c"sort\00"
@.str.7 = [21 x i8] c"Error calling sort!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca [2 x i32]
%9 = alloca i8*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%18 = call i32 @pipe(i32* %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @exit(i32 -3)
unreachable
23: ; preds = %16
%24 = call i64 (...) @fork()
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %40
26: ; preds = %23
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%28 = load i32, i32* %27
%29 = call i32 @close(i32 %28)
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%31 = load i32, i32* %30
%32 = load i32, i32* @STDOUT_FILENO
%33 = call i32 @dup2(i32 %31, i32 %32)
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32 (i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %36, i8* null)
%38 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32 @exit(i32 -10)
unreachable
40: ; preds = %23
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%42 = load i32, i32* %41
%43 = call i32 @close(i32 %42)
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%45 = call i32 @pipe(i32* %44)
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %50
47: ; preds = %40
%48 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%49 = call i32 @exit(i32 -3)
unreachable
50: ; preds = %40
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%52 = load i32, i32* %51
%53 = call i32 @close(i32 %52)
%54 = call i64 (...) @fork()
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %74
56: ; preds = %50
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%58 = load i32, i32* %57
%59 = call i32 @close(i32 %58)
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%61 = load i32, i32* %60
%62 = load i32, i32* @STDIN_FILENO
%63 = call i32 @dup2(i32 %61, i32 %62)
%64 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%65 = load i32, i32* %64
%66 = load i32, i32* @STDOUT_FILENO
%67 = call i32 @dup2(i32 %65, i32 %66)
%68 = load i8**, i8*** %5
%69 = getelementptr inbounds i8*, i8** %68, i64 2
%70 = load i8*, i8** %69
%71 = call i32 (i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %70, i8* null)
%72 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%73 = call i32 @exit(i32 -10)
unreachable
74: ; preds = %50
%75 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%76 = call i32 @pipe(i32* %75)
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %81
78: ; preds = %74
%79 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%80 = call i32 @exit(i32 -3)
unreachable
81: ; preds = %74
%82 = call i64 (...) @fork()
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %102
84: ; preds = %81
%85 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%86 = load i32, i32* %85
%87 = call i32 @close(i32 %86)
%88 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%89 = load i32, i32* %88
%90 = call i32 @close(i32 %89)
%91 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%92 = load i32, i32* %91
%93 = load i32, i32* @STDIN_FILENO
%94 = call i32 @dup2(i32 %92, i32 %93)
%95 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%96 = load i32, i32* %95
%97 = load i32, i32* @STDOUT_FILENO
%98 = call i32 @dup2(i32 %96, i32 %97)
%99 = call i32 (i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* null)
%100 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%101 = call i32 @exit(i32 -10)
unreachable
102: ; preds = %81
%103 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%104 = load i32, i32* %103
%105 = call i32 @close(i32 %104)
%106 = call i8* @malloc(i32 100)
store i8* %106, i8** %9
br label %107
107: ; preds = %113, %102
%108 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%109 = load i32, i32* %108
%110 = load i8*, i8** %9
%111 = call i32 @read(i32 %109, i8* %110, i32 100)
store i32 %111, i32* %10
%112 = icmp sgt i32 %111, 0
br i1 %112, label %113, label %118
113: ; preds = %107
%114 = load i32, i32* @STDOUT_FILENO
%115 = load i8*, i8** %9
%116 = load i32, i32* %10
%117 = call i32 @write(i32 %114, i8* %115, i32 %116)
br label %107
118: ; preds = %107
%119 = load i8*, i8** %9
%120 = call i32 @free(i8* %119)
ret i32 0
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str.2 = [3 x i8] c"ls\00"
@STDIN_FILENO = global i32 0
@.str.4 = [5 x i8] c"grep\00"
@.str.6 = [5 x i8] c"sort\00"
@str = [20 x i8] c"Error calling sort!\00"
@str.9 = [20 x i8] c"Error calling grep!\00"
@str.11 = [18 x i8] c"Error calling ls!\00"
@str.12 = [28 x i8] c"Error! Could not open pipe!\00"
@str.13 = [33 x i8] c"Error! I must get two arguments!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = icmp slt i32 %0, 3
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.13, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
%11 = bitcast [2 x i32]* %3 to i8*
%12 = bitcast [2 x i32]* %4 to i8*
%13 = bitcast [2 x i32]* %5 to i8*
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%15 = call i32 @pipe(i32* %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.12, i64 0, i64 0))
%19 = call i32 @exit(i32 -3)
unreachable
20: ; preds = %10
%21 = call i64 (...) @fork()
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %35
23: ; preds = %20
%24 = load i32, i32* %14
%25 = call i32 @close(i32 %24)
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%27 = load i32, i32* %26
%28 = load i32, i32* @STDOUT_FILENO
%29 = call i32 @dup2(i32 %27, i32 %28)
%30 = getelementptr inbounds i8*, i8** %1, i64 1
%31 = load i8*, i8** %30
%32 = call i32 (i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %31, i8* null)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0))
%34 = call i32 @exit(i32 -10)
unreachable
35: ; preds = %20
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%37 = load i32, i32* %36
%38 = call i32 @close(i32 %37)
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%40 = call i32 @pipe(i32* %39)
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %45
42: ; preds = %35
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.12, i64 0, i64 0))
%44 = call i32 @exit(i32 -3)
unreachable
45: ; preds = %35
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%47 = load i32, i32* %46
%48 = call i32 @close(i32 %47)
%49 = call i64 (...) @fork()
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %65
51: ; preds = %45
%52 = load i32, i32* %39
%53 = call i32 @close(i32 %52)
%54 = load i32, i32* %14
%55 = load i32, i32* @STDIN_FILENO
%56 = call i32 @dup2(i32 %54, i32 %55)
%57 = load i32, i32* %46
%58 = load i32, i32* @STDOUT_FILENO
%59 = call i32 @dup2(i32 %57, i32 %58)
%60 = getelementptr inbounds i8*, i8** %1, i64 2
%61 = load i8*, i8** %60
%62 = call i32 (i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %61, i8* null)
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0))
%64 = call i32 @exit(i32 -10)
unreachable
65: ; preds = %45
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%67 = call i32 @pipe(i32* %66)
%68 = icmp eq i32 %67, -1
br i1 %68, label %69, label %72
69: ; preds = %65
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.12, i64 0, i64 0))
%71 = call i32 @exit(i32 -3)
unreachable
72: ; preds = %65
%73 = call i64 (...) @fork()
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %90
75: ; preds = %72
%76 = load i32, i32* %46
%77 = call i32 @close(i32 %76)
%78 = load i32, i32* %14
%79 = call i32 @close(i32 %78)
%80 = load i32, i32* %39
%81 = load i32, i32* @STDIN_FILENO
%82 = call i32 @dup2(i32 %80, i32 %81)
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%84 = load i32, i32* %83
%85 = load i32, i32* @STDOUT_FILENO
%86 = call i32 @dup2(i32 %84, i32 %85)
%87 = call i32 (i8*, i8*, i8*, ...) @execlp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* null)
%88 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%89 = call i32 @exit(i32 -10)
unreachable
90: ; preds = %72
%91 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%92 = load i32, i32* %91
%93 = call i32 @close(i32 %92)
%94 = call dereferenceable_or_null(100) i8* @malloc(i32 100)
%95 = load i32, i32* %66
%96 = call i32 @read(i32 %95, i8* %94, i32 100)
%97 = icmp sgt i32 %96, 0
br i1 %97, label %98, label %105
98: ; preds = %90, %98
%99 = phi i32 [ %103, %98 ], [ %96, %90 ]
%100 = load i32, i32* @STDOUT_FILENO
%101 = call i32 @write(i32 %100, i8* %94, i32 %99)
%102 = load i32, i32* %66
%103 = call i32 @read(i32 %102, i8* %94, i32 100)
%104 = icmp sgt i32 %103, 0
br i1 %104, label %98, label %105
105: ; preds = %98, %90
%106 = call i32 @free(i8* %94)
ret i32 0
}