#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 */
typedef int /*<<< orphan*/ cpu_percent;

/* Variables and functions */
double fabs(int /*<<< orphan*/);
const char *cpustat_loading(const double cpu_percent) {
  if ((fabs((cpu_percent) - (0.0)) < (0.0000001)))
    return "idle";
  if (cpu_percent > 99.0)
    return "CPU fully loaded";
  if (cpu_percent > 95.0)
    return "nearly 1 CPU fully loaded";
  if (cpu_percent > 85.0)
    return "excessive load";
  if (cpu_percent > 70.0)
    return "very high load";
  if (cpu_percent > 40.0)
    return "high load";
  if (cpu_percent > 20.0)
    return "medium load";
  if (cpu_percent > 10.0)
    return "slight load";
  if (cpu_percent > 2.5)
    return "light load";
  return "very light load";
}


x86 assembly (clang, -O0):
<cpustat_loading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1157 <cpustat_loading+0x47>
lea    0xefa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
movsd  -0x10(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117e <cpustat_loading+0x6e>
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe85(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a5 <cpustat_loading+0x95>
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe66(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11cc <cpustat_loading+0xbc>
lea    0xea4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe47(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f3 <cpustat_loading+0xe3>
lea    0xe8c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe28(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    121a <cpustat_loading+0x10a>
lea    0xe6a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe09(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1241 <cpustat_loading+0x131>
lea    0xe4d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
movsd  -0x10(%rbp),%xmm0
movsd  0xdea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1268 <cpustat_loading+0x158>
lea    0xe32(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
movsd  -0x10(%rbp),%xmm0
movsd  0xdcb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    128f <cpustat_loading+0x17f>
lea    0xe1c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    129a <cpustat_loading+0x18a>
lea    0xe07(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpustat_loading>:
push   %rax
movsd  %xmm0,(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
movsd  0xed9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1136 <cpustat_loading+0x26>
lea    0xf14(%rip),%rax
pop    %rcx
ret
movsd  (%rsp),%xmm0
ucomisd 0xec5(%rip),%xmm0
jbe    114e <cpustat_loading+0x3e>
lea    0xf0a(%rip),%rax
pop    %rcx
ret
ucomisd 0xeba(%rip),%xmm0
jbe    1161 <cpustat_loading+0x51>
lea    0xeee(%rip),%rax
pop    %rcx
ret
ucomisd 0xeaf(%rip),%xmm0
jbe    1174 <cpustat_loading+0x64>
lea    0xef5(%rip),%rax
pop    %rcx
ret
ucomisd 0xea4(%rip),%xmm0
jbe    1187 <cpustat_loading+0x77>
lea    0xef1(%rip),%rax
pop    %rcx
ret
ucomisd 0xe99(%rip),%xmm0
jbe    119a <cpustat_loading+0x8a>
lea    0xee3(%rip),%rax
pop    %rcx
ret
ucomisd 0xe8e(%rip),%xmm0
jbe    11ad <cpustat_loading+0x9d>
lea    0xeda(%rip),%rax
pop    %rcx
ret
ucomisd 0xe83(%rip),%xmm0
jbe    11c0 <cpustat_loading+0xb0>
lea    0xed3(%rip),%rax
pop    %rcx
ret
ucomisd 0xe78(%rip),%xmm0
lea    0xed3(%rip),%rcx
lea    0xec7(%rip),%rax
cmova  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"idle\00"
@.str.1 = [17 x i8] c"CPU fully loaded\00"
@.str.2 = [26 x i8] c"nearly 1 CPU fully loaded\00"
@.str.3 = [15 x i8] c"excessive load\00"
@.str.4 = [15 x i8] c"very high load\00"
@.str.5 = [10 x i8] c"high load\00"
@.str.6 = [12 x i8] c"medium load\00"
@.str.7 = [12 x i8] c"slight load\00"
@.str.8 = [11 x i8] c"light load\00"
@.str.9 = [16 x i8] c"very light load\00"
define i8* @cpustat_loading(double %0) {
%2 = alloca i8*
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fsub double %4, 0.000000e+00
%6 = fptosi double %5 to i32
%7 = call double @fabs(i32 %6)
%8 = fcmp olt double %7, 0x3E7AD7F29ABCAF48
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %43
10: ; preds = %1
%11 = load double, double* %3
%12 = fcmp ogt double %11, 9.900000e+01
br i1 %12, label %13, label %14
13: ; preds = %10
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %43
14: ; preds = %10
%15 = load double, double* %3
%16 = fcmp ogt double %15, 9.500000e+01
br i1 %16, label %17, label %18
17: ; preds = %14
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %43
18: ; preds = %14
%19 = load double, double* %3
%20 = fcmp ogt double %19, 8.500000e+01
br i1 %20, label %21, label %22
21: ; preds = %18
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %43
22: ; preds = %18
%23 = load double, double* %3
%24 = fcmp ogt double %23, 7.000000e+01
br i1 %24, label %25, label %26
25: ; preds = %22
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %43
26: ; preds = %22
%27 = load double, double* %3
%28 = fcmp ogt double %27, 4.000000e+01
br i1 %28, label %29, label %30
29: ; preds = %26
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %43
30: ; preds = %26
%31 = load double, double* %3
%32 = fcmp ogt double %31, 2.000000e+01
br i1 %32, label %33, label %34
33: ; preds = %30
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %43
34: ; preds = %30
%35 = load double, double* %3
%36 = fcmp ogt double %35, 1.000000e+01
br i1 %36, label %37, label %38
37: ; preds = %34
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %43
38: ; preds = %34
%39 = load double, double* %3
%40 = fcmp ogt double %39, 2.500000e+00
br i1 %40, label %41, label %42
41: ; preds = %38
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %43
42: ; preds = %38
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %43
43: ; preds = %42, %41, %37, %33, %29, %25, %21, %17, %13, %9
%44 = load i8*, i8** %2
ret i8* %44
}

LLVM IR (-O2):
@.str = [5 x i8] c"idle\00"
@.str.1 = [17 x i8] c"CPU fully loaded\00"
@.str.2 = [26 x i8] c"nearly 1 CPU fully loaded\00"
@.str.3 = [15 x i8] c"excessive load\00"
@.str.4 = [15 x i8] c"very high load\00"
@.str.5 = [10 x i8] c"high load\00"
@.str.6 = [12 x i8] c"medium load\00"
@.str.7 = [12 x i8] c"slight load\00"
@.str.8 = [11 x i8] c"light load\00"
@.str.9 = [16 x i8] c"very light load\00"
define i8* @cpustat_loading(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @fabs(i32 %2)
%4 = fcmp olt double %3, 0x3E7AD7F29ABCAF48
br i1 %4, label %22, label %5
5: ; preds = %1
%6 = fcmp ogt double %0, 9.900000e+01
br i1 %6, label %22, label %7
7: ; preds = %5
%8 = fcmp ogt double %0, 9.500000e+01
br i1 %8, label %22, label %9
9: ; preds = %7
%10 = fcmp ogt double %0, 8.500000e+01
br i1 %10, label %22, label %11
11: ; preds = %9
%12 = fcmp ogt double %0, 7.000000e+01
br i1 %12, label %22, label %13
13: ; preds = %11
%14 = fcmp ogt double %0, 4.000000e+01
br i1 %14, label %22, label %15
15: ; preds = %13
%16 = fcmp ogt double %0, 2.000000e+01
br i1 %16, label %22, label %17
17: ; preds = %15
%18 = fcmp ogt double %0, 1.000000e+01
br i1 %18, label %22, label %19
19: ; preds = %17
%20 = fcmp ogt double %0, 2.500000e+00
%21 = select i1 %20, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0)
br label %22
22: ; preds = %19, %17, %15, %13, %11, %9, %7, %5, %1
%23 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), %7 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %9 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), %13 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), %15 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), %17 ], [ %21, %19 ]
ret i8* %23
}