#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*/ printf(char *);
int /*<<< orphan*/ test_add_timespec();
int /*<<< orphan*/ test_add_timeval();
int /*<<< orphan*/ test_compare_timespec();
int /*<<< orphan*/ test_compare_timeval();
int /*<<< orphan*/ test_ms_timespec();
int /*<<< orphan*/ test_ms_timeval();
int /*<<< orphan*/ test_normalize_timespec();
int /*<<< orphan*/ test_normalize_timeval();
int /*<<< orphan*/ test_subtract_timespec();
int /*<<< orphan*/ test_subtract_timeval();
int main(void) {
  printf("Unit testing C based time utilities\n");
  test_add_timespec();
  test_subtract_timespec();
  test_ms_timespec();
  test_compare_timespec();
  test_normalize_timespec();
  test_add_timeval();
  test_subtract_timeval();
  test_ms_timeval();
  test_compare_timeval();
  test_normalize_timeval();
  printf("Passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe3a(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10b0 <test_add_timespec@plt>
mov    $0x0,%al
call   10c0 <test_subtract_timespec@plt>
mov    $0x0,%al
call   10d0 <test_ms_timespec@plt>
mov    $0x0,%al
call   1080 <test_compare_timespec@plt>
mov    $0x0,%al
call   10a0 <test_normalize_timespec@plt>
mov    $0x0,%al
call   1040 <test_add_timeval@plt>
mov    $0x0,%al
call   1050 <test_subtract_timeval@plt>
mov    $0x0,%al
call   1060 <test_ms_timeval@plt>
mov    $0x0,%al
call   1030 <test_compare_timeval@plt>
mov    $0x0,%al
call   1090 <test_normalize_timeval@plt>
lea    0xe0d(%rip),%rdi
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe48(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10b0 <test_add_timespec@plt>
xor    %eax,%eax
call   10c0 <test_subtract_timespec@plt>
xor    %eax,%eax
call   10d0 <test_ms_timespec@plt>
xor    %eax,%eax
call   1080 <test_compare_timespec@plt>
xor    %eax,%eax
call   10a0 <test_normalize_timespec@plt>
xor    %eax,%eax
call   1050 <test_add_timeval@plt>
xor    %eax,%eax
call   1060 <test_subtract_timeval@plt>
xor    %eax,%eax
call   1070 <test_ms_timeval@plt>
xor    %eax,%eax
call   1030 <test_compare_timeval@plt>
xor    %eax,%eax
call   1090 <test_normalize_timeval@plt>
lea    0xe1a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Unit testing C based time utilities\0A\00"
@.str.1 = [8 x i8] c"Passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_add_timespec()
%4 = call i32 (...) @test_subtract_timespec()
%5 = call i32 (...) @test_ms_timespec()
%6 = call i32 (...) @test_compare_timespec()
%7 = call i32 (...) @test_normalize_timespec()
%8 = call i32 (...) @test_add_timeval()
%9 = call i32 (...) @test_subtract_timeval()
%10 = call i32 (...) @test_ms_timeval()
%11 = call i32 (...) @test_compare_timeval()
%12 = call i32 (...) @test_normalize_timeval()
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"Unit testing C based time utilities\00"
@str.2 = [7 x i8] c"Passed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_add_timespec()
%3 = tail call i32 (...) @test_subtract_timespec()
%4 = tail call i32 (...) @test_ms_timespec()
%5 = tail call i32 (...) @test_compare_timespec()
%6 = tail call i32 (...) @test_normalize_timespec()
%7 = tail call i32 (...) @test_add_timeval()
%8 = tail call i32 (...) @test_subtract_timeval()
%9 = tail call i32 (...) @test_ms_timeval()
%10 = tail call i32 (...) @test_compare_timeval()
%11 = tail call i32 (...) @test_normalize_timeval()
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}