#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 fabs(double);
int /*<<< orphan*/ find_freq_points(double, double, double *, int, int *,
                                    int *);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
double pow(int, int);
int /*<<< orphan*/ printf(char *, double);
void one_third_octave(double *frequencies, double *alpha_diffuse,
                      int nb_frequency_points, double bands[12]) {
  int a, b;
  double one_third_bands[2][12];
  int *idx;
  int length_idx = 0;
  idx = (int *)malloc(sizeof(int));
  double one_third_freq[12] = {200., 250.,  315.,  400.,  500.,  630.,
                               800., 1000., 1250., 1600., 2000., 2500};
  for (a = 0; a < 12; a++) {
    one_third_bands[0][a] = one_third_freq[a] / pow(2, 1 / 6);
    one_third_bands[1][a] = one_third_freq[a] * pow(2, 1 / 6);
  }
  for (a = 0; a < 12; a++) {
    bands[a] = 0;
    find_freq_points(one_third_bands[0][a], one_third_bands[1][a], frequencies,
                     nb_frequency_points, idx, &length_idx);
    if (length_idx == 0) {
      printf("Warning: no point found in band centered at %4.0f\n",
             one_third_freq[a]);
    } else if (length_idx == 1) {
      printf("Warning: only one point found in band centered at %4.0f\n",
             one_third_freq[a]);
      bands[a] = alpha_diffuse[idx[0]];
    } else if (length_idx > 1) {
      for (b = 0; b < length_idx - 2; b++) {
        bands[a] =
            bands[a] + (frequencies[idx[0] + b + 1] - frequencies[idx[0] + b]) *
                           fabs(alpha_diffuse[idx[0] + b + 1] +
                                alpha_diffuse[idx[0] + b]) /
                           2;
      }
      bands[a] =
          bands[a] / (frequencies[idx[length_idx - 1]] - frequencies[idx[0]]);
    }
  }
  free(idx);
}


x86 assembly (clang, -O0):
<one_third_octave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0xfc(%rbp)
mov    $0x4,%edi
call   1070 <malloc@plt>
mov    %rax,-0xf8(%rbp)
lea    -0x160(%rbp),%rdi
lea    0xe7d(%rip),%rsi
mov    $0x60,%edx
call   1060 <memcpy@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0xc,-0x24(%rbp)
jge    1246 <one_third_octave+0xe6>
movslq -0x24(%rbp),%rax
movsd  -0x160(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x170(%rbp)
ff
mov    $0x2,%edi
xor    %esi,%esi
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x170(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movslq -0x24(%rbp),%rax
movsd  %xmm0,-0xf0(%rbp,%rax,8)
ff ff
movslq -0x24(%rbp),%rax
movsd  -0x160(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x168(%rbp)
ff
mov    $0x2,%edi
xor    %esi,%esi
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x168(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movslq -0x24(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b4 <one_third_octave+0x54>
movl   $0x0,-0x24(%rbp)
cmpl   $0xc,-0x24(%rbp)
jge    1454 <one_third_octave+0x2f4>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x24(%rbp),%rax
movsd  -0xf0(%rbp,%rax,8),%xmm0
ff ff
movslq -0x24(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm1
ff ff
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0xf8(%rbp),%rdx
lea    -0xfc(%rbp),%rcx
call   1050 <find_freq_points@plt>
cmpl   $0x0,-0xfc(%rbp)
jne    12c6 <one_third_octave+0x166>
movslq -0x24(%rbp),%rax
movsd  -0x160(%rbp,%rax,8),%xmm0
ff ff
lea    0xdc4(%rip),%rdi
call   1040 <printf@plt>
jmp    1441 <one_third_octave+0x2e1>
cmpl   $0x1,-0xfc(%rbp)
jne    1311 <one_third_octave+0x1b1>
movslq -0x24(%rbp),%rax
movsd  -0x160(%rbp,%rax,8),%xmm0
ff ff
lea    0xdcc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    -0xf8(%rbp),%rcx
movslq (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    143c <one_third_octave+0x2dc>
cmpl   $0x1,-0xfc(%rbp)
jle    1437 <one_third_octave+0x2d7>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xfc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    13e6 <one_third_octave+0x286>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xf8(%rbp),%rcx
mov    (%rcx),%ecx
add    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xf8(%rbp),%rcx
mov    (%rcx),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0xf8(%rbp),%rcx
mov    (%rcx),%ecx
add    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
mov    -0xf8(%rbp),%rcx
mov    (%rcx),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm2
movaps 0xc5d(%rip),%xmm3
pand   %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xc3d(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1325 <one_third_octave+0x1c5>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xf8(%rbp),%rcx
mov    -0xfc(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xf8(%rbp),%rcx
movslq (%rcx),%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    143c <one_third_octave+0x2dc>
jmp    1441 <one_third_octave+0x2e1>
jmp    1446 <one_third_octave+0x2e6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    124d <one_third_octave+0xed>
mov    -0xf8(%rbp),%rdi
call   1030 <free@plt>
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_third_octave>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %rcx,%rbx
mov    %edx,%r15d
mov    %rsi,0x10(%rsp)
mov    %rdi,%r12
movl   $0x0,0x4(%rsp)
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
xor    %ebp,%ebp
lea    0xe93(%rip),%r13
nopl   (%rax)
movsd  0x0(%rbp,%r13,1),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
xor    %esi,%esi
call   1070 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp,%rbp,1)
mov    $0x2,%edi
xor    %esi,%esi
call   1070 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp,%rbp,1)
add    $0x8,%rbp
cmp    $0x60,%rbp
jne    1190 <one_third_octave+0x40>
lea    0x8(%r12),%rax
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%rbp
lea    0x8(%rbp),%rax
mov    %rax,0x18(%rsp)
xor    %r13d,%r13d
jmp    1227 <one_third_octave+0xd7>
nopl   0x0(%rax,%rax,1)
lea    0xe19(%rip),%rax
movsd  (%rax,%r13,8),%xmm0
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
add    $0x1,%r13
cmp    $0xc,%r13
je     133a <one_third_octave+0x1ea>
movq   $0x0,(%rbx,%r13,8)
movsd  0x20(%rsp,%r13,8),%xmm0
movsd  0x80(%rsp,%r13,8),%xmm1
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
lea    0x4(%rsp),%rcx
call   1050 <find_freq_points@plt>
movslq 0x4(%rsp),%rax
cmp    $0x1,%rax
je     1290 <one_third_octave+0x140>
test   %eax,%eax
je     1200 <one_third_octave+0xb0>
cmp    $0x2,%eax
movapd 0xd93(%rip),%xmm3
movsd  0xd9b(%rip),%xmm4
jl     1219 <one_third_octave+0xc9>
cmp    $0x2,%eax
jne    12b4 <one_third_octave+0x164>
movsd  (%rbx,%r13,8),%xmm0
movslq (%r14),%rcx
jmp    131a <one_third_octave+0x1ca>
nopw   0x0(%rax,%rax,1)
lea    0xd89(%rip),%rax
movsd  (%rax,%r13,8),%xmm0
lea    0xe0f(%rip),%rdi
call   1040 <printf@plt>
movslq (%r14),%rax
movsd  0x0(%rbp,%rax,8),%xmm0
jmp    132f <one_third_octave+0x1df>
lea    -0x2(%rax),%edx
movslq (%r14),%rcx
movsd  (%rbx,%r13,8),%xmm0
mov    0x8(%rsp),%rsi
lea    (%rsi,%rcx,8),%rsi
mov    0x18(%rsp),%rdi
lea    (%rdi,%rcx,8),%rdi
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rsi,%rbp,8),%xmm1
subsd  -0x8(%rsi,%rbp,8),%xmm1
movsd  (%rdi,%rbp,8),%xmm2
addsd  -0x8(%rdi,%rbp,8),%xmm2
andpd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx,%r13,8)
add    $0x1,%rbp
cmp    %rbp,%rdx
jne    12e0 <one_third_octave+0x190>
mov    0x10(%rsp),%rbp
movslq -0x4(%r14,%rax,4),%rax
movsd  (%r12,%rax,8),%xmm1
subsd  (%r12,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%r13,8)
jmp    1219 <one_third_octave+0xc9>
mov    %r14,%rdi
call   1030 <free@plt>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.one_third_octave.one_third_freq = [12 x double] [double 2.000000e+02, double 2.500000e+02, double 3.150000e+02, double 4.000000e+02, double 5.000000e+02, double 6.300000e+02, double 8.000000e+02, double 1.000000e+03, double 1.250000e+03, double 1.600000e+03, double 2.000000e+03, double 2.500000e+03]
@.str = [51 x i8] c"Warning: no point found in band centered at %4.0f\0A\00"
@.str.1 = [57 x i8] c"Warning: only one point found in band centered at %4.0f\0A\00"
define void @one_third_octave(double* %0, double* %1, i32 %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [2 x [12 x double]]
%12 = alloca i32*
%13 = alloca i32
%14 = alloca [12 x double]
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store double* %3, double** %8
store i32 0, i32* %13
%15 = call i64 @malloc(i32 4)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %12
%17 = bitcast [12 x double]* %14 to i8*
store i32 0, i32* %9
br label %18
18: ; preds = %42, %4
%19 = load i32, i32* %9
%20 = icmp slt i32 %19, 12
br i1 %20, label %21, label %45
21: ; preds = %18
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [12 x double], [12 x double]* %14, i64 0, i64 %23
%25 = load double, double* %24
%26 = call double @pow(i32 2, i32 0)
%27 = fdiv double %25, %26
%28 = getelementptr inbounds [2 x [12 x double]], [2 x [12 x double]]* %11, i64 0, i64 0
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [12 x double], [12 x double]* %28, i64 0, i64 %30
store double %27, double* %31
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [12 x double], [12 x double]* %14, i64 0, i64 %33
%35 = load double, double* %34
%36 = call double @pow(i32 2, i32 0)
%37 = fmul double %35, %36
%38 = getelementptr inbounds [2 x [12 x double]], [2 x [12 x double]]* %11, i64 0, i64 1
%39 = load i32, i32* %9
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [12 x double], [12 x double]* %38, i64 0, i64 %40
store double %37, double* %41
br label %42
42: ; preds = %21
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
br label %18
45: ; preds = %18
store i32 0, i32* %9
br label %46
46: ; preds = %194, %45
%47 = load i32, i32* %9
%48 = icmp slt i32 %47, 12
br i1 %48, label %49, label %197
49: ; preds = %46
%50 = load double*, double** %8
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
store double 0.000000e+00, double* %53
%54 = getelementptr inbounds [2 x [12 x double]], [2 x [12 x double]]* %11, i64 0, i64 0
%55 = load i32, i32* %9
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [12 x double], [12 x double]* %54, i64 0, i64 %56
%58 = load double, double* %57
%59 = getelementptr inbounds [2 x [12 x double]], [2 x [12 x double]]* %11, i64 0, i64 1
%60 = load i32, i32* %9
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [12 x double], [12 x double]* %59, i64 0, i64 %61
%63 = load double, double* %62
%64 = load double*, double** %5
%65 = load i32, i32* %7
%66 = load i32*, i32** %12
%67 = call i32 @find_freq_points(double %58, double %63, double* %64, i32 %65, i32* %66, i32* %13)
%68 = load i32, i32* %13
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %76
70: ; preds = %49
%71 = load i32, i32* %9
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [12 x double], [12 x double]* %14, i64 0, i64 %72
%74 = load double, double* %73
%75 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %74)
br label %193
76: ; preds = %49
%77 = load i32, i32* %13
%78 = icmp eq i32 %77, 1
br i1 %78, label %79, label %96
79: ; preds = %76
%80 = load i32, i32* %9
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [12 x double], [12 x double]* %14, i64 0, i64 %81
%83 = load double, double* %82
%84 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), double %83)
%85 = load double*, double** %6
%86 = load i32*, i32** %12
%87 = getelementptr inbounds i32, i32* %86, i64 0
%88 = load i32, i32* %87
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %85, i64 %89
%91 = load double, double* %90
%92 = load double*, double** %8
%93 = load i32, i32* %9
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %92, i64 %94
store double %91, double* %95
br label %192
96: ; preds = %76
%97 = load i32, i32* %13
%98 = icmp sgt i32 %97, 1
br i1 %98, label %99, label %191
99: ; preds = %96
store i32 0, i32* %10
br label %100
100: ; preds = %159, %99
%101 = load i32, i32* %10
%102 = load i32, i32* %13
%103 = sub nsw i32 %102, 2
%104 = icmp slt i32 %101, %103
br i1 %104, label %105, label %162
105: ; preds = %100
%106 = load double*, double** %8
%107 = load i32, i32* %9
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
%110 = load double, double* %109
%111 = load double*, double** %5
%112 = load i32*, i32** %12
%113 = getelementptr inbounds i32, i32* %112, i64 0
%114 = load i32, i32* %113
%115 = load i32, i32* %10
%116 = add nsw i32 %114, %115
%117 = add nsw i32 %116, 1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %111, i64 %118
%120 = load double, double* %119
%121 = load double*, double** %5
%122 = load i32*, i32** %12
%123 = getelementptr inbounds i32, i32* %122, i64 0
%124 = load i32, i32* %123
%125 = load i32, i32* %10
%126 = add nsw i32 %124, %125
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %121, i64 %127
%129 = load double, double* %128
%130 = fsub double %120, %129
%131 = load double*, double** %6
%132 = load i32*, i32** %12
%133 = getelementptr inbounds i32, i32* %132, i64 0
%134 = load i32, i32* %133
%135 = load i32, i32* %10
%136 = add nsw i32 %134, %135
%137 = add nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %131, i64 %138
%140 = load double, double* %139
%141 = load double*, double** %6
%142 = load i32*, i32** %12
%143 = getelementptr inbounds i32, i32* %142, i64 0
%144 = load i32, i32* %143
%145 = load i32, i32* %10
%146 = add nsw i32 %144, %145
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %141, i64 %147
%149 = load double, double* %148
%150 = fadd double %140, %149
%151 = call double @llvm.fabs.f64(double %150)
%152 = fmul double %130, %151
%153 = fdiv double %152, 2.000000e+00
%154 = fadd double %110, %153
%155 = load double*, double** %8
%156 = load i32, i32* %9
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
store double %154, double* %158
br label %159
159: ; preds = %105
%160 = load i32, i32* %10
%161 = add nsw i32 %160, 1
store i32 %161, i32* %10
br label %100
162: ; preds = %100
%163 = load double*, double** %8
%164 = load i32, i32* %9
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %163, i64 %165
%167 = load double, double* %166
%168 = load double*, double** %5
%169 = load i32*, i32** %12
%170 = load i32, i32* %13
%171 = sub nsw i32 %170, 1
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds i32, i32* %169, i64 %172
%174 = load i32, i32* %173
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds double, double* %168, i64 %175
%177 = load double, double* %176
%178 = load double*, double** %5
%179 = load i32*, i32** %12
%180 = getelementptr inbounds i32, i32* %179, i64 0
%181 = load i32, i32* %180
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %178, i64 %182
%184 = load double, double* %183
%185 = fsub double %177, %184
%186 = fdiv double %167, %185
%187 = load double*, double** %8
%188 = load i32, i32* %9
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %187, i64 %189
store double %186, double* %190
br label %191
191: ; preds = %162, %96
br label %192
192: ; preds = %191, %79
br label %193
193: ; preds = %192, %70
br label %194
194: ; preds = %193
%195 = load i32, i32* %9
%196 = add nsw i32 %195, 1
store i32 %196, i32* %9
br label %46
197: ; preds = %46
%198 = load i32*, i32** %12
%199 = call i32 @free(i32* %198)
ret void
}

LLVM IR (-O2):
@__const.one_third_octave.one_third_freq = [12 x double] [double 2.000000e+02, double 2.500000e+02, double 3.150000e+02, double 4.000000e+02, double 5.000000e+02, double 6.300000e+02, double 8.000000e+02, double 1.000000e+03, double 1.250000e+03, double 1.600000e+03, double 2.000000e+03, double 2.500000e+03]
@.str = [51 x i8] c"Warning: no point found in band centered at %4.0f\0A\00"
@.str.1 = [57 x i8] c"Warning: only one point found in band centered at %4.0f\0A\00"
define void @one_third_octave(double* %0, double* nocapture %1, i32 %2, double* nocapture %3) {
%5 = alloca [2 x [12 x double]]
%6 = alloca i32
%7 = bitcast [2 x [12 x double]]* %5 to i8*
%8 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%9 = tail call i64 @malloc(i32 4)
br label %10
10: ; preds = %4, %10
%11 = phi i64 [ 0, %4 ], [ %20, %10 ]
%12 = getelementptr inbounds [12 x double], [12 x double]* @__const.one_third_octave.one_third_freq, i64 0, i64 %11
%13 = load double, double* %12
%14 = tail call double @pow(i32 2, i32 0)
%15 = fdiv double %13, %14
%16 = getelementptr inbounds [2 x [12 x double]], [2 x [12 x double]]* %5, i64 0, i64 0, i64 %11
store double %15, double* %16
%17 = tail call double @pow(i32 2, i32 0)
%18 = fmul double %13, %17
%19 = getelementptr inbounds [2 x [12 x double]], [2 x [12 x double]]* %5, i64 0, i64 1, i64 %11
store double %18, double* %19
%20 = add nuw nsw i64 %11, 1
%21 = icmp eq i64 %20, 12
br i1 %21, label %22, label %10
22: ; preds = %10
%23 = inttoptr i64 %9 to i32*
br label %24
24: ; preds = %22, %94
%25 = phi i64 [ 0, %22 ], [ %95, %94 ]
%26 = getelementptr inbounds double, double* %3, i64 %25
store double 0.000000e+00, double* %26
%27 = getelementptr inbounds [2 x [12 x double]], [2 x [12 x double]]* %5, i64 0, i64 0, i64 %25
%28 = load double, double* %27
%29 = getelementptr inbounds [2 x [12 x double]], [2 x [12 x double]]* %5, i64 0, i64 1, i64 %25
%30 = load double, double* %29
%31 = call i32 @find_freq_points(double %28, double %30, double* %0, i32 %2, i32* %23, i32* %6)
%32 = load i32, i32* %6
switch i32 %32, label %45 [
i32 0, label %33
i32 1, label %37
]
33: ; preds = %24
%34 = getelementptr inbounds [12 x double], [12 x double]* @__const.one_third_octave.one_third_freq, i64 0, i64 %25
%35 = load double, double* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %35)
br label %94
37: ; preds = %24
%38 = getelementptr inbounds [12 x double], [12 x double]* @__const.one_third_octave.one_third_freq, i64 0, i64 %25
%39 = load double, double* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), double %39)
%41 = load i32, i32* %23
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %1, i64 %42
%44 = load double, double* %43
store double %44, double* %26
br label %94
45: ; preds = %24
%46 = icmp sgt i32 %32, 1
br i1 %46, label %47, label %94
47: ; preds = %45
%48 = icmp eq i32 %32, 2
br i1 %48, label %49, label %53
49: ; preds = %47
%50 = load double, double* %26
%51 = load i32, i32* %23
%52 = sext i32 %51 to i64
br label %80
53: ; preds = %47
%54 = add nsw i32 %32, -2
%55 = load i32, i32* %23
%56 = sext i32 %55 to i64
%57 = zext i32 %54 to i64
%58 = load double, double* %26
br label %59
59: ; preds = %53, %59
%60 = phi double [ %58, %53 ], [ %77, %59 ]
%61 = phi i64 [ 0, %53 ], [ %78, %59 ]
%62 = add nsw i64 %61, %56
%63 = add nsw i64 %62, 1
%64 = getelementptr inbounds double, double* %0, i64 %63
%65 = load double, double* %64
%66 = getelementptr inbounds double, double* %0, i64 %62
%67 = load double, double* %66
%68 = fsub double %65, %67
%69 = getelementptr inbounds double, double* %1, i64 %63
%70 = load double, double* %69
%71 = getelementptr inbounds double, double* %1, i64 %62
%72 = load double, double* %71
%73 = fadd double %70, %72
%74 = call double @llvm.fabs.f64(double %73)
%75 = fmul double %68, %74
%76 = fmul double %75, 5.000000e-01
%77 = fadd double %60, %76
store double %77, double* %26
%78 = add nuw nsw i64 %61, 1
%79 = icmp eq i64 %78, %57
br i1 %79, label %80, label %59
80: ; preds = %59, %49
%81 = phi i64 [ %52, %49 ], [ %56, %59 ]
%82 = phi double [ %50, %49 ], [ %77, %59 ]
%83 = add nsw i32 %32, -1
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %23, i64 %84
%86 = load i32, i32* %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %0, i64 %87
%89 = load double, double* %88
%90 = getelementptr inbounds double, double* %0, i64 %81
%91 = load double, double* %90
%92 = fsub double %89, %91
%93 = fdiv double %82, %92
store double %93, double* %26
br label %94
94: ; preds = %33, %45, %80, %37
%95 = add nuw nsw i64 %25, 1
%96 = icmp eq i64 %95, 12
br i1 %96, label %97, label %24
97: ; preds = %94
%98 = call i32 @free(i32* %23)
ret void
}