double time_visual(double t) {
  if (t > 60.0 * 60.0)
    return t / (60.0 * 60.0);
  if (t > 60.0)
    return t / 60.0;
  if (t < 0.0001)
    return t * 1000000.0;
  if (t < 0.1)
    return t * 1000.0;
  return t;
}


x86 assembly (clang, -O0):
<time_visual>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113b <time_visual+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11cb <time_visual+0xcb>
movsd  -0x10(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116d <time_visual+0x6d>
movsd  -0x10(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11cb <time_visual+0xcb>
movsd  0xe9b(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1197 <time_visual+0x97>
movsd  0xea0(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11cb <time_visual+0xcb>
movsd  0xe79(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11c1 <time_visual+0xc1>
movsd  0xe6e(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11cb <time_visual+0xcb>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_visual>:
ucomisd 0xef8(%rip),%xmm0
jbe    1113 <time_visual+0x13>
divsd  0xeee(%rip),%xmm0
ret
ucomisd 0xeed(%rip),%xmm0
jbe    1126 <time_visual+0x26>
divsd  0xee3(%rip),%xmm0
ret
movsd  0xee2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    113d <time_visual+0x3d>
mulsd  0xeec(%rip),%xmm0
ret
movsd  0xed3(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1153 <time_visual+0x53>
mulsd  0xecd(%rip),%xmm0
ret

LLVM IR (-O0):
define double @time_visual(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 3.600000e+03
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fdiv double %7, 3.600000e+03
store double %8, double* %2
br label %29
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp ogt double %10, 6.000000e+01
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %3
%14 = fdiv double %13, 6.000000e+01
store double %14, double* %2
br label %29
15: ; preds = %9
%16 = load double, double* %3
%17 = fcmp olt double %16, 1.000000e-04
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load double, double* %3
%20 = fmul double %19, 1.000000e+06
store double %20, double* %2
br label %29
21: ; preds = %15
%22 = load double, double* %3
%23 = fcmp olt double %22, 1.000000e-01
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load double, double* %3
%26 = fmul double %25, 1.000000e+03
store double %26, double* %2
br label %29
27: ; preds = %21
%28 = load double, double* %3
store double %28, double* %2
br label %29
29: ; preds = %27, %24, %18, %12, %6
%30 = load double, double* %2
ret double %30
}

LLVM IR (-O2):
define double @time_visual(double %0) {
%2 = fcmp ogt double %0, 3.600000e+03
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fdiv double %0, 3.600000e+03
br label %17
5: ; preds = %1
%6 = fcmp ogt double %0, 6.000000e+01
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = fdiv double %0, 6.000000e+01
br label %17
9: ; preds = %5
%10 = fcmp olt double %0, 1.000000e-04
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = fmul double %0, 1.000000e+06
br label %17
13: ; preds = %9
%14 = fcmp olt double %0, 1.000000e-01
br i1 %14, label %15, label %17
15: ; preds = %13
%16 = fmul double %0, 1.000000e+03
br label %17
17: ; preds = %13, %15, %11, %7, %3
%18 = phi double [ %4, %3 ], [ %8, %7 ], [ %12, %11 ], [ %16, %15 ], [ %0, %13 ]
ret double %18
}