#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 */
struct utsname {
  char const *nodename;
  char const *release;
};
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(char *);
char *malloc(int);
scalar_t__ mkdir(char const *, int);
int /*<<< orphan*/ *opendir(char const *);
int /*<<< orphan*/ perror(char *);
char *realloc(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *,
                            ...);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ stdout;
int strlen(char const *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
scalar_t__ uname(struct utsname *);
FILE *prepare_output(const char *dirname) {
  FILE *output = NULL;
  int len;
  char *filename, *filename_tmp;
  struct utsname sysdata;
  DIR *dir;
  dir = opendir(dirname);
  if (dir == NULL) {
    if (mkdir(dirname, 0755)) {
      perror("mkdir");
      fprintf(stderr, "error: Cannot create dir %s\n", dirname);
      return NULL;
    }
  }
  len = strlen(dirname) + 30;
  filename = malloc(sizeof(char) * len);
  if (!filename) {
    perror("malloc");
    goto out_dir;
  }
  if (uname(&sysdata) == 0) {
    len += strlen(sysdata.nodename) + strlen(sysdata.release);
    filename_tmp = realloc(filename, sizeof(*filename) * len);
    if (filename_tmp == NULL) {
      free(filename);
      perror("realloc");
      goto out_dir;
    }
    filename = filename_tmp;
    snprintf(filename, len - 1, "%s/benchmark_%s_%s_%li.log", dirname,
             sysdata.nodename, sysdata.release, time(NULL));
  } else {
    snprintf(filename, len - 1, "%s/benchmark_%li.log", dirname, time(NULL));
  }
  do {
  } while (0);
  output = fopen(filename, "w+");
  if (output == NULL) {
    perror("fopen");
    fprintf(stderr, "error: unable to open logfile\n");
    goto out;
  }
  fprintf(stdout, "Logfile: %s\n", filename);
  fprintf(output, "#round load sleep performance powersave percentage\n");
out:
  free(filename);
out_dir:
  closedir(dir);
  return output;
}


x86 assembly (clang, -O0):
<prepare_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <opendir@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1251 <prepare_output+0x81>
mov    -0x10(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
cmp    $0x0,%rax
je     124c <prepare_output+0x7c>
lea    0xde2(%rip),%rdi
call   10f0 <perror@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdce(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1447 <prepare_output+0x277>
jmp    1251 <prepare_output+0x81>
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
add    $0x1e,%eax
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    128f <prepare_output+0xbf>
lea    0xd9e(%rip),%rdi
call   10f0 <perror@plt>
jmp    1436 <prepare_output+0x266>
lea    -0x40(%rbp),%rdi
call   1080 <uname@plt>
cmp    $0x0,%rax
jne    1363 <prepare_output+0x193>
mov    -0x40(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x38(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
add    %ecx,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
call   10d0 <realloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1300 <prepare_output+0x130>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
lea    0xd34(%rip),%rdi
call   10f0 <perror@plt>
jmp    1436 <prepare_output+0x266>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    -0x78(%rbp),%rdi
mov    -0x6c(%rbp),%esi
mov    -0x68(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    -0x58(%rbp),%r9
lea    0xcde(%rip),%rdx
mov    %eax,(%rsp)
mov    $0x0,%al
call   1070 <snprintf@plt>
jmp    13ad <prepare_output+0x1dd>
mov    -0x28(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x84(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x80(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    -0x90(%rbp),%rdi
mov    -0x84(%rbp),%esi
mov    -0x80(%rbp),%rcx
movslq %eax,%r8
lea    0xca7(%rip),%rdx
mov    $0x0,%al
call   1070 <snprintf@plt>
jmp    13b2 <prepare_output+0x1e2>
jmp    13b7 <prepare_output+0x1e7>
mov    -0x28(%rbp),%rdi
lea    0xca0(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13ff <prepare_output+0x22f>
lea    0xc88(%rip),%rdi
call   10f0 <perror@plt>
mov    0x2bf7(%rip),%rax
mov    (%rax),%rdi
lea    0xc78(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    142d <prepare_output+0x25d>
mov    0x2bd2(%rip),%rax
movslq (%rax),%rdi
mov    -0x28(%rbp),%rdx
lea    0xc76(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc71(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1090 <closedir@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_output>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r15
call   1050 <opendir@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1214 <prepare_output+0x34>
mov    %r15,%rdi
mov    $0x1ed,%esi
call   1040 <mkdir@plt>
test   %rax,%rax
jne    137e <prepare_output+0x19e>
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
lea    0x1e(%rbp),%r12d
mov    %r12d,%edi
call   10c0 <malloc@plt>
test   %rax,%rax
je     1344 <prepare_output+0x164>
mov    %rax,%r14
mov    %rbx,0x10(%rsp)
lea    0x18(%rsp),%rdi
call   1080 <uname@plt>
test   %rax,%rax
je     126f <prepare_output+0x8f>
add    $0x1d,%ebp
xor    %edi,%edi
call   10b0 <time@plt>
movslq %eax,%r8
lea    0xdef(%rip),%rdx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %r15,%rcx
xor    %eax,%eax
call   1070 <snprintf@plt>
jmp    12d2 <prepare_output+0xf2>
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    0x20(%rsp),%r13
mov    %r13,%rdi
call   1060 <strlen@plt>
add    %r12d,%ebp
add    %eax,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   10d0 <realloc@plt>
test   %rax,%rax
je     13aa <prepare_output+0x1ca>
mov    %rax,%r12
add    $0xffffffff,%ebp
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,(%rsp)
lea    0xd78(%rip),%rdx
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r15,%rcx
mov    %rbx,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1070 <snprintf@plt>
mov    %r12,%r14
lea    0xd89(%rip),%rsi
mov    %r14,%rdi
call   10e0 <fopen@plt>
mov    %rax,%r12
test   %rax,%rax
je     1355 <prepare_output+0x175>
mov    0x2ce8(%rip),%rax
movslq (%rax),%rdi
lea    0xd90(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0xd8c(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1100 <fwrite@plt>
mov    0x10(%rsp),%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1090 <closedir@plt>
mov    %r12,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcd8(%rip),%rdi
call   10f0 <perror@plt>
xor    %r12d,%r12d
jmp    132a <prepare_output+0x14a>
lea    0xd09(%rip),%rdi
call   10f0 <perror@plt>
mov    0x2c78(%rip),%rax
mov    (%rax),%rcx
lea    0xcf9(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
jmp    1318 <prepare_output+0x138>
lea    0xc7b(%rip),%rdi
call   10f0 <perror@plt>
mov    0x2c4f(%rip),%rax
mov    (%rax),%rdi
lea    0xc6b(%rip),%rsi
xor    %r12d,%r12d
mov    %r15,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    1332 <prepare_output+0x152>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xc71(%rip),%rdi
call   10f0 <perror@plt>
xor    %r12d,%r12d
mov    0x10(%rsp),%rbx
jmp    132a <prepare_output+0x14a>

LLVM IR (-O0):
%struct.utsname = type { i8*, i8* }
@.str = [6 x i8] c"mkdir\00"
@stderr = global i32* null
@.str.1 = [29 x i8] c"error: Cannot create dir %s\0A\00"
@.str.2 = [7 x i8] c"malloc\00"
@.str.3 = [8 x i8] c"realloc\00"
@.str.4 = [27 x i8] c"%s/benchmark_%s_%s_%li.log\00"
@.str.5 = [21 x i8] c"%s/benchmark_%li.log\00"
@.str.6 = [3 x i8] c"w+\00"
@.str.7 = [6 x i8] c"fopen\00"
@.str.8 = [31 x i8] c"error: unable to open logfile\0A\00"
@stdout = global i32 0
@.str.9 = [13 x i8] c"Logfile: %s\0A\00"
@.str.10 = [52 x i8] c"#round load sleep performance powersave percentage\0A\00"
define i32* @prepare_output(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.utsname
%9 = alloca i32*
store i8* %0, i8** %3
store i32* null, i32** %4
%10 = load i8*, i8** %3
%11 = call i32* @opendir(i8* %10)
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %24
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = call i64 @mkdir(i8* %15, i32 493)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%20 = load i32*, i32** @stderr
%21 = load i8*, i8** %3
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %21)
store i32* null, i32** %2
br label %109
23: ; preds = %14
br label %24
24: ; preds = %23, %1
%25 = load i8*, i8** %3
%26 = call i32 @strlen(i8* %25)
%27 = add nsw i32 %26, 30
store i32 %27, i32* %5
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = mul i64 1, %29
%31 = trunc i64 %30 to i32
%32 = call i8* @malloc(i32 %31)
store i8* %32, i8** %6
%33 = load i8*, i8** %6
%34 = icmp ne i8* %33, null
br i1 %34, label %37, label %35
35: ; preds = %24
%36 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %105
37: ; preds = %24
%38 = call i64 @uname(%struct.utsname* %8)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %74
40: ; preds = %37
%41 = getelementptr inbounds %struct.utsname, %struct.utsname* %8, i32 0, i32 0
%42 = load i8*, i8** %41
%43 = call i32 @strlen(i8* %42)
%44 = getelementptr inbounds %struct.utsname, %struct.utsname* %8, i32 0, i32 1
%45 = load i8*, i8** %44
%46 = call i32 @strlen(i8* %45)
%47 = add nsw i32 %43, %46
%48 = load i32, i32* %5
%49 = add nsw i32 %48, %47
store i32 %49, i32* %5
%50 = load i8*, i8** %6
%51 = load i32, i32* %5
%52 = sext i32 %51 to i64
%53 = mul i64 1, %52
%54 = trunc i64 %53 to i32
%55 = call i8* @realloc(i8* %50, i32 %54)
store i8* %55, i8** %7
%56 = load i8*, i8** %7
%57 = icmp eq i8* %56, null
br i1 %57, label %58, label %62
58: ; preds = %40
%59 = load i8*, i8** %6
%60 = call i32 @free(i8* %59)
%61 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %105
62: ; preds = %40
%63 = load i8*, i8** %7
store i8* %63, i8** %6
%64 = load i8*, i8** %6
%65 = load i32, i32* %5
%66 = sub nsw i32 %65, 1
%67 = load i8*, i8** %3
%68 = getelementptr inbounds %struct.utsname, %struct.utsname* %8, i32 0, i32 0
%69 = load i8*, i8** %68
%70 = getelementptr inbounds %struct.utsname, %struct.utsname* %8, i32 0, i32 1
%71 = load i8*, i8** %70
%72 = call i32 @time(i32* null)
%73 = call i32 (i8*, i32, i8*, i8*, i8*, ...) @snprintf(i8* %64, i32 %66, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %67, i8* %69, i8* %71, i32 %72)
br label %83
74: ; preds = %37
%75 = load i8*, i8** %6
%76 = load i32, i32* %5
%77 = sub nsw i32 %76, 1
%78 = load i8*, i8** %3
%79 = call i32 @time(i32* null)
%80 = sext i32 %79 to i64
%81 = inttoptr i64 %80 to i8*
%82 = call i32 (i8*, i32, i8*, i8*, i8*, ...) @snprintf(i8* %75, i32 %77, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %78, i8* %81)
br label %83
83: ; preds = %74, %62
br label %84
84: ; preds = %83
br label %85
85: ; preds = %84
%86 = load i8*, i8** %6
%87 = call i32* @fopen(i8* %86, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %87, i32** %4
%88 = load i32*, i32** %4
%89 = icmp eq i32* %88, null
br i1 %89, label %90, label %94
90: ; preds = %85
%91 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%92 = load i32*, i32** @stderr
%93 = call i32 (i32*, i8*, ...) @fprintf(i32* %92, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
br label %102
94: ; preds = %85
%95 = load i32, i32* @stdout
%96 = sext i32 %95 to i64
%97 = inttoptr i64 %96 to i32*
%98 = load i8*, i8** %6
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %98)
%100 = load i32*, i32** %4
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %100, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.10, i64 0, i64 0))
br label %102
102: ; preds = %94, %90
%103 = load i8*, i8** %6
%104 = call i32 @free(i8* %103)
br label %105
105: ; preds = %102, %58, %35
%106 = load i32*, i32** %9
%107 = call i32 @closedir(i32* %106)
%108 = load i32*, i32** %4
store i32* %108, i32** %2
br label %109
109: ; preds = %105, %18
%110 = load i32*, i32** %2
ret i32* %110
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8* }
@.str = [6 x i8] c"mkdir\00"
@stderr = global i32* null
@.str.1 = [29 x i8] c"error: Cannot create dir %s\0A\00"
@.str.2 = [7 x i8] c"malloc\00"
@.str.3 = [8 x i8] c"realloc\00"
@.str.4 = [27 x i8] c"%s/benchmark_%s_%s_%li.log\00"
@.str.5 = [21 x i8] c"%s/benchmark_%li.log\00"
@.str.6 = [3 x i8] c"w+\00"
@.str.7 = [6 x i8] c"fopen\00"
@.str.8 = [31 x i8] c"error: unable to open logfile\0A\00"
@stdout = global i32 0
@.str.9 = [13 x i8] c"Logfile: %s\0A\00"
@.str.10 = [52 x i8] c"#round load sleep performance powersave percentage\0A\00"
define noalias i32* @prepare_output(i8* %0) {
%2 = alloca %struct.utsname
%3 = bitcast %struct.utsname* %2 to i8*
%4 = tail call i32* @opendir(i8* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = tail call i64 @mkdir(i8* %0, i32 493)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = load i32*, i32** @stderr
%12 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %66
13: ; preds = %6, %1
%14 = tail call i32 @strlen(i8* %0)
%15 = add nsw i32 %14, 30
%16 = tail call i8* @malloc(i32 %15)
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %63
20: ; preds = %13
%21 = call i64 @uname(%struct.utsname* %2)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %41
23: ; preds = %20
%24 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i64 0, i32 0
%25 = load i8*, i8** %24
%26 = tail call i32 @strlen(i8* %25)
%27 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i64 0, i32 1
%28 = load i8*, i8** %27
%29 = tail call i32 @strlen(i8* %28)
%30 = add i32 %26, %15
%31 = add i32 %30, %29
%32 = tail call i8* @realloc(i8* %16, i32 %31)
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %37
34: ; preds = %23
%35 = tail call i32 @free(i8* %16)
%36 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %63
37: ; preds = %23
%38 = add nsw i32 %31, -1
%39 = tail call i32 @time(i32* null)
%40 = tail call i32 (i8*, i32, i8*, i8*, i8*, ...) @snprintf(i8* %32, i32 %38, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %25, i8* %28, i32 %39)
br label %47
41: ; preds = %20
%42 = add nsw i32 %14, 29
%43 = tail call i32 @time(i32* null)
%44 = sext i32 %43 to i64
%45 = inttoptr i64 %44 to i8*
%46 = tail call i32 (i8*, i32, i8*, i8*, i8*, ...) @snprintf(i8* %16, i32 %42, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %0, i8* %45)
br label %47
47: ; preds = %37, %41
%48 = phi i8* [ %32, %37 ], [ %16, %41 ]
%49 = tail call i32* @fopen(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%53 = load i32*, i32** @stderr
%54 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i64 30, i64 1, i32* %53)
br label %61
55: ; preds = %47
%56 = load i32, i32* @stdout
%57 = sext i32 %56 to i64
%58 = inttoptr i64 %57 to i32*
%59 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %58, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %48)
%60 = tail call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.10, i64 0, i64 0), i64 51, i64 1, i32* %49)
br label %61
61: ; preds = %55, %51
%62 = tail call i32 @free(i8* %48)
br label %63
63: ; preds = %61, %34, %18
%64 = phi i32* [ null, %34 ], [ %49, %61 ], [ null, %18 ]
%65 = tail call i32 @closedir(i32* %4)
br label %66
66: ; preds = %63, %9
%67 = phi i32* [ null, %9 ], [ %64, %63 ]
ret i32* %67
}