int getLipoPerc(float vol) {
  if (vol >= 4.10)
    return 100;
  else if (vol >= 4.00)
    return 90;
  else if (vol >= 3.93)
    return 80;
  else if (vol >= 3.88)
    return 70;
  else if (vol >= 3.84)
    return 60;
  else if (vol >= 3.80)
    return 50;
  else if (vol >= 3.76)
    return 40;
  else if (vol >= 3.73)
    return 30;
  else if (vol >= 3.70)
    return 20;
  else if (vol >= 3.66)
    return 10;
  else if (vol >= 3.00)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<getLipoPerc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1130 <getLipoPerc+0x30>
movl   $0x64,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1157 <getLipoPerc+0x57>
movl   $0x5a,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     117e <getLipoPerc+0x7e>
movl   $0x50,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe89(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11a5 <getLipoPerc+0xa5>
movl   $0x46,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe6a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11cc <getLipoPerc+0xcc>
movl   $0x3c,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe4b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11f3 <getLipoPerc+0xf3>
movl   $0x32,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     121a <getLipoPerc+0x11a>
movl   $0x28,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1241 <getLipoPerc+0x141>
movl   $0x1e,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdee(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1268 <getLipoPerc+0x168>
movl   $0x14,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     128f <getLipoPerc+0x18f>
movl   $0xa,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdb0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     12b6 <getLipoPerc+0x1b6>
movl   $0x0,-0x4(%rbp)
jmp    12bd <getLipoPerc+0x1bd>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLipoPerc>:
cvtss2sd %xmm0,%xmm1
mov    $0x64,%eax
ucomisd 0xeef(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
mov    $0x5a,%eax
ucomiss 0xf25(%rip),%xmm0
jae    11aa <getLipoPerc+0xaa>
mov    $0x50,%eax
ucomisd 0xed2(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
mov    $0x46,%eax
ucomisd 0xecb(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
mov    $0x3c,%eax
ucomisd 0xec4(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
mov    $0x32,%eax
ucomisd 0xebd(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
mov    $0x28,%eax
ucomisd 0xeb6(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
mov    $0x1e,%eax
ucomisd 0xeaf(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
mov    $0x14,%eax
ucomisd 0xea8(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
mov    $0xa,%eax
ucomisd 0xea1(%rip),%xmm1
jae    11aa <getLipoPerc+0xaa>
ucomiss 0xea4(%rip),%xmm0
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getLipoPerc(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp oge double %5, 4.100000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 100, i32* %2
br label %59
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp oge double %10, 4.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 90, i32* %2
br label %59
13: ; preds = %8
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fcmp oge double %15, 3.930000e+00
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 80, i32* %2
br label %59
18: ; preds = %13
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = fcmp oge double %20, 3.880000e+00
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 70, i32* %2
br label %59
23: ; preds = %18
%24 = load float, float* %3
%25 = fpext float %24 to double
%26 = fcmp oge double %25, 3.840000e+00
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 60, i32* %2
br label %59
28: ; preds = %23
%29 = load float, float* %3
%30 = fpext float %29 to double
%31 = fcmp oge double %30, 3.800000e+00
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 50, i32* %2
br label %59
33: ; preds = %28
%34 = load float, float* %3
%35 = fpext float %34 to double
%36 = fcmp oge double %35, 3.760000e+00
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 40, i32* %2
br label %59
38: ; preds = %33
%39 = load float, float* %3
%40 = fpext float %39 to double
%41 = fcmp oge double %40, 3.730000e+00
br i1 %41, label %42, label %43
42: ; preds = %38
store i32 30, i32* %2
br label %59
43: ; preds = %38
%44 = load float, float* %3
%45 = fpext float %44 to double
%46 = fcmp oge double %45, 3.700000e+00
br i1 %46, label %47, label %48
47: ; preds = %43
store i32 20, i32* %2
br label %59
48: ; preds = %43
%49 = load float, float* %3
%50 = fpext float %49 to double
%51 = fcmp oge double %50, 3.660000e+00
br i1 %51, label %52, label %53
52: ; preds = %48
store i32 10, i32* %2
br label %59
53: ; preds = %48
%54 = load float, float* %3
%55 = fpext float %54 to double
%56 = fcmp oge double %55, 3.000000e+00
br i1 %56, label %57, label %58
57: ; preds = %53
store i32 0, i32* %2
br label %59
58: ; preds = %53
store i32 -1, i32* %2
br label %59
59: ; preds = %58, %57, %52, %47, %42, %37, %32, %27, %22, %17, %12, %7
%60 = load i32, i32* %2
ret i32 %60
}

LLVM IR (-O2):
define i32 @getLipoPerc(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ult double %2, 4.100000e+00
br i1 %3, label %4, label %25
4: ; preds = %1
%5 = fcmp ult float %0, 4.000000e+00
br i1 %5, label %6, label %25
6: ; preds = %4
%7 = fcmp ult double %2, 3.930000e+00
br i1 %7, label %8, label %25
8: ; preds = %6
%9 = fcmp ult double %2, 3.880000e+00
br i1 %9, label %10, label %25
10: ; preds = %8
%11 = fcmp ult double %2, 3.840000e+00
br i1 %11, label %12, label %25
12: ; preds = %10
%13 = fcmp ult double %2, 3.800000e+00
br i1 %13, label %14, label %25
14: ; preds = %12
%15 = fcmp ult double %2, 3.760000e+00
br i1 %15, label %16, label %25
16: ; preds = %14
%17 = fcmp ult double %2, 3.730000e+00
br i1 %17, label %18, label %25
18: ; preds = %16
%19 = fcmp ult double %2, 3.700000e+00
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = fcmp ult double %2, 3.660000e+00
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = fcmp ult float %0, 3.000000e+00
%24 = sext i1 %23 to i32
br label %25
25: ; preds = %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %1
%26 = phi i32 [ 100, %1 ], [ 90, %4 ], [ 80, %6 ], [ 70, %8 ], [ 60, %10 ], [ 50, %12 ], [ 40, %14 ], [ 30, %16 ], [ 20, %18 ], [ 10, %20 ], [ %24, %22 ]
ret i32 %26
}