float DBtoMM(float db) {
  float mm;
  if (db >= 10.) {
    mm = 0.;
  } else if (db > -10.) {
    mm = -12. / 5. * (db - 10.);
  } else if (db > -40.) {
    mm = 48. - 12. / 10. * (db + 10.);
  } else if (db > -60.) {
    mm = 84. - 12. / 20. * (db + 40.);
  } else if (db > -200.) {
    mm = 96. - 1. / 35. * (db + 60.);
  } else
    mm = 100.;
  mm = 100. - mm;
  return mm;
}


x86 assembly (clang, -O0):
<DBtoMM>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1131 <DBtoMM+0x31>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    129e <DBtoMM+0x19e>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117b <DBtoMM+0x7b>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeff(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1299 <DBtoMM+0x199>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe84(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11d1 <DBtoMM+0xd1>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe59(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1294 <DBtoMM+0x194>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe36(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1227 <DBtoMM+0x127>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe53(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe37(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe33(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    128f <DBtoMM+0x18f>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    127d <DBtoMM+0x17d>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xdc9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    128a <DBtoMM+0x18a>
movss  0xdf3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    128f <DBtoMM+0x18f>
jmp    1294 <DBtoMM+0x194>
jmp    1299 <DBtoMM+0x199>
jmp    129e <DBtoMM+0x19e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdc1(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DBtoMM>:
xorps  %xmm1,%xmm1
ucomiss 0xef6(%rip),%xmm0
jae    119d <DBtoMM+0x9d>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomiss 0xee6(%rip),%xmm0
jbe    1132 <DBtoMM+0x32>
addsd  0xf38(%rip),%xmm1
mulsd  0xf38(%rip),%xmm1
jmp    1199 <DBtoMM+0x99>
ucomiss 0xecf(%rip),%xmm0
jbe    1155 <DBtoMM+0x55>
addsd  0xf05(%rip),%xmm1
mulsd  0xf05(%rip),%xmm1
addsd  0xf05(%rip),%xmm1
jmp    1199 <DBtoMM+0x99>
ucomiss 0xeb0(%rip),%xmm0
jbe    1178 <DBtoMM+0x78>
addsd  0xeca(%rip),%xmm1
mulsd  0xeca(%rip),%xmm1
addsd  0xeca(%rip),%xmm1
jmp    1199 <DBtoMM+0x99>
ucomiss 0xe95(%rip),%xmm0
jbe    11aa <DBtoMM+0xaa>
addsd  0xe8f(%rip),%xmm1
mulsd  0xe8f(%rip),%xmm1
addsd  0xe8f(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
movss  0xe6b(%rip),%xmm0
subss  %xmm1,%xmm0
ret
movss  0xe5e(%rip),%xmm1
jmp    119d <DBtoMM+0x9d>

LLVM IR (-O0):
define float @DBtoMM(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp oge double %5, 1.000000e+01
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %3
br label %53
8: ; preds = %1
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fcmp ogt double %10, -1.000000e+01
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = fsub double %14, 1.000000e+01
%16 = fmul double -2.400000e+00, %15
%17 = fptrunc double %16 to float
store float %17, float* %3
br label %52
18: ; preds = %8
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = fcmp ogt double %20, -4.000000e+01
br i1 %21, label %22, label %28
22: ; preds = %18
%23 = load float, float* %2
%24 = fpext float %23 to double
%25 = fadd double %24, 1.000000e+01
%26 = call double @llvm.fmuladd.f64(double -1.200000e+00, double %25, double 4.800000e+01)
%27 = fptrunc double %26 to float
store float %27, float* %3
br label %51
28: ; preds = %18
%29 = load float, float* %2
%30 = fpext float %29 to double
%31 = fcmp ogt double %30, -6.000000e+01
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = load float, float* %2
%34 = fpext float %33 to double
%35 = fadd double %34, 4.000000e+01
%36 = call double @llvm.fmuladd.f64(double -6.000000e-01, double %35, double 8.400000e+01)
%37 = fptrunc double %36 to float
store float %37, float* %3
br label %50
38: ; preds = %28
%39 = load float, float* %2
%40 = fpext float %39 to double
%41 = fcmp ogt double %40, -2.000000e+02
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load float, float* %2
%44 = fpext float %43 to double
%45 = fadd double %44, 6.000000e+01
%46 = call double @llvm.fmuladd.f64(double 0xBF9D41D41D41D41D, double %45, double 9.600000e+01)
%47 = fptrunc double %46 to float
store float %47, float* %3
br label %49
48: ; preds = %38
store float 1.000000e+02, float* %3
br label %49
49: ; preds = %48, %42
br label %50
50: ; preds = %49, %32
br label %51
51: ; preds = %50, %22
br label %52
52: ; preds = %51, %12
br label %53
53: ; preds = %52, %7
%54 = load float, float* %3
%55 = fpext float %54 to double
%56 = fsub double 1.000000e+02, %55
%57 = fptrunc double %56 to float
store float %57, float* %3
%58 = load float, float* %3
ret float %58
}

LLVM IR (-O2):
define float @DBtoMM(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ult float %0, 1.000000e+01
br i1 %3, label %4, label %28
4: ; preds = %1
%5 = fcmp ogt float %0, -1.000000e+01
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = fadd double %2, -1.000000e+01
%8 = fmul double %7, -2.400000e+00
%9 = fptrunc double %8 to float
br label %28
10: ; preds = %4
%11 = fcmp ogt float %0, -4.000000e+01
br i1 %11, label %12, label %16
12: ; preds = %10
%13 = fadd double %2, 1.000000e+01
%14 = tail call double @llvm.fmuladd.f64(double %13, double -1.200000e+00, double 4.800000e+01)
%15 = fptrunc double %14 to float
br label %28
16: ; preds = %10
%17 = fcmp ogt float %0, -6.000000e+01
br i1 %17, label %18, label %22
18: ; preds = %16
%19 = fadd double %2, 4.000000e+01
%20 = tail call double @llvm.fmuladd.f64(double %19, double -6.000000e-01, double 8.400000e+01)
%21 = fptrunc double %20 to float
br label %28
22: ; preds = %16
%23 = fcmp ogt float %0, -2.000000e+02
br i1 %23, label %24, label %28
24: ; preds = %22
%25 = fadd double %2, 6.000000e+01
%26 = tail call double @llvm.fmuladd.f64(double %25, double 0xBF9D41D41D41D41D, double 9.600000e+01)
%27 = fptrunc double %26 to float
br label %28
28: ; preds = %22, %1, %6, %18, %24, %12
%29 = phi float [ %9, %6 ], [ %15, %12 ], [ %21, %18 ], [ %27, %24 ], [ 0.000000e+00, %1 ], [ 1.000000e+02, %22 ]
%30 = fsub float 1.000000e+02, %29
ret float %30
}