#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 pow(double, double);
double GetCenterFrequency(unsigned int filterBand) {
  double centerFrequency = 0.0f;
  double exponent;
  if (filterBand == 0) {
    centerFrequency = 0;
  } else if (filterBand >= 1 && filterBand <= 14) {
    centerFrequency = (200.0f * filterBand) / 3.0f;
  } else {
    exponent = filterBand - 14.0f;
    centerFrequency = pow(1.0711703, exponent);
    centerFrequency *= 1073.4;
  }
  return centerFrequency;
}


x86 assembly (clang, -O0):
<GetCenterFrequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <GetCenterFrequency+0x2a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11c7 <GetCenterFrequency+0xb7>
cmpl   $0x1,-0x4(%rbp)
jb     117c <GetCenterFrequency+0x6c>
cmpl   $0xe,-0x4(%rbp)
ja     117c <GetCenterFrequency+0x6c>
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm1
movss  0xeba(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  0xeaa(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11c2 <GetCenterFrequency+0xb2>
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xe84(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xe62(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xe48(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11c7 <GetCenterFrequency+0xb7>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCenterFrequency>:
push   %rax
test   %edi,%edi
je     1137 <GetCenterFrequency+0x27>
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
cmp    $0xe,%edi
ja     113c <GetCenterFrequency+0x2c>
mulss  0xedb(%rip),%xmm0
divss  0xed7(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rax
ret
xorps  %xmm0,%xmm0
pop    %rax
ret
addss  0xebc(%rip),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
call   1030 <pow@plt>
mulsd  0xebb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @GetCenterFrequency(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %3
br label %30
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp uge i32 %9, 1
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp ule i32 %12, 14
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %2
%16 = uitofp i32 %15 to float
%17 = fmul float 2.000000e+02, %16
%18 = fdiv float %17, 3.000000e+00
%19 = fpext float %18 to double
store double %19, double* %3
br label %29
20: ; preds = %11, %8
%21 = load i32, i32* %2
%22 = uitofp i32 %21 to float
%23 = fsub float %22, 1.400000e+01
%24 = fpext float %23 to double
store double %24, double* %4
%25 = load double, double* %4
%26 = call double @pow(double 0x3FF1238377EF24E6, double %25)
store double %26, double* %3
%27 = load double, double* %3
%28 = fmul double %27, 1.073400e+03
store double %28, double* %3
br label %29
29: ; preds = %20, %14
br label %30
30: ; preds = %29, %7
%31 = load double, double* %3
ret double %31
}

LLVM IR (-O2):
define double @GetCenterFrequency(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 15
%5 = uitofp i32 %0 to float
br i1 %4, label %6, label %10
6: ; preds = %3
%7 = fmul float %5, 2.000000e+02
%8 = fdiv float %7, 3.000000e+00
%9 = fpext float %8 to double
br label %15
10: ; preds = %3
%11 = fadd float %5, -1.400000e+01
%12 = fpext float %11 to double
%13 = tail call double @pow(double 0x3FF1238377EF24E6, double %12)
%14 = fmul double %13, 1.073400e+03
br label %15
15: ; preds = %1, %6, %10
%16 = phi double [ %9, %6 ], [ %14, %10 ], [ 0.000000e+00, %1 ]
ret double %16
}