#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 timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ get_utc_time_iso_string(struct timespec *, char *);
int /*<<< orphan*/ get_utc_time_string(struct timespec *, char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char string_buf[64];
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  printf("%ld.%09ld seconds since the Epoch\n", ts.tv_sec, ts.tv_nsec);
  get_utc_time_string(&ts, string_buf);
  puts(string_buf);
  get_utc_time_iso_string(&ts, string_buf);
  puts(string_buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    -0x58(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
lea    0xe82(%rip),%rdi
call   1050 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    -0x58(%rbp),%rdi
call   1070 <get_utc_time_string@plt>
lea    -0x50(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x50(%rbp),%rsi
lea    -0x58(%rbp),%rdi
call   1060 <get_utc_time_iso_string@plt>
lea    -0x50(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1040 <clock_gettime@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%esi
lea    0xe84(%rip),%rdi
call   1050 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <get_utc_time_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <get_utc_time_iso_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
@.str = [35 x i8] c"%ld.%09ld seconds since the Epoch\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca %struct.timespec
store i32 0, i32* %1
%4 = load i32, i32* @CLOCK_REALTIME
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %3)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%12 = call i32 @get_utc_time_string(%struct.timespec* %3, i8* %11)
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%14 = call i32 @puts(i8* %13)
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%16 = call i32 @get_utc_time_iso_string(%struct.timespec* %3, i8* %15)
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%18 = call i32 @puts(i8* %17)
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
@.str = [35 x i8] c"%ld.%09ld seconds since the Epoch\0A\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = alloca %struct.timespec
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%4 = bitcast %struct.timespec* %2 to i8*
%5 = load i32, i32* @CLOCK_REALTIME
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %2)
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
%12 = call i32 @get_utc_time_string(%struct.timespec* %2, i8* %3)
%13 = call i32 @puts(i8* %3)
%14 = call i32 @get_utc_time_iso_string(%struct.timespec* %2, i8* %3)
%15 = call i32 @puts(i8* %3)
ret i32 0
}