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

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ eout(char *, char *, char *);
int /*<<< orphan*/ errno;
scalar_t__ lstat(char *, struct stat *);
int /*<<< orphan*/ *opendir(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
scalar_t__ rmdir(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
scalar_t__ strcmp(char *, char *);
char *strerror(int /*<<< orphan*/);
int strlen(char *);
scalar_t__ unlink(char *);
int recursive_rm(char *dir) {
  char pathbuf[2048];
  DIR *dirp;
  struct dirent *de;
  struct stat stb;
  int rc = 0;
  if ((dirp = opendir(dir)) == NULL) {
    eout("can't read directory '%s': %s\n", dir, strerror(errno));
    return -1;
  }
  while ((de = readdir(dirp)) != NULL) {
    if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) {
      continue;
    }
    if (strlen(dir) + strlen(de->d_name) > sizeof(pathbuf) - 5) {
      eout("file path too long: %s/%s\n", dir, de->d_name);
      rc--;
      continue;
    }
    sprintf(pathbuf, "%s/%s", dir, de->d_name);
    if (lstat(pathbuf, &stb) < 0) {
      eout("can't stat '%s': %s\n", pathbuf, strerror(errno));
      rc--;
      continue;
    }
    if (S_ISDIR(stb.st_mode)) {
      rc += recursive_rm(pathbuf);
    } else {
      if (unlink(pathbuf) < 0) {
        eout("can't unlink '%s': %s\n", pathbuf, strerror(errno));
        rc--;
      }
    }
  }
  closedir(dirp);
  if (rmdir(dir) < 0) {
    eout("can't rmdir '%s': %s\n", dir, strerror(errno));
    rc--;
  }
  return rc;
}


x86 assembly (clang, -O0):
<recursive_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x82c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x818(%rbp)
cmp    $0x0,%rax
jne    123e <recursive_rm+0x6e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x838(%rbp)
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x838(%rbp),%rsi
mov    %rax,%rdx
lea    0xdd3(%rip),%rdi
call   10d0 <eout@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1486 <recursive_rm+0x2b6>
jmp    1243 <recursive_rm+0x73>
mov    -0x818(%rbp),%rdi
call   10b0 <readdir@plt>
mov    %rax,-0x820(%rbp)
cmp    $0x0,%rax
je     1420 <recursive_rm+0x250>
mov    -0x820(%rbp),%rax
mov    (%rax),%rdi
lea    0xdaf(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     12a0 <recursive_rm+0xd0>
mov    -0x820(%rbp),%rax
mov    (%rax),%rdi
lea    0xd8e(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12a5 <recursive_rm+0xd5>
jmp    1243 <recursive_rm+0x73>
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x83c(%rbp)
mov    -0x820(%rbp),%rax
mov    (%rax),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x83c(%rbp),%eax
add    %ecx,%eax
cltq
cmp    $0x7fb,%rax
jbe    1309 <recursive_rm+0x139>
mov    -0x10(%rbp),%rsi
mov    -0x820(%rbp),%rax
mov    (%rax),%rdx
lea    0xd32(%rip),%rdi
call   10d0 <eout@plt>
mov    -0x82c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x82c(%rbp)
jmp    1243 <recursive_rm+0x73>
lea    -0x810(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x820(%rbp),%rax
mov    (%rax),%rcx
lea    0xd18(%rip),%rsi
call   10e0 <sprintf@plt>
lea    -0x810(%rbp),%rdi
lea    -0x828(%rbp),%rsi
call   1090 <lstat@plt>
cmp    $0x0,%rax
jge    138d <recursive_rm+0x1bd>
lea    -0x810(%rbp),%rax
mov    %rax,-0x848(%rbp)
mov    0x2c84(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x848(%rbp),%rsi
mov    %rax,%rdx
lea    0xccf(%rip),%rdi
call   10d0 <eout@plt>
mov    -0x82c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x82c(%rbp)
jmp    1243 <recursive_rm+0x73>
mov    -0x828(%rbp),%edi
call   1070 <S_ISDIR@plt>
cmp    $0x0,%rax
je     13bf <recursive_rm+0x1ef>
lea    -0x810(%rbp),%rdi
call   10c0 <recursive_rm@plt>
add    -0x82c(%rbp),%eax
mov    %eax,-0x82c(%rbp)
jmp    141b <recursive_rm+0x24b>
lea    -0x810(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
jge    1416 <recursive_rm+0x246>
lea    -0x810(%rbp),%rax
mov    %rax,-0x850(%rbp)
mov    0x2bf6(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x850(%rbp),%rsi
mov    %rax,%rdx
lea    0xc56(%rip),%rdi
call   10d0 <eout@plt>
mov    -0x82c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x82c(%rbp)
jmp    141b <recursive_rm+0x24b>
jmp    1243 <recursive_rm+0x73>
mov    -0x818(%rbp),%rdi
call   1080 <closedir@plt>
mov    -0x10(%rbp),%rdi
call   1050 <rmdir@plt>
cmp    $0x0,%rax
jge    147d <recursive_rm+0x2ad>
mov    -0x10(%rbp),%rax
mov    %rax,-0x858(%rbp)
mov    0x2b8f(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x858(%rbp),%rsi
mov    %rax,%rdx
lea    0xc06(%rip),%rdi
call   10d0 <eout@plt>
mov    -0x82c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x82c(%rbp)
mov    -0x82c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive_rm>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
mov    %rdi,%r15
call   1040 <opendir@plt>
test   %rax,%rax
je     1217 <recursive_rm+0x47>
mov    %rax,%rbp
mov    %rax,%rdi
call   10b0 <readdir@plt>
test   %rax,%rax
je     123f <recursive_rm+0x6f>
mov    %rax,%r13
xor    %r14d,%r14d
lea    0xe15(%rip),%rbx
lea    0xe0d(%rip),%r12
jmp    12c4 <recursive_rm+0xf4>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
lea    0xdd4(%rip),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   10d0 <eout@plt>
mov    $0xffffffff,%r14d
jmp    127b <recursive_rm+0xab>
xor    %r14d,%r14d
mov    %rbp,%rdi
call   1080 <closedir@plt>
mov    %r15,%rdi
call   1050 <rmdir@plt>
test   %rax,%rax
jns    127b <recursive_rm+0xab>
mov    0x2d82(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
lea    0xe03(%rip),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   10d0 <eout@plt>
add    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd8b(%rip),%rdi
mov    %r15,%rsi
mov    %rcx,%rdx
call   10d0 <eout@plt>
mov    0x4(%rsp),%r14d
add    $0xffffffff,%r14d
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   10b0 <readdir@plt>
mov    %rax,%r13
test   %rax,%rax
je     1242 <recursive_rm+0x72>
mov    0x0(%r13),%rdi
mov    %rbx,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12b0 <recursive_rm+0xe0>
mov    0x0(%r13),%rdi
mov    %r12,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12b0 <recursive_rm+0xe0>
mov    %r14d,0x4(%rsp)
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %eax,%r14d
mov    0x0(%r13),%rdi
call   1060 <strlen@plt>
add    %r14d,%eax
mov    0x0(%r13),%rcx
cmp    $0x7fc,%eax
jae    1290 <recursive_rm+0xc0>
lea    0x10(%rsp),%r13
mov    %r13,%rdi
lea    0xd21(%rip),%rsi
mov    %r15,%rdx
call   10e0 <sprintf@plt>
mov    %r13,%rdi
lea    0x8(%rsp),%rsi
call   1090 <lstat@plt>
test   %rax,%rax
mov    0x4(%rsp),%r14d
js     1359 <recursive_rm+0x189>
mov    0x8(%rsp),%edi
call   1070 <S_ISDIR@plt>
test   %rax,%rax
je     137e <recursive_rm+0x1ae>
mov    %r13,%rdi
call   10c0 <recursive_rm@plt>
add    %eax,%r14d
jmp    12b0 <recursive_rm+0xe0>
mov    0x2c80(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
lea    0xcd5(%rip),%rdi
mov    %r13,%rsi
mov    %rax,%rdx
call   10d0 <eout@plt>
jmp    12a7 <recursive_rm+0xd7>
mov    %r13,%rdi
call   1030 <unlink@plt>
test   %rax,%rax
jns    12b0 <recursive_rm+0xe0>
mov    0x2c4a(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
lea    0xcb4(%rip),%rdi
jmp    136e <recursive_rm+0x19e>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@.str = [31 x i8] c"can't read directory '%s': %s\0A\00"
@errno = global i32 0
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [27 x i8] c"file path too long: %s/%s\0A\00"
@.str.4 = [6 x i8] c"%s/%s\00"
@.str.5 = [21 x i8] c"can't stat '%s': %s\0A\00"
@.str.6 = [23 x i8] c"can't unlink '%s': %s\0A\00"
@.str.7 = [22 x i8] c"can't rmdir '%s': %s\0A\00"
define i32 @recursive_rm(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [2048 x i8]
%5 = alloca i32*
%6 = alloca %struct.dirent*
%7 = alloca %struct.stat
%8 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %8
%9 = load i8*, i8** %3
%10 = call i32* @opendir(i8* %9)
store i32* %10, i32** %5
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = load i32, i32* @errno
%15 = call i8* @strerror(i32 %14)
%16 = call i32 @eout(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %15)
store i32 -1, i32* %2
br label %108
17: ; preds = %1
br label %18
18: ; preds = %92, %63, %45, %34, %17
%19 = load i32*, i32** %5
%20 = call %struct.dirent* @readdir(i32* %19)
store %struct.dirent* %20, %struct.dirent** %6
%21 = icmp ne %struct.dirent* %20, null
br i1 %21, label %22, label %93
22: ; preds = %18
%23 = load %struct.dirent*, %struct.dirent** %6
%24 = getelementptr inbounds %struct.dirent, %struct.dirent* %23, i32 0, i32 0
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %34, label %28
28: ; preds = %22
%29 = load %struct.dirent*, %struct.dirent** %6
%30 = getelementptr inbounds %struct.dirent, %struct.dirent* %29, i32 0, i32 0
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %28, %22
br label %18
35: ; preds = %28
%36 = load i8*, i8** %3
%37 = call i32 @strlen(i8* %36)
%38 = load %struct.dirent*, %struct.dirent** %6
%39 = getelementptr inbounds %struct.dirent, %struct.dirent* %38, i32 0, i32 0
%40 = load i8*, i8** %39
%41 = call i32 @strlen(i8* %40)
%42 = add nsw i32 %37, %41
%43 = sext i32 %42 to i64
%44 = icmp ugt i64 %43, 2043
br i1 %44, label %45, label %53
45: ; preds = %35
%46 = load i8*, i8** %3
%47 = load %struct.dirent*, %struct.dirent** %6
%48 = getelementptr inbounds %struct.dirent, %struct.dirent* %47, i32 0, i32 0
%49 = load i8*, i8** %48
%50 = call i32 @eout(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %46, i8* %49)
%51 = load i32, i32* %8
%52 = add nsw i32 %51, -1
store i32 %52, i32* %8
br label %18
53: ; preds = %35
%54 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%55 = load i8*, i8** %3
%56 = load %struct.dirent*, %struct.dirent** %6
%57 = getelementptr inbounds %struct.dirent, %struct.dirent* %56, i32 0, i32 0
%58 = load i8*, i8** %57
%59 = call i32 @sprintf(i8* %54, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %55, i8* %58)
%60 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%61 = call i64 @lstat(i8* %60, %struct.stat* %7)
%62 = icmp slt i64 %61, 0
br i1 %62, label %63, label %70
63: ; preds = %53
%64 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%65 = load i32, i32* @errno
%66 = call i8* @strerror(i32 %65)
%67 = call i32 @eout(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %64, i8* %66)
%68 = load i32, i32* %8
%69 = add nsw i32 %68, -1
store i32 %69, i32* %8
br label %18
70: ; preds = %53
%71 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%72 = load i32, i32* %71
%73 = call i64 @S_ISDIR(i32 %72)
%74 = icmp ne i64 %73, 0
br i1 %74, label %75, label %80
75: ; preds = %70
%76 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%77 = call i32 @recursive_rm(i8* %76)
%78 = load i32, i32* %8
%79 = add nsw i32 %78, %77
store i32 %79, i32* %8
br label %92
80: ; preds = %70
%81 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%82 = call i64 @unlink(i8* %81)
%83 = icmp slt i64 %82, 0
br i1 %83, label %84, label %91
84: ; preds = %80
%85 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%86 = load i32, i32* @errno
%87 = call i8* @strerror(i32 %86)
%88 = call i32 @eout(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* %85, i8* %87)
%89 = load i32, i32* %8
%90 = add nsw i32 %89, -1
store i32 %90, i32* %8
br label %91
91: ; preds = %84, %80
br label %92
92: ; preds = %91, %75
br label %18
93: ; preds = %18
%94 = load i32*, i32** %5
%95 = call i32 @closedir(i32* %94)
%96 = load i8*, i8** %3
%97 = call i64 @rmdir(i8* %96)
%98 = icmp slt i64 %97, 0
br i1 %98, label %99, label %106
99: ; preds = %93
%100 = load i8*, i8** %3
%101 = load i32, i32* @errno
%102 = call i8* @strerror(i32 %101)
%103 = call i32 @eout(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %100, i8* %102)
%104 = load i32, i32* %8
%105 = add nsw i32 %104, -1
store i32 %105, i32* %8
br label %106
106: ; preds = %99, %93
%107 = load i32, i32* %8
store i32 %107, i32* %2
br label %108
108: ; preds = %106, %12
%109 = load i32, i32* %2
ret i32 %109
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@.str = [31 x i8] c"can't read directory '%s': %s\0A\00"
@errno = global i32 0
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [27 x i8] c"file path too long: %s/%s\0A\00"
@.str.4 = [6 x i8] c"%s/%s\00"
@.str.5 = [21 x i8] c"can't stat '%s': %s\0A\00"
@.str.6 = [23 x i8] c"can't unlink '%s': %s\0A\00"
@.str.7 = [22 x i8] c"can't rmdir '%s': %s\0A\00"
define i32 @recursive_rm(i8* %0) {
%2 = alloca [2048 x i8]
%3 = alloca %struct.stat
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%5 = bitcast %struct.stat* %3 to i8*
%6 = tail call i32* @opendir(i8* %0)
%7 = icmp eq i32* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = call %struct.dirent* @readdir(i32* %6)
%10 = icmp eq %struct.dirent* %9, null
br i1 %10, label %71, label %11
11: ; preds = %8
%12 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
br label %44
13: ; preds = %1
%14 = load i32, i32* @errno
%15 = tail call i8* @strerror(i32 %14)
%16 = tail call i32 @eout(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %15)
br label %81
17: ; preds = %44, %27
%18 = phi %struct.dirent* [ %45, %44 ], [ %28, %27 ]
%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 %27, label %23
23: ; preds = %17
%24 = load i8*, i8** %19
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23, %17
%28 = call %struct.dirent* @readdir(i32* %6)
%29 = icmp eq %struct.dirent* %28, null
br i1 %29, label %71, label %17
30: ; preds = %23
%31 = call i32 @strlen(i8* %0)
%32 = load i8*, i8** %19
%33 = call i32 @strlen(i8* %32)
%34 = add nsw i32 %33, %31
%35 = icmp ugt i32 %34, 2043
%36 = load i8*, i8** %19
br i1 %35, label %37, label %47
37: ; preds = %30
%38 = call i32 @eout(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %36)
%39 = add nsw i32 %46, -1
br label %40
40: ; preds = %60, %66, %63, %37, %51
%41 = phi i32 [ %55, %51 ], [ %39, %37 ], [ %62, %60 ], [ %70, %66 ], [ %46, %63 ]
%42 = call %struct.dirent* @readdir(i32* %6)
%43 = icmp eq %struct.dirent* %42, null
br i1 %43, label %71, label %44
44: ; preds = %11, %40
%45 = phi %struct.dirent* [ %9, %11 ], [ %42, %40 ]
%46 = phi i32 [ 0, %11 ], [ %41, %40 ]
br label %17
47: ; preds = %30
%48 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %36)
%49 = call i64 @lstat(i8* %4, %struct.stat* %3)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %56
51: ; preds = %47
%52 = load i32, i32* @errno
%53 = call i8* @strerror(i32 %52)
%54 = call i32 @eout(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %4, i8* %53)
%55 = add nsw i32 %46, -1
br label %40
56: ; preds = %47
%57 = load i32, i32* %12
%58 = call i64 @S_ISDIR(i32 %57)
%59 = icmp eq i64 %58, 0
br i1 %59, label %63, label %60
60: ; preds = %56
%61 = call i32 @recursive_rm(i8* %4)
%62 = add nsw i32 %61, %46
br label %40
63: ; preds = %56
%64 = call i64 @unlink(i8* %4)
%65 = icmp slt i64 %64, 0
br i1 %65, label %66, label %40
66: ; preds = %63
%67 = load i32, i32* @errno
%68 = call i8* @strerror(i32 %67)
%69 = call i32 @eout(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i8* %4, i8* %68)
%70 = add nsw i32 %46, -1
br label %40
71: ; preds = %40, %27, %8
%72 = phi i32 [ 0, %8 ], [ %46, %27 ], [ %41, %40 ]
%73 = call i32 @closedir(i32* %6)
%74 = call i64 @rmdir(i8* %0)
%75 = icmp slt i64 %74, 0
br i1 %75, label %76, label %81
76: ; preds = %71
%77 = load i32, i32* @errno
%78 = call i8* @strerror(i32 %77)
%79 = call i32 @eout(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %0, i8* %78)
%80 = add nsw i32 %72, -1
br label %81
81: ; preds = %71, %76, %13
%82 = phi i32 [ -1, %13 ], [ %80, %76 ], [ %72, %71 ]
ret i32 %82
}