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

/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ chdir(char const *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
scalar_t__ difftime(int, int);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ *opendir(char const *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewinddir(int /*<<< orphan*/ *);
int stat(char *, struct stat *);
scalar_t__ strcmp(char *, char *);
void ref_most_recent(const char *dirname) {
  DIR *dirp;
  struct dirent *dir;
  struct stat buf;
  time_t latest;
  time_t diff;
  char cwd[PATH_MAX];
  if ((dirp = opendir(dirname)) == NULL) {
    perror("opendir");
    return;
  }
  getcwd(cwd, sizeof cwd);
  chdir(dirname);
  while ((dir = readdir(dirp)) != NULL) {
    if (stat(dir->d_name, &buf) == -1) {
      continue;
    }
    if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) {
      continue;
    }
    if (difftime(buf.st_mtime, latest) > 0) {
      latest = buf.st_mtime;
    }
  }
  rewinddir(dirp);
  while ((dir = readdir(dirp)) != NULL) {
    if (stat(dir->d_name, &buf) == -1) {
      continue;
    }
    if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) {
      continue;
    }
    diff = latest - buf.st_mtime;
    if (diff < (24 * 60 * 60)) {
      printf("\e[31m%s\e[39m\n", dir->d_name);
    } else if (diff < 3 * (24 * 60 * 60)) {
      printf("\e[91m%s\e[39m\n", dir->d_name);
    } else if (diff < (7 * (24 * 60 * 60))) {
      printf("\e[35m%s\e[39m\n", dir->d_name);
    } else if (diff < (30 * (24 * 60 * 60))) {
      printf("\e[95m%s\e[39m\n", dir->d_name);
    } else if (diff < (365 * (24 * 60 * 60))) {
      printf("\e[34m%s\e[39m\n", dir->d_name);
    } else {
      printf("\e[94m%s\e[39m\n", dir->d_name);
    }
  }
  chdir(cwd);
  closedir(dirp);
}


x86 assembly (clang, -O0):
<ref_most_recent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e2d(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x50(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    121b <ref_most_recent+0x6b>
lea    0xdf6(%rip),%rdi
call   10d0 <perror@plt>
movl   $0x1,-0x3c(%rbp)
jmp    144b <ref_most_recent+0x29b>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rax
mov    %eax,%esi
call   1070 <getcwd@plt>
mov    -0x8(%rbp),%rdi
call   1040 <chdir@plt>
mov    -0x10(%rbp),%rdi
call   10c0 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     12c7 <ref_most_recent+0x117>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    -0x20(%rbp),%rsi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
jne    1268 <ref_most_recent+0xb8>
jmp    1233 <ref_most_recent+0x83>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd93(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     12a2 <ref_most_recent+0xf2>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd75(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12a7 <ref_most_recent+0xf7>
jmp    1233 <ref_most_recent+0x83>
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1060 <difftime@plt>
cmp    $0x0,%rax
jle    12c2 <ref_most_recent+0x112>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1233 <ref_most_recent+0x83>
mov    -0x10(%rbp),%rdi
call   1080 <rewinddir@plt>
mov    -0x10(%rbp),%rdi
call   10c0 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1432 <ref_most_recent+0x282>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    -0x20(%rbp),%rsi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
jne    1305 <ref_most_recent+0x155>
jmp    12d0 <ref_most_recent+0x120>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xcf6(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     133f <ref_most_recent+0x18f>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xcd8(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1344 <ref_most_recent+0x194>
jmp    12d0 <ref_most_recent+0x120>
mov    -0x24(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x15180,-0x28(%rbp)
jge    1372 <ref_most_recent+0x1c2>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xca3(%rip),%rdi
call   1050 <printf@plt>
jmp    142d <ref_most_recent+0x27d>
cmpl   $0x3f480,-0x28(%rbp)
jge    1397 <ref_most_recent+0x1e7>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xc8c(%rip),%rdi
call   1050 <printf@plt>
jmp    1428 <ref_most_recent+0x278>
cmpl   $0x93a80,-0x28(%rbp)
jge    13bc <ref_most_recent+0x20c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xc75(%rip),%rdi
call   1050 <printf@plt>
jmp    1423 <ref_most_recent+0x273>
cmpl   $0x278d00,-0x28(%rbp)
jge    13e1 <ref_most_recent+0x231>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xc5e(%rip),%rdi
call   1050 <printf@plt>
jmp    141e <ref_most_recent+0x26e>
cmpl   $0x1e13380,-0x28(%rbp)
jge    1406 <ref_most_recent+0x256>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xc47(%rip),%rdi
call   1050 <printf@plt>
jmp    1419 <ref_most_recent+0x269>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xc3d(%rip),%rdi
call   1050 <printf@plt>
jmp    141e <ref_most_recent+0x26e>
jmp    1423 <ref_most_recent+0x273>
jmp    1428 <ref_most_recent+0x278>
jmp    142d <ref_most_recent+0x27d>
jmp    12d0 <ref_most_recent+0x120>
mov    -0x48(%rbp),%rdi
call   1040 <chdir@plt>
mov    -0x10(%rbp),%rdi
call   1090 <closedir@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_most_recent>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r14
mov    %rsp,%r15
mov    0x2e22(%rip),%rax
mov    (%rax),%r12d
mov    %rsp,%rbx
lea    0xf(%r12),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
call   1030 <opendir@plt>
test   %rax,%rax
je     13a1 <ref_most_recent+0x1f1>
mov    %rax,%r13
mov    %rbx,-0x40(%rbp)
mov    %rbx,%rdi
mov    %r12d,%esi
call   1070 <getcwd@plt>
mov    %r14,%rdi
call   1040 <chdir@plt>
mov    %r13,%rdi
call   10c0 <readdir@plt>
test   %rax,%rax
mov    %r15,-0x48(%rbp)
je     129c <ref_most_recent+0xec>
mov    %rax,%rbx
lea    -0x30(%rbp),%r14
lea    0xddb(%rip),%r15
lea    0xdd3(%rip),%r12
jmp    1250 <ref_most_recent+0xa0>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   10c0 <readdir@plt>
mov    %rax,%rbx
test   %rax,%rax
je     129c <ref_most_recent+0xec>
mov    (%rbx),%rdi
mov    %r14,%rsi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
je     1240 <ref_most_recent+0x90>
mov    (%rbx),%rdi
mov    %r15,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1240 <ref_most_recent+0x90>
mov    (%rbx),%rdi
mov    %r12,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1240 <ref_most_recent+0x90>
mov    -0x30(%rbp),%edi
mov    %edi,-0x38(%rbp)
mov    -0x34(%rbp),%ebx
mov    %ebx,%esi
call   1060 <difftime@plt>
test   %rax,%rax
cmovg  -0x38(%rbp),%ebx
mov    %ebx,-0x34(%rbp)
jmp    1240 <ref_most_recent+0x90>
mov    %r13,%rdi
call   1080 <rewinddir@plt>
mov    %r13,%rdi
call   10c0 <readdir@plt>
test   %rax,%rax
je     137a <ref_most_recent+0x1ca>
mov    %rax,%r15
lea    -0x30(%rbp),%r12
lea    0xd46(%rip),%rbx
lea    0xd3e(%rip),%r14
jmp    12ec <ref_most_recent+0x13c>
nopl   0x0(%rax)
mov    (%r15),%rsi
call   1050 <printf@plt>
mov    %r13,%rdi
call   10c0 <readdir@plt>
mov    %rax,%r15
test   %rax,%rax
je     137a <ref_most_recent+0x1ca>
mov    (%r15),%rdi
mov    %r12,%rsi
call   10b0 <stat@plt>
cmp    $0xffffffff,%eax
je     12d8 <ref_most_recent+0x128>
mov    (%r15),%rdi
mov    %rbx,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12d8 <ref_most_recent+0x128>
mov    (%r15),%rdi
mov    %r14,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12d8 <ref_most_recent+0x128>
mov    -0x34(%rbp),%eax
sub    -0x30(%rbp),%eax
lea    0xce2(%rip),%rdi
cmp    $0x15180,%eax
jl     12d0 <ref_most_recent+0x120>
lea    0xce2(%rip),%rdi
cmp    $0x3f480,%eax
jb     12d0 <ref_most_recent+0x120>
lea    0xce2(%rip),%rdi
cmp    $0x93a80,%eax
jb     12d0 <ref_most_recent+0x120>
lea    0xce2(%rip),%rdi
cmp    $0x278d00,%eax
jb     12d0 <ref_most_recent+0x120>
cmp    $0x1e13380,%eax
lea    0xce7(%rip),%rdi
lea    0xcd2(%rip),%rax
cmovb  %rax,%rdi
jmp    12d0 <ref_most_recent+0x120>
mov    -0x40(%rbp),%rdi
call   1040 <chdir@plt>
mov    %r13,%rdi
call   1090 <closedir@plt>
mov    -0x48(%rbp),%r15
mov    %r15,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc58(%rip),%rdi
call   10d0 <perror@plt>
jmp    138f <ref_most_recent+0x1df>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@PATH_MAX = global i32 0
@.str = [8 x i8] c"opendir\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [14 x i8] c"\1B[31m%s\1B[39m\0A\00"
@.str.4 = [14 x i8] c"\1B[91m%s\1B[39m\0A\00"
@.str.5 = [14 x i8] c"\1B[35m%s\1B[39m\0A\00"
@.str.6 = [14 x i8] c"\1B[95m%s\1B[39m\0A\00"
@.str.7 = [14 x i8] c"\1B[34m%s\1B[39m\0A\00"
@.str.8 = [14 x i8] c"\1B[94m%s\1B[39m\0A\00"
define void @ref_most_recent(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca %struct.dirent*
%5 = alloca %struct.stat
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %2
%11 = load i32, i32* @PATH_MAX
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %8
%14 = alloca i8, i64 %12
store i64 %12, i64* %9
%15 = load i8*, i8** %2
%16 = call i32* @opendir(i8* %15)
store i32* %16, i32** %3
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %20
18: ; preds = %1
%19 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %10
br label %144
20: ; preds = %1
%21 = trunc i64 %12 to i32
%22 = call i32 @getcwd(i8* %14, i32 %21)
%23 = load i8*, i8** %2
%24 = call i32 @chdir(i8* %23)
br label %25
25: ; preds = %58, %48, %35, %20
%26 = load i32*, i32** %3
%27 = call %struct.dirent* @readdir(i32* %26)
store %struct.dirent* %27, %struct.dirent** %4
%28 = icmp ne %struct.dirent* %27, null
br i1 %28, label %29, label %59
29: ; preds = %25
%30 = load %struct.dirent*, %struct.dirent** %4
%31 = getelementptr inbounds %struct.dirent, %struct.dirent* %30, i32 0, i32 0
%32 = load i8*, i8** %31
%33 = call i32 @stat(i8* %32, %struct.stat* %5)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %36
35: ; preds = %29
br label %25
36: ; preds = %29
%37 = load %struct.dirent*, %struct.dirent** %4
%38 = getelementptr inbounds %struct.dirent, %struct.dirent* %37, i32 0, i32 0
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %48, label %42
42: ; preds = %36
%43 = load %struct.dirent*, %struct.dirent** %4
%44 = getelementptr inbounds %struct.dirent, %struct.dirent* %43, i32 0, i32 0
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %42, %36
br label %25
49: ; preds = %42
%50 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%51 = load i32, i32* %50
%52 = load i32, i32* %6
%53 = call i64 @difftime(i32 %51, i32 %52)
%54 = icmp sgt i64 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %49
%56 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%57 = load i32, i32* %56
store i32 %57, i32* %6
br label %58
58: ; preds = %55, %49
br label %25
59: ; preds = %25
%60 = load i32*, i32** %3
%61 = call i32 @rewinddir(i32* %60)
br label %62
62: ; preds = %139, %85, %72, %59
%63 = load i32*, i32** %3
%64 = call %struct.dirent* @readdir(i32* %63)
store %struct.dirent* %64, %struct.dirent** %4
%65 = icmp ne %struct.dirent* %64, null
br i1 %65, label %66, label %140
66: ; preds = %62
%67 = load %struct.dirent*, %struct.dirent** %4
%68 = getelementptr inbounds %struct.dirent, %struct.dirent* %67, i32 0, i32 0
%69 = load i8*, i8** %68
%70 = call i32 @stat(i8* %69, %struct.stat* %5)
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %73
72: ; preds = %66
br label %62
73: ; preds = %66
%74 = load %struct.dirent*, %struct.dirent** %4
%75 = getelementptr inbounds %struct.dirent, %struct.dirent* %74, i32 0, i32 0
%76 = load i8*, i8** %75
%77 = call i64 @strcmp(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %85, label %79
79: ; preds = %73
%80 = load %struct.dirent*, %struct.dirent** %4
%81 = getelementptr inbounds %struct.dirent, %struct.dirent* %80, i32 0, i32 0
%82 = load i8*, i8** %81
%83 = call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %79, %73
br label %62
86: ; preds = %79
%87 = load i32, i32* %6
%88 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%89 = load i32, i32* %88
%90 = sub nsw i32 %87, %89
store i32 %90, i32* %7
%91 = load i32, i32* %7
%92 = icmp slt i32 %91, 86400
br i1 %92, label %93, label %98
93: ; preds = %86
%94 = load %struct.dirent*, %struct.dirent** %4
%95 = getelementptr inbounds %struct.dirent, %struct.dirent* %94, i32 0, i32 0
%96 = load i8*, i8** %95
%97 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %96)
br label %139
98: ; preds = %86
%99 = load i32, i32* %7
%100 = icmp slt i32 %99, 259200
br i1 %100, label %101, label %106
101: ; preds = %98
%102 = load %struct.dirent*, %struct.dirent** %4
%103 = getelementptr inbounds %struct.dirent, %struct.dirent* %102, i32 0, i32 0
%104 = load i8*, i8** %103
%105 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %104)
br label %138
106: ; preds = %98
%107 = load i32, i32* %7
%108 = icmp slt i32 %107, 604800
br i1 %108, label %109, label %114
109: ; preds = %106
%110 = load %struct.dirent*, %struct.dirent** %4
%111 = getelementptr inbounds %struct.dirent, %struct.dirent* %110, i32 0, i32 0
%112 = load i8*, i8** %111
%113 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %112)
br label %137
114: ; preds = %106
%115 = load i32, i32* %7
%116 = icmp slt i32 %115, 2592000
br i1 %116, label %117, label %122
117: ; preds = %114
%118 = load %struct.dirent*, %struct.dirent** %4
%119 = getelementptr inbounds %struct.dirent, %struct.dirent* %118, i32 0, i32 0
%120 = load i8*, i8** %119
%121 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %120)
br label %136
122: ; preds = %114
%123 = load i32, i32* %7
%124 = icmp slt i32 %123, 31536000
br i1 %124, label %125, label %130
125: ; preds = %122
%126 = load %struct.dirent*, %struct.dirent** %4
%127 = getelementptr inbounds %struct.dirent, %struct.dirent* %126, i32 0, i32 0
%128 = load i8*, i8** %127
%129 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %128)
br label %135
130: ; preds = %122
%131 = load %struct.dirent*, %struct.dirent** %4
%132 = getelementptr inbounds %struct.dirent, %struct.dirent* %131, i32 0, i32 0
%133 = load i8*, i8** %132
%134 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %133)
br label %135
135: ; preds = %130, %125
br label %136
136: ; preds = %135, %117
br label %137
137: ; preds = %136, %109
br label %138
138: ; preds = %137, %101
br label %139
139: ; preds = %138, %93
br label %62
140: ; preds = %62
%141 = call i32 @chdir(i8* %14)
%142 = load i32*, i32** %3
%143 = call i32 @closedir(i32* %142)
store i32 0, i32* %10
br label %144
144: ; preds = %140, %18
%145 = load i8*, i8** %8
%146 = load i32, i32* %10
switch i32 %146, label %148 [
i32 0, label %147
i32 1, label %147
]
147: ; preds = %144, %144
ret void
148: ; preds = %144
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@PATH_MAX = global i32 0
@.str = [8 x i8] c"opendir\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [14 x i8] c"\1B[31m%s\1B[39m\0A\00"
@.str.4 = [14 x i8] c"\1B[91m%s\1B[39m\0A\00"
@.str.5 = [14 x i8] c"\1B[35m%s\1B[39m\0A\00"
@.str.6 = [14 x i8] c"\1B[95m%s\1B[39m\0A\00"
@.str.7 = [14 x i8] c"\1B[34m%s\1B[39m\0A\00"
@.str.8 = [14 x i8] c"\1B[94m%s\1B[39m\0A\00"
define void @ref_most_recent(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = load i32, i32* @PATH_MAX
%5 = zext i32 %4 to i64
%6 = tail call i8* @llvm.stacksave()
%7 = alloca i8, i64 %5
%8 = tail call i32* @opendir(i8* %0)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %90
12: ; preds = %1
%13 = call i32 @getcwd(i8* %7, i32 %4)
%14 = call i32 @chdir(i8* %0)
%15 = call %struct.dirent* @readdir(i32* %8)
%16 = icmp eq %struct.dirent* %15, null
br i1 %16, label %46, label %17
17: ; preds = %12
%18 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
br label %19
19: ; preds = %17, %39
%20 = phi %struct.dirent* [ %15, %17 ], [ %44, %39 ]
%21 = phi i32 [ undef, %17 ], [ %43, %39 ]
br label %22
22: ; preds = %19, %36
%23 = phi %struct.dirent* [ %20, %19 ], [ %37, %36 ]
%24 = getelementptr inbounds %struct.dirent, %struct.dirent* %23, i64 0, i32 0
%25 = load i8*, i8** %24
%26 = call i32 @stat(i8* %25, %struct.stat* %2)
%27 = icmp eq i32 %26, -1
br i1 %27, label %36, label %28
28: ; preds = %22
%29 = load i8*, i8** %24
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i8*, i8** %24
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %28, %32, %22
%37 = call %struct.dirent* @readdir(i32* %8)
%38 = icmp eq %struct.dirent* %37, null
br i1 %38, label %46, label %22
39: ; preds = %32
%40 = load i32, i32* %18
%41 = call i64 @difftime(i32 %40, i32 %21)
%42 = icmp sgt i64 %41, 0
%43 = select i1 %42, i32 %40, i32 %21
%44 = call %struct.dirent* @readdir(i32* %8)
%45 = icmp eq %struct.dirent* %44, null
br i1 %45, label %46, label %19
46: ; preds = %39, %36, %12
%47 = phi i32 [ undef, %12 ], [ %21, %36 ], [ %43, %39 ]
%48 = call i32 @rewinddir(i32* %8)
%49 = call %struct.dirent* @readdir(i32* %8)
%50 = icmp eq %struct.dirent* %49, null
br i1 %50, label %87, label %51
51: ; preds = %46
%52 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
br label %53
53: ; preds = %51, %71
%54 = phi %struct.dirent* [ %49, %51 ], [ %72, %71 ]
%55 = getelementptr inbounds %struct.dirent, %struct.dirent* %54, i64 0, i32 0
%56 = load i8*, i8** %55
%57 = call i32 @stat(i8* %56, %struct.stat* %2)
%58 = icmp eq i32 %57, -1
br i1 %58, label %71, label %59
59: ; preds = %53
%60 = load i8*, i8** %55
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %71, label %63
63: ; preds = %59
%64 = load i8*, i8** %55
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %71, label %74
67: ; preds = %84, %82, %80, %78, %74
%68 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %74 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), %78 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), %80 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), %82 ], [ %86, %84 ]
%69 = load i8*, i8** %55
%70 = call i32 @printf(i8* %68, i8* %69)
br label %71
71: ; preds = %67, %59, %63, %53
%72 = call %struct.dirent* @readdir(i32* %8)
%73 = icmp eq %struct.dirent* %72, null
br i1 %73, label %87, label %53
74: ; preds = %63
%75 = load i32, i32* %52
%76 = sub nsw i32 %47, %75
%77 = icmp slt i32 %76, 86400
br i1 %77, label %67, label %78
78: ; preds = %74
%79 = icmp ult i32 %76, 259200
br i1 %79, label %67, label %80
80: ; preds = %78
%81 = icmp ult i32 %76, 604800
br i1 %81, label %67, label %82
82: ; preds = %80
%83 = icmp ult i32 %76, 2592000
br i1 %83, label %67, label %84
84: ; preds = %82
%85 = icmp ult i32 %76, 31536000
%86 = select i1 %85, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0)
br label %67
87: ; preds = %71, %46
%88 = call i32 @chdir(i8* %7)
%89 = call i32 @closedir(i32* %8)
br label %90
90: ; preds = %87, %10
ret void
}