#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 */

/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
int write(int, char *, int);
int main(void) {
  int fd = 0;
  int len = 0;
  fd = open("/sys/class/gpio/export", O_WRONLY);
  if (fd < 0) {
    perror("export error");
    return -1;
  }
  len = write(fd, "2", 2);
  if (len > 0) {
    printf("export ok!\n");
  }
  close(fd);
  usleep(100000);
  fd = open("/sys/class/gpio/gpio2/direction", O_WRONLY);
  if (fd < 0) {
    perror("direction error");
    return -1;
  }
  len = write(fd, "out", 4);
  if (len > 0) {
    printf("direction ok!\n");
  }
  close(fd);
  fd = open("/sys/class/gpio/gpio2/value", O_WRONLY);
  if (fd < 0) {
    perror("on/off error");
    return -1;
  }
  len = write(fd, "1", 2);
  if (len > 0) {
    printf("on ok!\n");
  }
  usleep(1000000);
  len = write(fd, "0", 2);
  if (len > 0) {
    printf("off ok!\n");
  }
  usleep(1000000);
  len = write(fd, "1", 2);
  if (len > 0) {
    printf("on ok!\n");
  }
  usleep(1000000);
  len = write(fd, "0", 2);
  if (len > 0) {
    printf("off ok!\n");
  }
  close(fd);
  fd = open("/sys/class/gpio/unexport", O_WRONLY);
  if (fd < 0) {
    perror("unexport error");
    return -1;
  }
  len = write(fd, "2", 2);
  if (len > 0) {
    printf("unexport ok!\n");
  }
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0x2e54(%rip),%rax
mov    (%rax),%esi
lea    0xe73(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    11b7 <main+0x57>
lea    0xf07(%rip),%rdi
call   1070 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ef <main+0x28f>
mov    -0x8(%rbp),%edi
lea    0xe56(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    11e4 <main+0x84>
lea    0xedd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
mov    $0x186a0,%edi
call   1080 <usleep@plt>
mov    0x2ddb(%rip),%rax
mov    (%rax),%esi
lea    0xe13(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1230 <main+0xd0>
lea    0xe1a(%rip),%rdi
call   1070 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ef <main+0x28f>
mov    -0x8(%rbp),%edi
lea    0xe0f(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    125d <main+0xfd>
lea    0xdf5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%esi
lea    0xde7(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    129f <main+0x13f>
lea    0xdea(%rip),%rdi
call   1070 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ef <main+0x28f>
mov    -0x8(%rbp),%edi
lea    0xddc(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    12cc <main+0x16c>
lea    0xd8d(%rip),%rdi
call   1040 <printf@plt>
mov    $0xf4240,%edi
call   1080 <usleep@plt>
mov    -0x8(%rbp),%edi
lea    0xda7(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1303 <main+0x1a3>
lea    0xd8b(%rip),%rdi
call   1040 <printf@plt>
mov    $0xf4240,%edi
call   1080 <usleep@plt>
mov    -0x8(%rbp),%edi
lea    0xd6e(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    133a <main+0x1da>
lea    0xd1f(%rip),%rdi
call   1040 <printf@plt>
mov    $0xf4240,%edi
call   1080 <usleep@plt>
mov    -0x8(%rbp),%edi
lea    0xd39(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1371 <main+0x211>
lea    0xd1d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
mov    0x2c58(%rip),%rax
mov    (%rax),%esi
lea    0xd09(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    13b3 <main+0x253>
lea    0xd09(%rip),%rdi
call   1070 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ef <main+0x28f>
mov    -0x8(%rbp),%edi
lea    0xc5a(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    13e0 <main+0x280>
lea    0xcdf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e6d(%rip),%r14
mov    (%r14),%esi
lea    0xe8b(%rip),%rdi
call   1060 <open@plt>
test   %eax,%eax
js     1308 <main+0x1a8>
mov    %eax,%ebx
lea    0xe8c(%rip),%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    11a7 <main+0x47>
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    $0x186a0,%edi
call   1080 <usleep@plt>
mov    (%r14),%esi
lea    0xe57(%rip),%rdi
call   1060 <open@plt>
test   %eax,%eax
js     1311 <main+0x1b1>
mov    %eax,%ebx
lea    0xe71(%rip),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    11f4 <main+0x94>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    (%r14),%esi
lea    0xe48(%rip),%rdi
call   1060 <open@plt>
test   %eax,%eax
js     131a <main+0x1ba>
mov    %eax,%ebx
lea    0xe5b(%rip),%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    1237 <main+0xd7>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf4240,%edi
call   1080 <usleep@plt>
lea    0xe30(%rip),%rsi
mov    %ebx,%edi
mov    $0x2,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    1264 <main+0x104>
lea    0xe50(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf4240,%edi
call   1080 <usleep@plt>
lea    0xe01(%rip),%rsi
mov    %ebx,%edi
mov    $0x2,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    1291 <main+0x131>
lea    0xe32(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf4240,%edi
call   1080 <usleep@plt>
lea    0xdd6(%rip),%rsi
mov    %ebx,%edi
mov    $0x2,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    12be <main+0x15e>
lea    0xdf6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <close@plt>
mov    (%r14),%esi
lea    0xdab(%rip),%rdi
call   1060 <open@plt>
test   %eax,%eax
js     1323 <main+0x1c3>
mov    %eax,%ebx
lea    0xd36(%rip),%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    12fd <main+0x19d>
lea    0xdaa(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %eax,%eax
jmp    1334 <main+0x1d4>
lea    0xd86(%rip),%rdi
jmp    132a <main+0x1ca>
lea    0xd21(%rip),%rdi
jmp    132a <main+0x1ca>
lea    0xd48(%rip),%rdi
jmp    132a <main+0x1ca>
lea    0xd69(%rip),%rdi
call   1070 <perror@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
@O_WRONLY = global i32 0
@.str.1 = [13 x i8] c"export error\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [12 x i8] c"export ok!\0A\00"
@.str.4 = [32 x i8] c"/sys/class/gpio/gpio2/direction\00"
@.str.5 = [16 x i8] c"direction error\00"
@.str.6 = [4 x i8] c"out\00"
@.str.7 = [15 x i8] c"direction ok!\0A\00"
@.str.8 = [28 x i8] c"/sys/class/gpio/gpio2/value\00"
@.str.9 = [13 x i8] c"on/off error\00"
@.str.10 = [2 x i8] c"1\00"
@.str.11 = [8 x i8] c"on ok!\0A\00"
@.str.12 = [2 x i8] c"0\00"
@.str.13 = [9 x i8] c"off ok!\0A\00"
@.str.14 = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.15 = [15 x i8] c"unexport error\00"
@.str.16 = [14 x i8] c"unexport ok!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* @O_WRONLY
%5 = call i32 @open(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %93
10: ; preds = %0
%11 = load i32, i32* %2
%12 = call i32 @write(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 2)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %10
%18 = load i32, i32* %2
%19 = call i32 @close(i32 %18)
%20 = call i32 @usleep(i32 100000)
%21 = load i32, i32* @O_WRONLY
%22 = call i32 @open(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %21)
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %17
%26 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
store i32 -1, i32* %1
br label %93
27: ; preds = %17
%28 = load i32, i32* %2
%29 = call i32 @write(i32 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 4)
store i32 %29, i32* %3
%30 = load i32, i32* %3
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
br label %34
34: ; preds = %32, %27
%35 = load i32, i32* %2
%36 = call i32 @close(i32 %35)
%37 = load i32, i32* @O_WRONLY
%38 = call i32 @open(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %37)
store i32 %38, i32* %2
%39 = load i32, i32* %2
%40 = icmp slt i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %34
%42 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
store i32 -1, i32* %1
br label %93
43: ; preds = %34
%44 = load i32, i32* %2
%45 = call i32 @write(i32 %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 2)
store i32 %45, i32* %3
%46 = load i32, i32* %3
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %43
%49 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %50
50: ; preds = %48, %43
%51 = call i32 @usleep(i32 1000000)
%52 = load i32, i32* %2
%53 = call i32 @write(i32 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 2)
store i32 %53, i32* %3
%54 = load i32, i32* %3
%55 = icmp sgt i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %50
%57 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
br label %58
58: ; preds = %56, %50
%59 = call i32 @usleep(i32 1000000)
%60 = load i32, i32* %2
%61 = call i32 @write(i32 %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 2)
store i32 %61, i32* %3
%62 = load i32, i32* %3
%63 = icmp sgt i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %58
%65 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
br label %66
66: ; preds = %64, %58
%67 = call i32 @usleep(i32 1000000)
%68 = load i32, i32* %2
%69 = call i32 @write(i32 %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 2)
store i32 %69, i32* %3
%70 = load i32, i32* %3
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %66
%73 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
br label %74
74: ; preds = %72, %66
%75 = load i32, i32* %2
%76 = call i32 @close(i32 %75)
%77 = load i32, i32* @O_WRONLY
%78 = call i32 @open(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0), i32 %77)
store i32 %78, i32* %2
%79 = load i32, i32* %2
%80 = icmp slt i32 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %74
%82 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
store i32 -1, i32* %1
br label %93
83: ; preds = %74
%84 = load i32, i32* %2
%85 = call i32 @write(i32 %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 2)
store i32 %85, i32* %3
%86 = load i32, i32* %3
%87 = icmp sgt i32 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %83
%89 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
br label %90
90: ; preds = %88, %83
%91 = load i32, i32* %2
%92 = call i32 @close(i32 %91)
store i32 0, i32* %1
br label %93
93: ; preds = %90, %81, %41, %25, %8
%94 = load i32, i32* %1
ret i32 %94
}

LLVM IR (-O2):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
@O_WRONLY = global i32 0
@.str.1 = [13 x i8] c"export error\00"
@.str.2 = [2 x i8] c"2\00"
@.str.4 = [32 x i8] c"/sys/class/gpio/gpio2/direction\00"
@.str.5 = [16 x i8] c"direction error\00"
@.str.6 = [4 x i8] c"out\00"
@.str.8 = [28 x i8] c"/sys/class/gpio/gpio2/value\00"
@.str.9 = [13 x i8] c"on/off error\00"
@.str.10 = [2 x i8] c"1\00"
@.str.12 = [2 x i8] c"0\00"
@.str.14 = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.15 = [15 x i8] c"unexport error\00"
@str = [13 x i8] c"unexport ok!\00"
@str.19 = [8 x i8] c"off ok!\00"
@str.20 = [7 x i8] c"on ok!\00"
@str.21 = [14 x i8] c"direction ok!\00"
@str.22 = [11 x i8] c"export ok!\00"
define i32 @main() {
%1 = load i32, i32* @O_WRONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %68
6: ; preds = %0
%7 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 2)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.22, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = tail call i32 @close(i32 %2)
%13 = tail call i32 @usleep(i32 100000)
%14 = load i32, i32* @O_WRONLY
%15 = tail call i32 @open(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %68
19: ; preds = %11
%20 = tail call i32 @write(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 4)
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
br label %24
24: ; preds = %22, %19
%25 = tail call i32 @close(i32 %15)
%26 = load i32, i32* @O_WRONLY
%27 = tail call i32 @open(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %26)
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
br label %68
31: ; preds = %24
%32 = tail call i32 @write(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 2)
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.20, i64 0, i64 0))
br label %36
36: ; preds = %34, %31
%37 = tail call i32 @usleep(i32 1000000)
%38 = tail call i32 @write(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 2)
%39 = icmp sgt i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.19, i64 0, i64 0))
br label %42
42: ; preds = %40, %36
%43 = tail call i32 @usleep(i32 1000000)
%44 = tail call i32 @write(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32 2)
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %42
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.20, i64 0, i64 0))
br label %48
48: ; preds = %46, %42
%49 = tail call i32 @usleep(i32 1000000)
%50 = tail call i32 @write(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 2)
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.19, i64 0, i64 0))
br label %54
54: ; preds = %52, %48
%55 = tail call i32 @close(i32 %27)
%56 = load i32, i32* @O_WRONLY
%57 = tail call i32 @open(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0), i32 %56)
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
br label %68
61: ; preds = %54
%62 = tail call i32 @write(i32 %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 2)
%63 = icmp sgt i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %66
66: ; preds = %64, %61
%67 = tail call i32 @close(i32 %57)
br label %68
68: ; preds = %66, %59, %29, %17, %4
%69 = phi i32 [ -1, %4 ], [ -1, %17 ], [ -1, %29 ], [ -1, %59 ], [ 0, %66 ]
ret i32 %69
}