#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 dirent {
  char const *d_name;
};
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int ENODATA;
int ENOENT;
int ENOMEM;
int asprintf(char **, char *, char const *, char const *);
int closedir(int /*<<< orphan*/ *);
int errno;
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int fscanf(int /*<<< orphan*/ *, char *, float *);
int /*<<< orphan*/ *opendir(char const *);
int /*<<< orphan*/ perror(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char const *);
int iioutils_get_param_float(float *output, const char *param_name,
                             const char *device_dir, const char *name,
                             const char *generic_name) {
  FILE *sysfsfp;
  int ret;
  DIR *dp;
  char *builtname, *builtname_generic;
  char *filename = NULL;
  const struct dirent *ent;
  ret = asprintf(&builtname, "%s_%s", name, param_name);
  if (ret < 0) {
    return -ENOMEM;
  }
  ret = asprintf(&builtname_generic, "%s_%s", generic_name, param_name);
  if (ret < 0) {
    ret = -ENOMEM;
    goto error_free_builtname;
  }
  dp = opendir(device_dir);
  if (!dp) {
    ret = -errno;
    goto error_free_builtname_generic;
  }
  ret = -ENOENT;
  while (ent = readdir(dp), ent)
    if ((strcmp(builtname, ent->d_name) == 0) ||
        (strcmp(builtname_generic, ent->d_name) == 0)) {
      ret = asprintf(&filename, "%s/%s", device_dir, ent->d_name);
      if (ret < 0) {
        ret = -ENOMEM;
        goto error_closedir;
      }
      sysfsfp = fopen(filename, "r");
      if (!sysfsfp) {
        ret = -errno;
        goto error_free_filename;
      }
      errno = 0;
      if (fscanf(sysfsfp, "%f", output) != 1) {
        ret = errno ? -errno : -ENODATA;
      }
      break;
    }
error_free_filename:
  if (filename) {
    free(filename);
  }
error_closedir:
  if (closedir(dp) == -1) {
    perror("iioutils_get_param_float(): Failed to close directory");
  }
error_free_builtname_generic:
  free(builtname_generic);
error_free_builtname:
  free(builtname);
  return ret;
}


x86 assembly (clang, -O0):
<iioutils_get_param_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movq   $0x0,-0x60(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x50(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1090 <asprintf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jge    11ec <iioutils_get_param_float+0x5c>
xor    %eax,%eax
mov    0x2df6(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    13da <iioutils_get_param_float+0x24a>
mov    -0x30(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x58(%rbp),%rdi
lea    0xe01(%rip),%rsi
call   1090 <asprintf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jge    1224 <iioutils_get_param_float+0x94>
xor    %eax,%eax
mov    0x2dbe(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x3c(%rbp)
jmp    13cb <iioutils_get_param_float+0x23b>
mov    -0x20(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    124f <iioutils_get_param_float+0xbf>
xor    %eax,%eax
mov    0x2d8b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x3c(%rbp)
jmp    13c2 <iioutils_get_param_float+0x232>
xor    %eax,%eax
mov    0x2d68(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%rdi
call   1080 <readdir@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
je     1381 <iioutils_get_param_float+0x1f1>
mov    -0x50(%rbp),%rdi
mov    -0x68(%rbp),%rax
mov    (%rax),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12a9 <iioutils_get_param_float+0x119>
mov    -0x58(%rbp),%rdi
mov    -0x68(%rbp),%rax
mov    (%rax),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    137c <iioutils_get_param_float+0x1ec>
mov    -0x20(%rbp),%rdx
mov    -0x68(%rbp),%rax
mov    (%rax),%rcx
lea    -0x60(%rbp),%rdi
lea    0xd47(%rip),%rsi
call   1090 <asprintf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jge    12e4 <iioutils_get_param_float+0x154>
xor    %eax,%eax
mov    0x2cfe(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x3c(%rbp)
jmp    139f <iioutils_get_param_float+0x20f>
mov    -0x60(%rbp),%rdi
lea    0xd1d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1316 <iioutils_get_param_float+0x186>
xor    %eax,%eax
mov    0x2cc4(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x3c(%rbp)
jmp    1386 <iioutils_get_param_float+0x1f6>
mov    0x2cb3(%rip),%rax
movl   $0x0,(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xcdc(%rip),%rsi
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     1377 <iioutils_get_param_float+0x1e7>
mov    0x2c89(%rip),%rax
cmpl   $0x0,(%rax)
je     1363 <iioutils_get_param_float+0x1d3>
xor    %eax,%eax
mov    0x2c77(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x6c(%rbp)
jmp    1371 <iioutils_get_param_float+0x1e1>
xor    %eax,%eax
mov    0x2c7c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    1381 <iioutils_get_param_float+0x1f1>
jmp    125d <iioutils_get_param_float+0xcd>
jmp    1386 <iioutils_get_param_float+0x1f6>
cmpq   $0x0,-0x60(%rbp)
je     139a <iioutils_get_param_float+0x20a>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
jmp    139f <iioutils_get_param_float+0x20f>
mov    -0x48(%rbp),%rdi
call   1060 <closedir@plt>
cmp    $0xffffffff,%eax
jne    13bd <iioutils_get_param_float+0x22d>
lea    0xc59(%rip),%rdi
call   10b0 <perror@plt>
jmp    13c2 <iioutils_get_param_float+0x232>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iioutils_get_param_float>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %r8,%rbx
mov    %rdx,%r12
mov    %rsi,%rbp
mov    %rdi,%r15
movq   $0x0,0x8(%rsp)
lea    0xe48(%rip),%rsi
lea    0x18(%rsp),%rdi
mov    %rcx,%rdx
mov    %rbp,%rcx
call   1090 <asprintf@plt>
test   %eax,%eax
js     12b2 <iioutils_get_param_float+0x122>
lea    0xe29(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    %rbx,%rdx
mov    %rbp,%rcx
call   1090 <asprintf@plt>
test   %eax,%eax
js     12bf <iioutils_get_param_float+0x12f>
mov    %r12,%rdi
call   1040 <opendir@plt>
test   %rax,%rax
je     12cc <iioutils_get_param_float+0x13c>
mov    %rax,%r14
mov    0x2db6(%rip),%rax
xor    %ebp,%ebp
sub    (%rax),%ebp
xchg   %ax,%ax
mov    %r14,%rdi
call   1080 <readdir@plt>
test   %rax,%rax
je     12f1 <iioutils_get_param_float+0x161>
mov    %rax,%rbx
mov    0x18(%rsp),%rdi
mov    (%rax),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1248 <iioutils_get_param_float+0xb8>
mov    0x10(%rsp),%rdi
mov    (%rbx),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1210 <iioutils_get_param_float+0x80>
mov    (%rbx),%rcx
lea    0xdb4(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    %r12,%rdx
call   1090 <asprintf@plt>
test   %eax,%eax
js     12d9 <iioutils_get_param_float+0x149>
mov    %eax,%ebp
mov    0x8(%rsp),%rdi
lea    0xd9b(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     12e6 <iioutils_get_param_float+0x156>
mov    0x2d4e(%rip),%rbx
movl   $0x0,(%rbx)
lea    0xd7f(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     12f1 <iioutils_get_param_float+0x161>
mov    (%rbx),%ebp
test   %ebp,%ebp
jne    12ae <iioutils_get_param_float+0x11e>
mov    0x2d3c(%rip),%rax
mov    (%rax),%ebp
neg    %ebp
jmp    12f1 <iioutils_get_param_float+0x161>
mov    0x2d1f(%rip),%rax
xor    %ebp,%ebp
sub    (%rax),%ebp
jmp    1321 <iioutils_get_param_float+0x191>
mov    0x2d12(%rip),%rax
xor    %ebp,%ebp
sub    (%rax),%ebp
jmp    1317 <iioutils_get_param_float+0x187>
mov    0x2cfd(%rip),%rax
xor    %ebp,%ebp
sub    (%rax),%ebp
jmp    130d <iioutils_get_param_float+0x17d>
mov    0x2cf8(%rip),%rax
xor    %ebp,%ebp
sub    (%rax),%ebp
jmp    1300 <iioutils_get_param_float+0x170>
mov    0x2ce3(%rip),%rax
xor    %ebp,%ebp
sub    (%rax),%ebp
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1300 <iioutils_get_param_float+0x170>
call   1030 <free@plt>
mov    %r14,%rdi
call   1060 <closedir@plt>
cmp    $0xffffffff,%eax
je     1330 <iioutils_get_param_float+0x1a0>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcda(%rip),%rdi
call   10b0 <perror@plt>
jmp    130d <iioutils_get_param_float+0x17d>

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [6 x i8] c"%s_%s\00"
@ENOMEM = global i32 0
@errno = global i32 0
@ENOENT = global i32 0
@.str.1 = [6 x i8] c"%s/%s\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%f\00"
@ENODATA = global i32 0
@.str.4 = [54 x i8] c"iioutils_get_param_float(): Failed to close directory\00"
define i32 @iioutils_get_param_float(float* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca %struct.dirent*
store float* %0, float** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* null, i8** %17
%19 = load i8*, i8** %10
%20 = load i8*, i8** %8
%21 = call i32 @asprintf(i8** %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20)
store i32 %21, i32* %13
%22 = load i32, i32* %13
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %5
%25 = load i32, i32* @ENOMEM
%26 = sub nsw i32 0, %25
store i32 %26, i32* %6
br label %125
27: ; preds = %5
%28 = load i8*, i8** %11
%29 = load i8*, i8** %8
%30 = call i32 @asprintf(i8** %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %28, i8* %29)
store i32 %30, i32* %13
%31 = load i32, i32* %13
%32 = icmp slt i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %27
%34 = load i32, i32* @ENOMEM
%35 = sub nsw i32 0, %34
store i32 %35, i32* %13
br label %121
36: ; preds = %27
%37 = load i8*, i8** %9
%38 = call i32* @opendir(i8* %37)
store i32* %38, i32** %14
%39 = load i32*, i32** %14
%40 = icmp ne i32* %39, null
br i1 %40, label %44, label %41
41: ; preds = %36
%42 = load i32, i32* @errno
%43 = sub nsw i32 0, %42
store i32 %43, i32* %13
br label %118
44: ; preds = %36
%45 = load i32, i32* @ENOENT
%46 = sub nsw i32 0, %45
store i32 %46, i32* %13
br label %47
47: ; preds = %102, %44
%48 = load i32*, i32** %14
%49 = call %struct.dirent* @readdir(i32* %48)
store %struct.dirent* %49, %struct.dirent** %18
%50 = load %struct.dirent*, %struct.dirent** %18
%51 = icmp ne %struct.dirent* %50, null
br i1 %51, label %52, label %103
52: ; preds = %47
%53 = load i8*, i8** %15
%54 = load %struct.dirent*, %struct.dirent** %18
%55 = getelementptr inbounds %struct.dirent, %struct.dirent* %54, i32 0, i32 0
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %53, i8* %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %66, label %59
59: ; preds = %52
%60 = load i8*, i8** %16
%61 = load %struct.dirent*, %struct.dirent** %18
%62 = getelementptr inbounds %struct.dirent, %struct.dirent* %61, i32 0, i32 0
%63 = load i8*, i8** %62
%64 = call i64 @strcmp(i8* %60, i8* %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %102
66: ; preds = %59, %52
%67 = load i8*, i8** %9
%68 = load %struct.dirent*, %struct.dirent** %18
%69 = getelementptr inbounds %struct.dirent, %struct.dirent* %68, i32 0, i32 0
%70 = load i8*, i8** %69
%71 = call i32 @asprintf(i8** %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %67, i8* %70)
store i32 %71, i32* %13
%72 = load i32, i32* %13
%73 = icmp slt i32 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %66
%75 = load i32, i32* @ENOMEM
%76 = sub nsw i32 0, %75
store i32 %76, i32* %13
br label %111
77: ; preds = %66
%78 = load i8*, i8** %17
%79 = call i32* @fopen(i8* %78, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %79, i32** %12
%80 = load i32*, i32** %12
%81 = icmp ne i32* %80, null
br i1 %81, label %85, label %82
82: ; preds = %77
%83 = load i32, i32* @errno
%84 = sub nsw i32 0, %83
store i32 %84, i32* %13
br label %104
85: ; preds = %77
store i32 0, i32* @errno
%86 = load i32*, i32** %12
%87 = load float*, float** %7
%88 = call i32 @fscanf(i32* %86, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %87)
%89 = icmp ne i32 %88, 1
br i1 %89, label %90, label %101
90: ; preds = %85
%91 = load i32, i32* @errno
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %90
%94 = load i32, i32* @errno
%95 = sub nsw i32 0, %94
br label %99
96: ; preds = %90
%97 = load i32, i32* @ENODATA
%98 = sub nsw i32 0, %97
br label %99
99: ; preds = %96, %93
%100 = phi i32 [ %95, %93 ], [ %98, %96 ]
store i32 %100, i32* %13
br label %101
101: ; preds = %99, %85
br label %103
102: ; preds = %59
br label %47
103: ; preds = %101, %47
br label %104
104: ; preds = %103, %82
%105 = load i8*, i8** %17
%106 = icmp ne i8* %105, null
br i1 %106, label %107, label %110
107: ; preds = %104
%108 = load i8*, i8** %17
%109 = call i32 @free(i8* %108)
br label %110
110: ; preds = %107, %104
br label %111
111: ; preds = %110, %74
%112 = load i32*, i32** %14
%113 = call i32 @closedir(i32* %112)
%114 = icmp eq i32 %113, -1
br i1 %114, label %115, label %117
115: ; preds = %111
%116 = call i32 @perror(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
br label %117
117: ; preds = %115, %111
br label %118
118: ; preds = %117, %41
%119 = load i8*, i8** %16
%120 = call i32 @free(i8* %119)
br label %121
121: ; preds = %118, %33
%122 = load i8*, i8** %15
%123 = call i32 @free(i8* %122)
%124 = load i32, i32* %13
store i32 %124, i32* %6
br label %125
125: ; preds = %121, %24
%126 = load i32, i32* %6
ret i32 %126
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [6 x i8] c"%s_%s\00"
@ENOMEM = global i32 0
@errno = global i32 0
@ENOENT = global i32 0
@.str.1 = [6 x i8] c"%s/%s\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%f\00"
@ENODATA = global i32 0
@.str.4 = [54 x i8] c"iioutils_get_param_float(): Failed to close directory\00"
define i32 @iioutils_get_param_float(float* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = bitcast i8** %6 to i8*
%10 = bitcast i8** %7 to i8*
%11 = bitcast i8** %8 to i8*
store i8* null, i8** %8
%12 = call i32 @asprintf(i8** %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %1)
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %5
%15 = load i32, i32* @ENOMEM
%16 = sub nsw i32 0, %15
br label %89
17: ; preds = %5
%18 = call i32 @asprintf(i8** %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %1)
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* @ENOMEM
%22 = sub nsw i32 0, %21
br label %85
23: ; preds = %17
%24 = call i32* @opendir(i8* %2)
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* @errno
%28 = sub nsw i32 0, %27
br label %81
29: ; preds = %23
%30 = load i32, i32* @ENOENT
%31 = sub nsw i32 0, %30
br label %32
32: ; preds = %41, %29
%33 = call %struct.dirent* @readdir(i32* %24)
%34 = icmp eq %struct.dirent* %33, null
br i1 %34, label %69, label %35
35: ; preds = %32
%36 = load i8*, i8** %6
%37 = getelementptr inbounds %struct.dirent, %struct.dirent* %33, i64 0, i32 0
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %36, i8* %38)
%40 = icmp eq i64 %39, 0
br i1 %40, label %46, label %41
41: ; preds = %35
%42 = load i8*, i8** %7
%43 = load i8*, i8** %37
%44 = call i64 @strcmp(i8* %42, i8* %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %32
46: ; preds = %41, %35
%47 = load i8*, i8** %37
%48 = call i32 @asprintf(i8** %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %47)
%49 = icmp slt i32 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = load i32, i32* @ENOMEM
%52 = sub nsw i32 0, %51
br label %75
53: ; preds = %46
%54 = load i8*, i8** %8
%55 = call i32* @fopen(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = load i32, i32* @errno
%59 = sub nsw i32 0, %58
br label %69
60: ; preds = %53
store i32 0, i32* @errno
%61 = call i32 @fscanf(i32* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %0)
%62 = icmp eq i32 %61, 1
br i1 %62, label %69, label %63
63: ; preds = %60
%64 = load i32, i32* @errno
%65 = icmp eq i32 %64, 0
%66 = load i32, i32* @ENODATA
%67 = select i1 %65, i32 %66, i32 %64
%68 = sub nsw i32 0, %67
br label %69
69: ; preds = %32, %63, %60, %57
%70 = phi i32 [ %68, %63 ], [ %48, %60 ], [ %59, %57 ], [ %31, %32 ]
%71 = load i8*, i8** %8
%72 = icmp eq i8* %71, null
br i1 %72, label %75, label %73
73: ; preds = %69
%74 = call i32 @free(i8* %71)
br label %75
75: ; preds = %69, %73, %50
%76 = phi i32 [ %52, %50 ], [ %70, %73 ], [ %70, %69 ]
%77 = call i32 @closedir(i32* %24)
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = call i32 @perror(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
br label %81
81: ; preds = %75, %79, %26
%82 = phi i32 [ %76, %79 ], [ %76, %75 ], [ %28, %26 ]
%83 = load i8*, i8** %7
%84 = call i32 @free(i8* %83)
br label %85
85: ; preds = %81, %20
%86 = phi i32 [ %22, %20 ], [ %82, %81 ]
%87 = load i8*, i8** %6
%88 = call i32 @free(i8* %87)
br label %89
89: ; preds = %85, %14
%90 = phi i32 [ %16, %14 ], [ %86, %85 ]
ret i32 %90
}