#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(int);
float log(float);
float hz2mel(float hz) {
  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 (hz < brkfrq) {
    z = (hz - f_0) / f_sp;
  } else {
    z = brkpt + ((log(hz / brkfrq)) / log(logstep));
  }
  return z;
}


x86 assembly (clang, -O0):
<hz2mel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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
cvttss2si %xmm0,%edi
call   1030 <exp@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11b6 <hz2mel+0x96>
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11f8 <hz2mel+0xd8>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1040 <log@plt>
movss  -0x24(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x20(%rbp),%xmm0
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hz2mel>:
push   %rax
movss  %xmm0,(%rsp)
xor    %edi,%edi
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movss  0xec8(%rip),%xmm0
movss  (%rsp),%xmm2
ucomiss %xmm2,%xmm0
movaps %xmm2,%xmm0
jbe    114f <hz2mel+0x2f>
divss  0xebb(%rip),%xmm0
pop    %rax
ret
divss  0xea9(%rip),%xmm0
movss  %xmm1,0x4(%rsp)
call   1040 <log@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
call   1040 <log@plt>
movss  (%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
addss  0xe7e(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @hz2mel(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 = fptosi float %15 to i32
%17 = call float @exp(i32 %16)
store float %17, float* %8
%18 = load float, float* %2
%19 = load float, float* %5
%20 = fcmp olt float %18, %19
br i1 %20, label %21, label %27
21: ; preds = %1
%22 = load float, float* %2
%23 = load float, float* %3
%24 = fsub float %22, %23
%25 = load float, float* %4
%26 = fdiv float %24, %25
store float %26, float* %7
br label %37
27: ; preds = %1
%28 = load float, float* %6
%29 = load float, float* %2
%30 = load float, float* %5
%31 = fdiv float %29, %30
%32 = call float @log(float %31)
%33 = load float, float* %8
%34 = call float @log(float %33)
%35 = fdiv float %32, %34
%36 = fadd float %28, %35
store float %36, float* %7
br label %37
37: ; preds = %27, %21
%38 = load float, float* %7
ret float %38
}

LLVM IR (-O2):
define float @hz2mel(float %0) {
%2 = tail call float @exp(i32 0)
%3 = fcmp olt float %0, 1.000000e+03
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = fdiv float %0, 6.600000e+01
br label %12
6: ; preds = %1
%7 = fdiv float %0, 1.000000e+03
%8 = tail call float @log(float %7)
%9 = tail call float @log(float %2)
%10 = fdiv float %8, %9
%11 = fadd float %10, 0x402E4D9360000000
br label %12
12: ; preds = %6, %4
%13 = phi float [ %5, %4 ], [ %11, %6 ]
ret float %13
}