const float toBARK(const float f) {
  float z;
  z = ((26.81f * f) / (1960.0f + f)) - 0.53f;
  if (z < 2.0f) {
    z = z + 0.15f * (2.0f - z);
  } else if (z > 20.1f) {
    z = z + 0.22f * (z - 20.1f);
  }
  return z;
}


x86 assembly (clang, -O0):
<toBARK>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xefb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xed5(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec0(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1176 <toBARK+0x76>
movss  -0x8(%rbp),%xmm1
movss  0xea9(%rip),%xmm0
subss  -0x8(%rbp),%xmm0
movss  0xeb4(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11bc <toBARK+0xbc>
movss  -0x8(%rbp),%xmm0
movss  0xe8d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11b7 <toBARK+0xb7>
movss  -0x8(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movss  0xe72(%rip),%xmm2
subss  %xmm2,%xmm0
movss  0xe6a(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11bc <toBARK+0xbc>
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toBARK>:
movaps %xmm0,%xmm1
movss  0xef5(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  0xeed(%rip),%xmm1
divss  %xmm1,%xmm0
addss  0xee5(%rip),%xmm0
movss  0xee1(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    113e <toBARK+0x3e>
subss  %xmm0,%xmm1
mulss  0xee0(%rip),%xmm1
jmp    115b <toBARK+0x5b>
ucomiss 0xecb(%rip),%xmm0
jbe    1162 <toBARK+0x62>
movss  0xec5(%rip),%xmm1
addss  %xmm0,%xmm1
mulss  0xebd(%rip),%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @toBARK(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float 0x403ACF5C20000000, %4
%6 = load float, float* %2
%7 = fadd float 1.960000e+03, %6
%8 = fdiv float %5, %7
%9 = fsub float %8, 0x3FE0F5C280000000
store float %9, float* %3
%10 = load float, float* %3
%11 = fcmp olt float %10, 2.000000e+00
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load float, float* %3
%14 = load float, float* %3
%15 = fsub float 2.000000e+00, %14
%16 = call float @llvm.fmuladd.f32(float 0x3FC3333340000000, float %15, float %13)
store float %16, float* %3
br label %26
17: ; preds = %1
%18 = load float, float* %3
%19 = fcmp ogt float %18, 0x40341999A0000000
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load float, float* %3
%22 = load float, float* %3
%23 = fsub float %22, 0x40341999A0000000
%24 = call float @llvm.fmuladd.f32(float 0x3FCC28F5C0000000, float %23, float %21)
store float %24, float* %3
br label %25
25: ; preds = %20, %17
br label %26
26: ; preds = %25, %12
%27 = load float, float* %3
ret float %27
}

LLVM IR (-O2):
define float @toBARK(float %0) {
%2 = fmul float %0, 0x403ACF5C20000000
%3 = fadd float %0, 1.960000e+03
%4 = fdiv float %2, %3
%5 = fadd float %4, 0xBFE0F5C280000000
%6 = fcmp olt float %5, 2.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = fsub float 2.000000e+00, %5
%9 = tail call float @llvm.fmuladd.f32(float %8, float 0x3FC3333340000000, float %5)
br label %15
10: ; preds = %1
%11 = fcmp ogt float %5, 0x40341999A0000000
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = fadd float %5, 0xC0341999A0000000
%14 = tail call float @llvm.fmuladd.f32(float %13, float 0x3FCC28F5C0000000, float %5)
br label %15
15: ; preds = %10, %12, %7
%16 = phi float [ %9, %7 ], [ %14, %12 ], [ %5, %10 ]
ret float %16
}