#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 */
scalar_t__ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int getpid();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pipe(int *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ wait(int *);
scalar_t__ write(int, char *, int);
int main() {
  pid_t childid;
  int childec;
  int fd[2];
  char buffer[1024];
  pipe(fd);
  childid = fork();
  if (childid > 0) {
    printf("I'm parent. pid : %d\n", getpid());
    if (!(0 == close(fd[1])))
      fprintf(stderr, "Error %s. Error : %s \n", "closing pipe",
              strerror(errno));
    ;
    if (!(0 <= read(fd[0], buffer, 1024)))
      fprintf(stderr, "Error %s. Error : %s \n", "reading pipe",
              strerror(errno));
    ;
    printf("Read from pipe: %s\n", buffer);
    if (!(0 == close(fd[0])))
      fprintf(stderr, "Error %s. Error : %s \n", "closing pipe",
              strerror(errno));
    ;
    wait(&childec);
    printf("Waited for child, exit code : %d\n", childec);
  } else if (childid == 0) {
    printf("I'm child. pid : %d\n", getpid());
    if (!(0 == close(fd[0])))
      fprintf(stderr, "Error %s. Error : %s \n", "closing pipe",
              strerror(errno));
    ;
    if (!(0 <= write(fd[1], "YOLO!", sizeof("YOLO!"))))
      fprintf(stderr, "Error %s. Error : %s \n", "writing pipe",
              strerror(errno));
    ;
    if (!(0 == close(fd[1])))
      fprintf(stderr, "Error %s. Error : %s \n", "closing pipe",
              strerror(errno));
    ;
  } else {
    printf("Failed to fork. Error! \n");
    perror("fork");
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1c(%rbp),%rdi
call   1070 <pipe@plt>
mov    $0x0,%al
call   10e0 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1335 <main+0x175>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1257 <main+0x97>
mov    0x2dbb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x424(%rbp)
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x424(%rbp),%edi
mov    %rax,%rcx
lea    0xdcb(%rip),%rsi
lea    0xddb(%rip),%rdx
call   1090 <fprintf@plt>
mov    -0x1c(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1080 <read@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    12b2 <main+0xf2>
mov    0x2d60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x428(%rbp)
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x428(%rbp),%edi
mov    %rax,%rcx
lea    0xd70(%rip),%rsi
lea    0xd8d(%rip),%rdx
call   1090 <fprintf@plt>
lea    -0x420(%rbp),%rsi
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1316 <main+0x156>
mov    0x2cfc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x42c(%rbp)
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x42c(%rbp),%edi
mov    %rax,%rcx
lea    0xd0c(%rip),%rsi
lea    0xd1c(%rip),%rdx
call   1090 <fprintf@plt>
lea    -0x14(%rbp),%rdi
call   10d0 <wait@plt>
mov    -0x14(%rbp),%esi
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    147b <main+0x2bb>
cmpq   $0x0,-0x10(%rbp)
jne    1455 <main+0x295>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     13a6 <main+0x1e6>
mov    0x2c6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x430(%rbp)
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x430(%rbp),%edi
mov    %rax,%rcx
lea    0xc7c(%rip),%rsi
lea    0xc8c(%rip),%rdx
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%edi
lea    0xce2(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    1401 <main+0x241>
mov    0x2c11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x434(%rbp)
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x434(%rbp),%edi
mov    %rax,%rcx
lea    0xc21(%rip),%rsi
lea    0xc9c(%rip),%rdx
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1450 <main+0x290>
mov    0x2bc2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x438(%rbp)
mov    0x2bab(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x438(%rbp),%edi
mov    %rax,%rcx
lea    0xbd2(%rip),%rsi
lea    0xbe2(%rip),%rdx
call   1090 <fprintf@plt>
jmp    1476 <main+0x2b6>
lea    0xc49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc54(%rip),%rdi
call   10a0 <perror@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
jmp    147b <main+0x2bb>
xor    %eax,%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
lea    0x4(%rsp),%rdi
call   1080 <pipe@plt>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %rax,%rax
jle    12fe <main+0x12e>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xe00(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
test   %rax,%rax
je     1246 <main+0x76>
mov    0x2dc2(%rip),%rax
mov    (%rax),%ebx
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xde1(%rip),%rsi
lea    0xdf1(%rip),%rdx
mov    %ebx,%edi
mov    %rax,%rcx
call   10a0 <fprintf@plt>
mov    0x4(%rsp),%edi
lea    0x10(%rsp),%rsi
mov    $0x400,%edx
call   1090 <read@plt>
test   %rax,%rax
jns    128d <main+0xbd>
mov    0x2d7b(%rip),%rax
mov    (%rax),%ebx
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xd9a(%rip),%rsi
lea    0xdb7(%rip),%rdx
mov    %ebx,%edi
mov    %rax,%rcx
call   10a0 <fprintf@plt>
lea    0xdb3(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
test   %rax,%rax
je     12dd <main+0x10d>
mov    0x2d2b(%rip),%rax
mov    (%rax),%ebx
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xd4a(%rip),%rsi
lea    0xd5a(%rip),%rdx
mov    %ebx,%edi
mov    %rax,%rcx
call   10a0 <fprintf@plt>
lea    0xc(%rsp),%rdi
call   10e0 <wait@plt>
mov    0xc(%rsp),%esi
lea    0xd69(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    13de <main+0x20e>
jne    13e9 <main+0x219>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xd6b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%edi
call   1070 <close@plt>
test   %rax,%rax
je     1358 <main+0x188>
mov    0x2cb0(%rip),%rax
mov    (%rax),%ebx
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xccf(%rip),%rsi
lea    0xcdf(%rip),%rdx
mov    %ebx,%edi
mov    %rax,%rcx
call   10a0 <fprintf@plt>
mov    0x8(%rsp),%edi
lea    0xd2f(%rip),%rsi
mov    $0x6,%edx
call   1040 <write@plt>
test   %rax,%rax
jns    13a1 <main+0x1d1>
mov    0x2c67(%rip),%rax
mov    (%rax),%ebx
mov    0x2c56(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xc86(%rip),%rsi
lea    0xd01(%rip),%rdx
mov    %ebx,%edi
mov    %rax,%rcx
call   10a0 <fprintf@plt>
mov    0x8(%rsp),%edi
call   1070 <close@plt>
test   %rax,%rax
je     13de <main+0x20e>
mov    0x2c2a(%rip),%rax
mov    (%rax),%ebx
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xc49(%rip),%rsi
lea    0xc59(%rip),%rdx
mov    %ebx,%edi
mov    %rax,%rcx
call   10a0 <fprintf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret
lea    0xcba(%rip),%rdi
call   1030 <puts@plt>
lea    0xca9(%rip),%rdi
call   10b0 <perror@plt>
xor    %edi,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"I'm parent. pid : %d\0A\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"Error %s. Error : %s \0A\00"
@.str.2 = [13 x i8] c"closing pipe\00"
@errno = global i32 0
@.str.3 = [13 x i8] c"reading pipe\00"
@.str.4 = [20 x i8] c"Read from pipe: %s\0A\00"
@.str.5 = [34 x i8] c"Waited for child, exit code : %d\0A\00"
@.str.6 = [21 x i8] c"I'm child. pid : %d\0A\00"
@.str.7 = [6 x i8] c"YOLO!\00"
@.str.8 = [13 x i8] c"writing pipe\00"
@.str.9 = [25 x i8] c"Failed to fork. Error! \0A\00"
@.str.10 = [5 x i8] c"fork\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca [1024 x i8]
store i32 0, i32* %1
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%7 = call i32 @pipe(i32* %6)
%8 = call i64 (...) @fork()
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %50
11: ; preds = %0
%12 = call i32 (...) @getpid()
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%15 = load i32, i32* %14
%16 = call i64 @close(i32 %15)
%17 = icmp eq i64 0, %16
br i1 %17, label %23, label %18
18: ; preds = %11
%19 = load i32, i32* @stderr
%20 = load i32, i32* @errno
%21 = call i8* @strerror(i32 %20)
%22 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %18, %11
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%25 = load i32, i32* %24
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%27 = call i64 @read(i32 %25, i8* %26, i32 1024)
%28 = icmp sle i64 0, %27
br i1 %28, label %34, label %29
29: ; preds = %23
%30 = load i32, i32* @stderr
%31 = load i32, i32* @errno
%32 = call i8* @strerror(i32 %31)
%33 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %29, %23
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %35)
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%38 = load i32, i32* %37
%39 = call i64 @close(i32 %38)
%40 = icmp eq i64 0, %39
br i1 %40, label %46, label %41
41: ; preds = %34
%42 = load i32, i32* @stderr
%43 = load i32, i32* @errno
%44 = call i8* @strerror(i32 %43)
%45 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %44)
br label %46
46: ; preds = %41, %34
%47 = call i32 @wait(i32* %3)
%48 = load i32, i32* %3
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %48)
br label %91
50: ; preds = %0
%51 = load i64, i64* %2
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %86
53: ; preds = %50
%54 = call i32 (...) @getpid()
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%57 = load i32, i32* %56
%58 = call i64 @close(i32 %57)
%59 = icmp eq i64 0, %58
br i1 %59, label %65, label %60
60: ; preds = %53
%61 = load i32, i32* @stderr
%62 = load i32, i32* @errno
%63 = call i8* @strerror(i32 %62)
%64 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %63)
br label %65
65: ; preds = %60, %53
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%67 = load i32, i32* %66
%68 = call i64 @write(i32 %67, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 6)
%69 = icmp sle i64 0, %68
br i1 %69, label %75, label %70
70: ; preds = %65
%71 = load i32, i32* @stderr
%72 = load i32, i32* @errno
%73 = call i8* @strerror(i32 %72)
%74 = call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %73)
br label %75
75: ; preds = %70, %65
%76 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%77 = load i32, i32* %76
%78 = call i64 @close(i32 %77)
%79 = icmp eq i64 0, %78
br i1 %79, label %85, label %80
80: ; preds = %75
%81 = load i32, i32* @stderr
%82 = load i32, i32* @errno
%83 = call i8* @strerror(i32 %82)
%84 = call i32 @fprintf(i32 %81, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %83)
br label %85
85: ; preds = %80, %75
br label %90
86: ; preds = %50
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
%88 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%89 = call i32 @exit(i32 0)
unreachable
90: ; preds = %85
br label %91
91: ; preds = %90, %46
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"I'm parent. pid : %d\0A\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"Error %s. Error : %s \0A\00"
@.str.2 = [13 x i8] c"closing pipe\00"
@errno = global i32 0
@.str.3 = [13 x i8] c"reading pipe\00"
@.str.4 = [20 x i8] c"Read from pipe: %s\0A\00"
@.str.5 = [34 x i8] c"Waited for child, exit code : %d\0A\00"
@.str.6 = [21 x i8] c"I'm child. pid : %d\0A\00"
@.str.7 = [6 x i8] c"YOLO!\00"
@.str.8 = [13 x i8] c"writing pipe\00"
@.str.10 = [5 x i8] c"fork\00"
@str = [24 x i8] c"Failed to fork. Error! \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [1024 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast [2 x i32]* %2 to i8*
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = call i32 @pipe(i32* %7)
%9 = call i64 (...) @fork()
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %46
11: ; preds = %0
%12 = call i32 (...) @getpid()
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%15 = load i32, i32* %14
%16 = call i64 @close(i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %11
%19 = load i32, i32* @stderr
%20 = load i32, i32* @errno
%21 = call i8* @strerror(i32 %20)
%22 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %18, %11
%24 = load i32, i32* %7
%25 = call i64 @read(i32 %24, i8* %6, i32 1024)
%26 = icmp sgt i64 %25, -1
br i1 %26, label %32, label %27
27: ; preds = %23
%28 = load i32, i32* @stderr
%29 = load i32, i32* @errno
%30 = call i8* @strerror(i32 %29)
%31 = call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %27, %23
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%34 = load i32, i32* %7
%35 = call i64 @close(i32 %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %42, label %37
37: ; preds = %32
%38 = load i32, i32* @stderr
%39 = load i32, i32* @errno
%40 = call i8* @strerror(i32 %39)
%41 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %37, %32
%43 = call i32 @wait(i32* %1)
%44 = load i32, i32* %1
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %44)
br label %82
46: ; preds = %0
%47 = icmp eq i64 %9, 0
br i1 %47, label %48, label %78
48: ; preds = %46
%49 = call i32 (...) @getpid()
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %7
%52 = call i64 @close(i32 %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %59, label %54
54: ; preds = %48
%55 = load i32, i32* @stderr
%56 = load i32, i32* @errno
%57 = call i8* @strerror(i32 %56)
%58 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %54, %48
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%61 = load i32, i32* %60
%62 = call i64 @write(i32 %61, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 6)
%63 = icmp sgt i64 %62, -1
br i1 %63, label %69, label %64
64: ; preds = %59
%65 = load i32, i32* @stderr
%66 = load i32, i32* @errno
%67 = call i8* @strerror(i32 %66)
%68 = call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %67)
br label %69
69: ; preds = %64, %59
%70 = load i32, i32* %60
%71 = call i64 @close(i32 %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %82, label %73
73: ; preds = %69
%74 = load i32, i32* @stderr
%75 = load i32, i32* @errno
%76 = call i8* @strerror(i32 %75)
%77 = call i32 @fprintf(i32 %74, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %76)
br label %82
78: ; preds = %46
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%80 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%81 = call i32 @exit(i32 0)
unreachable
82: ; preds = %73, %69, %42
ret i32 0
}