#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;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int STDIN_FILENO;
int /*<<< orphan*/ close(int);
int dup2(int, int);
int /*<<< orphan*/ execlp(char *, char *, char *);
int /*<<< orphan*/ exit(int);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getenv(char *);
int /*<<< orphan*/ perror(char *);
scalar_t__ pipe(int *);
int /*<<< orphan*/ stderr;
int strlen(char *);
char *strrchr(char *, char);
scalar_t__ waitpid(scalar_t__, int /*<<< orphan*/ *, int /*<<< orphan*/);
int write(int, char *, int);
int main(int argc, char **argv) {
  int n, fd[2];
  pid_t pid;
  char line[128], *pager, *argv0;
  FILE *fp;
  if (argc != 2) {
    perror("usage: a.out <pathname>");
    exit(1);
  }
  if ((fp = fopen(argv[1], "r")) == NULL) {
    fprintf(stderr, "can't open %s\n", argv[1]);
    exit(1);
  }
  if (pipe(fd) < 0) {
    perror("pipe error");
    exit(1);
  }
  if ((pid = fork()) < 0) {
    perror("fork error");
    exit(1);
  } else if (pid > 0) {
    close(fd[0]);
    while (fgets(line, 128, fp) != NULL) {
      n = strlen(line);
      if (write(fd[1], line, n) != n) {
        perror("write error to pipe");
        exit(1);
      }
    }
    if (ferror(fp)) {
      perror("fgets error");
      exit(1);
    }
    close(fd[1]);
    if (waitpid(pid, NULL, 0) < 0) {
      perror("waitpid error");
      exit(1);
    }
    exit(0);
  } else {
    close(fd[1]);
    if (fd[0] != STDIN_FILENO) {
      if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) {
        perror("dup2 error to stdin");
        exit(1);
      }
    }
    if ((pager = getenv("PAGER")) == NULL)
      pager = "/usr/bin/more";
    if ((argv0 = strrchr(pager, '/')) != NULL)
      argv0++;
    else
      argv0 = pager;
    execlp(pager, argv0, (char *)0);
    fprintf(stderr, "execl error for %s\n", pager);
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1239 <main+0x39>
lea    0xdd6(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe21(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0xc8(%rbp)
cmp    $0x0,%rax
jne    1285 <main+0x85>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xda2(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    -0x1c(%rbp),%rdi
call   10a0 <pipe@plt>
cmp    $0x0,%rax
jge    12ae <main+0xae>
lea    0xd88(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    $0x0,%al
call   1120 <fork@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jge    12d9 <main+0xd9>
lea    0xd68(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
cmpq   $0x0,-0x28(%rbp)
jle    13bd <main+0x1bd>
mov    -0x1c(%rbp),%edi
call   1090 <close@plt>
lea    -0xb0(%rbp),%rdi
mov    -0xc8(%rbp),%rdx
mov    $0x80,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
je     1353 <main+0x153>
lea    -0xb0(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <write@plt>
cmp    -0x14(%rbp),%eax
je     134e <main+0x14e>
lea    0xcfe(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    12ec <main+0xec>
mov    -0xc8(%rbp),%rdi
call   1040 <ferror@plt>
cmp    $0x0,%rax
je     137f <main+0x17f>
lea    0xce1(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
mov    -0x28(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10d0 <waitpid@plt>
cmp    $0x0,%rax
jge    13b6 <main+0x1b6>
lea    0xcb6(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x18(%rbp),%edi
call   1090 <close@plt>
mov    -0x1c(%rbp),%eax
mov    0x2c09(%rip),%rcx
cmp    (%rcx),%eax
je     1412 <main+0x212>
mov    -0x1c(%rbp),%edi
mov    0x2bf7(%rip),%rax
mov    (%rax),%esi
call   1070 <dup2@plt>
mov    0x2be9(%rip),%rcx
cmp    (%rcx),%eax
je     140d <main+0x20d>
lea    0xc6d(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    1412 <main+0x212>
lea    0xc66(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0xb8(%rbp)
cmp    $0x0,%rax
jne    143d <main+0x23d>
lea    0xc4f(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc0(%rbp)
cmp    $0x0,%rax
je     1476 <main+0x276>
mov    -0xc0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc0(%rbp)
jmp    1484 <main+0x284>
mov    -0xb8(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0xb8(%rbp),%rdi
mov    -0xc0(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1110 <execlp@plt>
mov    0x2b3e(%rip),%rax
mov    (%rax),%edi
mov    -0xb8(%rbp),%rdx
lea    0xbe1(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x98,%rsp
cmp    $0x2,%edi
jne    124d <main+0x4d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe49(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
jne    1263 <main+0x63>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xdda(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    0xdac(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    %rax,%r15
lea    0x8(%rsp),%rdi
call   10a0 <pipe@plt>
test   %rax,%rax
jns    127e <main+0x7e>
lea    0xdab(%rip),%rdi
jmp    1254 <main+0x54>
xor    %eax,%eax
call   1120 <fork@plt>
test   %rax,%rax
jns    1293 <main+0x93>
lea    0xda1(%rip),%rdi
jmp    1254 <main+0x54>
jne    1310 <main+0x110>
mov    0xc(%rsp),%edi
call   1090 <close@plt>
mov    0x8(%rsp),%edi
mov    0x2d2f(%rip),%rbx
mov    (%rbx),%esi
cmp    %esi,%edi
je     12bc <main+0xbc>
call   1070 <dup2@plt>
cmp    (%rbx),%eax
jne    13a0 <main+0x1a0>
lea    0xdbc(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xdb3(%rip),%rbx
cmovne %rax,%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
lea    0x1(%rax),%rsi
test   %rax,%rax
cmove  %rbx,%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1110 <execlp@plt>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
lea    0xd8b(%rip),%rsi
mov    %rbx,%rdx
jmp    123e <main+0x3e>
mov    %rax,%r14
mov    0x8(%rsp),%edi
call   1090 <close@plt>
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     136d <main+0x16d>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
cmp    %ebp,%eax
je     1330 <main+0x130>
lea    0xcd5(%rip),%rdi
jmp    1254 <main+0x54>
mov    %r15,%rdi
call   1040 <ferror@plt>
test   %rax,%rax
jne    13ac <main+0x1ac>
mov    0xc(%rsp),%edi
call   1090 <close@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <waitpid@plt>
test   %rax,%rax
jns    13b8 <main+0x1b8>
lea    0xcc2(%rip),%rdi
jmp    1254 <main+0x54>
lea    0xcc4(%rip),%rdi
jmp    1254 <main+0x54>
lea    0xc9e(%rip),%rdi
jmp    1254 <main+0x54>
xor    %edi,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: a.out <pathname>\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [15 x i8] c"can't open %s\0A\00"
@.str.3 = [11 x i8] c"pipe error\00"
@.str.4 = [11 x i8] c"fork error\00"
@.str.5 = [20 x i8] c"write error to pipe\00"
@.str.6 = [12 x i8] c"fgets error\00"
@.str.7 = [14 x i8] c"waitpid error\00"
@STDIN_FILENO = global i32 0
@.str.8 = [20 x i8] c"dup2 error to stdin\00"
@.str.9 = [6 x i8] c"PAGER\00"
@.str.10 = [14 x i8] c"/usr/bin/more\00"
@.str.11 = [20 x i8] c"execl error for %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2 x i32]
%8 = alloca i64
%9 = alloca [128 x i8]
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %22, i32** %12
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %31
24: ; preds = %18
%25 = load i32, i32* @stderr
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %18
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%33 = call i64 @pipe(i32* %32)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %31
%39 = call i64 (...) @fork()
store i64 %39, i64* %8
%40 = icmp slt i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %38
%45 = load i64, i64* %8
%46 = icmp sgt i64 %45, 0
br i1 %46, label %47, label %89
47: ; preds = %44
%48 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%49 = load i32, i32* %48
%50 = call i32 @close(i32 %49)
br label %51
51: ; preds = %69, %47
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%53 = load i32*, i32** %12
%54 = call i32* @fgets(i8* %52, i32 128, i32* %53)
%55 = icmp ne i32* %54, null
br i1 %55, label %56, label %70
56: ; preds = %51
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%58 = call i32 @strlen(i8* %57)
store i32 %58, i32* %6
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%60 = load i32, i32* %59
%61 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%62 = load i32, i32* %6
%63 = call i32 @write(i32 %60, i8* %61, i32 %62)
%64 = load i32, i32* %6
%65 = icmp ne i32 %63, %64
br i1 %65, label %66, label %69
66: ; preds = %56
%67 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %56
br label %51
70: ; preds = %51
%71 = load i32*, i32** %12
%72 = call i64 @ferror(i32* %71)
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %70
%75 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %70
%78 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%79 = load i32, i32* %78
%80 = call i32 @close(i32 %79)
%81 = load i64, i64* %8
%82 = call i64 @waitpid(i64 %81, i32* null, i32 0)
%83 = icmp slt i64 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %77
%85 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%86 = call i32 @exit(i32 1)
unreachable
87: ; preds = %77
%88 = call i32 @exit(i32 0)
unreachable
89: ; preds = %44
%90 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%91 = load i32, i32* %90
%92 = call i32 @close(i32 %91)
%93 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%94 = load i32, i32* %93
%95 = load i32, i32* @STDIN_FILENO
%96 = icmp ne i32 %94, %95
br i1 %96, label %97, label %108
97: ; preds = %89
%98 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%99 = load i32, i32* %98
%100 = load i32, i32* @STDIN_FILENO
%101 = call i32 @dup2(i32 %99, i32 %100)
%102 = load i32, i32* @STDIN_FILENO
%103 = icmp ne i32 %101, %102
br i1 %103, label %104, label %107
104: ; preds = %97
%105 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%106 = call i32 @exit(i32 1)
unreachable
107: ; preds = %97
br label %108
108: ; preds = %107, %89
%109 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
store i8* %109, i8** %10
%110 = icmp eq i8* %109, null
br i1 %110, label %111, label %112
111: ; preds = %108
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8** %10
br label %112
112: ; preds = %111, %108
%113 = load i8*, i8** %10
%114 = call i8* @strrchr(i8* %113, i8 signext 47)
store i8* %114, i8** %11
%115 = icmp ne i8* %114, null
br i1 %115, label %116, label %119
116: ; preds = %112
%117 = load i8*, i8** %11
%118 = getelementptr inbounds i8, i8* %117, i32 1
store i8* %118, i8** %11
br label %121
119: ; preds = %112
%120 = load i8*, i8** %10
store i8* %120, i8** %11
br label %121
121: ; preds = %119, %116
%122 = load i8*, i8** %10
%123 = load i8*, i8** %11
%124 = call i32 @execlp(i8* %122, i8* %123, i8* null)
%125 = load i32, i32* @stderr
%126 = load i8*, i8** %10
%127 = call i32 @fprintf(i32 %125, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %126)
%128 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"usage: a.out <pathname>\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [15 x i8] c"can't open %s\0A\00"
@.str.3 = [11 x i8] c"pipe error\00"
@.str.4 = [11 x i8] c"fork error\00"
@.str.5 = [20 x i8] c"write error to pipe\00"
@.str.6 = [12 x i8] c"fgets error\00"
@.str.7 = [14 x i8] c"waitpid error\00"
@STDIN_FILENO = global i32 0
@.str.8 = [20 x i8] c"dup2 error to stdin\00"
@.str.9 = [6 x i8] c"PAGER\00"
@.str.10 = [14 x i8] c"/usr/bin/more\00"
@.str.11 = [20 x i8] c"execl error for %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32]
%4 = alloca [128 x i8]
%5 = bitcast [2 x i32]* %3 to i8*
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 2
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %12
%19 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %11
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%23 = call i64 @pipe(i32* %22)
%24 = icmp slt i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %21
%29 = call i64 (...) @fork()
%30 = icmp slt i64 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %28
%35 = icmp eq i64 %29, 0
br i1 %35, label %67, label %36
36: ; preds = %34
%37 = load i32, i32* %22
%38 = call i32 @close(i32 %37)
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
br label %40
40: ; preds = %43, %36
%41 = call i32* @fgets(i8* %6, i32 128, i32* %14)
%42 = icmp eq i32* %41, null
br i1 %42, label %51, label %43
43: ; preds = %40
%44 = call i32 @strlen(i8* %6)
%45 = load i32, i32* %39
%46 = call i32 @write(i32 %45, i8* %6, i32 %44)
%47 = icmp eq i32 %46, %44
br i1 %47, label %40, label %48
48: ; preds = %43
%49 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%50 = call i32 @exit(i32 1)
unreachable
51: ; preds = %40
%52 = call i64 @ferror(i32* %14)
%53 = icmp eq i64 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %51
%55 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %51
%58 = load i32, i32* %39
%59 = call i32 @close(i32 %58)
%60 = call i64 @waitpid(i64 %29, i32* null, i32 0)
%61 = icmp slt i64 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %57
%63 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%64 = call i32 @exit(i32 1)
unreachable
65: ; preds = %57
%66 = call i32 @exit(i32 0)
unreachable
67: ; preds = %34
%68 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%69 = load i32, i32* %68
%70 = call i32 @close(i32 %69)
%71 = load i32, i32* %22
%72 = load i32, i32* @STDIN_FILENO
%73 = icmp eq i32 %71, %72
br i1 %73, label %81, label %74
74: ; preds = %67
%75 = call i32 @dup2(i32 %71, i32 %72)
%76 = load i32, i32* @STDIN_FILENO
%77 = icmp eq i32 %75, %76
br i1 %77, label %81, label %78
78: ; preds = %74
%79 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%80 = call i32 @exit(i32 1)
unreachable
81: ; preds = %74, %67
%82 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%83 = icmp eq i8* %82, null
%84 = select i1 %83, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %82
%85 = call i8* @strrchr(i8* dereferenceable(1) %84, i8 signext 47)
%86 = icmp eq i8* %85, null
%87 = getelementptr inbounds i8, i8* %85, i64 1
%88 = select i1 %86, i8* %84, i8* %87
%89 = call i32 @execlp(i8* %84, i8* %88, i8* null)
%90 = load i32, i32* @stderr
%91 = call i32 @fprintf(i32 %90, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %84)
%92 = call i32 @exit(i32 1)
unreachable
}