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

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ close(int);
int dup2(int, int);
int /*<<< orphan*/ errno;
int execl(char *, char *, char *, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ *fopen(char const *, char *);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int pipe(int *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
char *strerror(int /*<<< orphan*/);
char *strrchr(char const *, char);
FILE *e_fopen_compressed(const char *filename) {
  FILE *fp = NULL;
  char *s = strrchr(filename, '.');
  if (s != NULL && (strcmp(s, ".gz") == 0 || strcmp(s, ".Z") == 0)) {
    pid_t pid;
    int pipefd[2];
    if (pipe(pipefd) == -1) {
      fprintf(stderr, "Error: pipe: %s\n", strerror(errno));
      exit(3);
    } else if ((pid = fork()) == -1) {
      fprintf(stderr, "Error: fork: %s\n", strerror(errno));
      close(pipefd[0]);
      close(pipefd[1]);
      exit(3);
    } else if (pid == 0) {
      close(pipefd[1]);
      if (dup2(pipefd[0], 1) == -1) {
        fprintf(stderr, "Error: dup2: %s\n", strerror(errno));
      } else if (execl("/usr/bin/gzip", "gzip", "-d", "-c", filename, 0) ==
                 -1) {
        fprintf(stderr, "Error: execl %s -d -c %s: %s\n", "/usr/bin/gzip",
                filename, strerror(errno));
      }
      _exit(1);
    } else {
      close(pipefd[0]);
      if ((fp = fdopen(pipefd[1], "r")) == NULL) {
        fprintf(stderr, "Error: fdopen: %s\n", strerror(errno));
        exit(3);
      }
    }
  } else if ((fp = fopen(filename, "r")) == NULL) {
    fprintf(stderr, "Error: fopen %s: %s\n", filename, strerror(errno));
    exit(3);
  }
  return fp;
}


x86 assembly (clang, -O0):
<e_fopen_compressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1427 <e_fopen_compressed+0x257>
mov    -0x18(%rbp),%rdi
lea    0xdf4(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1235 <e_fopen_compressed+0x65>
mov    -0x18(%rbp),%rdi
lea    0xdde(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1427 <e_fopen_compressed+0x257>
lea    -0x24(%rbp),%rdi
call   1070 <pipe@plt>
cmp    $0xffffffff,%eax
jne    127f <e_fopen_compressed+0xaf>
mov    0x2d92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x28(%rbp),%edi
mov    %rax,%rdx
lea    0xd99(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x3,%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   10f0 <fork@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    12da <e_fopen_compressed+0x10a>
mov    0x2d47(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2d33(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    %rax,%rdx
lea    0xd5f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
mov    -0x20(%rbp),%edi
call   1060 <close@plt>
mov    $0x3,%edi
call   10c0 <exit@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    13b6 <e_fopen_compressed+0x1e6>
mov    -0x20(%rbp),%edi
call   1060 <close@plt>
mov    -0x24(%rbp),%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    1335 <e_fopen_compressed+0x165>
mov    0x2cd7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x30(%rbp),%edi
mov    %rax,%rdx
lea    0xd00(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    13ac <e_fopen_compressed+0x1dc>
mov    -0x8(%rbp),%r8
lea    0xcfa(%rip),%rdi
lea    0xcfc(%rip),%rsi
lea    0xcfa(%rip),%rdx
lea    0xcf6(%rip),%rcx
xor    %r9d,%r9d
call   10e0 <execl@plt>
cmp    $0xffffffff,%eax
jne    13a7 <e_fopen_compressed+0x1d7>
mov    0x2c73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rcx
mov    %rax,%r8
lea    0xcb5(%rip),%rsi
lea    0xc9a(%rip),%rdx
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    13ac <e_fopen_compressed+0x1dc>
mov    $0x1,%edi
call   1030 <_exit@plt>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
mov    -0x20(%rbp),%edi
lea    0xca4(%rip),%rsi
call   10a0 <fdopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1413 <e_fopen_compressed+0x243>
mov    0x2bfe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    0x2bea(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x40(%rbp),%edi
mov    %rax,%rdx
lea    0xc6c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x3,%edi
call   10c0 <exit@plt>
jmp    1418 <e_fopen_compressed+0x248>
jmp    141d <e_fopen_compressed+0x24d>
jmp    1422 <e_fopen_compressed+0x252>
jmp    148e <e_fopen_compressed+0x2be>
mov    -0x8(%rbp),%rdi
lea    0xc3a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1489 <e_fopen_compressed+0x2b9>
mov    0x2b94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x2b78(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x4c(%rbp),%edi
mov    -0x48(%rbp),%rdx
mov    %rax,%rcx
lea    0xc09(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x3,%edi
call   10c0 <exit@plt>
jmp    148e <e_fopen_compressed+0x2be>
mov    -0x10(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_fopen_compressed>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2e,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     1211 <e_fopen_compressed+0x41>
mov    %rax,%rbx
lea    0xe10(%rip),%rsi
mov    %rax,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     125c <e_fopen_compressed+0x8c>
lea    0xe00(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     125c <e_fopen_compressed+0x8c>
lea    0xe54(%rip),%rsi
mov    %r14,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
jne    129e <e_fopen_compressed+0xce>
mov    0x2db4(%rip),%rax
mov    (%rax),%ebx
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xe3e(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x3,%edi
call   10c0 <exit@plt>
mov    %rsp,%rdi
call   1070 <pipe@plt>
cmp    $0xffffffff,%eax
je     12a6 <e_fopen_compressed+0xd6>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %eax,%eax
je     12c9 <e_fopen_compressed+0xf9>
cmp    $0xffffffff,%eax
je     131c <e_fopen_compressed+0x14c>
mov    (%rsp),%edi
call   1060 <close@plt>
mov    0x4(%rsp),%edi
lea    0xddc(%rip),%rsi
call   10a0 <fdopen@plt>
test   %rax,%rax
je     1361 <e_fopen_compressed+0x191>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2d33(%rip),%rax
mov    (%rax),%ebx
mov    0x2d22(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xd43(%rip),%rsi
jmp    137f <e_fopen_compressed+0x1af>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    (%rsp),%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    1395 <e_fopen_compressed+0x1c5>
mov    0x2cf1(%rip),%rax
mov    (%rax),%ebx
mov    0x2ce0(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xd23(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>
mov    0x2cbd(%rip),%rax
mov    (%rax),%ebx
mov    0x2cac(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xcde(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%rsp),%edi
call   1060 <close@plt>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    $0x3,%edi
call   10c0 <exit@plt>
mov    0x2c78(%rip),%rax
mov    (%rax),%ebx
mov    0x2c67(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xcef(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x3,%edi
call   10c0 <exit@plt>
lea    0xc9e(%rip),%rdi
lea    0xca0(%rip),%rsi
lea    0xc9e(%rip),%rdx
lea    0xc9a(%rip),%rcx
mov    %r14,%r8
xor    %r9d,%r9d
call   10e0 <execl@plt>
cmp    $0xffffffff,%eax
jne    13f5 <e_fopen_compressed+0x225>
mov    0x2c18(%rip),%rax
mov    (%rax),%ebx
mov    0x2c07(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xc6f(%rip),%rsi
lea    0xc54(%rip),%rdx
mov    %ebx,%edi
mov    %r14,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c".gz\00"
@.str.1 = [3 x i8] c".Z\00"
@stderr = global i32 0
@.str.2 = [17 x i8] c"Error: pipe: %s\0A\00"
@errno = global i32 0
@.str.3 = [17 x i8] c"Error: fork: %s\0A\00"
@.str.4 = [17 x i8] c"Error: dup2: %s\0A\00"
@.str.5 = [14 x i8] c"/usr/bin/gzip\00"
@.str.6 = [5 x i8] c"gzip\00"
@.str.7 = [3 x i8] c"-d\00"
@.str.8 = [3 x i8] c"-c\00"
@.str.9 = [30 x i8] c"Error: execl %s -d -c %s: %s\0A\00"
@.str.10 = [2 x i8] c"r\00"
@.str.11 = [19 x i8] c"Error: fdopen: %s\0A\00"
@.str.12 = [21 x i8] c"Error: fopen %s: %s\0A\00"
define i32* @e_fopen_compressed(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [2 x i32]
store i8* %0, i8** %2
store i32* null, i32** %3
%7 = load i8*, i8** %2
%8 = call i8* @strrchr(i8* %7, i8 signext 46)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %91
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %91
19: ; preds = %15, %11
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%21 = call i32 @pipe(i32* %20)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %29
23: ; preds = %19
%24 = load i32, i32* @stderr
%25 = load i32, i32* @errno
%26 = call i8* @strerror(i32 %25)
%27 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 3)
unreachable
29: ; preds = %19
%30 = call i32 (...) @fork()
store i32 %30, i32* %5
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %44
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = load i32, i32* @errno
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %35)
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%38 = load i32, i32* %37
%39 = call i32 @close(i32 %38)
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%41 = load i32, i32* %40
%42 = call i32 @close(i32 %41)
%43 = call i32 @exit(i32 3)
unreachable
44: ; preds = %29
%45 = load i32, i32* %5
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %73
47: ; preds = %44
%48 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%49 = load i32, i32* %48
%50 = call i32 @close(i32 %49)
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%52 = load i32, i32* %51
%53 = call i32 @dup2(i32 %52, i32 1)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %60
55: ; preds = %47
%56 = load i32, i32* @stderr
%57 = load i32, i32* @errno
%58 = call i8* @strerror(i32 %57)
%59 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %58)
br label %71
60: ; preds = %47
%61 = load i8*, i8** %2
%62 = call i32 @execl(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %61, i32 0)
%63 = icmp eq i32 %62, -1
br i1 %63, label %64, label %70
64: ; preds = %60
%65 = load i32, i32* @stderr
%66 = load i8*, i8** %2
%67 = load i32, i32* @errno
%68 = call i8* @strerror(i32 %67)
%69 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %66, i8* %68)
br label %70
70: ; preds = %64, %60
br label %71
71: ; preds = %70, %55
%72 = call i32 @_exit(i32 1)
unreachable
73: ; preds = %44
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%75 = load i32, i32* %74
%76 = call i32 @close(i32 %75)
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%78 = load i32, i32* %77
%79 = call i32* @fdopen(i32 %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %79, i32** %3
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %87
81: ; preds = %73
%82 = load i32, i32* @stderr
%83 = load i32, i32* @errno
%84 = call i8* @strerror(i32 %83)
%85 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* %84)
%86 = call i32 @exit(i32 3)
unreachable
87: ; preds = %73
br label %88
88: ; preds = %87
br label %89
89: ; preds = %88
br label %90
90: ; preds = %89
br label %103
91: ; preds = %15, %1
%92 = load i8*, i8** %2
%93 = call i32* @fopen(i8* %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %93, i32** %3
%94 = icmp eq i32* %93, null
br i1 %94, label %95, label %102
95: ; preds = %91
%96 = load i32, i32* @stderr
%97 = load i8*, i8** %2
%98 = load i32, i32* @errno
%99 = call i8* @strerror(i32 %98)
%100 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %97, i8* %99)
%101 = call i32 @exit(i32 3)
unreachable
102: ; preds = %91
br label %103
103: ; preds = %102, %90
%104 = load i32*, i32** %3
ret i32* %104
}

LLVM IR (-O2):
@.str = [4 x i8] c".gz\00"
@.str.1 = [3 x i8] c".Z\00"
@stderr = global i32 0
@.str.2 = [17 x i8] c"Error: pipe: %s\0A\00"
@errno = global i32 0
@.str.3 = [17 x i8] c"Error: fork: %s\0A\00"
@.str.4 = [17 x i8] c"Error: dup2: %s\0A\00"
@.str.5 = [14 x i8] c"/usr/bin/gzip\00"
@.str.6 = [5 x i8] c"gzip\00"
@.str.7 = [3 x i8] c"-d\00"
@.str.8 = [3 x i8] c"-c\00"
@.str.9 = [30 x i8] c"Error: execl %s -d -c %s: %s\0A\00"
@.str.10 = [2 x i8] c"r\00"
@.str.11 = [19 x i8] c"Error: fdopen: %s\0A\00"
@.str.12 = [21 x i8] c"Error: fopen %s: %s\0A\00"
define noalias i32* @e_fopen_compressed(i8* %0) {
%2 = alloca [2 x i32]
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %71, label %5
5: ; preds = %1
%6 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %71
11: ; preds = %8, %5
%12 = bitcast [2 x i32]* %2 to i8*
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%14 = call i32 @pipe(i32* %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %22
16: ; preds = %11
%17 = load i32, i32* @stderr
%18 = load i32, i32* @errno
%19 = call i8* @strerror(i32 %18)
%20 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 3)
unreachable
22: ; preds = %11
%23 = call i32 (...) @fork()
switch i32 %23, label %57 [
i32 -1, label %24
i32 0, label %35
]
24: ; preds = %22
%25 = load i32, i32* @stderr
%26 = load i32, i32* @errno
%27 = call i8* @strerror(i32 %26)
%28 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%29 = load i32, i32* %13
%30 = call i32 @close(i32 %29)
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%32 = load i32, i32* %31
%33 = call i32 @close(i32 %32)
%34 = call i32 @exit(i32 3)
unreachable
35: ; preds = %22
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%37 = load i32, i32* %36
%38 = call i32 @close(i32 %37)
%39 = load i32, i32* %13
%40 = call i32 @dup2(i32 %39, i32 1)
%41 = icmp eq i32 %40, -1
br i1 %41, label %42, label %47
42: ; preds = %35
%43 = load i32, i32* @stderr
%44 = load i32, i32* @errno
%45 = call i8* @strerror(i32 %44)
%46 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %45)
br label %55
47: ; preds = %35
%48 = call i32 @execl(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %0, i32 0)
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = load i32, i32* @stderr
%52 = load i32, i32* @errno
%53 = call i8* @strerror(i32 %52)
%54 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %0, i8* %53)
br label %55
55: ; preds = %47, %50, %42
%56 = call i32 @_exit(i32 1)
unreachable
57: ; preds = %22
%58 = load i32, i32* %13
%59 = call i32 @close(i32 %58)
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%61 = load i32, i32* %60
%62 = call i32* @fdopen(i32 %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%63 = icmp eq i32* %62, null
br i1 %63, label %64, label %70
64: ; preds = %57
%65 = load i32, i32* @stderr
%66 = load i32, i32* @errno
%67 = call i8* @strerror(i32 %66)
%68 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* %67)
%69 = call i32 @exit(i32 3)
unreachable
70: ; preds = %57
br label %80
71: ; preds = %8, %1
%72 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%73 = icmp eq i32* %72, null
br i1 %73, label %74, label %80
74: ; preds = %71
%75 = load i32, i32* @stderr
%76 = load i32, i32* @errno
%77 = tail call i8* @strerror(i32 %76)
%78 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %0, i8* %77)
%79 = tail call i32 @exit(i32 3)
unreachable
80: ; preds = %71, %70
%81 = phi i32* [ %62, %70 ], [ %72, %71 ]
ret i32* %81
}