#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int time_t;
struct utimbuf {
  int member_0;
  int member_1;
};
struct TYPE_4__ {
  int tv_sec;
};
struct TYPE_3__ {
  int tv_sec;
};
struct stat {
  TYPE_2__ st_mtim;
  TYPE_1__ st_atim;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int getopt(int, char **, char *);
int /*<<< orphan*/ optarg;
int optind;
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
scalar_t__ stat(char *, struct stat *);
int strtol(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
scalar_t__ utime(char *, struct utimbuf *);
int main(int argc, char *argv[]) {
  int access = 0;
  int modification = 0;
  int c;
  int index = 0;
  time_t time = 10 * 24 * 60 * 60;
  while ((c = getopt(argc, argv, "amt:h")) != -1) {
    switch (c) {
    case 'a':
      access = 1;
      break;
    case 'm':
      modification = 1;
      break;
    case 't':
      time = strtol(optarg, NULL, 10);
      break;
    case 'h':
    case '?':
      printf("usage: ager [-a] [-m] [-t time] [file ...]");
    default:
      abort();
    }
  }
  for (index = optind; index < argc; index++) {
    struct stat structstat;
    if (stat(argv[index], &structstat) == 0) {
      time_t atim = structstat.st_atim.tv_sec;
      time_t mtim = structstat.st_mtim.tv_sec;
      if (!modification || access) {
        atim -= time;
      }
      if (!access || modification) {
        mtim -= time;
      }
      struct utimbuf structutimbuf = {atim, mtim};
      if (utime(argv[index], &structutimbuf) != 0) {
        perror(NULL);
      }
    } else {
      perror(NULL);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0xd2f00,-0x24(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe50(%rip),%rdx
call   1090 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     1268 <main+0xf8>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
sub    $0x3f,%eax
je     1250 <main+0xe0>
jmp    11d5 <main+0x65>
mov    -0x44(%rbp),%eax
sub    $0x61,%eax
je     1219 <main+0xa9>
jmp    11e6 <main+0x76>
mov    -0x44(%rbp),%eax
sub    $0x68,%eax
je     1250 <main+0xe0>
jmp    11f7 <main+0x87>
mov    -0x44(%rbp),%eax
sub    $0x6d,%eax
je     1225 <main+0xb5>
jmp    1208 <main+0x98>
mov    -0x44(%rbp),%eax
sub    $0x74,%eax
je     1231 <main+0xc1>
jmp    125c <main+0xec>
movl   $0x1,-0x14(%rbp)
jmp    1263 <main+0xf3>
movl   $0x1,-0x18(%rbp)
jmp    1263 <main+0xf3>
mov    0x2dc0(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtol@plt>
mov    %eax,-0x24(%rbp)
jmp    1263 <main+0xf3>
lea    0xdaf(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    11a2 <main+0x32>
mov    0x2d71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    133e <main+0x1ce>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <stat@plt>
cmp    $0x0,%rax
jne    1322 <main+0x1b2>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     12bf <main+0x14f>
cmpl   $0x0,-0x14(%rbp)
je     12ca <main+0x15a>
mov    -0x24(%rbp),%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     12de <main+0x16e>
cmpl   $0x0,-0x18(%rbp)
je     12e9 <main+0x179>
mov    -0x24(%rbp),%ecx
mov    -0x38(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <utime@plt>
cmp    $0x0,%rax
je     131d <main+0x1ad>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <perror@plt>
jmp    132b <main+0x1bb>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <perror@plt>
jmp    1330 <main+0x1c0>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1274 <main+0x104>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %edi,%r13d
mov    $0xd2f00,%ebp
xor    %eax,%eax
mov    %rax,0x10(%rsp)
mov    $0x1,%al
mov    %eax,0xc(%rsp)
lea    0xe63(%rip),%r15
mov    0x2e54(%rip),%rbx
xor    %r12d,%r12d
jmp    11c0 <main+0x50>
nopl   0x0(%rax)
mov    (%rbx),%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtol@plt>
mov    %eax,%ebp
mov    %r13d,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1090 <getopt@plt>
cmp    $0x74,%eax
je     11b0 <main+0x40>
cmp    $0x60,%eax
jle    11ff <main+0x8f>
cmp    $0x61,%eax
je     11f7 <main+0x87>
cmp    $0x6d,%eax
jne    12b6 <main+0x146>
mov    $0x1,%al
mov    %rax,0x10(%rsp)
movl   $0x0,0xc(%rsp)
jmp    11c0 <main+0x50>
mov    $0x1,%r12d
jmp    11c0 <main+0x50>
cmp    $0xffffffff,%eax
jne    12ce <main+0x15e>
mov    0x2dd1(%rip),%rax
movslq (%rax),%rax
cmp    %r13d,%eax
jge    12a5 <main+0x135>
xor    %ebx,%ebx
testb  $0x1,0x10(%rsp)
mov    $0x0,%r15d
cmovne %ebp,%r15d
test   %r12d,%r12d
cmovne %ebp,%r12d
cmove  %ebp,%r15d
testb  $0x1,0xc(%rsp)
cmovne %ebp,%r12d
lea    (%r14,%rax,8),%r14
sub    %eax,%r13d
lea    0x20(%rsp),%rbp
jmp    1269 <main+0xf9>
xor    %edi,%edi
call   1080 <perror@plt>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
cmp    %ebx,%r13d
je     12a5 <main+0x135>
mov    (%r14,%rbx,8),%rdi
mov    %rbp,%rsi
call   1060 <stat@plt>
test   %rax,%rax
jne    124e <main+0xde>
mov    0x20(%rsp),%eax
sub    %r15d,%eax
mov    0x24(%rsp),%ecx
sub    %r12d,%ecx
mov    %ecx,0x18(%rsp)
mov    %eax,0x1c(%rsp)
mov    (%r14,%rbx,8),%rdi
lea    0x18(%rsp),%rsi
call   1030 <utime@plt>
test   %rax,%rax
je     1260 <main+0xf0>
jmp    124e <main+0xde>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x68,%eax
jne    12c7 <main+0x157>
lea    0xd44(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <abort@plt>
cmp    $0x3f,%eax
je     12bb <main+0x14b>
jmp    12c7 <main+0x157>

LLVM IR (-O0):
%struct.stat = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32 }
%struct.TYPE_3__ = type { i32 }
%struct.utimbuf = type { i32, i32 }
@.str = [6 x i8] c"amt:h\00"
@optarg = global i32 0
@.str.1 = [43 x i8] c"usage: ager [-a] [-m] [-t time] [file ...]\00"
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.stat
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.utimbuf
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %9
store i32 864000, i32* %10
br label %15
15: ; preds = %31, %2
%16 = load i32, i32* %4
%17 = load i8**, i8*** %5
%18 = call i32 @getopt(i32 %16, i8** %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %18, i32* %8
%19 = icmp ne i32 %18, -1
br i1 %19, label %20, label %32
20: ; preds = %15
%21 = load i32, i32* %8
switch i32 %21, label %29 [
i32 97, label %22
i32 109, label %23
i32 116, label %24
i32 104, label %27
i32 63, label %27
]
22: ; preds = %20
store i32 1, i32* %6
br label %31
23: ; preds = %20
store i32 1, i32* %7
br label %31
24: ; preds = %20
%25 = load i32, i32* @optarg
%26 = call i32 @strtol(i32 %25, i32* null, i32 10)
store i32 %26, i32* %10
br label %31
27: ; preds = %20, %20
%28 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %20, %27
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %24, %23, %22
br label %15
32: ; preds = %15
%33 = load i32, i32* @optind
store i32 %33, i32* %9
br label %34
34: ; preds = %90, %32
%35 = load i32, i32* %9
%36 = load i32, i32* %4
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %93
38: ; preds = %34
%39 = load i8**, i8*** %5
%40 = load i32, i32* %9
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = call i64 @stat(i8* %43, %struct.stat* %11)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %87
46: ; preds = %38
%47 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 1
%48 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %47, i32 0, i32 0
%49 = load i32, i32* %48
store i32 %49, i32* %12
%50 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%51 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %50, i32 0, i32 0
%52 = load i32, i32* %51
store i32 %52, i32* %13
%53 = load i32, i32* %7
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %46
%56 = load i32, i32* %6
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %55, %46
%59 = load i32, i32* %10
%60 = load i32, i32* %12
%61 = sub nsw i32 %60, %59
store i32 %61, i32* %12
br label %62
62: ; preds = %58, %55
%63 = load i32, i32* %6
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = load i32, i32* %7
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %72
68: ; preds = %65, %62
%69 = load i32, i32* %10
%70 = load i32, i32* %13
%71 = sub nsw i32 %70, %69
store i32 %71, i32* %13
br label %72
72: ; preds = %68, %65
%73 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %14, i32 0, i32 0
%74 = load i32, i32* %12
store i32 %74, i32* %73
%75 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %14, i32 0, i32 1
%76 = load i32, i32* %13
store i32 %76, i32* %75
%77 = load i8**, i8*** %5
%78 = load i32, i32* %9
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8*, i8** %77, i64 %79
%81 = load i8*, i8** %80
%82 = call i64 @utime(i8* %81, %struct.utimbuf* %14)
%83 = icmp ne i64 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %72
%85 = call i32 @perror(i32* null)
br label %86
86: ; preds = %84, %72
br label %89
87: ; preds = %38
%88 = call i32 @perror(i32* null)
br label %89
89: ; preds = %87, %86
br label %90
90: ; preds = %89
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
br label %34
93: ; preds = %34
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32 }
%struct.TYPE_3__ = type { i32 }
%struct.utimbuf = type { i32, i32 }
@.str = [6 x i8] c"amt:h\00"
@optarg = global i32 0
@.str.1 = [43 x i8] c"usage: ager [-a] [-m] [-t time] [file ...]\00"
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.stat
%4 = alloca %struct.utimbuf
br label %5
5: ; preds = %13, %2
%6 = phi i1 [ true, %2 ], [ false, %13 ]
%7 = phi i1 [ false, %2 ], [ true, %13 ]
%8 = phi i32 [ 0, %2 ], [ %11, %13 ]
%9 = phi i32 [ 864000, %2 ], [ %14, %13 ]
br label %10
10: ; preds = %13, %5
%11 = phi i32 [ %8, %5 ], [ 1, %13 ]
%12 = phi i32 [ %9, %5 ], [ %14, %13 ]
br label %13
13: ; preds = %10, %16
%14 = phi i32 [ %18, %16 ], [ %12, %10 ]
%15 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
switch i32 %15, label %21 [
i32 -1, label %23
i32 97, label %10
i32 109, label %5
i32 116, label %16
i32 104, label %19
i32 63, label %19
]
16: ; preds = %13
%17 = load i32, i32* @optarg
%18 = tail call i32 @strtol(i32 %17, i32* null, i32 10)
br label %13
19: ; preds = %13, %13
%20 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %13, %19
%22 = tail call i32 (...) @abort()
unreachable
23: ; preds = %13
%24 = load i32, i32* @optind
%25 = icmp slt i32 %24, %0
br i1 %25, label %26, label %63
26: ; preds = %23
%27 = bitcast %struct.stat* %3 to i8*
%28 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1, i32 0
%29 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0, i32 0
%30 = icmp ne i32 %11, 0
%31 = select i1 %6, i1 true, i1 %30
%32 = select i1 %31, i32 %14, i32 0
%33 = icmp eq i32 %11, 0
%34 = or i1 %33, %7
%35 = select i1 %34, i32 %14, i32 0
%36 = bitcast %struct.utimbuf* %4 to i8*
%37 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %4, i64 0, i32 0
%38 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %4, i64 0, i32 1
%39 = sext i32 %24 to i64
br label %40
40: ; preds = %26, %59
%41 = phi i64 [ %39, %26 ], [ %60, %59 ]
%42 = getelementptr inbounds i8*, i8** %1, i64 %41
%43 = load i8*, i8** %42
%44 = call i64 @stat(i8* %43, %struct.stat* %3)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %57
46: ; preds = %40
%47 = load i32, i32* %28
%48 = load i32, i32* %29
%49 = sub nsw i32 %47, %32
%50 = sub nsw i32 %48, %35
store i32 %49, i32* %37
store i32 %50, i32* %38
%51 = load i8*, i8** %42
%52 = call i64 @utime(i8* %51, %struct.utimbuf* %4)
%53 = icmp eq i64 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %46
%55 = call i32 @perror(i32* null)
br label %56
56: ; preds = %54, %46
br label %59
57: ; preds = %40
%58 = call i32 @perror(i32* null)
br label %59
59: ; preds = %57, %56
%60 = add nsw i64 %41, 1
%61 = trunc i64 %60 to i32
%62 = icmp eq i32 %61, %0
br i1 %62, label %63, label %40
63: ; preds = %59, %23
ret i32 0
}