#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 */

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_clock();
int /*<<< orphan*/ test_clock_gettime(int /*<<< orphan*/, char *);
int /*<<< orphan*/ test_getrusage();
int /*<<< orphan*/ test_gettimeofday();
int /*<<< orphan*/ test_time();
int /*<<< orphan*/ test_times();
int main() {
  test_time();
  test_clock();
  test_times();
  test_getrusage();
  test_gettimeofday();
  printf("\nHigh precision clock_gettime() tests:\n\n");
  test_clock_gettime(CLOCK_REALTIME, "CLOCK_REALTIME");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <test_time@plt>
mov    $0x0,%al
call   1050 <test_clock@plt>
mov    $0x0,%al
call   1090 <test_times@plt>
mov    $0x0,%al
call   1070 <test_getrusage@plt>
mov    $0x0,%al
call   1030 <test_gettimeofday@plt>
lea    0xe57(%rip),%rdi
call   1060 <printf@plt>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe6b(%rip),%rsi
call   1040 <test_clock_gettime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_time@plt>
xor    %eax,%eax
call   1060 <test_clock@plt>
xor    %eax,%eax
call   1090 <test_times@plt>
xor    %eax,%eax
call   1070 <test_getrusage@plt>
xor    %eax,%eax
call   1030 <test_gettimeofday@plt>
lea    0xe74(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
call   1050 <test_clock_gettime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0AHigh precision clock_gettime() tests:\0A\0A\00"
@CLOCK_REALTIME = global i32 0
@.str.1 = [15 x i8] c"CLOCK_REALTIME\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_time()
%3 = call i32 (...) @test_clock()
%4 = call i32 (...) @test_times()
%5 = call i32 (...) @test_getrusage()
%6 = call i32 (...) @test_gettimeofday()
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @CLOCK_REALTIME
%9 = call i32 @test_clock_gettime(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@CLOCK_REALTIME = global i32 0
@.str.1 = [15 x i8] c"CLOCK_REALTIME\00"
@str = [40 x i8] c"\0AHigh precision clock_gettime() tests:\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test_time()
%2 = tail call i32 (...) @test_clock()
%3 = tail call i32 (...) @test_times()
%4 = tail call i32 (...) @test_getrusage()
%5 = tail call i32 (...) @test_gettimeofday()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @CLOCK_REALTIME
%8 = tail call i32 @test_clock_gettime(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}