#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 *, double);
void statsdump_print_humanize_si(double number) {
  if (number < 0.0009995) {
    printf("%.2lfu", number * 10000000.0);
  } else if (number < 0.9995) {
    printf("%.2lfm", number * 1000.0);
  } else if (number < 999.5) {
    printf("%.2lf", number);
  } else if (number < 999500.0) {
    printf("%.2lfk", number / 1000.0);
  } else if (number < 999500000.0) {
    printf("%.2lfM", number / 1000000.0);
  } else if (number < 999500000000.0) {
    printf("%.2lfG", number / 1000000000.0);
  } else if (number < 999500000000000.0) {
    printf("%.2lfT", number / 1000000000000.0);
  } else {
    printf("%.2lfP", number / 1000000000000000.0);
  }
}


x86 assembly (clang, -O0):
<statsdump_print_humanize_si>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114e <statsdump_print_humanize_si+0x3e>
movsd  0xf28(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
lea    0xf24(%rip),%rdi
call   1030 <printf@plt>
jmp    12b7 <statsdump_print_humanize_si+0x1a7>
movsd  0xeb2(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    117f <statsdump_print_humanize_si+0x6f>
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
jmp    12b2 <statsdump_print_humanize_si+0x1a2>
movsd  0xe89(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11a8 <statsdump_print_humanize_si+0x98>
movsd  -0x8(%rbp),%xmm0
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
jmp    12ad <statsdump_print_humanize_si+0x19d>
movsd  0xe68(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11dd <statsdump_print_humanize_si+0xcd>
movsd  -0x8(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    12a8 <statsdump_print_humanize_si+0x198>
movsd  0xe3b(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1212 <statsdump_print_humanize_si+0x102>
movsd  -0x8(%rbp),%xmm0
movsd  0xe53(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    12a3 <statsdump_print_humanize_si+0x193>
movsd  0xe0e(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1247 <statsdump_print_humanize_si+0x137>
movsd  -0x8(%rbp),%xmm0
movsd  0xe16(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    129e <statsdump_print_humanize_si+0x18e>
movsd  0xde1(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    127c <statsdump_print_humanize_si+0x16c>
movsd  -0x8(%rbp),%xmm0
movsd  0xdd9(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe1f(%rip),%rdi
call   1030 <printf@plt>
jmp    1299 <statsdump_print_humanize_si+0x189>
movsd  -0x8(%rbp),%xmm0
movsd  0xdaf(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe04(%rip),%rdi
call   1030 <printf@plt>
jmp    129e <statsdump_print_humanize_si+0x18e>
jmp    12a3 <statsdump_print_humanize_si+0x193>
jmp    12a8 <statsdump_print_humanize_si+0x198>
jmp    12ad <statsdump_print_humanize_si+0x19d>
jmp    12b2 <statsdump_print_humanize_si+0x1a2>
jmp    12b7 <statsdump_print_humanize_si+0x1a7>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statsdump_print_humanize_si>:
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1132 <statsdump_print_humanize_si+0x22>
mulsd  0xf3a(%rip),%xmm0
lea    0xf3b(%rip),%rdi
jmp    1030 <printf@plt>
movsd  0xece(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1154 <statsdump_print_humanize_si+0x44>
mulsd  0xf10(%rip),%xmm0
lea    0xf20(%rip),%rdi
jmp    1030 <printf@plt>
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    116e <statsdump_print_humanize_si+0x5e>
lea    0xf0d(%rip),%rdi
jmp    1030 <printf@plt>
movsd  0xea2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1190 <statsdump_print_humanize_si+0x80>
divsd  0xed4(%rip),%xmm0
lea    0xef1(%rip),%rdi
jmp    1030 <printf@plt>
movsd  0xe88(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11b2 <statsdump_print_humanize_si+0xa2>
divsd  0xeaa(%rip),%xmm0
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>
movsd  0xe6e(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11d4 <statsdump_print_humanize_si+0xc4>
divsd  0xe80(%rip),%xmm0
lea    0xebb(%rip),%rdi
jmp    1030 <printf@plt>
movsd  0xe54(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11f6 <statsdump_print_humanize_si+0xe6>
divsd  0xe56(%rip),%xmm0
lea    0xea0(%rip),%rdi
jmp    1030 <printf@plt>
divsd  0xe3a(%rip),%xmm0
lea    0xe93(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%.2lfu\00"
@.str.1 = [7 x i8] c"%.2lfm\00"
@.str.2 = [6 x i8] c"%.2lf\00"
@.str.3 = [7 x i8] c"%.2lfk\00"
@.str.4 = [7 x i8] c"%.2lfM\00"
@.str.5 = [7 x i8] c"%.2lfG\00"
@.str.6 = [7 x i8] c"%.2lfT\00"
@.str.7 = [7 x i8] c"%.2lfP\00"
define void @statsdump_print_humanize_si(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0x3F506034F3FD933E
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double %6, 1.000000e+07
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %7)
br label %60
9: ; preds = %1
%10 = load double, double* %2
%11 = fcmp olt double %10, 9.995000e-01
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load double, double* %2
%14 = fmul double %13, 1.000000e+03
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %14)
br label %59
16: ; preds = %9
%17 = load double, double* %2
%18 = fcmp olt double %17, 9.995000e+02
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load double, double* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %20)
br label %58
22: ; preds = %16
%23 = load double, double* %2
%24 = fcmp olt double %23, 9.995000e+05
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load double, double* %2
%27 = fdiv double %26, 1.000000e+03
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %27)
br label %57
29: ; preds = %22
%30 = load double, double* %2
%31 = fcmp olt double %30, 9.995000e+08
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load double, double* %2
%34 = fdiv double %33, 1.000000e+06
%35 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %34)
br label %56
36: ; preds = %29
%37 = load double, double* %2
%38 = fcmp olt double %37, 9.995000e+11
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = load double, double* %2
%41 = fdiv double %40, 1.000000e+09
%42 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %41)
br label %55
43: ; preds = %36
%44 = load double, double* %2
%45 = fcmp olt double %44, 9.995000e+14
br i1 %45, label %46, label %50
46: ; preds = %43
%47 = load double, double* %2
%48 = fdiv double %47, 1.000000e+12
%49 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double %48)
br label %54
50: ; preds = %43
%51 = load double, double* %2
%52 = fdiv double %51, 1.000000e+15
%53 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %52)
br label %54
54: ; preds = %50, %46
br label %55
55: ; preds = %54, %39
br label %56
56: ; preds = %55, %32
br label %57
57: ; preds = %56, %25
br label %58
58: ; preds = %57, %19
br label %59
59: ; preds = %58, %12
br label %60
60: ; preds = %59, %5
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.2lfu\00"
@.str.1 = [7 x i8] c"%.2lfm\00"
@.str.2 = [6 x i8] c"%.2lf\00"
@.str.3 = [7 x i8] c"%.2lfk\00"
@.str.4 = [7 x i8] c"%.2lfM\00"
@.str.5 = [7 x i8] c"%.2lfG\00"
@.str.6 = [7 x i8] c"%.2lfT\00"
@.str.7 = [7 x i8] c"%.2lfP\00"
define void @statsdump_print_humanize_si(double %0) {
%2 = fcmp olt double %0, 0x3F506034F3FD933E
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fmul double %0, 1.000000e+07
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %4)
br label %38
6: ; preds = %1
%7 = fcmp olt double %0, 9.995000e-01
br i1 %7, label %8, label %11
8: ; preds = %6
%9 = fmul double %0, 1.000000e+03
%10 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %9)
br label %38
11: ; preds = %6
%12 = fcmp olt double %0, 9.995000e+02
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %0)
br label %38
15: ; preds = %11
%16 = fcmp olt double %0, 9.995000e+05
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = fdiv double %0, 1.000000e+03
%19 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %18)
br label %38
20: ; preds = %15
%21 = fcmp olt double %0, 9.995000e+08
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = fdiv double %0, 1.000000e+06
%24 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %23)
br label %38
25: ; preds = %20
%26 = fcmp olt double %0, 9.995000e+11
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = fdiv double %0, 1.000000e+09
%29 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %28)
br label %38
30: ; preds = %25
%31 = fcmp olt double %0, 9.995000e+14
br i1 %31, label %32, label %35
32: ; preds = %30
%33 = fdiv double %0, 1.000000e+12
%34 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double %33)
br label %38
35: ; preds = %30
%36 = fdiv double %0, 1.000000e+15
%37 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %36)
br label %38
38: ; preds = %8, %17, %27, %35, %32, %22, %13, %3
ret void
}