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

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
char *append_file(char const *, char const *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *opendir(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int stat(char *, struct stat *);
scalar_t__ strcmp(char const *, char *);
char **tracecmd_add_list(char **, char const *, int /*<<< orphan*/);
char **tracecmd_system_events(const char *tracing_dir, const char *system) {
  struct dirent *dent;
  char **events = NULL;
  char *events_dir;
  char *system_dir;
  struct stat st;
  DIR *dir;
  int len = 0;
  int ret;
  if (!tracing_dir || !system)
    return NULL;
  events_dir = append_file(tracing_dir, "events");
  if (!events_dir)
    return NULL;
  ret = stat(events_dir, &st);
  if (ret < 0 || !S_ISDIR(st.st_mode))
    goto out_free;
  system_dir = append_file(events_dir, system);
  if (!system_dir)
    goto out_free;
  ret = stat(system_dir, &st);
  if (ret < 0 || !S_ISDIR(st.st_mode))
    goto out_free_sys;
  dir = opendir(system_dir);
  if (!dir)
    goto out_free_sys;
  while ((dent = readdir(dir))) {
    const char *name = dent->d_name;
    char *enable;
    char *event;
    if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0)
      continue;
    event = append_file(system_dir, name);
    ret = stat(event, &st);
    if (ret < 0 || !S_ISDIR(st.st_mode)) {
      free(event);
      continue;
    }
    enable = append_file(event, "enable");
    ret = stat(enable, &st);
    if (ret >= 0)
      events = tracecmd_add_list(events, name, len++);
    free(enable);
    free(event);
  }
  closedir(dir);
out_free_sys:
  free(system_dir);
out_free:
  free(events_dir);
  return events;
}


x86 assembly (clang, -O0):
<tracecmd_system_events>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11c5 <tracecmd_system_events+0x35>
cmpq   $0x0,-0x18(%rbp)
jne    11d2 <tracecmd_system_events+0x42>
movq   $0x0,-0x8(%rbp)
jmp    13ca <tracecmd_system_events+0x23a>
mov    -0x10(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   1050 <append_file@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11fe <tracecmd_system_events+0x6e>
movq   $0x0,-0x8(%rbp)
jmp    13ca <tracecmd_system_events+0x23a>
mov    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1090 <stat@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
jl     1229 <tracecmd_system_events+0x99>
mov    -0x40(%rbp),%edi
call   1060 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    122e <tracecmd_system_events+0x9e>
jmp    13b9 <tracecmd_system_events+0x229>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <append_file@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    124f <tracecmd_system_events+0xbf>
jmp    13b9 <tracecmd_system_events+0x229>
mov    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1090 <stat@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
jl     127a <tracecmd_system_events+0xea>
mov    -0x40(%rbp),%edi
call   1060 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    127f <tracecmd_system_events+0xef>
jmp    13b0 <tracecmd_system_events+0x220>
mov    -0x38(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    129c <tracecmd_system_events+0x10c>
jmp    13b0 <tracecmd_system_events+0x220>
jmp    12a1 <tracecmd_system_events+0x111>
mov    -0x48(%rbp),%rdi
call   10a0 <readdir@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     13a7 <tracecmd_system_events+0x217>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    0xd3a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     12f7 <tracecmd_system_events+0x167>
mov    -0x58(%rbp),%rdi
lea    0xd1f(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12fc <tracecmd_system_events+0x16c>
jmp    12a1 <tracecmd_system_events+0x111>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   1050 <append_file@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1090 <stat@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
jl     1338 <tracecmd_system_events+0x1a8>
mov    -0x40(%rbp),%edi
call   1060 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    1346 <tracecmd_system_events+0x1b6>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
jmp    12a1 <tracecmd_system_events+0x111>
mov    -0x68(%rbp),%rdi
lea    0xcb9(%rip),%rsi
call   1050 <append_file@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1090 <stat@plt>
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
jl     1390 <tracecmd_system_events+0x200>
mov    -0x28(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x4c(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
call   10b0 <tracecmd_add_list@plt>
mov    %rax,-0x28(%rbp)
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
jmp    12a1 <tracecmd_system_events+0x111>
mov    -0x48(%rbp),%rdi
call   1070 <closedir@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracecmd_system_events>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
xor    %ebx,%ebx
test   %rdi,%rdi
je     1368 <tracecmd_system_events+0x1d8>
mov    %rsi,%rbp
test   %rsi,%rsi
je     1368 <tracecmd_system_events+0x1d8>
lea    0xe44(%rip),%rsi
call   1050 <append_file@plt>
test   %rax,%rax
je     1270 <tracecmd_system_events+0xe0>
mov    %rax,%r15
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1090 <stat@plt>
test   %eax,%eax
js     1269 <tracecmd_system_events+0xd9>
mov    0x8(%rsp),%edi
call   1060 <S_ISDIR@plt>
test   %eax,%eax
je     1269 <tracecmd_system_events+0xd9>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1050 <append_file@plt>
test   %rax,%rax
je     1269 <tracecmd_system_events+0xd9>
mov    %rax,%r14
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1090 <stat@plt>
test   %eax,%eax
js     134a <tracecmd_system_events+0x1ba>
mov    0x8(%rsp),%edi
call   1060 <S_ISDIR@plt>
test   %eax,%eax
je     134a <tracecmd_system_events+0x1ba>
mov    %r14,%rdi
call   1040 <opendir@plt>
test   %rax,%rax
je     134a <tracecmd_system_events+0x1ba>
mov    %rax,%r12
mov    %rax,%rdi
call   10a0 <readdir@plt>
test   %rax,%rax
je     134e <tracecmd_system_events+0x1be>
xor    %ecx,%ecx
mov    %rcx,0x10(%rsp)
lea    0xdad(%rip),%r13
xor    %ebx,%ebx
mov    %r14,0x18(%rsp)
mov    %r12,0x20(%rsp)
jmp    12a5 <tracecmd_system_events+0x115>
xor    %ebx,%ebx
jmp    1360 <tracecmd_system_events+0x1d0>
xor    %ebx,%ebx
jmp    1368 <tracecmd_system_events+0x1d8>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%r14
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r12,%r13
mov    0x20(%rsp),%r12
mov    %r12,%rdi
call   10a0 <readdir@plt>
test   %rax,%rax
je     1350 <tracecmd_system_events+0x1c0>
mov    (%rax),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1294 <tracecmd_system_events+0x104>
mov    %rbp,%rdi
lea    0xd45(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1294 <tracecmd_system_events+0x104>
mov    %r13,%r12
mov    %r14,%rdi
mov    %rbp,%rsi
call   1050 <append_file@plt>
mov    %rax,%r13
mov    %rax,%rdi
lea    0x8(%rsp),%rsi
call   1090 <stat@plt>
test   %eax,%eax
js     1284 <tracecmd_system_events+0xf4>
mov    0x8(%rsp),%edi
call   1060 <S_ISDIR@plt>
test   %eax,%eax
je     1284 <tracecmd_system_events+0xf4>
mov    %r13,%rdi
lea    0xd05(%rip),%rsi
call   1050 <append_file@plt>
mov    %rax,%r14
mov    %rax,%rdi
lea    0x8(%rsp),%rsi
call   1090 <stat@plt>
test   %eax,%eax
js     1277 <tracecmd_system_events+0xe7>
mov    0x10(%rsp),%rdx
lea    0x1(%rdx),%eax
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10b0 <tracecmd_add_list@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%eax
mov    %rax,0x10(%rsp)
jmp    1277 <tracecmd_system_events+0xe7>
xor    %ebx,%ebx
jmp    1358 <tracecmd_system_events+0x1c8>
xor    %ebx,%ebx
mov    %r12,%rdi
call   1070 <closedir@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@.str = [7 x i8] c"events\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [7 x i8] c"enable\00"
define i8** @tracecmd_system_events(i8* %0, i8* %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = icmp ne i8* %0, null
%6 = icmp ne i8* %1, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %83
8: ; preds = %2
%9 = tail call i8* @append_file(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %83, label %11
11: ; preds = %8
%12 = call i32 @stat(i8* %9, %struct.stat* %3)
%13 = icmp slt i32 %12, 0
br i1 %13, label %80, label %14
14: ; preds = %11
%15 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%16 = load i32, i32* %15
%17 = tail call i32 @S_ISDIR(i32 %16)
%18 = icmp eq i32 %17, 0
br i1 %18, label %80, label %19
19: ; preds = %14
%20 = tail call i8* @append_file(i8* %9, i8* %1)
%21 = icmp eq i8* %20, null
br i1 %21, label %80, label %22
22: ; preds = %19
%23 = call i32 @stat(i8* %20, %struct.stat* %3)
%24 = icmp slt i32 %23, 0
br i1 %24, label %77, label %25
25: ; preds = %22
%26 = load i32, i32* %15
%27 = tail call i32 @S_ISDIR(i32 %26)
%28 = icmp eq i32 %27, 0
br i1 %28, label %77, label %29
29: ; preds = %25
%30 = tail call i32* @opendir(i8* %20)
%31 = icmp eq i32* %30, null
br i1 %31, label %77, label %32
32: ; preds = %29
%33 = tail call %struct.dirent* @readdir(i32* %30)
%34 = icmp eq %struct.dirent* %33, null
br i1 %34, label %74, label %35
35: ; preds = %32, %69
%36 = phi %struct.dirent* [ %72, %69 ], [ %33, %32 ]
%37 = phi i8** [ %71, %69 ], [ null, %32 ]
%38 = phi i32 [ %70, %69 ], [ 0, %32 ]
%39 = getelementptr inbounds %struct.dirent, %struct.dirent* %36, i64 0, i32 0
%40 = load i8*, i8** %39
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %69, label %43
43: ; preds = %35
%44 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %69, label %46
46: ; preds = %43
%47 = tail call i8* @append_file(i8* %20, i8* %40)
%48 = call i32 @stat(i8* %47, %struct.stat* %3)
%49 = icmp slt i32 %48, 0
br i1 %49, label %65, label %50
50: ; preds = %46
%51 = load i32, i32* %15
%52 = tail call i32 @S_ISDIR(i32 %51)
%53 = icmp eq i32 %52, 0
br i1 %53, label %65, label %54
54: ; preds = %50
%55 = tail call i8* @append_file(i8* %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%56 = call i32 @stat(i8* %55, %struct.stat* %3)
%57 = icmp sgt i32 %56, -1
br i1 %57, label %58, label %61
58: ; preds = %54
%59 = add nsw i32 %38, 1
%60 = tail call i8** @tracecmd_add_list(i8** %37, i8* %40, i32 %38)
br label %61
61: ; preds = %58, %54
%62 = phi i32 [ %59, %58 ], [ %38, %54 ]
%63 = phi i8** [ %60, %58 ], [ %37, %54 ]
%64 = tail call i32 @free(i8* %55)
br label %65
65: ; preds = %46, %50, %61
%66 = phi i32 [ %62, %61 ], [ %38, %50 ], [ %38, %46 ]
%67 = phi i8** [ %63, %61 ], [ %37, %50 ], [ %37, %46 ]
%68 = tail call i32 @free(i8* %47)
br label %69
69: ; preds = %65, %35, %43
%70 = phi i32 [ %38, %43 ], [ %38, %35 ], [ %66, %65 ]
%71 = phi i8** [ %37, %43 ], [ %37, %35 ], [ %67, %65 ]
%72 = tail call %struct.dirent* @readdir(i32* %30)
%73 = icmp eq %struct.dirent* %72, null
br i1 %73, label %74, label %35
74: ; preds = %69, %32
%75 = phi i8** [ null, %32 ], [ %71, %69 ]
%76 = tail call i32 @closedir(i32* %30)
br label %77
77: ; preds = %29, %22, %25, %74
%78 = phi i8** [ null, %22 ], [ %75, %74 ], [ null, %29 ], [ null, %25 ]
%79 = tail call i32 @free(i8* %20)
br label %80
80: ; preds = %19, %11, %14, %77
%81 = phi i8** [ null, %11 ], [ %78, %77 ], [ null, %19 ], [ null, %14 ]
%82 = tail call i32 @free(i8* %9)
br label %83
83: ; preds = %8, %2, %80
%84 = phi i8** [ %81, %80 ], [ null, %2 ], [ null, %8 ]
ret i8** %84
}