#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 /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
long mtime_long(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ then_time(long);
int /*<<< orphan*/ tidy_dir(int *, int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  int removed = 0;
  char *mtime_str;
  char *path;
  long mtime;
  time_t then;
  if (argc != 3) {
    fprintf(stderr,
            "Need 2 arguments dude. Directory name, and number of days\n");
    exit(EXIT_FAILURE);
  }
  path = argv[1];
  mtime_str = argv[2];
  mtime = mtime_long(mtime_str);
  then = then_time(mtime);
  tidy_dir(&removed, then, path);
  fprintf(stderr, "%d files deleted\n", removed);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     119c <main+0x4c>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <mtime_long@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <then_time@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
mov    -0x28(%rbp),%rdx
lea    -0x14(%rbp),%rdi
call   1030 <tidy_dir@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe4b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
cmp    $0x3,%edi
jne    11af <main+0x5f>
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%rdi
call   1040 <mtime_long@plt>
mov    %rax,%rdi
call   1050 <then_time@plt>
lea    0xc(%rsp),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <tidy_dir@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
mov    0xc(%rsp),%edx
lea    0xea1(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xe41(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"Need 2 arguments dude. Directory name, and number of days\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [18 x i8] c"%d files deleted\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
store i8* %21, i8** %8
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
store i8* %24, i8** %7
%25 = load i8*, i8** %7
%26 = call i64 @mtime_long(i8* %25)
store i64 %26, i64* %9
%27 = load i64, i64* %9
%28 = call i32 @then_time(i64 %27)
store i32 %28, i32* %10
%29 = load i32, i32* %10
%30 = load i8*, i8** %8
%31 = call i32 @tidy_dir(i32* %6, i32 %29, i8* %30)
%32 = load i32, i32* @stderr
%33 = load i32, i32* %6
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = load i32, i32* @EXIT_SUCCESS
%36 = call i32 @exit(i32 %35)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"Need 2 arguments dude. Directory name, and number of days\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [18 x i8] c"%d files deleted\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = icmp eq i32 %0, 3
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i64 @mtime_long(i8* %15)
%17 = tail call i32 @then_time(i64 %16)
%18 = call i32 @tidy_dir(i32* %3, i32 %17, i8* %13)
%19 = load i32, i32* @stderr
%20 = load i32, i32* %3
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @EXIT_SUCCESS
%23 = call i32 @exit(i32 %22)
unreachable
}