int rssi_to_heat(float rssi) {
  if (rssi < -102) {
    return 0;
  } else if (rssi < -99.58) {
    return 1;
  } else if (rssi < -97.17) {
    return 2;
  } else if (rssi < -94.76) {
    return 3;
  } else if (rssi < -92.35) {
    return 4;
  } else if (rssi < -89.94) {
    return 5;
  } else if (rssi < -87.52) {
    return 6;
  } else if (rssi < -85.11) {
    return 7;
  } else if (rssi < -82.70) {
    return 8;
  } else if (rssi < -80.29) {
    return 9;
  } else if (rssi < -77.88) {
    return 10;
  } else if (rssi < -75.47) {
    return 11;
  } else if (rssi < -73.05) {
    return 12;
  } else if (rssi < -70.64) {
    return 13;
  } else if (rssi < -68.23) {
    return 14;
  } else if (rssi < -65.82) {
    return 15;
  } else if (rssi < -63.41) {
    return 16;
  }
  if (rssi < -61.0f) {
    return 17;
  } else {
    return 18;
  }
}


x86 assembly (clang, -O0):
<rssi_to_heat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1127 <rssi_to_heat+0x27>
movl   $0x0,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114e <rssi_to_heat+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1175 <rssi_to_heat+0x75>
movl   $0x2,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe92(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    119c <rssi_to_heat+0x9c>
movl   $0x3,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe73(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c3 <rssi_to_heat+0xc3>
movl   $0x4,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe54(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ea <rssi_to_heat+0xea>
movl   $0x5,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe35(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1211 <rssi_to_heat+0x111>
movl   $0x6,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe16(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1238 <rssi_to_heat+0x138>
movl   $0x7,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdf7(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    125f <rssi_to_heat+0x15f>
movl   $0x8,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdd8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1286 <rssi_to_heat+0x186>
movl   $0x9,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdb9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12ad <rssi_to_heat+0x1ad>
movl   $0xa,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd9a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12d4 <rssi_to_heat+0x1d4>
movl   $0xb,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd7b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12fb <rssi_to_heat+0x1fb>
movl   $0xc,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd5c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1322 <rssi_to_heat+0x222>
movl   $0xd,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd3d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1349 <rssi_to_heat+0x249>
movl   $0xe,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd1e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1370 <rssi_to_heat+0x270>
movl   $0xf,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcff(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1397 <rssi_to_heat+0x297>
movl   $0x10,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
jmp    139c <rssi_to_heat+0x29c>
jmp    13a1 <rssi_to_heat+0x2a1>
jmp    13a6 <rssi_to_heat+0x2a6>
jmp    13ab <rssi_to_heat+0x2ab>
jmp    13b0 <rssi_to_heat+0x2b0>
jmp    13b5 <rssi_to_heat+0x2b5>
jmp    13ba <rssi_to_heat+0x2ba>
jmp    13bf <rssi_to_heat+0x2bf>
jmp    13c4 <rssi_to_heat+0x2c4>
jmp    13c9 <rssi_to_heat+0x2c9>
jmp    13ce <rssi_to_heat+0x2ce>
jmp    13d3 <rssi_to_heat+0x2d3>
jmp    13d8 <rssi_to_heat+0x2d8>
jmp    13dd <rssi_to_heat+0x2dd>
jmp    13e2 <rssi_to_heat+0x2e2>
jmp    13e7 <rssi_to_heat+0x2e7>
movss  0xc15(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1405 <rssi_to_heat+0x305>
movl   $0x11,-0x4(%rbp)
jmp    140c <rssi_to_heat+0x30c>
movl   $0x12,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rssi_to_heat>:
xor    %eax,%eax
movss  0xef6(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1289 <rssi_to_heat+0x189>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mov    $0x1,%eax
movsd  0xee1(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x2,%eax
movsd  0xed2(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x3,%eax
movsd  0xec3(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x4,%eax
movsd  0xeb4(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x5,%eax
movsd  0xea5(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x6,%eax
movsd  0xe96(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x7,%eax
movsd  0xe87(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x8,%eax
movsd  0xe78(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x9,%eax
movsd  0xe69(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0xa,%eax
movsd  0xe5a(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0xb,%eax
movsd  0xe4b(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0xc,%eax
movsd  0xe40(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0xd,%eax
movsd  0xe35(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0xe,%eax
movsd  0xe2a(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0xf,%eax
movsd  0xe1f(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
mov    $0x10,%eax
movsd  0xe14(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1289 <rssi_to_heat+0x189>
movss  0xd8a(%rip),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
mov    $0x12,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @rssi_to_heat(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, -1.020000e+02
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %108
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp olt double %9, 0xC058E51EB851EB85
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %108
12: ; preds = %7
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fcmp olt double %14, -9.717000e+01
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 2, i32* %2
br label %108
17: ; preds = %12
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = fcmp olt double %19, -9.476000e+01
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 3, i32* %2
br label %108
22: ; preds = %17
%23 = load float, float* %3
%24 = fpext float %23 to double
%25 = fcmp olt double %24, 0xC057166666666666
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 4, i32* %2
br label %108
27: ; preds = %22
%28 = load float, float* %3
%29 = fpext float %28 to double
%30 = fcmp olt double %29, 0xC0567C28F5C28F5C
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 5, i32* %2
br label %108
32: ; preds = %27
%33 = load float, float* %3
%34 = fpext float %33 to double
%35 = fcmp olt double %34, 0xC055E147AE147AE1
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 6, i32* %2
br label %108
37: ; preds = %32
%38 = load float, float* %3
%39 = fpext float %38 to double
%40 = fcmp olt double %39, 0xC055470A3D70A3D7
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 7, i32* %2
br label %108
42: ; preds = %37
%43 = load float, float* %3
%44 = fpext float %43 to double
%45 = fcmp olt double %44, -8.270000e+01
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 8, i32* %2
br label %108
47: ; preds = %42
%48 = load float, float* %3
%49 = fpext float %48 to double
%50 = fcmp olt double %49, -8.029000e+01
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 9, i32* %2
br label %108
52: ; preds = %47
%53 = load float, float* %3
%54 = fpext float %53 to double
%55 = fcmp olt double %54, 0xC0537851EB851EB8
br i1 %55, label %56, label %57
56: ; preds = %52
store i32 10, i32* %2
br label %108
57: ; preds = %52
%58 = load float, float* %3
%59 = fpext float %58 to double
%60 = fcmp olt double %59, -7.547000e+01
br i1 %60, label %61, label %62
61: ; preds = %57
store i32 11, i32* %2
br label %108
62: ; preds = %57
%63 = load float, float* %3
%64 = fpext float %63 to double
%65 = fcmp olt double %64, -7.305000e+01
br i1 %65, label %66, label %67
66: ; preds = %62
store i32 12, i32* %2
br label %108
67: ; preds = %62
%68 = load float, float* %3
%69 = fpext float %68 to double
%70 = fcmp olt double %69, -7.064000e+01
br i1 %70, label %71, label %72
71: ; preds = %67
store i32 13, i32* %2
br label %108
72: ; preds = %67
%73 = load float, float* %3
%74 = fpext float %73 to double
%75 = fcmp olt double %74, -6.823000e+01
br i1 %75, label %76, label %77
76: ; preds = %72
store i32 14, i32* %2
br label %108
77: ; preds = %72
%78 = load float, float* %3
%79 = fpext float %78 to double
%80 = fcmp olt double %79, 0xC050747AE147AE14
br i1 %80, label %81, label %82
81: ; preds = %77
store i32 15, i32* %2
br label %108
82: ; preds = %77
%83 = load float, float* %3
%84 = fpext float %83 to double
%85 = fcmp olt double %84, -6.341000e+01
br i1 %85, label %86, label %87
86: ; preds = %82
store i32 16, i32* %2
br label %108
87: ; preds = %82
br label %88
88: ; preds = %87
br label %89
89: ; preds = %88
br label %90
90: ; preds = %89
br label %91
91: ; preds = %90
br label %92
92: ; preds = %91
br label %93
93: ; preds = %92
br label %94
94: ; preds = %93
br label %95
95: ; preds = %94
br label %96
96: ; preds = %95
br label %97
97: ; preds = %96
br label %98
98: ; preds = %97
br label %99
99: ; preds = %98
br label %100
100: ; preds = %99
br label %101
101: ; preds = %100
br label %102
102: ; preds = %101
br label %103
103: ; preds = %102
%104 = load float, float* %3
%105 = fcmp olt float %104, -6.100000e+01
br i1 %105, label %106, label %107
106: ; preds = %103
store i32 17, i32* %2
br label %108
107: ; preds = %103
store i32 18, i32* %2
br label %108
108: ; preds = %107, %106, %86, %81, %76, %71, %66, %61, %56, %51, %46, %41, %36, %31, %26, %21, %16, %11, %6
%109 = load i32, i32* %2
ret i32 %109
}

LLVM IR (-O2):
define i32 @rssi_to_heat(float %0) {
%2 = fcmp olt float %0, -1.020000e+02
br i1 %2, label %39, label %3
3: ; preds = %1
%4 = fpext float %0 to double
%5 = fcmp olt double %4, 0xC058E51EB851EB85
br i1 %5, label %39, label %6
6: ; preds = %3
%7 = fcmp olt double %4, -9.717000e+01
br i1 %7, label %39, label %8
8: ; preds = %6
%9 = fcmp olt double %4, -9.476000e+01
br i1 %9, label %39, label %10
10: ; preds = %8
%11 = fcmp olt double %4, 0xC057166666666666
br i1 %11, label %39, label %12
12: ; preds = %10
%13 = fcmp olt double %4, 0xC0567C28F5C28F5C
br i1 %13, label %39, label %14
14: ; preds = %12
%15 = fcmp olt double %4, 0xC055E147AE147AE1
br i1 %15, label %39, label %16
16: ; preds = %14
%17 = fcmp olt double %4, 0xC055470A3D70A3D7
br i1 %17, label %39, label %18
18: ; preds = %16
%19 = fcmp olt double %4, -8.270000e+01
br i1 %19, label %39, label %20
20: ; preds = %18
%21 = fcmp olt double %4, -8.029000e+01
br i1 %21, label %39, label %22
22: ; preds = %20
%23 = fcmp olt double %4, 0xC0537851EB851EB8
br i1 %23, label %39, label %24
24: ; preds = %22
%25 = fcmp olt double %4, -7.547000e+01
br i1 %25, label %39, label %26
26: ; preds = %24
%27 = fcmp olt double %4, -7.305000e+01
br i1 %27, label %39, label %28
28: ; preds = %26
%29 = fcmp olt double %4, -7.064000e+01
br i1 %29, label %39, label %30
30: ; preds = %28
%31 = fcmp olt double %4, -6.823000e+01
br i1 %31, label %39, label %32
32: ; preds = %30
%33 = fcmp olt double %4, 0xC050747AE147AE14
br i1 %33, label %39, label %34
34: ; preds = %32
%35 = fcmp olt double %4, -6.341000e+01
br i1 %35, label %39, label %36
36: ; preds = %34
%37 = fcmp olt float %0, -6.100000e+01
%38 = select i1 %37, i32 17, i32 18
br label %39
39: ; preds = %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %3, %1
%40 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 2, %6 ], [ 3, %8 ], [ 4, %10 ], [ 5, %12 ], [ 6, %14 ], [ 7, %16 ], [ 8, %18 ], [ 9, %20 ], [ 10, %22 ], [ 11, %24 ], [ 12, %26 ], [ 13, %28 ], [ 14, %30 ], [ 15, %32 ], [ 16, %34 ], [ %38, %36 ]
ret i32 %40
}