#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 tm {
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_isdst;
  scalar_t__ tm_wday;
  int tm_yday;
};
typedef scalar_t__ clock_t;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
scalar_t__ clock();
char *ctime(scalar_t__ *);
double difftime(scalar_t__, scalar_t__);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ localtime(scalar_t__ *);
scalar_t__ mktime(struct tm *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
int strcmp(char *, char *);
scalar_t__ time(scalar_t__ *);
int main() {
  char buf[32];
  clock_t tc = clock();
  struct tm ts1;
  time_t tt1, tt2;
  static char *dstr = "Sun Dec 2 06:55:15 1979\n";
  tt1 = time(&tt2);
  assert(tt1 == tt2);
  ts1.tm_sec = 15;
  ts1.tm_min = 55;
  ts1.tm_hour = 6;
  ts1.tm_mday = 2;
  ts1.tm_mon = 11;
  ts1.tm_year = 79;
  ts1.tm_isdst = -2;
  tt1 = mktime(&ts1);
  assert(ts1.tm_wday == 0);
  assert(ts1.tm_yday == 335);
  ++ts1.tm_sec;
  tt2 = mktime(&ts1);
  assert(difftime(tt1, tt2) < 0.0);
  assert(strcmp(asctime(localtime(&tt1)), dstr));
  assert(strcmp(buf, "16") == 0);
  assert(tc <= clock());
  fputs("Current data -- ", stdout);
  time(&tt1);
  fputs(ctime(&tt1), stdout);
  puts("SUCCESS testing <time.h>");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <clock@plt>
mov    %rax,-0x38(%rbp)
lea    -0x78(%rbp),%rdi
call   10c0 <time@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
cmp    -0x78(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
movl   $0xf,-0x68(%rbp)
movl   $0x37,-0x64(%rbp)
movl   $0x6,-0x60(%rbp)
movl   $0x2,-0x5c(%rbp)
movl   $0xb,-0x58(%rbp)
movl   $0x4f,-0x54(%rbp)
movl   $0xfffffffe,-0x50(%rbp)
lea    -0x68(%rbp),%rdi
call   10d0 <mktime@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x48(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
cmpl   $0x14f,-0x40(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
lea    -0x68(%rbp),%rdi
call   10d0 <mktime@plt>
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rsi
call   1080 <difftime@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
lea    -0x70(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1070 <asctime@plt>
mov    %rax,%rdi
mov    0x2dd1(%rip),%rsi
call   10a0 <strcmp@plt>
mov    %eax,%edi
call   10b0 <assert@plt>
lea    -0x30(%rbp),%rdi
lea    0xd5b(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    $0x0,%al
call   1050 <clock@plt>
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   10b0 <assert@plt>
mov    0x2ce0(%rip),%rax
mov    (%rax),%esi
lea    0xd13(%rip),%rdi
call   1090 <fputs@plt>
lea    -0x70(%rbp),%rdi
call   10c0 <time@plt>
lea    -0x70(%rbp),%rdi
call   1060 <ctime@plt>
mov    %rax,%rdi
mov    0x2cb6(%rip),%rax
mov    (%rax),%esi
call   1090 <fputs@plt>
lea    0xcf5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
xor    %eax,%eax
call   1050 <clock@plt>
mov    %rax,%r14
mov    %rsp,%rdi
call   10c0 <time@plt>
xor    %edi,%edi
cmp    (%rsp),%rax
sete   %dil
call   10b0 <assert@plt>
movapd 0xe1e(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
movabs $0x4f0000000b,%rax
mov    %rax,0x20(%rsp)
movl   $0xfffffffe,0x28(%rsp)
ff
lea    0x10(%rsp),%r15
mov    %r15,%rdi
call   10d0 <mktime@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
xor    %edi,%edi
cmpq   $0x0,0x30(%rsp)
sete   %dil
call   10b0 <assert@plt>
xor    %edi,%edi
cmpl   $0x14f,0x38(%rsp)
sete   %dil
call   10b0 <assert@plt>
addl   $0x1,0x10(%rsp)
mov    %r15,%rdi
call   10d0 <mktime@plt>
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    %rax,%rsi
call   1080 <difftime@plt>
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm0,%xmm1
seta   %dil
call   10b0 <assert@plt>
lea    0x8(%rsp),%r15
mov    %r15,%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1070 <asctime@plt>
lea    0xd8e(%rip),%rsi
mov    %rax,%rdi
call   10a0 <strcmp@plt>
mov    %eax,%edi
call   10b0 <assert@plt>
mov    $0x3631,%eax
xor    0x40(%rsp),%eax
movzbl 0x42(%rsp),%ecx
xor    %edi,%edi
or     %ax,%cx
sete   %dil
call   10b0 <assert@plt>
xor    %eax,%eax
call   1050 <clock@plt>
xor    %edi,%edi
cmp    %rax,%r14
setle  %dil
call   10b0 <assert@plt>
mov    0x2d17(%rip),%rbx
mov    (%rbx),%esi
lea    0xd5a(%rip),%rdi
call   1090 <fputs@plt>
mov    %r15,%rdi
call   10c0 <time@plt>
mov    %r15,%rdi
call   1060 <ctime@plt>
mov    (%rbx),%esi
mov    %rax,%rdi
call   1090 <fputs@plt>
lea    0xd45(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i64, i32 }
@main.dstr = internal global i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i32 0, i32 0)
@.str = [25 x i8] c"Sun Dec 2 06:55:15 1979\0A\00"
@.str.1 = [3 x i8] c"16\00"
@.str.2 = [17 x i8] c"Current data -- \00"
@stdout = global i32 0
@.str.3 = [25 x i8] c"SUCCESS testing <time.h>\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = alloca i64
%4 = alloca %struct.tm
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i64 (...) @clock()
store i64 %7, i64* %3
%8 = call i64 @time(i64* %6)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = icmp eq i64 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
store i32 15, i32* %14
%15 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 1
store i32 55, i32* %15
%16 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
store i32 6, i32* %16
%17 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 3
store i32 2, i32* %17
%18 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 4
store i32 11, i32* %18
%19 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 5
store i32 79, i32* %19
%20 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 6
store i32 -2, i32* %20
%21 = call i64 @mktime(%struct.tm* %4)
store i64 %21, i64* %5
%22 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 7
%23 = load i64, i64* %22
%24 = icmp eq i64 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 8
%28 = load i32, i32* %27
%29 = icmp eq i32 %28, 335
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%33 = load i32, i32* %32
%34 = add nsw i32 %33, 1
store i32 %34, i32* %32
%35 = call i64 @mktime(%struct.tm* %4)
store i64 %35, i64* %6
%36 = load i64, i64* %5
%37 = load i64, i64* %6
%38 = call double @difftime(i64 %36, i64 %37)
%39 = fcmp olt double %38, 0.000000e+00
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = call i32 @localtime(i64* %5)
%43 = call i8* @asctime(i32 %42)
%44 = load i8*, i8** @main.dstr
%45 = call i32 @strcmp(i8* %43, i8* %44)
%46 = call i32 @assert(i32 %45)
%47 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%48 = call i32 @strcmp(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
%52 = load i64, i64* %3
%53 = call i64 (...) @clock()
%54 = icmp sle i64 %52, %53
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = load i32, i32* @stdout
%58 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %57)
%59 = call i64 @time(i64* %5)
%60 = call i8* @ctime(i64* %5)
%61 = load i32, i32* @stdout
%62 = call i32 @fputs(i8* %60, i32 %61)
%63 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i64, i32 }
@.str = [25 x i8] c"Sun Dec 2 06:55:15 1979\0A\00"
@.str.1 = [3 x i8] c"16\00"
@.str.2 = [17 x i8] c"Current data -- \00"
@stdout = global i32 0
@.str.3 = [25 x i8] c"SUCCESS testing <time.h>\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = alloca %struct.tm
%3 = alloca i64
%4 = alloca i64
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%6 = tail call i64 (...) @clock()
%7 = bitcast %struct.tm* %2 to i8*
%8 = bitcast i64* %3 to i8*
%9 = bitcast i64* %4 to i8*
%10 = call i64 @time(i64* %4)
%11 = load i64, i64* %4
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
%16 = bitcast %struct.tm* %2 to <4 x i32>*
store <4 x i32> <i32 15, i32 55, i32 6, i32 2>, <4 x i32>* %16
%17 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 4
store i32 11, i32* %17
%18 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 5
store i32 79, i32* %18
%19 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 6
store i32 -2, i32* %19
%20 = call i64 @mktime(%struct.tm* %2)
store i64 %20, i64* %3
%21 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 7
%22 = load i64, i64* %21
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 8
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 335
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = load i32, i32* %15
%32 = add nsw i32 %31, 1
store i32 %32, i32* %15
%33 = call i64 @mktime(%struct.tm* %2)
store i64 %33, i64* %4
%34 = call double @difftime(i64 %20, i64 %33)
%35 = fcmp olt double %34, 0.000000e+00
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = call i32 @localtime(i64* %3)
%39 = call i8* @asctime(i32 %38)
%40 = call i32 @strcmp(i8* dereferenceable(1) %39, i8* dereferenceable(25) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%41 = call i32 @assert(i32 %40)
%42 = call i32 @bcmp(i8* dereferenceable(3) %5, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 3)
%43 = icmp eq i32 %42, 0
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = call i64 (...) @clock()
%47 = icmp sle i64 %6, %46
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = load i32, i32* @stdout
%51 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = call i64 @time(i64* %3)
%53 = call i8* @ctime(i64* %3)
%54 = load i32, i32* @stdout
%55 = call i32 @fputs(i8* %53, i32 %54)
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}