#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 scalar_t__ time_t;
struct utimbuf {
  int actime;
  int modtime;
};
struct stat {
  int st_mtime;
  int st_atime;
};
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
int L_tmpnam;
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ sleep(int);
scalar_t__ stat(char *, struct stat *);
scalar_t__ 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 %jd != %jd\n", (intmax_t)st.st_mtime, (intmax_t)ut.modtime);
    return 1;
  }
  if (st.st_atime != ut.actime) {
    printf("actime %jd != %jd\n", (intmax_t)st.st_atime, (intmax_t)ut.actime);
    return 1;
  }
  if (stnow.st_mtime < now1 || stnow.st_mtime > now2) {
    printf("modtime %jd <%jd >%jd\n", (intmax_t)stnow.st_mtime, (intmax_t)now1,
           (intmax_t)now2);
    return 1;
  }
  if (stnow.st_atime < now1 || stnow.st_atime > now2) {
    printf("actime %jd <%jd >%jd\n", (intmax_t)stnow.st_atime, (intmax_t)now1,
           (intmax_t)now2);
    return 1;
  }
  puts("Test succeeded.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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,-0x58(%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,-0x50(%rbp)
jmp    1521 <main+0x371>
mov    -0x58(%rbp),%rdi
mov    $0x1b6,%esi
call   10b0 <creat@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jge    125a <main+0xaa>
lea    0xdc5(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
mov    -0x4c(%rbp),%edi
call   1070 <close@plt>
mov    -0x58(%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    -0x58(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
mov    -0x58(%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    -0x58(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0xffffffffffffffff,-0x40(%rbp)
jne    132e <main+0x17e>
lea    0xd01(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x58(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    -0x58(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <utime@plt>
cmp    $0x0,%rax
je     1377 <main+0x1c7>
lea    0xcc2(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x58(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
mov    $0x1,%edi
call   10d0 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0xffffffffffffffff,-0x48(%rbp)
jne    13c1 <main+0x211>
lea    0xc6e(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x58(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
mov    -0x58(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%rax
je     1400 <main+0x250>
lea    0xc34(%rip),%rdi
call   10a0 <perror@plt>
mov    -0x58(%rbp),%rdi
call   1040 <remove@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
mov    -0x58(%rbp),%rdi
call   1040 <remove@plt>
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     143c <main+0x28c>
mov    -0x30(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xc01(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     146f <main+0x2bf>
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xbe2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
movslq -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
jl     148b <main+0x2db>
movslq -0x38(%rbp),%rax
cmp    -0x48(%rbp),%rax
jle    14bb <main+0x30b>
mov    -0x38(%rbp),%esi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    -0x48(%rbp),%rax
mov    %eax,%ecx
lea    0xba9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
movslq -0x34(%rbp),%rax
cmp    -0x40(%rbp),%rax
jl     14d7 <main+0x327>
movslq -0x34(%rbp),%rax
cmp    -0x48(%rbp),%rax
jle    1507 <main+0x357>
mov    -0x34(%rbp),%esi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    -0x48(%rbp),%rax
mov    %eax,%ecx
lea    0xb74(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x50(%rbp)
jmp    1521 <main+0x371>
lea    0xb69(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x50(%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     1339 <main+0x189>
mov    %rbx,%rdi
mov    $0x1b6,%esi
call   10b0 <creat@plt>
test   %eax,%eax
js     1342 <main+0x192>
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    1350 <main+0x1a0>
lea    -0x30(%rbp),%rsi
mov    %rbx,%rdi
call   1080 <stat@plt>
test   %rax,%rax
jne    1327 <main+0x177>
xor    %edi,%edi
call   1090 <time@plt>
cmp    $0xffffffffffffffff,%rax
je     1359 <main+0x1a9>
mov    %rax,%r14
mov    $0x1,%r15d
mov    $0x1,%edi
call   10d0 <sleep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <utime@plt>
test   %rax,%rax
jne    136f <main+0x1bf>
mov    $0x1,%r15d
mov    $0x1,%edi
call   10d0 <sleep@plt>
xor    %edi,%edi
call   1090 <time@plt>
cmp    $0xffffffffffffffff,%rax
je     1378 <main+0x1c8>
mov    %rax,%r12
lea    -0x28(%rbp),%rsi
mov    %rbx,%rdi
call   1080 <stat@plt>
test   %rax,%rax
jne    1327 <main+0x177>
mov    %rbx,%rdi
call   1040 <remove@plt>
mov    -0x30(%rbp),%esi
cmp    $0x1dcd6501,%esi
jne    1304 <main+0x154>
mov    -0x2c(%rbp),%esi
cmp    $0x1dcd6500,%esi
jne    1312 <main+0x162>
mov    -0x28(%rbp),%esi
movslq %esi,%rax
cmp    %rax,%r14
jg     1330 <main+0x180>
cmp    %rax,%r12
jl     1330 <main+0x180>
mov    -0x24(%rbp),%esi
movslq %esi,%rax
cmp    %rax,%r14
jg     138e <main+0x1de>
cmp    %rax,%r12
jl     138e <main+0x1de>
lea    0xd80(%rip),%rdi
call   1050 <puts@plt>
xor    %r15d,%r15d
jmp    13a8 <main+0x1f8>
lea    0xd18(%rip),%rdi
mov    $0x1dcd6501,%edx
jmp    131e <main+0x16e>
lea    0xd1e(%rip),%rdi
mov    $0x1dcd6500,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    13a2 <main+0x1f2>
lea    0xce5(%rip),%rdi
jmp    1360 <main+0x1b0>
lea    0xd13(%rip),%rdi
jmp    1395 <main+0x1e5>
lea    0xcc0(%rip),%rdi
jmp    1349 <main+0x199>
lea    0xcbe(%rip),%rdi
call   10a0 <perror@plt>
jmp    13a2 <main+0x1f2>
lea    0xcb6(%rip),%rdi
jmp    1360 <main+0x1b0>
lea    0xcae(%rip),%rdi
call   10a0 <perror@plt>
mov    %rbx,%rdi
call   1040 <remove@plt>
jmp    13a2 <main+0x1f2>
lea    0xca2(%rip),%rdi
jmp    137f <main+0x1cf>
lea    0xc8f(%rip),%rdi
call   10a0 <perror@plt>
mov    %rbx,%rdi
call   1040 <remove@plt>
jmp    13a8 <main+0x1f8>
lea    0xccc(%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 %jd != %jd\0A\00"
@.str.7 = [19 x i8] c"actime %jd != %jd\0A\00"
@.str.8 = [23 x i8] c"modtime %jd <%jd >%jd\0A\00"
@.str.9 = [22 x i8] c"actime %jd <%jd >%jd\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 i64
%12 = alloca i64
%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 %140
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 %140
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 %140
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 %140
45: ; preds = %39
%46 = call i64 @time(i32* null)
store i64 %46, i64* %11
%47 = load i64, i64* %11
%48 = icmp eq i64 %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 %140
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 %140
59: ; preds = %52
%60 = call i32 @sleep(i32 1)
%61 = call i64 @time(i32* null)
store i64 %61, i64* %12
%62 = load i64, i64* %12
%63 = icmp eq i64 %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 %140
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 %140
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 %140
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 %140
98: ; preds = %86
%99 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%100 = load i32, i32* %99
%101 = sext i32 %100 to i64
%102 = load i64, i64* %11
%103 = icmp slt i64 %101, %102
br i1 %103, label %110, label %104
104: ; preds = %98
%105 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%106 = load i32, i32* %105
%107 = sext i32 %106 to i64
%108 = load i64, i64* %12
%109 = icmp sgt i64 %107, %108
br i1 %109, label %110, label %118
110: ; preds = %104, %98
%111 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%112 = load i32, i32* %111
%113 = load i64, i64* %11
%114 = trunc i64 %113 to i32
%115 = load i64, i64* %12
%116 = trunc i64 %115 to i32
%117 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %112, i32 %114, i32 %116)
store i32 1, i32* %3
store i32 1, i32* %14
br label %140
118: ; preds = %104
%119 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%120 = load i32, i32* %119
%121 = sext i32 %120 to i64
%122 = load i64, i64* %11
%123 = icmp slt i64 %121, %122
br i1 %123, label %130, label %124
124: ; preds = %118
%125 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%126 = load i32, i32* %125
%127 = sext i32 %126 to i64
%128 = load i64, i64* %12
%129 = icmp sgt i64 %127, %128
br i1 %129, label %130, label %138
130: ; preds = %124, %118
%131 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%132 = load i32, i32* %131
%133 = load i64, i64* %11
%134 = trunc i64 %133 to i32
%135 = load i64, i64* %12
%136 = trunc i64 %135 to i32
%137 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 %132, i32 %134, i32 %136)
store i32 1, i32* %3
store i32 1, i32* %14
br label %140
138: ; preds = %124
%139 = 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 %140
140: ; preds = %138, %130, %110, %92, %80, %70, %64, %56, %49, %42, %36, %27, %21
%141 = load i8*, i8** %6
%142 = load i32, i32* %3
ret i32 %142
}

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 %jd != %jd\0A\00"
@.str.7 = [19 x i8] c"actime %jd != %jd\0A\00"
@.str.8 = [23 x i8] c"modtime %jd <%jd >%jd\0A\00"
@.str.9 = [22 x i8] c"actime %jd <%jd >%jd\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 %99
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 %99
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 %99
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 %99
36: ; preds = %30
%37 = call i64 @time(i32* null)
%38 = icmp eq i64 %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 %99
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 %99
49: ; preds = %42
%50 = call i32 @sleep(i32 1)
%51 = call i64 @time(i32* null)
%52 = icmp eq i64 %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 %99
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 %99
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 %99
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 %99
75: ; preds = %69
%76 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 0
%77 = load i32, i32* %76
%78 = sext i32 %77 to i64
%79 = icmp sgt i64 %37, %78
%80 = icmp slt i64 %51, %78
%81 = select i1 %79, i1 true, i1 %80
br i1 %81, label %82, label %86
82: ; preds = %75
%83 = trunc i64 %37 to i32
%84 = trunc i64 %51 to i32
%85 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i32 %77, i32 %83, i32 %84)
br label %99
86: ; preds = %75
%87 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 1
%88 = load i32, i32* %87
%89 = sext i32 %88 to i64
%90 = icmp sgt i64 %37, %89
%91 = icmp slt i64 %51, %89
%92 = select i1 %90, i1 true, i1 %91
br i1 %92, label %93, label %97
93: ; preds = %86
%94 = trunc i64 %37 to i32
%95 = trunc i64 %51 to i32
%96 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i32 %88, i32 %94, i32 %95)
br label %99
97: ; preds = %86
%98 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
br label %99
99: ; preds = %97, %93, %82, %73, %67, %59, %53, %46, %39, %33, %27, %19, %14
%100 = phi i32 [ 1, %14 ], [ 1, %19 ], [ 1, %27 ], [ 1, %33 ], [ 1, %39 ], [ 1, %46 ], [ 1, %53 ], [ 1, %59 ], [ 1, %67 ], [ 1, %73 ], [ 1, %82 ], [ 1, %93 ], [ 0, %97 ]
ret i32 %100
}