#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 *);
scalar_t__ time_diff_nsec_test();
scalar_t__ time_diff_usec_test();
int main(int argc, char **argv) {
  printf("Running gettime_test...\n");
  do {
    printf("Running "
           "time_diff_usec_test"
           "... ");
    if (time_diff_usec_test())
      printf("FAIL\n");
    else
      printf("SUCCESS\n");
  } while (0);
  ;
  do {
    printf("Running "
           "time_diff_nsec_test"
           "... ");
    if (time_diff_nsec_test())
      printf("FAIL\n");
    else
      printf("SUCCESS\n");
  } while (0);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <time_diff_usec_test@plt>
cmp    $0x0,%rax
je     1180 <main+0x50>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x5c>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    1191 <main+0x61>
jmp    1196 <main+0x66>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <time_diff_nsec_test@plt>
cmp    $0x0,%rax
je     11c4 <main+0x94>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xa0>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    11d5 <main+0xa5>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <time_diff_usec_test@plt>
test   %rax,%rax
lea    0xeeb(%rip),%r14
lea    0xeec(%rip),%rbx
mov    %rbx,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <time_diff_nsec_test@plt>
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Running gettime_test...\0A\00"
@.str.1 = [32 x i8] c"Running time_diff_usec_test... \00"
@.str.2 = [6 x i8] c"FAIL\0A\00"
@.str.3 = [9 x i8] c"SUCCESS\0A\00"
@.str.4 = [32 x i8] c"Running time_diff_nsec_test... \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%9 = call i64 (...) @time_diff_usec_test()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %15
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15
br label %17
17: ; preds = %16
%18 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%19 = call i64 (...) @time_diff_nsec_test()
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %25
23: ; preds = %17
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
br label %26
26: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [32 x i8] c"Running time_diff_usec_test... \00"
@.str.4 = [32 x i8] c"Running time_diff_nsec_test... \00"
@str = [24 x i8] c"Running gettime_test...\00"
@str.6 = [8 x i8] c"SUCCESS\00"
@str.8 = [5 x i8] c"FAIL\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i64 (...) @time_diff_usec_test()
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.8, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i64 (...) @time_diff_nsec_test()
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.8, i64 0, i64 0)
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}