#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 *d_name;
  int d_type;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int DT_DIR;
int /*<<< orphan*/ EXIT_FAILURE;
int PATH_MAX;
scalar_t__ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ *opendir(char const *);
int /*<<< orphan*/ printf(char *, char const *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ remove(char *);
int snprintf(char *, int, char *, char const *, char const *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char const *, char *);
char *strerror(int /*<<< orphan*/);
void listFolderAndDeleteFiles(const char *dir_name, bool verbose) {
  DIR *d;
  d = opendir(dir_name);
  if (!d) {
    fprintf(stderr,
            "Cannot open path '%s': %s.\nRun this command with admnistrator "
            "privileges.\n",
            dir_name, strerror(errno));
    exit(EXIT_FAILURE);
  }
  while (1) {
    struct dirent *entry;
    const char *dname;
    entry = readdir(d);
    if (!entry) {
      break;
    }
    dname = entry->d_name;
    if (strcmp(dname, ".") != 0 && strcmp(dname, "..") != 0 &&
        strcmp(dname, ".DS_Store") == 0) {
      char fpath[PATH_MAX];
      sprintf(fpath, "%s/%s", dir_name, dname);
      remove(fpath);
      if (verbose) {
        printf("Cleaning directory: %s\n", dir_name);
      }
    }
    if (entry->d_type & DT_DIR) {
      if (strcmp(dname, ".") != 0 && strcmp(dname, "..") != 0) {
        int path_length;
        char path[PATH_MAX];
        path_length = snprintf(path, PATH_MAX, "%s/%s", dir_name, dname);
        if (path_length > PATH_MAX) {
          fprintf(stderr, "Path too long!\n");
          exit(EXIT_FAILURE);
        }
        listFolderAndDeleteFiles(path, verbose);
      }
    }
  }
  if (closedir(d)) {
    fprintf(stderr, "Could not close '%s': %s\n", dir_name, strerror(errno));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<listFolderAndDeleteFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1232 <listFolderAndDeleteFiles+0x72>
mov    0x2de7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x5c(%rbp),%edi
mov    -0x58(%rbp),%rdx
mov    %rax,%rcx
lea    0xde3(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1237 <listFolderAndDeleteFiles+0x77>
mov    -0x18(%rbp),%rdi
call   10b0 <readdir@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1254 <listFolderAndDeleteFiles+0x94>
jmp    1404 <listFolderAndDeleteFiles+0x244>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xde2(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1317 <listFolderAndDeleteFiles+0x157>
mov    -0x28(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1317 <listFolderAndDeleteFiles+0x157>
mov    -0x28(%rbp),%rdi
lea    0xdb0(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1317 <listFolderAndDeleteFiles+0x157>
mov    0x2d3c(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x68(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xd70(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x68(%rbp),%rdi
call   1030 <remove@plt>
cmpl   $0x0,-0xc(%rbp)
je     1310 <listFolderAndDeleteFiles+0x150>
mov    -0x8(%rbp),%rsi
lea    0xd53(%rip),%rdi
call   1060 <printf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%eax
mov    0x2cab(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     13ff <listFolderAndDeleteFiles+0x23f>
mov    -0x28(%rbp),%rdi
lea    0xd11(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     13fa <listFolderAndDeleteFiles+0x23a>
mov    -0x28(%rbp),%rdi
lea    0xcf6(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     13fa <listFolderAndDeleteFiles+0x23a>
mov    0x2c85(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x70(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x50(%rbp)
mov    0x2c59(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xcb0(%rip),%rdx
call   1070 <snprintf@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    0x2c36(%rip),%rcx
cmp    (%rcx),%eax
jle    13e7 <listFolderAndDeleteFiles+0x227>
mov    0x2c0f(%rip),%rax
mov    (%rax),%edi
lea    0xca4(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2be0(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <listFolderAndDeleteFiles@plt>
mov    -0x48(%rbp),%rax
mov    %rax,%rsp
jmp    13ff <listFolderAndDeleteFiles+0x23f>
jmp    1237 <listFolderAndDeleteFiles+0x77>
mov    -0x18(%rbp),%rdi
call   1080 <closedir@plt>
cmp    $0x0,%rax
je     145f <listFolderAndDeleteFiles+0x29f>
mov    0x2bba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    0x2b96(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x7c(%rbp),%edi
mov    -0x78(%rbp),%rdx
mov    %rax,%rcx
lea    0xc3c(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2b68(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listFolderAndDeleteFiles>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,-0x2c(%rbp)
mov    %rdi,-0x38(%rbp)
call   1040 <opendir@plt>
test   %rax,%rax
je     1397 <listFolderAndDeleteFiles+0x1d7>
mov    %rax,%r13
mov    %rax,%rdi
call   10b0 <readdir@plt>
test   %rax,%rax
je     137b <listFolderAndDeleteFiles+0x1bb>
mov    %rax,%r15
lea    0xe48(%rip),%rbx
jmp    1239 <listFolderAndDeleteFiles+0x79>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    -0x2c(%rbp),%esi
call   1050 <listFolderAndDeleteFiles@plt>
mov    %r15,%rsp
lea    0xe27(%rip),%rbx
mov    %r13,%rdi
call   10b0 <readdir@plt>
mov    %rax,%r15
test   %rax,%rax
je     137b <listFolderAndDeleteFiles+0x1bb>
mov    (%r15),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12e0 <listFolderAndDeleteFiles+0x120>
mov    %r14,%rdi
lea    0xdf1(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12e0 <listFolderAndDeleteFiles+0x120>
mov    %r14,%rdi
lea    0xde0(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    12e0 <listFolderAndDeleteFiles+0x120>
mov    -0x38(%rbp),%r12
mov    %rsp,-0x40(%rbp)
mov    0x2d69(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
lea    0xdb4(%rip),%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   10c0 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
cmpl   $0x0,-0x2c(%rbp)
je     12cc <listFolderAndDeleteFiles+0x10c>
lea    0xd9a(%rip),%rdi
mov    %r12,%rsi
call   1060 <printf@plt>
mov    -0x40(%rbp),%rsp
lea    0xd75(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    0x2ce9(%rip),%rax
mov    (%rax),%eax
test   %eax,0x8(%r15)
je     1225 <listFolderAndDeleteFiles+0x65>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1225 <listFolderAndDeleteFiles+0x65>
mov    %r14,%rdi
lea    0xd3a(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1225 <listFolderAndDeleteFiles+0x65>
mov    %rsp,%r15
mov    0x2cc7(%rip),%r12
mov    (%r12),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    (%r12),%esi
mov    %rbx,%rdi
lea    0xd0c(%rip),%rdx
mov    -0x38(%rbp),%rcx
mov    %r14,%r8
call   1070 <snprintf@plt>
cmp    (%r12),%eax
jle    1210 <listFolderAndDeleteFiles+0x50>
mov    0x2c6f(%rip),%rax
mov    (%rax),%edi
lea    0xd04(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    13e5 <listFolderAndDeleteFiles+0x225>
mov    %r13,%rdi
call   1080 <closedir@plt>
test   %rax,%rax
jne    13b7 <listFolderAndDeleteFiles+0x1f7>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c3a(%rip),%rax
mov    (%rax),%ebx
mov    0x2c21(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xc4b(%rip),%rsi
jmp    13d5 <listFolderAndDeleteFiles+0x215>
mov    0x2c1a(%rip),%rax
mov    (%rax),%ebx
mov    0x2c01(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xcb1(%rip),%rsi
mov    %ebx,%edi
mov    -0x38(%rbp),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x2bd4(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.dirent = type { i8*, i32 }
@stderr = global i32 0
@.str = [75 x i8] c"Cannot open path '%s': %s.\0ARun this command with admnistrator privileges.\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [10 x i8] c".DS_Store\00"
@PATH_MAX = global i32 0
@.str.4 = [6 x i8] c"%s/%s\00"
@.str.5 = [24 x i8] c"Cleaning directory: %s\0A\00"
@DT_DIR = global i32 0
@.str.6 = [16 x i8] c"Path too long!\0A\00"
@.str.7 = [26 x i8] c"Could not close '%s': %s\0A\00"
define void @listFolderAndDeleteFiles(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.dirent*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%13 = load i8*, i8** %3
%14 = call i32* @opendir(i8* %13)
store i32* %14, i32** %5
%15 = load i32*, i32** %5
%16 = icmp ne i32* %15, null
br i1 %16, label %25, label %17
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %3
%20 = load i32, i32* @errno
%21 = call i8* @strerror(i32 %20)
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %21)
%23 = load i32, i32* @EXIT_FAILURE
%24 = call i32 @exit(i32 %23)
unreachable
25: ; preds = %2
br label %26
26: ; preds = %25, %99
%27 = load i32*, i32** %5
%28 = call %struct.dirent* @readdir(i32* %27)
store %struct.dirent* %28, %struct.dirent** %6
%29 = load %struct.dirent*, %struct.dirent** %6
%30 = icmp ne %struct.dirent* %29, null
br i1 %30, label %32, label %31
31: ; preds = %26
br label %100
32: ; preds = %26
%33 = load %struct.dirent*, %struct.dirent** %6
%34 = getelementptr inbounds %struct.dirent, %struct.dirent* %33, i32 0, i32 0
%35 = load i8*, i8** %34
store i8* %35, i8** %7
%36 = load i8*, i8** %7
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %63
39: ; preds = %32
%40 = load i8*, i8** %7
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %63
43: ; preds = %39
%44 = load i8*, i8** %7
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %63
47: ; preds = %43
%48 = load i32, i32* @PATH_MAX
%49 = zext i32 %48 to i64
%50 = call i8* @llvm.stacksave()
store i8* %50, i8** %8
%51 = alloca i8, i64 %49
store i64 %49, i64* %9
%52 = load i8*, i8** %3
%53 = load i8*, i8** %7
%54 = call i32 @sprintf(i8* %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %52, i8* %53)
%55 = call i32 @remove(i8* %51)
%56 = load i32, i32* %4
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %47
%59 = load i8*, i8** %3
%60 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %59)
br label %61
61: ; preds = %58, %47
%62 = load i8*, i8** %8
br label %63
63: ; preds = %61, %43, %39, %32
%64 = load %struct.dirent*, %struct.dirent** %6
%65 = getelementptr inbounds %struct.dirent, %struct.dirent* %64, i32 0, i32 1
%66 = load i32, i32* %65
%67 = load i32, i32* @DT_DIR
%68 = and i32 %66, %67
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %99
70: ; preds = %63
%71 = load i8*, i8** %7
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %98
74: ; preds = %70
%75 = load i8*, i8** %7
%76 = call i64 @strcmp(i8* %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %98
78: ; preds = %74
%79 = load i32, i32* @PATH_MAX
%80 = zext i32 %79 to i64
%81 = call i8* @llvm.stacksave()
store i8* %81, i8** %11
%82 = alloca i8, i64 %80
store i64 %80, i64* %12
%83 = load i32, i32* @PATH_MAX
%84 = load i8*, i8** %3
%85 = load i8*, i8** %7
%86 = call i32 @snprintf(i8* %82, i32 %83, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %84, i8* %85)
store i32 %86, i32* %10
%87 = load i32, i32* %10
%88 = load i32, i32* @PATH_MAX
%89 = icmp sgt i32 %87, %88
br i1 %89, label %90, label %95
90: ; preds = %78
%91 = load i32, i32* @stderr
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%93 = load i32, i32* @EXIT_FAILURE
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %78
%96 = load i32, i32* %4
%97 = load i8*, i8** %11
br label %98
98: ; preds = %95, %74, %70
br label %99
99: ; preds = %98, %63
br label %26
100: ; preds = %31
%101 = load i32*, i32** %5
%102 = call i64 @closedir(i32* %101)
%103 = icmp ne i64 %102, 0
br i1 %103, label %104, label %112
104: ; preds = %100
%105 = load i32, i32* @stderr
%106 = load i8*, i8** %3
%107 = load i32, i32* @errno
%108 = call i8* @strerror(i32 %107)
%109 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %106, i8* %108)
%110 = load i32, i32* @EXIT_FAILURE
%111 = call i32 @exit(i32 %110)
unreachable
112: ; preds = %100
ret void
}

LLVM IR (-O2):
%struct.dirent = type { i8*, i32 }
@stderr = global i32 0
@.str = [75 x i8] c"Cannot open path '%s': %s.\0ARun this command with admnistrator privileges.\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [10 x i8] c".DS_Store\00"
@PATH_MAX = global i32 0
@.str.4 = [6 x i8] c"%s/%s\00"
@.str.5 = [24 x i8] c"Cleaning directory: %s\0A\00"
@DT_DIR = global i32 0
@.str.6 = [16 x i8] c"Path too long!\0A\00"
@.str.7 = [26 x i8] c"Could not close '%s': %s\0A\00"
define void @listFolderAndDeleteFiles(i8* %0, i32 %1) {
%3 = tail call i32* @opendir(i8* %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = call %struct.dirent* @readdir(i32* %3)
%7 = icmp eq %struct.dirent* %6, null
br i1 %7, label %69, label %8
8: ; preds = %5
%9 = icmp eq i32 %1, 0
br label %17
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i32, i32* @errno
%13 = tail call i8* @strerror(i32 %12)
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = tail call i32 @exit(i32 %15)
unreachable
17: ; preds = %8, %66
%18 = phi %struct.dirent* [ %6, %8 ], [ %67, %66 ]
%19 = getelementptr inbounds %struct.dirent, %struct.dirent* %18, i64 0, i32 0
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %39, label %23
23: ; preds = %17
%24 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %39, label %26
26: ; preds = %23
%27 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %39
29: ; preds = %26
%30 = load i32, i32* @PATH_MAX
%31 = zext i32 %30 to i64
%32 = call i8* @llvm.stacksave()
%33 = alloca i8, i64 %31
%34 = call i32 @sprintf(i8* %33, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %20)
%35 = call i32 @remove(i8* %33)
br i1 %9, label %38, label %36
36: ; preds = %29
%37 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i8* %0)
br label %38
38: ; preds = %36, %29
br label %39
39: ; preds = %38, %26, %23, %17
%40 = getelementptr inbounds %struct.dirent, %struct.dirent* %18, i64 0, i32 1
%41 = load i32, i32* %40
%42 = load i32, i32* @DT_DIR
%43 = and i32 %42, %41
%44 = icmp eq i32 %43, 0
br i1 %44, label %66, label %45
45: ; preds = %39
%46 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %66, label %48
48: ; preds = %45
%49 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %66, label %51
51: ; preds = %48
%52 = load i32, i32* @PATH_MAX
%53 = zext i32 %52 to i64
%54 = call i8* @llvm.stacksave()
%55 = alloca i8, i64 %53
%56 = load i32, i32* @PATH_MAX
%57 = call i32 @snprintf(i8* %55, i32 %56, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %20)
%58 = load i32, i32* @PATH_MAX
%59 = icmp sgt i32 %57, %58
br i1 %59, label %60, label %65
60: ; preds = %51
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%63 = load i32, i32* @EXIT_FAILURE
%64 = call i32 @exit(i32 %63)
unreachable
65: ; preds = %51
br label %66
66: ; preds = %39, %65, %48, %45
%67 = call %struct.dirent* @readdir(i32* %3)
%68 = icmp eq %struct.dirent* %67, null
br i1 %68, label %69, label %17
69: ; preds = %66, %5
%70 = call i64 @closedir(i32* %3)
%71 = icmp eq i64 %70, 0
br i1 %71, label %79, label %72
72: ; preds = %69
%73 = load i32, i32* @stderr
%74 = load i32, i32* @errno
%75 = call i8* @strerror(i32 %74)
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %0, i8* %75)
%77 = load i32, i32* @EXIT_FAILURE
%78 = call i32 @exit(i32 %77)
unreachable
79: ; preds = %69
ret void
}