#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 *, unsigned long long, char *);
void jc_test_report_time(unsigned long long t) {
  if (t < 5000)
    printf("%g %s", (double)t, "\u00b5s");
  else if (t < 500000)
    printf("%g %s", t / 1000.0, "ms");
  else
    printf("%g %s", t / 1000000.0, "s");
}


x86 assembly (clang, -O0):
<jc_test_report_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1388,-0x8(%rbp)
jae    118f <jc_test_report_time+0x7f>
movaps 0xecf(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xece(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rsi
mov    %rsi,%rcx
sar    $0x3f,%rcx
movsd  0xec0(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rsi
lea    0xeba(%rip),%rdi
lea    0xeb9(%rip),%rdx
call   1030 <printf@plt>
jmp    127f <jc_test_report_time+0x16f>
cmpq   $0x7a120,-0x8(%rbp)
jae    120e <jc_test_report_time+0xfe>
movaps 0xe5c(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xe5b(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe64(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rsi
mov    %rsi,%rcx
sar    $0x3f,%rcx
movsd  0xe41(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rsi
lea    0xe3b(%rip),%rdi
lea    0xe3e(%rip),%rdx
call   1030 <printf@plt>
jmp    127a <jc_test_report_time+0x16a>
movaps 0xdeb(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xdea(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xde3(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rsi
mov    %rsi,%rcx
sar    $0x3f,%rcx
movsd  0xdd0(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rsi
lea    0xdca(%rip),%rdi
lea    0xdc7(%rip),%rdx
call   1030 <printf@plt>
jmp    127f <jc_test_report_time+0x16f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jc_test_report_time>:
cmp    $0x1387,%rdi
ja     1143 <jc_test_report_time+0x33>
movq   %rdi,%xmm1
punpckldq 0xeda(%rip),%xmm1
subpd  0xee2(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
lea    0xefd(%rip),%rdx
jmp    118d <jc_test_report_time+0x7d>
movq   %rdi,%xmm1
punpckldq 0xeb0(%rip),%xmm1
subpd  0xeb8(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
cmp    $0x7a11f,%rdi
ja     117e <jc_test_report_time+0x6e>
divsd  0xeb3(%rip),%xmm0
lea    0xec6(%rip),%rdx
jmp    118d <jc_test_report_time+0x7d>
divsd  0xe9a(%rip),%xmm0
lea    0xeaf(%rip),%rdx
cvttsd2si %xmm0,%rax
mov    %rax,%rcx
subsd  0xe93(%rip),%xmm0
cvttsd2si %xmm0,%rsi
sar    $0x3f,%rcx
and    %rcx,%rsi
or     %rax,%rsi
lea    0xe85(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%g %s\00"
@.str.1 = [4 x i8] c"\C2\B5s\00"
@.str.2 = [3 x i8] c"ms\00"
@.str.3 = [2 x i8] c"s\00"
define void @jc_test_report_time(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 5000
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i64, i64* %2
%7 = uitofp i64 %6 to double
%8 = fptoui double %7 to i64
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %26
10: ; preds = %1
%11 = load i64, i64* %2
%12 = icmp ult i64 %11, 500000
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i64, i64* %2
%15 = uitofp i64 %14 to double
%16 = fdiv double %15, 1.000000e+03
%17 = fptoui double %16 to i64
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %25
19: ; preds = %10
%20 = load i64, i64* %2
%21 = uitofp i64 %20 to double
%22 = fdiv double %21, 1.000000e+06
%23 = fptoui double %22 to i64
%24 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %19, %13
br label %26
26: ; preds = %25, %5
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%g %s\00"
@.str.1 = [4 x i8] c"\C2\B5s\00"
@.str.2 = [3 x i8] c"ms\00"
@.str.3 = [2 x i8] c"s\00"
define void @jc_test_report_time(i64 %0) {
%2 = icmp ult i64 %0, 5000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = uitofp i64 %0 to double
br label %12
5: ; preds = %1
%6 = icmp ult i64 %0, 500000
%7 = uitofp i64 %0 to double
br i1 %6, label %8, label %10
8: ; preds = %5
%9 = fdiv double %7, 1.000000e+03
br label %12
10: ; preds = %5
%11 = fdiv double %7, 1.000000e+06
br label %12
12: ; preds = %8, %10, %3
%13 = phi double [ %9, %8 ], [ %11, %10 ], [ %4, %3 ]
%14 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %10 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %3 ]
%15 = fptoui double %13 to i64
%16 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %15, i8* %14)
ret void
}