#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;
struct timezone {
  int dummy;
};
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ GetDateTime1(int /*<<< orphan*/);
int /*<<< orphan*/ GetDateTime2(int /*<<< orphan*/);
int /*<<< orphan*/ GetDateTime3(int /*<<< orphan*/);
int /*<<< orphan*/ GetDateTime4(int /*<<< orphan*/);
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  time_t seconds;
  time(&seconds);
  printf("Seconds since the Epoch: %ld\n\n", seconds);
  GetDateTime1(seconds);
  GetDateTime2(seconds);
  GetDateTime3(seconds);
  GetDateTime4(seconds);
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  printf("Seconds since the Epoch: %ld\n", tv.tv_sec);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1070 <time@plt>
mov    -0x4(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <GetDateTime1@plt>
mov    -0x4(%rbp),%edi
call   1080 <GetDateTime2@plt>
mov    -0x4(%rbp),%edi
call   1090 <GetDateTime3@plt>
mov    -0x4(%rbp),%edi
call   1060 <GetDateTime4@plt>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <gettimeofday@plt>
mov    -0x8(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x4(%rsp),%rdi
call   1070 <time@plt>
mov    0x4(%rsp),%esi
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
call   1030 <GetDateTime1@plt>
mov    0x4(%rsp),%edi
call   1080 <GetDateTime2@plt>
mov    0x4(%rsp),%edi
call   1090 <GetDateTime3@plt>
mov    0x4(%rsp),%edi
call   1060 <GetDateTime4@plt>
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1050 <gettimeofday@plt>
mov    0x8(%rsp),%esi
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@.str = [31 x i8] c"Seconds since the Epoch: %ld\0A\0A\00"
@.str.1 = [30 x i8] c"Seconds since the Epoch: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = alloca %struct.timezone
%4 = call i32 @time(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @GetDateTime1(i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @GetDateTime2(i32 %9)
%11 = load i32, i32* %1
%12 = call i32 @GetDateTime3(i32 %11)
%13 = load i32, i32* %1
%14 = call i32 @GetDateTime4(i32 %13)
%15 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %3)
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@.str = [31 x i8] c"Seconds since the Epoch: %ld\0A\0A\00"
@.str.1 = [30 x i8] c"Seconds since the Epoch: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = alloca %struct.timezone
%4 = bitcast i32* %1 to i8*
%5 = call i32 @time(i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @GetDateTime1(i32 %8)
%10 = load i32, i32* %1
%11 = call i32 @GetDateTime2(i32 %10)
%12 = load i32, i32* %1
%13 = call i32 @GetDateTime3(i32 %12)
%14 = load i32, i32* %1
%15 = call i32 @GetDateTime4(i32 %14)
%16 = bitcast %struct.timeval* %2 to i8*
%17 = bitcast %struct.timezone* %3 to i8*
%18 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %3)
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}