#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double atan(float);
float toolame_freq2bark(float freq) {
  if (freq < 0)
    freq = 0;
  freq = freq * 0.001;
  return 13.0 * atan(.76 * freq) + 3.5 * atan(freq * freq / (7.5 * 7.5));
}


x86 assembly (clang, -O0):
<toolame_freq2bark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <toolame_freq2bark+0x22>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <atan@plt>
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe87(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xe62(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe4e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toolame_freq2bark>:
sub    $0x18,%rsp
xorps  %xmm1,%xmm1
maxss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
mulsd  0xec8(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <atan@plt>
movsd  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
divss  0xebf(%rip),%xmm0
call   1030 <atan@plt>
mulsd  0xea2(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xe9c(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @toolame_freq2bark(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
store float 0.000000e+00, float* %2
br label %6
6: ; preds = %5, %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double %8, 1.000000e-03
%10 = fptrunc double %9 to float
store float %10, float* %2
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fmul double 7.600000e-01, %12
%14 = fptrunc double %13 to float
%15 = call double @atan(float %14)
%16 = load float, float* %2
%17 = load float, float* %2
%18 = fmul float %16, %17
%19 = fpext float %18 to double
%20 = fdiv double %19, 5.625000e+01
%21 = fptrunc double %20 to float
%22 = call double @atan(float %21)
%23 = fmul double 3.500000e+00, %22
%24 = call double @llvm.fmuladd.f64(double 1.300000e+01, double %15, double %23)
%25 = fptrunc double %24 to float
ret float %25
}

LLVM IR (-O2):
define float @toolame_freq2bark(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = select i1 %2, float 0.000000e+00, float %0
%4 = fpext float %3 to double
%5 = fmul double %4, 1.000000e-03
%6 = fptrunc double %5 to float
%7 = fpext float %6 to double
%8 = fmul double %7, 7.600000e-01
%9 = fptrunc double %8 to float
%10 = tail call double @atan(float %9)
%11 = fmul float %6, %6
%12 = fdiv float %11, 5.625000e+01
%13 = tail call double @atan(float %12)
%14 = fmul double %13, 3.500000e+00
%15 = tail call double @llvm.fmuladd.f64(double %10, double 1.300000e+01, double %14)
%16 = fptrunc double %15 to float
ret float %16
}