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

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/, ...);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  struct timeval timev;
  gettimeofday(&timev, NULL);
  fprintf(stdout, "%ld\n", time(NULL));
  fprintf(stdout, "%ld.%06ld\n", timev.tv_sec, timev.tv_usec);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe83(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x2e8b(%rip),%r14
mov    (%r14),%ebx
xor    %edi,%edi
call   1050 <time@plt>
lea    0xe9a(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    (%rsp),%ecx
mov    0x4(%rsp),%edx
lea    0xe83(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@stdout = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
@.str.1 = [11 x i8] c"%ld.%06ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = load i32, i32* @stdout
%5 = call i32 @time(i32* null)
%6 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@stdout = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
@.str.1 = [11 x i8] c"%ld.%06ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = load i32, i32* @stdout
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%11 = load i32, i32* %10
%12 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = tail call i32 @exit(i32 %13)
unreachable
}