float IEC_dB(float fScale) {
  float dB = 0.0f;
  if (fScale < 0.025f)
    dB = (fScale / 0.0025f) - 70.0f;
  else if (fScale < 0.075f)
    dB = (fScale - 0.025f) / 0.005f - 60.0f;
  else if (fScale < 0.15f)
    dB = (fScale - 0.075f) / 0.0075f - 50.0f;
  else if (fScale < 0.3f)
    dB = (fScale - 0.15f) / 0.015f - 40.0f;
  else if (fScale < 0.5f)
    dB = (fScale - 0.3f) / 0.02f - 30.0f;
  else
    dB = (fScale - 0.5f) / 0.025f - 20.0f;
  return (dB > -0.001f && dB < 0.001f ? 0.0f : dB);
}


x86 assembly (clang, -O0):
<IEC_dB>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee7(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    114a <IEC_dB+0x4a>
movss  -0x4(%rbp),%xmm0
movss  0xf0c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xefc(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    12a0 <IEC_dB+0x1a0>
movss  0xeb2(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    118f <IEC_dB+0x8f>
movss  -0x4(%rbp),%xmm0
movss  0xe97(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xebf(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xeaf(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    129b <IEC_dB+0x19b>
movss  0xe71(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    11d4 <IEC_dB+0xd4>
movss  -0x4(%rbp),%xmm0
movss  0xe56(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe72(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe62(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1296 <IEC_dB+0x196>
movss  0xe30(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1219 <IEC_dB+0x119>
movss  -0x4(%rbp),%xmm0
movss  0xe15(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe25(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe15(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1291 <IEC_dB+0x191>
movss  0xdef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    125e <IEC_dB+0x15e>
movss  -0x4(%rbp),%xmm0
movss  0xdd4(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xdd8(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xdc8(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    128c <IEC_dB+0x18c>
movss  -0x4(%rbp),%xmm0
movss  0xda5(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xd89(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xd91(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1291 <IEC_dB+0x191>
jmp    1296 <IEC_dB+0x196>
jmp    129b <IEC_dB+0x19b>
jmp    12a0 <IEC_dB+0x1a0>
movss  -0x8(%rbp),%xmm0
movss  0xd93(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    12d5 <IEC_dB+0x1d5>
movss  0xd86(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    12d5 <IEC_dB+0x1d5>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    12df <IEC_dB+0x1df>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<IEC_dB>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1122 <IEC_dB+0x22>
divss  0xf37(%rip),%xmm0
addss  0xf33(%rip),%xmm0
jmp    11d9 <IEC_dB+0xd9>
movss  0xeda(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    114c <IEC_dB+0x4c>
addss  0xf09(%rip),%xmm0
divss  0xf05(%rip),%xmm0
addss  0xf01(%rip),%xmm0
jmp    11d9 <IEC_dB+0xd9>
movss  0xeb4(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1173 <IEC_dB+0x73>
addss  0xed3(%rip),%xmm0
divss  0xecf(%rip),%xmm0
addss  0xecb(%rip),%xmm0
jmp    11d9 <IEC_dB+0xd9>
movss  0xe91(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    119a <IEC_dB+0x9a>
addss  0xea0(%rip),%xmm0
divss  0xe9c(%rip),%xmm0
addss  0xe98(%rip),%xmm0
jmp    11d9 <IEC_dB+0xd9>
movss  0xe6e(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11c1 <IEC_dB+0xc1>
addss  0xe6d(%rip),%xmm0
divss  0xe69(%rip),%xmm0
addss  0xe65(%rip),%xmm0
jmp    11d9 <IEC_dB+0xd9>
addss  0xe4b(%rip),%xmm0
divss  0xe2f(%rip),%xmm0
addss  0xe3f(%rip),%xmm0
movss  0xe73(%rip),%xmm1
cmpltss %xmm0,%xmm1
movaps %xmm0,%xmm2
cmpltss 0xe66(%rip),%xmm2
andnps %xmm0,%xmm2
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @IEC_dB(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fcmp olt float %4, 0x3F999999A0000000
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %2
%8 = fdiv float %7, 0x3F647AE140000000
%9 = fsub float %8, 7.000000e+01
store float %9, float* %3
br label %51
10: ; preds = %1
%11 = load float, float* %2
%12 = fcmp olt float %11, 0x3FB3333340000000
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load float, float* %2
%15 = fsub float %14, 0x3F999999A0000000
%16 = fdiv float %15, 0x3F747AE140000000
%17 = fsub float %16, 6.000000e+01
store float %17, float* %3
br label %50
18: ; preds = %10
%19 = load float, float* %2
%20 = fcmp olt float %19, 0x3FC3333340000000
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load float, float* %2
%23 = fsub float %22, 0x3FB3333340000000
%24 = fdiv float %23, 0x3F7EB851E0000000
%25 = fsub float %24, 5.000000e+01
store float %25, float* %3
br label %49
26: ; preds = %18
%27 = load float, float* %2
%28 = fcmp olt float %27, 0x3FD3333340000000
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load float, float* %2
%31 = fsub float %30, 0x3FC3333340000000
%32 = fdiv float %31, 0x3F8EB851E0000000
%33 = fsub float %32, 4.000000e+01
store float %33, float* %3
br label %48
34: ; preds = %26
%35 = load float, float* %2
%36 = fcmp olt float %35, 5.000000e-01
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load float, float* %2
%39 = fsub float %38, 0x3FD3333340000000
%40 = fdiv float %39, 0x3F947AE140000000
%41 = fsub float %40, 3.000000e+01
store float %41, float* %3
br label %47
42: ; preds = %34
%43 = load float, float* %2
%44 = fsub float %43, 5.000000e-01
%45 = fdiv float %44, 0x3F999999A0000000
%46 = fsub float %45, 2.000000e+01
store float %46, float* %3
br label %47
47: ; preds = %42, %37
br label %48
48: ; preds = %47, %29
br label %49
49: ; preds = %48, %21
br label %50
50: ; preds = %49, %13
br label %51
51: ; preds = %50, %6
%52 = load float, float* %3
%53 = fcmp ogt float %52, 0xBF50624DE0000000
br i1 %53, label %54, label %58
54: ; preds = %51
%55 = load float, float* %3
%56 = fcmp olt float %55, 0x3F50624DE0000000
br i1 %56, label %57, label %58
57: ; preds = %54
br label %60
58: ; preds = %54, %51
%59 = load float, float* %3
br label %60
60: ; preds = %58, %57
%61 = phi float [ 0.000000e+00, %57 ], [ %59, %58 ]
ret float %61
}

LLVM IR (-O2):
define float @IEC_dB(float %0) {
%2 = fcmp olt float %0, 0x3F999999A0000000
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fdiv float %0, 0x3F647AE140000000
%5 = fadd float %4, -7.000000e+01
br label %34
6: ; preds = %1
%7 = fcmp olt float %0, 0x3FB3333340000000
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = fadd float %0, 0xBF999999A0000000
%10 = fdiv float %9, 0x3F747AE140000000
%11 = fadd float %10, -6.000000e+01
br label %34
12: ; preds = %6
%13 = fcmp olt float %0, 0x3FC3333340000000
br i1 %13, label %14, label %18
14: ; preds = %12
%15 = fadd float %0, 0xBFB3333340000000
%16 = fdiv float %15, 0x3F7EB851E0000000
%17 = fadd float %16, -5.000000e+01
br label %34
18: ; preds = %12
%19 = fcmp olt float %0, 0x3FD3333340000000
br i1 %19, label %20, label %24
20: ; preds = %18
%21 = fadd float %0, 0xBFC3333340000000
%22 = fdiv float %21, 0x3F8EB851E0000000
%23 = fadd float %22, -4.000000e+01
br label %34
24: ; preds = %18
%25 = fcmp olt float %0, 5.000000e-01
br i1 %25, label %26, label %30
26: ; preds = %24
%27 = fadd float %0, 0xBFD3333340000000
%28 = fdiv float %27, 0x3F947AE140000000
%29 = fadd float %28, -3.000000e+01
br label %34
30: ; preds = %24
%31 = fadd float %0, -5.000000e-01
%32 = fdiv float %31, 0x3F999999A0000000
%33 = fadd float %32, -2.000000e+01
br label %34
34: ; preds = %8, %20, %30, %26, %14, %3
%35 = phi float [ %5, %3 ], [ %11, %8 ], [ %17, %14 ], [ %23, %20 ], [ %29, %26 ], [ %33, %30 ]
%36 = fcmp ogt float %35, 0xBF50624DE0000000
%37 = fcmp olt float %35, 0x3F50624DE0000000
%38 = and i1 %36, %37
%39 = select i1 %38, float 0.000000e+00, float %35
ret float %39
}