#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 M_PI;
double cos(double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int sqrt(double);
void oneGoertzel(short *data, int f_station, int bandwidth, short wav_buf[]) {
  double s = 0.0;
  double s_prev = 0.0;
  double s_prev2 = 0.0;
  double coeff = 2 * cos((2.0 * M_PI) * f_station / (20 * 1000 * 1000));
  double RC_d = 0.005;
  double dt = 1.0 / 11025;
  double alpha_d = RC_d / (RC_d + dt);
  double yi_d = 0.0;
  double yi1_d = 0.0;
  double xi_d = 0.0;
  double xi1_d = 0.0;
  double RC_a = 0.000003;
  double alpha_a = dt / (RC_a + dt);
  double yi_a = 0.0;
  double yi1_a = 0.0;
  double xi_a = 0.0;
  double mean = 0.0;
  unsigned aidx, widx;
  int window_len = 1.33 * 2.72 * (double)(20 * 1000 * 1000) / (double)bandwidth;
  double *window = (double *)malloc(window_len * sizeof(double));
  unsigned i;
  for (i = 0; i < window_len; i++)
    window[i] =
        0.35875 - 0.48829 * cos((2.0 * M_PI) * (double)i / (double)window_len) +
        0.14128 * cos((2.0 * M_PI) * 2.0 * (double)i / (double)window_len) -
        0.01168 * cos((2.0 * M_PI) * 3.0 * (double)i / (double)window_len);
  memset((void *)wav_buf, 0, (20 * 1000 * 1000) / ((20 * 1000 * 1000) / 11025));
  for (aidx = 0;
       aidx < ((20 * 1000 * 1000) - window_len) / ((20 * 1000 * 1000) / 11025);
       aidx++) {
    for (widx = 0; widx < window_len; widx++) {
      s = data[aidx * ((20 * 1000 * 1000) / 11025) + widx] * window[widx] +
          coeff * s_prev - s_prev2;
      s_prev2 = s_prev;
      s_prev = s;
    }
    xi_d =
        sqrt(s_prev2 * s_prev2 + s_prev * s_prev - coeff * s_prev * s_prev2) /
        window_len;
    yi_d = alpha_d * (yi1_d + xi_d - xi1_d);
    xi_a = yi_d;
    yi_a = yi1_a + alpha_a * (xi_a - yi1_a);
    wav_buf[aidx] = (short)(300.0 * yi_a);
    yi1_d = yi_d;
    xi1_d = xi_d;
    yi1_a = yi_a;
    mean += yi_a * yi_a;
    s = 0.0;
    s_prev = 0.0;
    s_prev2 = 0.0;
  }
  mean /= (20 * 1000 * 1000) / ((20 * 1000 * 1000) / 11025);
  free(window);
}


x86 assembly (clang, -O0):
<oneGoertzel>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe97(%rip),%xmm0
mov    0x2e58(%rip),%rax
mulsd  (%rax),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe67(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe4e(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe39(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xdec(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xd8e(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xac(%rbp)
movslq -0xac(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0xb8(%rbp)
movl   $0x0,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0xac(%rbp),%eax
jae    13d7 <oneGoertzel+0x287>
mov    0x2d2c(%rip),%rax
mov    %rax,-0xd0(%rbp)
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
mov    -0xbc(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xac(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
mov    -0xd0(%rbp),%rax
movsd  0xd4e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd4a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
mov    -0xbc(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xac(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
movsd  -0xd8(%rbp),%xmm1
ff
mov    -0xd0(%rbp),%rax
movsd  0xd03(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
movsd  0xceb(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0xbc(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xac(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  0xc97(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0xb8(%rbp),%rax
mov    -0xbc(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    12a3 <oneGoertzel+0x153>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x2b11,%edx
call   1040 <memset@plt>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
mov    %eax,-0xdc(%rbp)
mov    $0x1312d00,%eax
sub    -0xac(%rbp),%eax
mov    $0x716,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xdc(%rbp),%eax
cmp    %ecx,%eax
jae    15f0 <oneGoertzel+0x4a0>
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0xac(%rbp),%eax
jae    14b0 <oneGoertzel+0x360>
mov    -0x8(%rbp),%rax
imul   $0x716,-0xa4(%rbp),%ecx
add    -0xa8(%rbp),%ecx
mov    %ecx,%ecx
movswl (%rax,%rcx,2),%eax
cvtsi2sd %eax,%xmm0
mov    -0xb8(%rbp),%rax
mov    -0xa8(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    142a <oneGoertzel+0x2da>
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movaps %xmm3,%xmm1
mulsd  %xmm1,%xmm1
movaps %xmm2,%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
mov    -0xac(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x70(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xad9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
mov    -0x18(%rbp),%rax
mov    -0xa4(%rbp),%ecx
mov    %dx,(%rax,%rcx,2)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    13f1 <oneGoertzel+0x2a1>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0xa30(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oneGoertzel>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rcx,%rbp
mov    %edx,%ebx
mov    %rdi,%r15
mov    0x2e7b(%rip),%r14
movsd  (%r14),%xmm1
cvtsi2sd %esi,%xmm0
addsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm0
divsd  0xe7a(%rip),%xmm0
call   1060 <cos@plt>
movapd %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xe68(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%r12d
lea    0x0(,%r12,8),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r12d,%r13d
test   %r12d,%r12d
mov    %rbp,0x28(%rsp)
mov    %r13,0x20(%rsp)
je     12ce <oneGoertzel+0x17e>
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %ebp,%ebp
nop
movsd  (%r14),%xmm0
addsd  %xmm0,%xmm0
mov    %ebp,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movsd  %xmm1,0x18(%rsp)
mulsd  %xmm1,%xmm0
divsd  0x10(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0xe00(%rip),%xmm0
addsd  0xe00(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r14),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
mulsd  0x18(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0xddc(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r14),%xmm0
addsd  %xmm0,%xmm0
mulsd  0xdc7(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0xdb6(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    11e0 <oneGoertzel+0x90>
mov    0x28(%rsp),%rdi
xor    %esi,%esi
mov    $0x2b11,%edx
call   1040 <memset@plt>
lea    -0x13125eb(%r12),%eax
fe
cmp    $0xe2b,%eax
movapd 0x30(%rsp),%xmm4
jae    12e3 <oneGoertzel+0x193>
mov    %rbx,%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x2b11,%edx
call   1040 <memset@plt>
movapd 0x30(%rsp),%xmm4
addsd  %xmm4,%xmm4
mov    $0x1312d00,%eax
sub    %r12d,%eax
cltq
imul   $0x9082f6b,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
movapd 0xd43(%rip),%xmm0
xorpd  %xmm4,%xmm0
movapd %xmm0,0x50(%rsp)
cmp    $0x2,%eax
mov    $0x1,%ecx
cmovae %eax,%ecx
mov    %rcx,0x48(%rsp)
mov    0x20(%rsp),%r13
and    $0xfffffffe,%r13d
xorpd  %xmm2,%xmm2
mov    $0x1,%r14d
xor    %ebp,%ebp
xorpd  %xmm0,%xmm0
xorpd  %xmm3,%xmm3
movapd %xmm4,0x30(%rsp)
jmp    13e9 <oneGoertzel+0x299>
nop
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
mulsd  0x50(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
call   1070 <sqrt@plt>
movapd 0x30(%rsp),%xmm4
cltd
idiv   %r12d
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x18(%rsp),%xmm3
addsd  %xmm0,%xmm3
subsd  0x8(%rsp),%xmm3
mulsd  0xc98(%rip),%xmm3
movapd %xmm3,%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm2,%xmm1
mulsd  0xc8a(%rip),%xmm1
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm1
mulsd  0xc82(%rip),%xmm1
cvttsd2si %xmm1,%eax
mov    0x28(%rsp),%rcx
mov    %ax,(%rcx,%rbp,2)
add    $0x1,%rbp
add    $0x716,%r14
cmp    0x48(%rsp),%rbp
je     12b8 <oneGoertzel+0x168>
movsd  %xmm0,0x8(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
test   %r12d,%r12d
je     1350 <oneGoertzel+0x200>
cmp    $0x1,%r12d
jne    1420 <oneGoertzel+0x2d0>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
xorpd  %xmm1,%xmm1
jmp    1490 <oneGoertzel+0x340>
xchg   %ax,%ax
xorpd  %xmm2,%xmm2
mov    %r14,%rcx
xor    %eax,%eax
xorpd  %xmm3,%xmm3
nopl   (%rax)
lea    -0x1(%rcx),%edx
and    $0xfffffffe,%edx
movswl (%r15,%rdx,2),%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm2,%xmm0
mulsd  (%rbx,%rax,8),%xmm1
addsd  %xmm0,%xmm1
subsd  %xmm3,%xmm1
mov    %ecx,%edx
movswl (%r15,%rdx,2),%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movapd %xmm4,%xmm3
mulsd  %xmm1,%xmm3
mulsd  0x8(%rbx,%rax,8),%xmm0
addsd  %xmm3,%xmm0
subsd  %xmm2,%xmm0
add    $0x2,%rax
add    $0x2,%rcx
movapd %xmm0,%xmm2
movapd %xmm1,%xmm3
cmp    %rax,%r13
jne    1430 <oneGoertzel+0x2e0>
testb  $0x1,0x20(%rsp)
je     1350 <oneGoertzel+0x200>
imul   $0x716,%rbp,%rcx
add    %eax,%ecx
movswl (%r15,%rcx,2),%ecx
xorps  %xmm2,%xmm2
cvtsi2sd %ecx,%xmm2
movapd %xmm4,%xmm3
mulsd  %xmm0,%xmm3
mulsd  (%rbx,%rax,8),%xmm2
addsd  %xmm3,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
movapd %xmm2,%xmm0
jmp    1350 <oneGoertzel+0x200>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @oneGoertzel(i16* %0, i32 %1, i32 %2, i16* %3) {
%5 = alloca i16*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i16*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca double*
%30 = alloca i32
store i16* %0, i16** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i16* %3, i16** %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
%31 = load double, double* @M_PI
%32 = fmul double 2.000000e+00, %31
%33 = load i32, i32* %6
%34 = sitofp i32 %33 to double
%35 = fmul double %32, %34
%36 = fdiv double %35, 2.000000e+07
%37 = call double @cos(double %36)
%38 = fmul double 2.000000e+00, %37
store double %38, double* %12
store double 5.000000e-03, double* %13
store double 0x3F17C6F8C751F177, double* %14
%39 = load double, double* %13
%40 = load double, double* %13
%41 = load double, double* %14
%42 = fadd double %40, %41
%43 = fdiv double %39, %42
store double %43, double* %15
store double 0.000000e+00, double* %16
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %19
store double 3.000000e-06, double* %20
%44 = load double, double* %14
%45 = load double, double* %20
%46 = load double, double* %14
%47 = fadd double %45, %46
%48 = fdiv double %44, %47
store double %48, double* %21
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
store double 0.000000e+00, double* %25
%49 = load i32, i32* %7
%50 = sitofp i32 %49 to double
%51 = fdiv double 7.235200e+07, %50
%52 = fptosi double %51 to i32
store i32 %52, i32* %28
%53 = load i32, i32* %28
%54 = sext i32 %53 to i64
%55 = mul i64 %54, 8
%56 = trunc i64 %55 to i32
%57 = call i64 @malloc(i32 %56)
%58 = inttoptr i64 %57 to double*
store double* %58, double** %29
store i32 0, i32* %30
br label %59
59: ; preds = %100, %4
%60 = load i32, i32* %30
%61 = load i32, i32* %28
%62 = icmp ult i32 %60, %61
br i1 %62, label %63, label %103
63: ; preds = %59
%64 = load double, double* @M_PI
%65 = fmul double 2.000000e+00, %64
%66 = load i32, i32* %30
%67 = uitofp i32 %66 to double
%68 = fmul double %65, %67
%69 = load i32, i32* %28
%70 = sitofp i32 %69 to double
%71 = fdiv double %68, %70
%72 = call double @cos(double %71)
%73 = call double @llvm.fmuladd.f64(double -4.882900e-01, double %72, double 3.587500e-01)
%74 = load double, double* @M_PI
%75 = fmul double 2.000000e+00, %74
%76 = fmul double %75, 2.000000e+00
%77 = load i32, i32* %30
%78 = uitofp i32 %77 to double
%79 = fmul double %76, %78
%80 = load i32, i32* %28
%81 = sitofp i32 %80 to double
%82 = fdiv double %79, %81
%83 = call double @cos(double %82)
%84 = call double @llvm.fmuladd.f64(double 1.412800e-01, double %83, double %73)
%85 = load double, double* @M_PI
%86 = fmul double 2.000000e+00, %85
%87 = fmul double %86, 3.000000e+00
%88 = load i32, i32* %30
%89 = uitofp i32 %88 to double
%90 = fmul double %87, %89
%91 = load i32, i32* %28
%92 = sitofp i32 %91 to double
%93 = fdiv double %90, %92
%94 = call double @cos(double %93)
%95 = call double @llvm.fmuladd.f64(double -1.168000e-02, double %94, double %84)
%96 = load double*, double** %29
%97 = load i32, i32* %30
%98 = zext i32 %97 to i64
%99 = getelementptr inbounds double, double* %96, i64 %98
store double %95, double* %99
br label %100
100: ; preds = %63
%101 = load i32, i32* %30
%102 = add i32 %101, 1
store i32 %102, i32* %30
br label %59
103: ; preds = %59
%104 = load i16*, i16** %8
%105 = bitcast i16* %104 to i8*
%106 = call i32 @memset(i8* %105, i32 0, i32 11025)
store i32 0, i32* %26
br label %107
107: ; preds = %190, %103
%108 = load i32, i32* %26
%109 = load i32, i32* %28
%110 = sub nsw i32 20000000, %109
%111 = sdiv i32 %110, 1814
%112 = icmp ult i32 %108, %111
br i1 %112, label %113, label %193
113: ; preds = %107
store i32 0, i32* %27
br label %114
114: ; preds = %142, %113
%115 = load i32, i32* %27
%116 = load i32, i32* %28
%117 = icmp ult i32 %115, %116
br i1 %117, label %118, label %145
118: ; preds = %114
%119 = load i16*, i16** %5
%120 = load i32, i32* %26
%121 = mul i32 %120, 1814
%122 = load i32, i32* %27
%123 = add i32 %121, %122
%124 = zext i32 %123 to i64
%125 = getelementptr inbounds i16, i16* %119, i64 %124
%126 = load i16, i16* %125
%127 = sext i16 %126 to i32
%128 = sitofp i32 %127 to double
%129 = load double*, double** %29
%130 = load i32, i32* %27
%131 = zext i32 %130 to i64
%132 = getelementptr inbounds double, double* %129, i64 %131
%133 = load double, double* %132
%134 = load double, double* %12
%135 = load double, double* %10
%136 = fmul double %134, %135
%137 = call double @llvm.fmuladd.f64(double %128, double %133, double %136)
%138 = load double, double* %11
%139 = fsub double %137, %138
store double %139, double* %9
%140 = load double, double* %10
store double %140, double* %11
%141 = load double, double* %9
store double %141, double* %10
br label %142
142: ; preds = %118
%143 = load i32, i32* %27
%144 = add i32 %143, 1
store i32 %144, i32* %27
br label %114
145: ; preds = %114
%146 = load double, double* %11
%147 = load double, double* %11
%148 = load double, double* %10
%149 = load double, double* %10
%150 = fmul double %148, %149
%151 = call double @llvm.fmuladd.f64(double %146, double %147, double %150)
%152 = load double, double* %12
%153 = load double, double* %10
%154 = fmul double %152, %153
%155 = load double, double* %11
%156 = fneg double %154
%157 = call double @llvm.fmuladd.f64(double %156, double %155, double %151)
%158 = call i32 @sqrt(double %157)
%159 = load i32, i32* %28
%160 = sdiv i32 %158, %159
%161 = sitofp i32 %160 to double
store double %161, double* %18
%162 = load double, double* %15
%163 = load double, double* %17
%164 = load double, double* %18
%165 = fadd double %163, %164
%166 = load double, double* %19
%167 = fsub double %165, %166
%168 = fmul double %162, %167
store double %168, double* %16
%169 = load double, double* %16
store double %169, double* %24
%170 = load double, double* %23
%171 = load double, double* %21
%172 = load double, double* %24
%173 = load double, double* %23
%174 = fsub double %172, %173
%175 = call double @llvm.fmuladd.f64(double %171, double %174, double %170)
store double %175, double* %22
%176 = load double, double* %22
%177 = fmul double 3.000000e+02, %176
%178 = fptosi double %177 to i16
%179 = load i16*, i16** %8
%180 = load i32, i32* %26
%181 = zext i32 %180 to i64
%182 = getelementptr inbounds i16, i16* %179, i64 %181
store i16 %178, i16* %182
%183 = load double, double* %16
store double %183, double* %17
%184 = load double, double* %18
store double %184, double* %19
%185 = load double, double* %22
store double %185, double* %23
%186 = load double, double* %22
%187 = load double, double* %22
%188 = load double, double* %25
%189 = call double @llvm.fmuladd.f64(double %186, double %187, double %188)
store double %189, double* %25
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
br label %190
190: ; preds = %145
%191 = load i32, i32* %26
%192 = add i32 %191, 1
store i32 %192, i32* %26
br label %107
193: ; preds = %107
%194 = load double, double* %25
%195 = fdiv double %194, 1.102500e+04
store double %195, double* %25
%196 = load double*, double** %29
%197 = call i32 @free(double* %196)
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @oneGoertzel(i16* nocapture %0, i32 %1, i32 %2, i16* %3) {
%5 = load double, double* @M_PI
%6 = fmul double %5, 2.000000e+00
%7 = sitofp i32 %1 to double
%8 = fmul double %6, %7
%9 = fdiv double %8, 2.000000e+07
%10 = tail call double @cos(double %9)
%11 = fmul double %10, 2.000000e+00
%12 = sitofp i32 %2 to double
%13 = fdiv double 7.235200e+07, %12
%14 = fptosi double %13 to i32
%15 = shl i32 %14, 3
%16 = tail call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to double*
%18 = icmp eq i32 %14, 0
br i1 %18, label %19, label %22
19: ; preds = %4
%20 = bitcast i16* %3 to i8*
%21 = tail call i32 @memset(i8* %20, i32 0, i32 11025)
br label %57
22: ; preds = %4
%23 = sitofp i32 %14 to double
%24 = zext i32 %14 to i64
br label %25
25: ; preds = %22, %25
%26 = phi i64 [ 0, %22 ], [ %50, %25 ]
%27 = load double, double* @M_PI
%28 = fmul double %27, 2.000000e+00
%29 = trunc i64 %26 to i32
%30 = uitofp i32 %29 to double
%31 = fmul double %28, %30
%32 = fdiv double %31, %23
%33 = tail call double @cos(double %32)
%34 = tail call double @llvm.fmuladd.f64(double %33, double -4.882900e-01, double 3.587500e-01)
%35 = load double, double* @M_PI
%36 = fmul double %35, 2.000000e+00
%37 = fmul double %36, 2.000000e+00
%38 = fmul double %37, %30
%39 = fdiv double %38, %23
%40 = tail call double @cos(double %39)
%41 = tail call double @llvm.fmuladd.f64(double %40, double 1.412800e-01, double %34)
%42 = load double, double* @M_PI
%43 = fmul double %42, 2.000000e+00
%44 = fmul double %43, 3.000000e+00
%45 = fmul double %44, %30
%46 = fdiv double %45, %23
%47 = tail call double @cos(double %46)
%48 = tail call double @llvm.fmuladd.f64(double %47, double -1.168000e-02, double %41)
%49 = getelementptr inbounds double, double* %17, i64 %26
store double %48, double* %49
%50 = add nuw nsw i64 %26, 1
%51 = icmp eq i64 %50, %24
br i1 %51, label %52, label %25
52: ; preds = %25
%53 = bitcast i16* %3 to i8*
%54 = tail call i32 @memset(i8* %53, i32 0, i32 11025)
%55 = add i32 %14, -19998187
%56 = icmp ult i32 %55, 3627
br i1 %56, label %141, label %57
57: ; preds = %19, %52
%58 = sub nsw i32 20000000, %14
%59 = sdiv i32 %58, 1814
%60 = fneg double %11
%61 = call i32 @llvm.umax.i32(i32 %59, i32 1)
%62 = zext i32 %61 to i64
%63 = zext i32 %14 to i64
%64 = and i64 %63, 1
%65 = icmp eq i32 %14, 1
%66 = and i64 %63, 4294967294
%67 = icmp eq i64 %64, 0
br label %68
68: ; preds = %57, %121
%69 = phi i64 [ 0, %57 ], [ %139, %121 ]
%70 = phi double [ 0.000000e+00, %57 ], [ %135, %121 ]
%71 = phi double [ 0.000000e+00, %57 ], [ %130, %121 ]
%72 = phi double [ 0.000000e+00, %57 ], [ %133, %121 ]
br i1 %18, label %121, label %73
73: ; preds = %68
%74 = mul i64 %69, 1814
br i1 %65, label %104, label %75
75: ; preds = %73, %75
%76 = phi i64 [ %101, %75 ], [ 0, %73 ]
%77 = phi double [ %100, %75 ], [ 0.000000e+00, %73 ]
%78 = phi double [ %89, %75 ], [ 0.000000e+00, %73 ]
%79 = phi i64 [ %102, %75 ], [ 0, %73 ]
%80 = add i64 %74, %76
%81 = and i64 %80, 4294967294
%82 = getelementptr inbounds i16, i16* %0, i64 %81
%83 = load i16, i16* %82
%84 = sitofp i16 %83 to double
%85 = getelementptr inbounds double, double* %17, i64 %76
%86 = load double, double* %85
%87 = fmul double %11, %77
%88 = tail call double @llvm.fmuladd.f64(double %84, double %86, double %87)
%89 = fsub double %88, %78
%90 = or i64 %76, 1
%91 = add i64 %74, %90
%92 = and i64 %91, 4294967295
%93 = getelementptr inbounds i16, i16* %0, i64 %92
%94 = load i16, i16* %93
%95 = sitofp i16 %94 to double
%96 = getelementptr inbounds double, double* %17, i64 %90
%97 = load double, double* %96
%98 = fmul double %11, %89
%99 = tail call double @llvm.fmuladd.f64(double %95, double %97, double %98)
%100 = fsub double %99, %77
%101 = add nuw nsw i64 %76, 2
%102 = add i64 %79, 2
%103 = icmp eq i64 %102, %66
br i1 %103, label %104, label %75
104: ; preds = %75, %73
%105 = phi double [ undef, %73 ], [ %89, %75 ]
%106 = phi double [ undef, %73 ], [ %100, %75 ]
%107 = phi i64 [ 0, %73 ], [ %101, %75 ]
%108 = phi double [ 0.000000e+00, %73 ], [ %100, %75 ]
%109 = phi double [ 0.000000e+00, %73 ], [ %89, %75 ]
br i1 %67, label %121, label %110
110: ; preds = %104
%111 = add i64 %74, %107
%112 = and i64 %111, 4294967295
%113 = getelementptr inbounds i16, i16* %0, i64 %112
%114 = load i16, i16* %113
%115 = sitofp i16 %114 to double
%116 = getelementptr inbounds double, double* %17, i64 %107
%117 = load double, double* %116
%118 = fmul double %11, %108
%119 = tail call double @llvm.fmuladd.f64(double %115, double %117, double %118)
%120 = fsub double %119, %109
br label %121
121: ; preds = %110, %104, %68
%122 = phi double [ 0.000000e+00, %68 ], [ %105, %104 ], [ %108, %110 ]
%123 = phi double [ 0.000000e+00, %68 ], [ %106, %104 ], [ %120, %110 ]
%124 = fmul double %123, %123
%125 = tail call double @llvm.fmuladd.f64(double %122, double %122, double %124)
%126 = fmul double %123, %60
%127 = tail call double @llvm.fmuladd.f64(double %126, double %122, double %125)
%128 = tail call i32 @sqrt(double %127)
%129 = sdiv i32 %128, %14
%130 = sitofp i32 %129 to double
%131 = fadd double %72, %130
%132 = fsub double %131, %71
%133 = fmul double %132, 0x3FEF6E0A434744FD
%134 = fsub double %133, %70
%135 = tail call double @llvm.fmuladd.f64(double %134, double 0x3FEEF9B970168026, double %70)
%136 = fmul double %135, 3.000000e+02
%137 = fptosi double %136 to i16
%138 = getelementptr inbounds i16, i16* %3, i64 %69
store i16 %137, i16* %138
%139 = add nuw nsw i64 %69, 1
%140 = icmp eq i64 %139, %62
br i1 %140, label %141, label %68
141: ; preds = %121, %52
%142 = tail call i32 @free(double* %17)
ret void
}