float gp2y0a21ykGetCentimerDistanceForTension(float milliVolt) {
  int valueToCompare = milliVolt;
  if (valueToCompare > 0x300) {
    return 300;
  } else if (valueToCompare > 0x200) {
    return 10;
  } else if (valueToCompare > 0x190) {
    return 15;
  } else if (valueToCompare > 0x180) {
    return 20;
  } else if (valueToCompare > 0x167) {
    return 30;
  } else if (valueToCompare > 0x140) {
    return 40;
  } else if (valueToCompare > 0x100) {
    return 50;
  } else if (valueToCompare > 0x090) {
    return 60;
  } else if (valueToCompare > 0x080) {
    return 70;
  } else if (valueToCompare > 0x070) {
    return 80;
  }
  return 300;
}


x86 assembly (clang, -O0):
<gp2y0a21ykGetCentimerDistanceForTension>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x300,-0xc(%rbp)
jle    1130 <gp2y0a21ykGetCentimerDistanceForTension+0x30>
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x200,-0xc(%rbp)
jle    114f <gp2y0a21ykGetCentimerDistanceForTension+0x4f>
movss  0xedf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x190,-0xc(%rbp)
jle    116e <gp2y0a21ykGetCentimerDistanceForTension+0x6e>
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x180,-0xc(%rbp)
jle    118d <gp2y0a21ykGetCentimerDistanceForTension+0x8d>
movss  0xe99(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x167,-0xc(%rbp)
jle    11ac <gp2y0a21ykGetCentimerDistanceForTension+0xac>
movss  0xe76(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x140,-0xc(%rbp)
jle    11cb <gp2y0a21ykGetCentimerDistanceForTension+0xcb>
movss  0xe53(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x100,-0xc(%rbp)
jle    11ea <gp2y0a21ykGetCentimerDistanceForTension+0xea>
movss  0xe30(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x90,-0xc(%rbp)
jle    1209 <gp2y0a21ykGetCentimerDistanceForTension+0x109>
movss  0xe0d(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x80,-0xc(%rbp)
jle    1228 <gp2y0a21ykGetCentimerDistanceForTension+0x128>
movss  0xdea(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
cmpl   $0x70,-0xc(%rbp)
jle    1244 <gp2y0a21ykGetCentimerDistanceForTension+0x144>
movss  0xdca(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <gp2y0a21ykGetCentimerDistanceForTension+0x17e>
jmp    1249 <gp2y0a21ykGetCentimerDistanceForTension+0x149>
jmp    124e <gp2y0a21ykGetCentimerDistanceForTension+0x14e>
jmp    1253 <gp2y0a21ykGetCentimerDistanceForTension+0x153>
jmp    1258 <gp2y0a21ykGetCentimerDistanceForTension+0x158>
jmp    125d <gp2y0a21ykGetCentimerDistanceForTension+0x15d>
jmp    1262 <gp2y0a21ykGetCentimerDistanceForTension+0x162>
jmp    1267 <gp2y0a21ykGetCentimerDistanceForTension+0x167>
jmp    126c <gp2y0a21ykGetCentimerDistanceForTension+0x16c>
jmp    1271 <gp2y0a21ykGetCentimerDistanceForTension+0x171>
movss  0xd87(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp2y0a21ykGetCentimerDistanceForTension>:
cvttss2si %xmm0,%eax
cmp    $0x300,%eax
jle    1114 <gp2y0a21ykGetCentimerDistanceForTension+0x14>
movss  0xeed(%rip),%xmm0
ret
cmp    $0x200,%eax
jle    1124 <gp2y0a21ykGetCentimerDistanceForTension+0x24>
movss  0xee1(%rip),%xmm0
ret
cmp    $0x190,%eax
jle    1134 <gp2y0a21ykGetCentimerDistanceForTension+0x34>
movss  0xed5(%rip),%xmm0
ret
cmp    $0x180,%eax
jle    1144 <gp2y0a21ykGetCentimerDistanceForTension+0x44>
movss  0xec9(%rip),%xmm0
ret
cmp    $0x167,%eax
jle    1154 <gp2y0a21ykGetCentimerDistanceForTension+0x54>
movss  0xebd(%rip),%xmm0
ret
cmp    $0x140,%eax
jle    1164 <gp2y0a21ykGetCentimerDistanceForTension+0x64>
movss  0xeb1(%rip),%xmm0
ret
cmp    $0x100,%eax
jle    1174 <gp2y0a21ykGetCentimerDistanceForTension+0x74>
movss  0xea5(%rip),%xmm0
ret
cmp    $0x90,%eax
jle    1184 <gp2y0a21ykGetCentimerDistanceForTension+0x84>
movss  0xe99(%rip),%xmm0
ret
cmp    $0x80,%eax
jle    1194 <gp2y0a21ykGetCentimerDistanceForTension+0x94>
movss  0xe8d(%rip),%xmm0
ret
xor    %ecx,%ecx
cmp    $0x71,%eax
setge  %cl
lea    0xe81(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
ret

LLVM IR (-O0):
define float @gp2y0a21ykGetCentimerDistanceForTension(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = fptosi float %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 768
br i1 %8, label %9, label %10
9: ; preds = %1
store float 3.000000e+02, float* %2
br label %56
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 512
br i1 %12, label %13, label %14
13: ; preds = %10
store float 1.000000e+01, float* %2
br label %56
14: ; preds = %10
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 400
br i1 %16, label %17, label %18
17: ; preds = %14
store float 1.500000e+01, float* %2
br label %56
18: ; preds = %14
%19 = load i32, i32* %4
%20 = icmp sgt i32 %19, 384
br i1 %20, label %21, label %22
21: ; preds = %18
store float 2.000000e+01, float* %2
br label %56
22: ; preds = %18
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 359
br i1 %24, label %25, label %26
25: ; preds = %22
store float 3.000000e+01, float* %2
br label %56
26: ; preds = %22
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 320
br i1 %28, label %29, label %30
29: ; preds = %26
store float 4.000000e+01, float* %2
br label %56
30: ; preds = %26
%31 = load i32, i32* %4
%32 = icmp sgt i32 %31, 256
br i1 %32, label %33, label %34
33: ; preds = %30
store float 5.000000e+01, float* %2
br label %56
34: ; preds = %30
%35 = load i32, i32* %4
%36 = icmp sgt i32 %35, 144
br i1 %36, label %37, label %38
37: ; preds = %34
store float 6.000000e+01, float* %2
br label %56
38: ; preds = %34
%39 = load i32, i32* %4
%40 = icmp sgt i32 %39, 128
br i1 %40, label %41, label %42
41: ; preds = %38
store float 7.000000e+01, float* %2
br label %56
42: ; preds = %38
%43 = load i32, i32* %4
%44 = icmp sgt i32 %43, 112
br i1 %44, label %45, label %46
45: ; preds = %42
store float 8.000000e+01, float* %2
br label %56
46: ; preds = %42
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
br label %50
50: ; preds = %49
br label %51
51: ; preds = %50
br label %52
52: ; preds = %51
br label %53
53: ; preds = %52
br label %54
54: ; preds = %53
br label %55
55: ; preds = %54
store float 3.000000e+02, float* %2
br label %56
56: ; preds = %55, %45, %41, %37, %33, %29, %25, %21, %17, %13, %9
%57 = load float, float* %2
ret float %57
}

LLVM IR (-O2):
define float @gp2y0a21ykGetCentimerDistanceForTension(float %0) {
%2 = fptosi float %0 to i32
%3 = icmp sgt i32 %2, 768
br i1 %3, label %23, label %4
4: ; preds = %1
%5 = icmp sgt i32 %2, 512
br i1 %5, label %23, label %6
6: ; preds = %4
%7 = icmp sgt i32 %2, 400
br i1 %7, label %23, label %8
8: ; preds = %6
%9 = icmp sgt i32 %2, 384
br i1 %9, label %23, label %10
10: ; preds = %8
%11 = icmp sgt i32 %2, 359
br i1 %11, label %23, label %12
12: ; preds = %10
%13 = icmp sgt i32 %2, 320
br i1 %13, label %23, label %14
14: ; preds = %12
%15 = icmp sgt i32 %2, 256
br i1 %15, label %23, label %16
16: ; preds = %14
%17 = icmp sgt i32 %2, 144
br i1 %17, label %23, label %18
18: ; preds = %16
%19 = icmp sgt i32 %2, 128
br i1 %19, label %23, label %20
20: ; preds = %18
%21 = icmp sgt i32 %2, 112
%22 = select i1 %21, float 8.000000e+01, float 3.000000e+02
br label %23
23: ; preds = %20, %18, %16, %14, %12, %10, %8, %6, %4, %1
%24 = phi float [ 3.000000e+02, %1 ], [ 1.000000e+01, %4 ], [ 1.500000e+01, %6 ], [ 2.000000e+01, %8 ], [ 3.000000e+01, %10 ], [ 4.000000e+01, %12 ], [ 5.000000e+01, %14 ], [ 6.000000e+01, %16 ], [ 7.000000e+01, %18 ], [ %22, %20 ]
ret float %24
}