#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ close(int);
int dup2(int, int /*<<< orphan*/);
int execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
scalar_t__ pipe(int *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main(int argc, char **argv) {
  int p[2], r, i;
  char buf[64];
  pid_t pid;
  if (argc != 3) {
    fprintf(stderr, "%s ARG1 ARG2\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  char *request[] = {"../bin/client", "-c",    "concat", "-ret",  "-str",
                     "-str",          argv[1], "-str",   argv[2], NULL};
  printf("Request: \n  ");
  for (i = 0; i < 9; i++) {
    printf("%s ", request[i]);
  }
  printf("\n\nAnswer : \n");
  if (pipe(p) != 0) {
    perror("pipe()");
    exit(EXIT_FAILURE);
  }
  pid = fork();
  if (pid < 0) {
    perror("fork()");
    exit(EXIT_FAILURE);
  } else if (pid == 0) {
    close(p[0]);
    if (dup2(p[1], STDOUT_FILENO) == -1) {
      perror("dup2()");
      exit(EXIT_FAILURE);
    }
    if (execvp(request[0], request) == -1) {
      perror("execvp()");
      exit(EXIT_FAILURE);
    }
  }
  close(p[1]);
  while ((r = read(p[0], buf, 64)) > 0) {
    write(STDOUT_FILENO, buf, r);
  }
  if (r == -1) {
    perror("read()");
    exit(EXIT_FAILURE);
  }
  wait(NULL);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     120d <main+0x4d>
mov    0x2dee(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe06(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
lea    0xdfa(%rip),%rax
mov    %rax,-0xc0(%rbp)
lea    0xdfa(%rip),%rax
mov    %rax,-0xb8(%rbp)
lea    0xdef(%rip),%rax
mov    %rax,-0xb0(%rbp)
lea    0xde8(%rip),%rax
mov    %rax,-0xa8(%rbp)
lea    0xddf(%rip),%rax
mov    %rax,-0xa0(%rbp)
lea    0xdd1(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x90(%rbp)
lea    0xdb4(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x80(%rbp)
movq   $0x0,-0x78(%rbp)
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x9,-0x20(%rbp)
jge    12d9 <main+0x119>
movslq -0x20(%rbp),%rax
mov    -0xc0(%rbp,%rax,8),%rsi
ff
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12a7 <main+0xe7>
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1070 <pipe@plt>
cmp    $0x0,%rax
je     1314 <main+0x154>
lea    0xd4d(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   10e0 <fork@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jge    1344 <main+0x184>
lea    0xd24(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2c93(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
cmpq   $0x0,-0x68(%rbp)
jne    13c6 <main+0x206>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    -0x14(%rbp),%edi
mov    0x2c8f(%rip),%rax
mov    (%rax),%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    138b <main+0x1cb>
lea    0xce4(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2c4c(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0xc0(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   10b0 <execvp@plt>
cmp    $0xffffffff,%eax
jne    13c1 <main+0x201>
lea    0xcb5(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    13c6 <main+0x206>
jmp    13cb <main+0x20b>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
mov    -0x18(%rbp),%edi
lea    -0x60(%rbp),%rsi
mov    $0x40,%edx
call   1080 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    140a <main+0x24a>
mov    0x2bf9(%rip),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <write@plt>
jmp    13d3 <main+0x213>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    142e <main+0x26e>
lea    0xc51(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2ba9(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10d0 <wait@plt>
mov    0x2b8a(%rip),%rax
mov    (%rax),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
cmp    $0x3,%edi
jne    13c9 <main+0x1f9>
lea    0xe1d(%rip),%rbp
mov    %rbp,0x10(%rsp)
lea    0xe1f(%rip),%r13
mov    %r13,0x18(%rsp)
lea    0xe16(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xe11(%rip),%rax
mov    %rax,0x28(%rsp)
lea    0xe0a(%rip),%r12
mov    %r12,0x30(%rsp)
mov    %r12,0x38(%rsp)
mov    0x8(%rsi),%r15
mov    %r15,0x40(%rsp)
mov    %r12,0x48(%rsp)
mov    0x10(%rsi),%r14
mov    %r14,0x50(%rsp)
movq   $0x0,0x58(%rsp)
lea    0xdde(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xddd(%rip),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
lea    0xd9b(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
lea    0xd91(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd82(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1080 <pipe@plt>
test   %rax,%rax
jne    13e3 <main+0x213>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %rax,%rax
js     13ec <main+0x21c>
jne    134c <main+0x17c>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
mov    0xc(%rsp),%edi
mov    0x2cce(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
cmp    $0xffffffff,%eax
je     13fe <main+0x22e>
lea    0xcd5(%rip),%rdi
lea    0x10(%rsp),%rsi
call   10c0 <execvp@plt>
cmp    $0xffffffff,%eax
je     1407 <main+0x237>
mov    0xc(%rsp),%edi
call   1070 <close@plt>
mov    0x8(%rsp),%edi
lea    0x60(%rsp),%rsi
mov    $0x40,%edx
call   1090 <read@plt>
test   %eax,%eax
jle    13a2 <main+0x1d2>
mov    0x2c7d(%rip),%rbp
lea    0x60(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1090 <read@plt>
test   %eax,%eax
jg     1380 <main+0x1b0>
cmp    $0xffffffff,%eax
je     13f5 <main+0x225>
xor    %edi,%edi
call   10e0 <wait@plt>
mov    0x2c13(%rip),%rax
mov    (%rax),%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c08(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xc24(%rip),%rsi
call   10a0 <fprintf@plt>
jmp    1413 <main+0x243>
lea    0xc57(%rip),%rdi
jmp    140e <main+0x23e>
lea    0xc55(%rip),%rdi
jmp    140e <main+0x23e>
lea    0xc63(%rip),%rdi
jmp    140e <main+0x23e>
lea    0xc4a(%rip),%rdi
jmp    140e <main+0x23e>
lea    0xc48(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2bb6(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"%s ARG1 ARG2\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [14 x i8] c"../bin/client\00"
@.str.2 = [3 x i8] c"-c\00"
@.str.3 = [7 x i8] c"concat\00"
@.str.4 = [5 x i8] c"-ret\00"
@.str.5 = [5 x i8] c"-str\00"
@.str.6 = [13 x i8] c"Request: \0A \00"
@.str.7 = [4 x i8] c"%s \00"
@.str.9 = [7 x i8] c"pipe()\00"
@.str.10 = [7 x i8] c"fork()\00"
@STDOUT_FILENO = global i32 0
@.str.11 = [7 x i8] c"dup2()\00"
@.str.12 = [9 x i8] c"execvp()\00"
@.str.13 = [7 x i8] c"read()\00"
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"\0A\0AAnswer : \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32]
%4 = alloca [64 x i8]
%5 = alloca [10 x i8*]
%6 = bitcast [2 x i32]* %3 to i8*
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%8 = icmp eq i32 %0, 3
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %1
%12 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = bitcast [10 x i8*]* %5 to i8*
%17 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 0
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %17
%18 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %20
%21 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %21
%22 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %22
%23 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 6
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
store i8* %25, i8** %23
%26 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %26
%27 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 8
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
store i8* %29, i8** %27
%30 = getelementptr inbounds [10 x i8*], [10 x i8*]* %5, i64 0, i64 9
store i8* null, i8** %30
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %25)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %29)
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%43 = call i64 @pipe(i32* %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %49, label %45
45: ; preds = %15
%46 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %15
%50 = call i64 (...) @fork()
%51 = icmp slt i64 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%54 = load i32, i32* @EXIT_FAILURE
%55 = call i32 @exit(i32 %54)
unreachable
56: ; preds = %49
%57 = icmp eq i64 %50, 0
br i1 %57, label %58, label %77
58: ; preds = %56
%59 = load i32, i32* %42
%60 = call i32 @close(i32 %59)
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%62 = load i32, i32* %61
%63 = load i32, i32* @STDOUT_FILENO
%64 = call i32 @dup2(i32 %62, i32 %63)
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %70
66: ; preds = %58
%67 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%68 = load i32, i32* @EXIT_FAILURE
%69 = call i32 @exit(i32 %68)
unreachable
70: ; preds = %58
%71 = call i32 @execvp(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %17)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%75 = load i32, i32* @EXIT_FAILURE
%76 = call i32 @exit(i32 %75)
unreachable
77: ; preds = %56, %70
%78 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%79 = load i32, i32* %78
%80 = call i32 @close(i32 %79)
%81 = load i32, i32* %42
%82 = call i32 @read(i32 %81, i8* %7, i32 64)
%83 = icmp sgt i32 %82, 0
br i1 %83, label %84, label %91
84: ; preds = %77, %84
%85 = phi i32 [ %89, %84 ], [ %82, %77 ]
%86 = load i32, i32* @STDOUT_FILENO
%87 = call i32 @write(i32 %86, i8* %7, i32 %85)
%88 = load i32, i32* %42
%89 = call i32 @read(i32 %88, i8* %7, i32 64)
%90 = icmp sgt i32 %89, 0
br i1 %90, label %84, label %91
91: ; preds = %84, %77
%92 = phi i32 [ %82, %77 ], [ %89, %84 ]
%93 = icmp eq i32 %92, -1
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%96 = load i32, i32* @EXIT_FAILURE
%97 = call i32 @exit(i32 %96)
unreachable
98: ; preds = %91
%99 = call i32 @wait(i32* null)
%100 = load i32, i32* @EXIT_SUCCESS
ret i32 %100
}