#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 */
float exp(float);
float log(float);
float mel2hz(float mel) {
  float f_0 = 0;
  float f_sp = 200 / 3;
  float brkfrq = 1000;
  float brkpt = (brkfrq - f_0) / f_sp;
  float z;
  float logstep = exp(log(6.4) / 27);
  if (mel < brkpt) {
    z = f_0 + f_sp * mel;
  } else {
    z = brkfrq * exp(log(logstep) * (mel - brkpt));
  }
  return z;
}


x86 assembly (clang, -O0):
<mel2hz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xebe(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe99(%rip),%xmm0
call   1040 <log@plt>
movss  0xe88(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <exp@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ba <mel2hz+0x9a>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11f2 <mel2hz+0xd2>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1040 <log@plt>
movss  -0x4(%rbp),%xmm1
subss  -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mel2hz>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1132 <mel2hz+0x22>
mulss  0xeea(%rip),%xmm0
xorps  %xmm1,%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret
addss  0xeca(%rip),%xmm0
mulss  0xec6(%rip),%xmm0
call   1030 <exp@plt>
mulss  0xebd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mel2hz(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
store float 6.600000e+01, float* %4
store float 1.000000e+03, float* %5
%9 = load float, float* %5
%10 = load float, float* %3
%11 = fsub float %9, %10
%12 = load float, float* %4
%13 = fdiv float %11, %12
store float %13, float* %6
%14 = call float @log(float 0x40199999A0000000)
%15 = fdiv float %14, 2.700000e+01
%16 = call float @exp(float %15)
store float %16, float* %8
%17 = load float, float* %2
%18 = load float, float* %6
%19 = fcmp olt float %17, %18
br i1 %19, label %20, label %25
20: ; preds = %1
%21 = load float, float* %3
%22 = load float, float* %4
%23 = load float, float* %2
%24 = call float @llvm.fmuladd.f32(float %22, float %23, float %21)
store float %24, float* %7
br label %35
25: ; preds = %1
%26 = load float, float* %5
%27 = load float, float* %8
%28 = call float @log(float %27)
%29 = load float, float* %2
%30 = load float, float* %6
%31 = fsub float %29, %30
%32 = fmul float %28, %31
%33 = call float @exp(float %32)
%34 = fmul float %26, %33
store float %34, float* %7
br label %35
35: ; preds = %25, %20
%36 = load float, float* %7
ret float %36
}

LLVM IR (-O2):
define float @mel2hz(float %0) {
%2 = fcmp olt float %0, 0x402E4D9360000000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float 6.600000e+01, float 0.000000e+00)
br label %10
5: ; preds = %1
%6 = fadd float %0, 0xC02E4D9360000000
%7 = fmul float %6, 0x3FB199B820000000
%8 = tail call float @exp(float %7)
%9 = fmul float %8, 1.000000e+03
br label %10
10: ; preds = %5, %3
%11 = phi float [ %4, %3 ], [ %9, %5 ]
ret float %11
}