#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 int pid_t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execlp(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ pipe(int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ wait(int *);
int main(int argc, char **argv) {
  int fd1[2], fd2[2];
  int st;
  pid_t pid;
  if (argc != 4) {
    fprintf(stderr, "wrong number of parameters\n");
    return 0;
  }
  if (pipe(fd1) < 0 || pipe(fd2) < 0) {
    fprintf(stderr, "pipe failed\n");
    exit(1);
  }
  if ((pid = fork()) == 0) {
    dup2(fd2[0], 0);
    close(fd2[0]);
    close(fd2[1]);
    close(fd1[0]);
    close(fd1[1]);
    execlp(argv[3], argv[3], NULL);
    fprintf(stderr, "exec in c failed\n");
    exit(0);
  } else if (pid == -1) {
    fprintf(stderr, "fork failed\n");
    exit(0);
  }
  if ((pid = fork()) == 0) {
    dup2(fd2[1], 1);
    dup2(fd2[1], 2);
    dup2(fd1[0], 0);
    close(fd2[0]);
    close(fd2[1]);
    close(fd1[0]);
    close(fd1[1]);
    execlp(argv[2], argv[2], NULL);
    fprintf(stderr, "exec in pr2 failed\n");
    exit(0);
  } else if (pid == -1) {
    fprintf(stderr, "third fork failed\n");
    exit(0);
  }
  if ((pid = fork()) == 0) {
    dup2(fd1[1], 1);
    close(fd1[0]);
    close(fd1[1]);
    close(fd2[0]);
    close(fd2[1]);
    execlp(argv[1], argv[1], NULL);
    fprintf(stderr, "exec in b failed\n");
    exit(0);
  } else if (pid == -1) {
    fprintf(stderr, "fork failed\n");
    exit(0);
  }
  close(fd1[0]);
  close(fd1[1]);
  close(fd2[0]);
  close(fd2[1]);
  wait(&st);
  wait(&st);
  wait(&st);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11c1 <main+0x41>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    143c <main+0x2bc>
lea    -0x18(%rbp),%rdi
call   1050 <pipe@plt>
cmp    $0x0,%rax
jl     11e7 <main+0x67>
lea    -0x20(%rbp),%rdi
call   1050 <pipe@plt>
cmp    $0x0,%rax
jge    1206 <main+0x86>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0xe25(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %eax,-0x28(%rbp)
cmp    $0x0,%eax
jne    1278 <main+0xf8>
mov    -0x20(%rbp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    -0x20(%rbp),%edi
call   1040 <close@plt>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1080 <execlp@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%edi
lea    0xdbd(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
cmpl   $0xffffffff,-0x28(%rbp)
jne    129e <main+0x11e>
mov    0x2d57(%rip),%rax
mov    (%rax),%edi
lea    0xdc3(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    12a3 <main+0x123>
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %eax,-0x28(%rbp)
cmp    $0x0,%eax
jne    132f <main+0x1af>
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x1c(%rbp),%edi
mov    $0x2,%esi
call   1030 <dup2@plt>
mov    -0x18(%rbp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    -0x20(%rbp),%edi
call   1040 <close@plt>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1080 <execlp@plt>
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
lea    0xd18(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
cmpl   $0xffffffff,-0x28(%rbp)
jne    1355 <main+0x1d5>
mov    0x2ca0(%rip),%rax
mov    (%rax),%edi
lea    0xd06(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    135a <main+0x1da>
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %eax,-0x28(%rbp)
cmp    $0x0,%eax
jne    13cf <main+0x24f>
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x20(%rbp),%edi
call   1040 <close@plt>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1080 <execlp@plt>
mov    0x2c26(%rip),%rax
mov    (%rax),%edi
lea    0xc9f(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
cmpl   $0xffffffff,-0x28(%rbp)
jne    13f5 <main+0x275>
mov    0x2c00(%rip),%rax
mov    (%rax),%edi
lea    0xc6c(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    13fa <main+0x27a>
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x20(%rbp),%edi
call   1040 <close@plt>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
lea    -0x24(%rbp),%rdi
call   1090 <wait@plt>
lea    -0x24(%rbp),%rdi
call   1090 <wait@plt>
lea    -0x24(%rbp),%rdi
call   1090 <wait@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
cmp    $0x4,%edi
jne    1242 <main+0xc2>
mov    %rsi,%rbx
lea    0x14(%rsp),%rdi
call   1050 <pipe@plt>
test   %rax,%rax
js     125f <main+0xdf>
lea    0xc(%rsp),%rdi
call   1050 <pipe@plt>
test   %rax,%rax
js     125f <main+0xdf>
xor    %eax,%eax
call   10a0 <fork@plt>
cmp    $0xffffffff,%eax
je     127e <main+0xfe>
test   %eax,%eax
je     1293 <main+0x113>
xor    %eax,%eax
call   10a0 <fork@plt>
cmp    $0xffffffff,%eax
je     12e5 <main+0x165>
test   %eax,%eax
je     12fa <main+0x17a>
xor    %eax,%eax
call   10a0 <fork@plt>
cmp    $0xffffffff,%eax
je     127e <main+0xfe>
test   %eax,%eax
je     1365 <main+0x1e5>
mov    0x14(%rsp),%edi
call   1040 <close@plt>
mov    0x18(%rsp),%edi
call   1040 <close@plt>
mov    0xc(%rsp),%edi
call   1040 <close@plt>
mov    0x10(%rsp),%edi
call   1040 <close@plt>
lea    0x1c(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <wait@plt>
mov    %rbx,%rdi
call   1090 <wait@plt>
mov    %rbx,%rdi
call   1090 <wait@plt>
jmp    1257 <main+0xd7>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
lea    0xdae(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
lea    0xdad(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
lea    0xdc7(%rip),%rsi
jmp    13b5 <main+0x235>
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    0xc(%rsp),%edi
call   1040 <close@plt>
mov    0x10(%rsp),%edi
call   1040 <close@plt>
mov    0x14(%rsp),%edi
call   1040 <close@plt>
mov    0x18(%rsp),%edi
call   1040 <close@plt>
mov    0x18(%rbx),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1080 <execlp@plt>
mov    0x2d09(%rip),%rax
mov    (%rax),%edi
lea    0xd49(%rip),%rsi
jmp    13b5 <main+0x235>
mov    0x2cf4(%rip),%rax
mov    (%rax),%edi
lea    0xd5a(%rip),%rsi
jmp    13b5 <main+0x235>
mov    0x10(%rsp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    0x10(%rsp),%edi
mov    $0x2,%esi
call   1030 <dup2@plt>
mov    0x14(%rsp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    0xc(%rsp),%edi
call   1040 <close@plt>
mov    0x10(%rsp),%edi
call   1040 <close@plt>
mov    0x14(%rsp),%edi
call   1040 <close@plt>
mov    0x18(%rsp),%edi
call   1040 <close@plt>
mov    0x10(%rbx),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1080 <execlp@plt>
mov    0x2c86(%rip),%rax
mov    (%rax),%edi
lea    0xcd8(%rip),%rsi
jmp    13b5 <main+0x235>
mov    0x18(%rsp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    0x14(%rsp),%edi
call   1040 <close@plt>
mov    0x18(%rsp),%edi
call   1040 <close@plt>
mov    0xc(%rsp),%edi
call   1040 <close@plt>
mov    0x10(%rsp),%edi
call   1040 <close@plt>
mov    0x8(%rbx),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1080 <execlp@plt>
mov    0x2c34(%rip),%rax
mov    (%rax),%edi
lea    0xcad(%rip),%rsi
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"wrong number of parameters\0A\00"
@.str.1 = [13 x i8] c"pipe failed\0A\00"
@.str.2 = [18 x i8] c"exec in c failed\0A\00"
@.str.3 = [13 x i8] c"fork failed\0A\00"
@.str.4 = [20 x i8] c"exec in pr2 failed\0A\00"
@.str.5 = [19 x i8] c"third fork failed\0A\00"
@.str.6 = [18 x i8] c"exec in b failed\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 i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 4
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %160
15: ; preds = %2
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%17 = call i64 @pipe(i32* %16)
%18 = icmp slt i64 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%21 = call i64 @pipe(i32* %20)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19, %15
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %19
%28 = call i32 (...) @fork()
store i32 %28, i32* %9
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %56
30: ; preds = %27
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%32 = load i32, i32* %31
%33 = call i32 @dup2(i32 %32, i32 0)
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%35 = load i32, i32* %34
%36 = call i32 @close(i32 %35)
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%38 = load i32, i32* %37
%39 = call i32 @close(i32 %38)
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%41 = load i32, i32* %40
%42 = call i32 @close(i32 %41)
%43 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%44 = load i32, i32* %43
%45 = call i32 @close(i32 %44)
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 3
%48 = load i8*, i8** %47
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 3
%51 = load i8*, i8** %50
%52 = call i32 @execlp(i8* %48, i8* %51, i32* null)
%53 = load i32, i32* @stderr
%54 = call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%55 = call i32 @exit(i32 0)
unreachable
56: ; preds = %27
%57 = load i32, i32* %9
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %63
59: ; preds = %56
%60 = load i32, i32* @stderr
%61 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%62 = call i32 @exit(i32 0)
unreachable
63: ; preds = %56
br label %64
64: ; preds = %63
%65 = call i32 (...) @fork()
store i32 %65, i32* %9
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %99
67: ; preds = %64
%68 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%69 = load i32, i32* %68
%70 = call i32 @dup2(i32 %69, i32 1)
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%72 = load i32, i32* %71
%73 = call i32 @dup2(i32 %72, i32 2)
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%75 = load i32, i32* %74
%76 = call i32 @dup2(i32 %75, i32 0)
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%78 = load i32, i32* %77
%79 = call i32 @close(i32 %78)
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%81 = load i32, i32* %80
%82 = call i32 @close(i32 %81)
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%84 = load i32, i32* %83
%85 = call i32 @close(i32 %84)
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%87 = load i32, i32* %86
%88 = call i32 @close(i32 %87)
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 2
%91 = load i8*, i8** %90
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 2
%94 = load i8*, i8** %93
%95 = call i32 @execlp(i8* %91, i8* %94, i32* null)
%96 = load i32, i32* @stderr
%97 = call i32 @fprintf(i32 %96, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%98 = call i32 @exit(i32 0)
unreachable
99: ; preds = %64
%100 = load i32, i32* %9
%101 = icmp eq i32 %100, -1
br i1 %101, label %102, label %106
102: ; preds = %99
%103 = load i32, i32* @stderr
%104 = call i32 @fprintf(i32 %103, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%105 = call i32 @exit(i32 0)
unreachable
106: ; preds = %99
br label %107
107: ; preds = %106
%108 = call i32 (...) @fork()
store i32 %108, i32* %9
%109 = icmp eq i32 %108, 0
br i1 %109, label %110, label %136
110: ; preds = %107
%111 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%112 = load i32, i32* %111
%113 = call i32 @dup2(i32 %112, i32 1)
%114 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%115 = load i32, i32* %114
%116 = call i32 @close(i32 %115)
%117 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%118 = load i32, i32* %117
%119 = call i32 @close(i32 %118)
%120 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%121 = load i32, i32* %120
%122 = call i32 @close(i32 %121)
%123 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%124 = load i32, i32* %123
%125 = call i32 @close(i32 %124)
%126 = load i8**, i8*** %5
%127 = getelementptr inbounds i8*, i8** %126, i64 1
%128 = load i8*, i8** %127
%129 = load i8**, i8*** %5
%130 = getelementptr inbounds i8*, i8** %129, i64 1
%131 = load i8*, i8** %130
%132 = call i32 @execlp(i8* %128, i8* %131, i32* null)
%133 = load i32, i32* @stderr
%134 = call i32 @fprintf(i32 %133, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%135 = call i32 @exit(i32 0)
unreachable
136: ; preds = %107
%137 = load i32, i32* %9
%138 = icmp eq i32 %137, -1
br i1 %138, label %139, label %143
139: ; preds = %136
%140 = load i32, i32* @stderr
%141 = call i32 @fprintf(i32 %140, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%142 = call i32 @exit(i32 0)
unreachable
143: ; preds = %136
br label %144
144: ; preds = %143
%145 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%146 = load i32, i32* %145
%147 = call i32 @close(i32 %146)
%148 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%149 = load i32, i32* %148
%150 = call i32 @close(i32 %149)
%151 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%152 = load i32, i32* %151
%153 = call i32 @close(i32 %152)
%154 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%155 = load i32, i32* %154
%156 = call i32 @close(i32 %155)
%157 = call i32 @wait(i32* %8)
%158 = call i32 @wait(i32* %8)
%159 = call i32 @wait(i32* %8)
store i32 0, i32* %3
br label %160
160: ; preds = %144, %12
%161 = load i32, i32* %3
ret i32 %161
}

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