#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 FreqToMel(float const);
int /*<<< orphan*/ assert(int);
void CalculateCenterFrequencies(const int num_channels,
                                const float lower_frequency_limit,
                                const float upper_frequency_limit,
                                float *center_frequencies) {
  assert(lower_frequency_limit >= 0.0f);
  assert(upper_frequency_limit > lower_frequency_limit);
  const float mel_low = FreqToMel(lower_frequency_limit);
  const float mel_hi = FreqToMel(upper_frequency_limit);
  const float mel_span = mel_hi - mel_low;
  const float mel_spacing = mel_span / ((float)num_channels);
  int i;
  for (i = 0; i < num_channels; ++i) {
    center_frequencies[i] = mel_low + (mel_spacing * (i + 1));
  }
}


x86 assembly (clang, -O0):
<CalculateCenterFrequencies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movss  -0x8(%rbp),%xmm0
call   1030 <FreqToMel@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <FreqToMel@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11f1 <CalculateCenterFrequencies+0xd1>
movss  -0x1c(%rbp),%xmm1
movss  -0x28(%rbp),%xmm0
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ae <CalculateCenterFrequencies+0x8e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateCenterFrequencies>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x10(%rsp)
mov    %edi,%ebp
xorps  %xmm1,%xmm1
xor    %edi,%edi
ucomiss %xmm1,%xmm0
setae  %dil
call   1040 <assert@plt>
xor    %edi,%edi
movss  0xc(%rsp),%xmm0
ucomiss 0x10(%rsp),%xmm0
seta   %dil
call   1040 <assert@plt>
movss  0x10(%rsp),%xmm0
call   1030 <FreqToMel@plt>
movaps %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <FreqToMel@plt>
movaps 0x10(%rsp),%xmm10
test   %ebp,%ebp
jle    1261 <CalculateCenterFrequencies+0x141>
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
subss  %xmm10,%xmm0
divss  %xmm1,%xmm0
mov    %ebp,%eax
cmp    $0x8,%ebp
jae    11a5 <CalculateCenterFrequencies+0x85>
xor    %ecx,%ecx
jmp    1240 <CalculateCenterFrequencies+0x120>
mov    %eax,%ecx
and    $0xfffffff8,%ecx
movaps %xmm0,%xmm1
shufps $0x0,%xmm0,%xmm1
movaps %xmm10,%xmm2
shufps $0x0,%xmm10,%xmm2
lea    0x0(,%rax,4),%rdx
and    $0xffffffffffffffe0,%rdx
movaps 0xe33(%rip),%xmm3
movaps 0xe3c(%rip),%xmm5
xor    %esi,%esi
pcmpeqd %xmm8,%xmm8
movdqa 0xe3c(%rip),%xmm9
movdqa 0xe44(%rip),%xmm7
nopl   0x0(%rax)
movaps %xmm5,%xmm4
shufps $0x88,%xmm3,%xmm4
movaps %xmm4,%xmm6
psubd  %xmm8,%xmm6
paddd  %xmm9,%xmm4
cvtdq2ps %xmm6,%xmm6
cvtdq2ps %xmm4,%xmm4
mulps  %xmm1,%xmm6
addps  %xmm2,%xmm6
mulps  %xmm1,%xmm4
addps  %xmm2,%xmm4
movups %xmm6,(%rbx,%rsi,1)
movups %xmm4,0x10(%rbx,%rsi,1)
paddq  %xmm7,%xmm5
paddq  %xmm7,%xmm3
add    $0x20,%rsi
cmp    %rsi,%rdx
jne    11f0 <CalculateCenterFrequencies+0xd0>
cmp    %rax,%rcx
je     1261 <CalculateCenterFrequencies+0x141>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rcx),%rdx
xorps  %xmm1,%xmm1
cvtsi2ss %edx,%xmm1
mulss  %xmm0,%xmm1
addss  %xmm10,%xmm1
movss  %xmm1,(%rbx,%rcx,4)
mov    %rdx,%rcx
cmp    %rdx,%rax
jne    1240 <CalculateCenterFrequencies+0x120>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @CalculateCenterFrequencies(i32 %0, float %1, float %2, float* %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float*
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float %2, float* %7
store float* %3, float** %8
%14 = load float, float* %6
%15 = fcmp oge float %14, 0.000000e+00
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load float, float* %7
%19 = load float, float* %6
%20 = fcmp ogt float %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load float, float* %6
%24 = call float @FreqToMel(float %23)
store float %24, float* %9
%25 = load float, float* %7
%26 = call float @FreqToMel(float %25)
store float %26, float* %10
%27 = load float, float* %10
%28 = load float, float* %9
%29 = fsub float %27, %28
store float %29, float* %11
%30 = load float, float* %11
%31 = load i32, i32* %5
%32 = sitofp i32 %31 to float
%33 = fdiv float %30, %32
store float %33, float* %12
store i32 0, i32* %13
br label %34
34: ; preds = %49, %4
%35 = load i32, i32* %13
%36 = load i32, i32* %5
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %52
38: ; preds = %34
%39 = load float, float* %9
%40 = load float, float* %12
%41 = load i32, i32* %13
%42 = add nsw i32 %41, 1
%43 = sitofp i32 %42 to float
%44 = call float @llvm.fmuladd.f32(float %40, float %43, float %39)
%45 = load float*, float** %8
%46 = load i32, i32* %13
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds float, float* %45, i64 %47
store float %44, float* %48
br label %49
49: ; preds = %38
%50 = load i32, i32* %13
%51 = add nsw i32 %50, 1
store i32 %51, i32* %13
br label %34
52: ; preds = %34
ret void
}

LLVM IR (-O2):
define void @CalculateCenterFrequencies(i32 %0, float %1, float %2, float* nocapture writeonly %3) {
%5 = fcmp oge float %1, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = fcmp ogt float %2, %1
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call float @FreqToMel(float %1)
%12 = tail call float @FreqToMel(float %2)
%13 = fsub float %12, %11
%14 = sitofp i32 %0 to float
%15 = fdiv float %13, %14
%16 = icmp sgt i32 %0, 0
br i1 %16, label %17, label %60
17: ; preds = %4
%18 = zext i32 %0 to i64
%19 = icmp ult i32 %0, 8
br i1 %19, label %50, label %20
20: ; preds = %17
%21 = and i64 %18, 4294967288
%22 = insertelement <4 x float> poison, float %15, i64 0
%23 = shufflevector <4 x float> %22, <4 x float> poison, <4 x i32> zeroinitializer
%24 = insertelement <4 x float> poison, float %11, i64 0
%25 = shufflevector <4 x float> %24, <4 x float> poison, <4 x i32> zeroinitializer
%26 = insertelement <4 x float> poison, float %15, i64 0
%27 = shufflevector <4 x float> %26, <4 x float> poison, <4 x i32> zeroinitializer
%28 = insertelement <4 x float> poison, float %11, i64 0
%29 = shufflevector <4 x float> %28, <4 x float> poison, <4 x i32> zeroinitializer
br label %30
30: ; preds = %30, %20
%31 = phi i64 [ 0, %20 ], [ %45, %30 ]
%32 = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %20 ], [ %46, %30 ]
%33 = trunc <4 x i64> %32 to <4 x i32>
%34 = add <4 x i32> %33, <i32 1, i32 1, i32 1, i32 1>
%35 = trunc <4 x i64> %32 to <4 x i32>
%36 = add <4 x i32> %35, <i32 5, i32 5, i32 5, i32 5>
%37 = sitofp <4 x i32> %34 to <4 x float>
%38 = sitofp <4 x i32> %36 to <4 x float>
%39 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %23, <4 x float> %37, <4 x float> %25)
%40 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %27, <4 x float> %38, <4 x float> %29)
%41 = getelementptr inbounds float, float* %3, i64 %31
%42 = bitcast float* %41 to <4 x float>*
store <4 x float> %39, <4 x float>* %42
%43 = getelementptr inbounds float, float* %41, i64 4
%44 = bitcast float* %43 to <4 x float>*
store <4 x float> %40, <4 x float>* %44
%45 = add nuw i64 %31, 8
%46 = add <4 x i64> %32, <i64 8, i64 8, i64 8, i64 8>
%47 = icmp eq i64 %45, %21
br i1 %47, label %48, label %30
48: ; preds = %30
%49 = icmp eq i64 %21, %18
br i1 %49, label %60, label %50
50: ; preds = %17, %48
%51 = phi i64 [ 0, %17 ], [ %21, %48 ]
br label %52
52: ; preds = %50, %52
%53 = phi i64 [ %54, %52 ], [ %51, %50 ]
%54 = add nuw nsw i64 %53, 1
%55 = trunc i64 %54 to i32
%56 = sitofp i32 %55 to float
%57 = tail call float @llvm.fmuladd.f32(float %15, float %56, float %11)
%58 = getelementptr inbounds float, float* %3, i64 %53
store float %57, float* %58
%59 = icmp eq i64 %54, %18
br i1 %59, label %60, label %52
60: ; preds = %52, %48, %4
ret void
}