#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 utimbuf {
  int actime;
  int modtime;
};
struct stat {
  int st_mtime;
  int st_atime;
};

/* Variables and functions */
int L_tmpnam;
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int, int, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ sleep(int);
scalar_t__ stat(char *, struct stat *);
int time(int /*<<< orphan*/ *);
scalar_t__ tmpnam(char *);
scalar_t__ utime(char *, struct utimbuf *);
int main(int argc, char *argv[]) {
  char file[L_tmpnam];
  struct utimbuf ut;
  struct stat st;
  struct stat stnow;
  time_t now1, now2;
  int fd;
  if (tmpnam(file) == 0) {
    perror("tmpnam");
    return 1;
  }
  fd = creat(file, 0666);
  if (fd < 0) {
    perror("creat");
    return 1;
  }
  close(fd);
  ut.actime = 500000000;
  ut.modtime = 500000001;
  if (utime(file, &ut)) {
    perror("utime");
    remove(file);
    return 1;
  }
  if (stat(file, &st)) {
    perror("stat");
    remove(file);
    return 1;
  }
  now1 = time(NULL);
  if (now1 == (time_t)-1) {
    perror("time");
    remove(file);
    return 1;
  }
  sleep(1);
  if (utime(file, NULL)) {
    perror("utime NULL");
    remove(file);
    return 1;
  }
  sleep(1);
  now2 = time(NULL);
  if (now2 == (time_t)-1) {
    perror("time");
    remove(file);
    return 1;
  }
  if (stat(file, &stnow)) {
    perror("stat");
    remove(file);
    return 1;
  }
  remove(file);
  if (st.st_mtime != ut.modtime) {
    printf("modtime %ld != %ld\n", st.st_mtime, ut.modtime);
    return 1;
  }
  if (st.st_atime != ut.actime) {
    printf("actime %ld != %ld\n", st.st_atime, ut.actime);
    return 1;
  }
  if (stnow.st_mtime < now1 || stnow.st_mtime > now2) {
    printf("modtime %ld <%ld >%ld\n", stnow.st_mtime, now1, now2);
    return 1;
  }
  if (stnow.st_atime < now1 || stnow.st_atime > now2) {
    printf("actime %ld <%ld >%ld\n", stnow.st_atime, now1, now2);
    return 1;
  }
  puts("Test succeeded.");
  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)
mov    0x2e13(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x50(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
call   10c0 <tmpnam@plt>
cmp    $0x0,%rax
jne    1220 <main+0x70>
lea    0xdf8(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    -0x50(%rbp),%rdi
mov    $0x1b6,%esi
call   10b0 <creat@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    125a <main+0xaa>
lea    0xdc5(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    -0x44(%rbp),%edi
call   1070 <close@plt>
mov    -0x50(%rbp),%rdi
movl   $0x1dcd6500,-0x28(%rbp)
movl   $0x1dcd6501,-0x24(%rbp)
lea    -0x28(%rbp),%rsi
call   1030 <utime@plt>
cmp    $0x0,%rax
je     12af <main+0xff>
lea    0xd7f(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x50(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%rax
je     12ee <main+0x13e>
lea    0xd46(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x50(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0xffffffff,-0x3c(%rbp)
jne    132c <main+0x17c>
lea    0xd03(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x50(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <utime@plt>
cmp    $0x0,%rax
je     1375 <main+0x1c5>
lea    0xcc4(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x50(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    $0x1,%edi
call   10d0 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0xffffffff,-0x40(%rbp)
jne    13bd <main+0x20d>
lea    0xc72(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x50(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    -0x50(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%rax
je     13fc <main+0x24c>
lea    0xc38(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x50(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    -0x50(%rbp),%rdi
call   1040 <remove@plt>
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1438 <main+0x288>
mov    -0x30(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xc05(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     146b <main+0x2bb>
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xbe6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    -0x38(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jl     1483 <main+0x2d3>
mov    -0x38(%rbp),%eax
cmp    -0x40(%rbp),%eax
jle    14ad <main+0x2fd>
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x40(%rbp),%ecx
lea    0xbb7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
mov    -0x34(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jl     14c5 <main+0x315>
mov    -0x34(%rbp),%eax
cmp    -0x40(%rbp),%eax
jle    14ef <main+0x33f>
mov    -0x34(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x40(%rbp),%ecx
lea    0xb8c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1509 <main+0x359>
lea    0xb81(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    0x2e1a(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   10c0 <tmpnam@plt>
test   %rax,%rax
je     1331 <main+0x181>
mov    %rbx,%rdi
mov    $0x1b6,%esi
call   10b0 <creat@plt>
test   %eax,%eax
js     133a <main+0x18a>
mov    %eax,%edi
call   1070 <close@plt>
movabs $0x1dcd65011dcd6500,%rax
65 cd 1d
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rsi
mov    %rbx,%rdi
call   1030 <utime@plt>
test   %rax,%rax
jne    1348 <main+0x198>
lea    -0x30(%rbp),%rsi
mov    %rbx,%rdi
call   1080 <stat@plt>
test   %rax,%rax
jne    131f <main+0x16f>
xor    %edi,%edi
call   1090 <time@plt>
cmp    $0xffffffff,%eax
je     1351 <main+0x1a1>
mov    %eax,%r14d
mov    $0x1,%r15d
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <utime@plt>
test   %rax,%rax
jne    1367 <main+0x1b7>
mov    $0x1,%r15d
mov    $0x1,%edi
call   10d0 <sleep@plt>
xor    %edi,%edi
call   1090 <time@plt>
cmp    $0xffffffff,%eax
je     1370 <main+0x1c0>
mov    %eax,%r12d
lea    -0x28(%rbp),%rsi
mov    %rbx,%rdi
call   1080 <stat@plt>
test   %rax,%rax
jne    131f <main+0x16f>
mov    %rbx,%rdi
call   1040 <remove@plt>
mov    -0x30(%rbp),%esi
cmp    $0x1dcd6501,%esi
jne    12fc <main+0x14c>
mov    -0x2c(%rbp),%esi
cmp    $0x1dcd6500,%esi
jne    130a <main+0x15a>
mov    -0x28(%rbp),%esi
cmp    %r14d,%esi
jl     1328 <main+0x178>
cmp    %r12d,%esi
jg     1328 <main+0x178>
mov    -0x24(%rbp),%esi
cmp    %r14d,%esi
jl     1386 <main+0x1d6>
cmp    %r12d,%esi
jg     1386 <main+0x1d6>
lea    0xd88(%rip),%rdi
call   1050 <puts@plt>
xor    %r15d,%r15d
jmp    13a0 <main+0x1f0>
lea    0xd20(%rip),%rdi
mov    $0x1dcd6501,%edx
jmp    1316 <main+0x166>
lea    0xd26(%rip),%rdi
mov    $0x1dcd6500,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    139a <main+0x1ea>
lea    0xced(%rip),%rdi
jmp    1358 <main+0x1a8>
lea    0xd1b(%rip),%rdi
jmp    138d <main+0x1dd>
lea    0xcc8(%rip),%rdi
jmp    1341 <main+0x191>
lea    0xcc6(%rip),%rdi
call   10a0 <perror@plt>
jmp    139a <main+0x1ea>
lea    0xcbe(%rip),%rdi
jmp    1358 <main+0x1a8>
lea    0xcb6(%rip),%rdi
call   10a0 <perror@plt>
mov    %rbx,%rdi
call   1040 <remove@plt>
jmp    139a <main+0x1ea>
lea    0xcaa(%rip),%rdi
jmp    1377 <main+0x1c7>
lea    0xc97(%rip),%rdi
call   10a0 <perror@plt>
mov    %rbx,%rdi
call   1040 <remove@plt>
jmp    13a0 <main+0x1f0>
lea    0xcd4(%rip),%rdi
mov    %r14d,%edx
mov    %r12d,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.utimbuf = type { i32, i32 }
%struct.stat = type { i32, i32 }
@L_tmpnam = global i32 0
@.str = [7 x i8] c"tmpnam\00"
@.str.1 = [6 x i8] c"creat\00"
@.str.2 = [6 x i8] c"utime\00"
@.str.3 = [5 x i8] c"stat\00"
@.str.4 = [5 x i8] c"time\00"
@.str.5 = [11 x i8] c"utime NULL\00"
@.str.6 = [20 x i8] c"modtime %ld != %ld\0A\00"
@.str.7 = [19 x i8] c"actime %ld != %ld\0A\00"
@.str.8 = [23 x i8] c"modtime %ld <%ld >%ld\0A\00"
@.str.9 = [22 x i8] c"actime %ld <%ld >%ld\0A\00"
@.str.10 = [16 x i8] c"Test succeeded.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.utimbuf
%9 = alloca %struct.stat
%10 = alloca %struct.stat
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* @L_tmpnam
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %6
%18 = alloca i8, i64 %16
store i64 %16, i64* %7
%19 = call i64 @tmpnam(i8* %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
23: ; preds = %2
%24 = call i32 @creat(i8* %18, i32 438)
store i32 %24, i32* %13
%25 = load i32, i32* %13
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
29: ; preds = %23
%30 = load i32, i32* %13
%31 = call i32 @close(i32 %30)
%32 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %8, i32 0, i32 0
store i32 500000000, i32* %32
%33 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %8, i32 0, i32 1
store i32 500000001, i32* %33
%34 = call i64 @utime(i8* %18, %struct.utimbuf* %8)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %29
%37 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%38 = call i32 @remove(i8* %18)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
39: ; preds = %29
%40 = call i64 @stat(i8* %18, %struct.stat* %9)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%44 = call i32 @remove(i8* %18)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
45: ; preds = %39
%46 = call i32 @time(i32* null)
store i32 %46, i32* %11
%47 = load i32, i32* %11
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%51 = call i32 @remove(i8* %18)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
52: ; preds = %45
%53 = call i32 @sleep(i32 1)
%54 = call i64 @utime(i8* %18, %struct.utimbuf* null)
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %52
%57 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%58 = call i32 @remove(i8* %18)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
59: ; preds = %52
%60 = call i32 @sleep(i32 1)
%61 = call i32 @time(i32* null)
store i32 %61, i32* %12
%62 = load i32, i32* %12
%63 = icmp eq i32 %62, -1
br i1 %63, label %64, label %67
64: ; preds = %59
%65 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%66 = call i32 @remove(i8* %18)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
67: ; preds = %59
%68 = call i64 @stat(i8* %18, %struct.stat* %10)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%72 = call i32 @remove(i8* %18)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
73: ; preds = %67
%74 = call i32 @remove(i8* %18)
%75 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%76 = load i32, i32* %75
%77 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %8, i32 0, i32 1
%78 = load i32, i32* %77
%79 = icmp ne i32 %76, %78
br i1 %79, label %80, label %86
80: ; preds = %73
%81 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%82 = load i32, i32* %81
%83 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %8, i32 0, i32 1
%84 = load i32, i32* %83
%85 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %82, i32 %84)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
86: ; preds = %73
%87 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%88 = load i32, i32* %87
%89 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %8, i32 0, i32 0
%90 = load i32, i32* %89
%91 = icmp ne i32 %88, %90
br i1 %91, label %92, label %98
92: ; preds = %86
%93 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%94 = load i32, i32* %93
%95 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %8, i32 0, i32 0
%96 = load i32, i32* %95
%97 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %94, i32 %96)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
98: ; preds = %86
%99 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%100 = load i32, i32* %99
%101 = load i32, i32* %11
%102 = icmp slt i32 %100, %101
br i1 %102, label %108, label %103
103: ; preds = %98
%104 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%105 = load i32, i32* %104
%106 = load i32, i32* %12
%107 = icmp sgt i32 %105, %106
br i1 %107, label %108, label %114
108: ; preds = %103, %98
%109 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%110 = load i32, i32* %109
%111 = load i32, i32* %11
%112 = load i32, i32* %12
%113 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %110, i32 %111, i32 %112)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
114: ; preds = %103
%115 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%116 = load i32, i32* %115
%117 = load i32, i32* %11
%118 = icmp slt i32 %116, %117
br i1 %118, label %124, label %119
119: ; preds = %114
%120 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%121 = load i32, i32* %120
%122 = load i32, i32* %12
%123 = icmp sgt i32 %121, %122
br i1 %123, label %124, label %130
124: ; preds = %119, %114
%125 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%126 = load i32, i32* %125
%127 = load i32, i32* %11
%128 = load i32, i32* %12
%129 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 %126, i32 %127, i32 %128)
store i32 1, i32* %3
store i32 1, i32* %14
br label %132
130: ; preds = %119
%131 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %3
store i32 1, i32* %14
br label %132
132: ; preds = %130, %124, %108, %92, %80, %70, %64, %56, %49, %42, %36, %27, %21
%133 = load i8*, i8** %6
%134 = load i32, i32* %3
ret i32 %134
}

LLVM IR (-O2):
%struct.utimbuf = type { i32, i32 }
%struct.stat = type { i32, i32 }
@L_tmpnam = global i32 0
@.str = [7 x i8] c"tmpnam\00"
@.str.1 = [6 x i8] c"creat\00"
@.str.2 = [6 x i8] c"utime\00"
@.str.3 = [5 x i8] c"stat\00"
@.str.4 = [5 x i8] c"time\00"
@.str.5 = [11 x i8] c"utime NULL\00"
@.str.6 = [20 x i8] c"modtime %ld != %ld\0A\00"
@.str.7 = [19 x i8] c"actime %ld != %ld\0A\00"
@.str.8 = [23 x i8] c"modtime %ld <%ld >%ld\0A\00"
@.str.9 = [22 x i8] c"actime %ld <%ld >%ld\0A\00"
@.str.10 = [16 x i8] c"Test succeeded.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.utimbuf
%4 = alloca %struct.stat
%5 = alloca %struct.stat
%6 = load i32, i32* @L_tmpnam
%7 = zext i32 %6 to i64
%8 = alloca i8, i64 %7
%9 = bitcast %struct.utimbuf* %3 to i8*
%10 = bitcast %struct.stat* %4 to i8*
%11 = bitcast %struct.stat* %5 to i8*
%12 = call i64 @tmpnam(i8* %8)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %93
16: ; preds = %2
%17 = call i32 @creat(i8* %8, i32 438)
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %93
21: ; preds = %16
%22 = call i32 @close(i32 %17)
%23 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %3, i64 0, i32 0
store i32 500000000, i32* %23
%24 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %3, i64 0, i32 1
store i32 500000001, i32* %24
%25 = call i64 @utime(i8* %8, %struct.utimbuf* %3)
%26 = icmp eq i64 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %21
%28 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%29 = call i32 @remove(i8* %8)
br label %93
30: ; preds = %21
%31 = call i64 @stat(i8* %8, %struct.stat* %4)
%32 = icmp eq i64 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %30
%34 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%35 = call i32 @remove(i8* %8)
br label %93
36: ; preds = %30
%37 = call i32 @time(i32* null)
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%41 = call i32 @remove(i8* %8)
br label %93
42: ; preds = %36
%43 = call i32 @sleep(i32 1)
%44 = call i64 @utime(i8* %8, %struct.utimbuf* null)
%45 = icmp eq i64 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %42
%47 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%48 = call i32 @remove(i8* %8)
br label %93
49: ; preds = %42
%50 = call i32 @sleep(i32 1)
%51 = call i32 @time(i32* null)
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%55 = call i32 @remove(i8* %8)
br label %93
56: ; preds = %49
%57 = call i64 @stat(i8* %8, %struct.stat* %5)
%58 = icmp eq i64 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%61 = call i32 @remove(i8* %8)
br label %93
62: ; preds = %56
%63 = call i32 @remove(i8* %8)
%64 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%65 = load i32, i32* %64
%66 = icmp eq i32 %65, 500000001
br i1 %66, label %69, label %67
67: ; preds = %62
%68 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %65, i32 500000001)
br label %93
69: ; preds = %62
%70 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 1
%71 = load i32, i32* %70
%72 = icmp eq i32 %71, 500000000
br i1 %72, label %75, label %73
73: ; preds = %69
%74 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %71, i32 500000000)
br label %93
75: ; preds = %69
%76 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 0
%77 = load i32, i32* %76
%78 = icmp slt i32 %77, %37
%79 = icmp sgt i32 %77, %51
%80 = select i1 %78, i1 true, i1 %79
br i1 %80, label %81, label %83
81: ; preds = %75
%82 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %77, i32 %37, i32 %51)
br label %93
83: ; preds = %75
%84 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 1
%85 = load i32, i32* %84
%86 = icmp slt i32 %85, %37
%87 = icmp sgt i32 %85, %51
%88 = select i1 %86, i1 true, i1 %87
br i1 %88, label %89, label %91
89: ; preds = %83
%90 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 %85, i32 %37, i32 %51)
br label %93
91: ; preds = %83
%92 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
br label %93
93: ; preds = %91, %89, %81, %73, %67, %59, %53, %46, %39, %33, %27, %19, %14
%94 = phi i32 [ 1, %14 ], [ 1, %19 ], [ 1, %27 ], [ 1, %33 ], [ 1, %39 ], [ 1, %46 ], [ 1, %53 ], [ 1, %59 ], [ 1, %67 ], [ 1, %73 ], [ 1, %81 ], [ 1, %89 ], [ 0, %91 ]
ret i32 %94
}