#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(double *);
double *iirFilter(double *B, double *A, int filterLength, double *signal,
                  int signalLength) {
  int i;
  double *x, *y, *output;
  double zeros = 0;
  double poles = 0;
  if (A[0] != 1) {
    for (i = 0; i < filterLength; i++) {
      A[i] = A[i] / A[0];
      B[i] = B[i] / A[0];
    }
  }
  x = (double *)calloc((filterLength - 1), sizeof(double));
  y = (double *)calloc((filterLength - 1), sizeof(double));
  output = (double *)calloc((signalLength), sizeof(double));
  for (i = 0; i < filterLength - 1; i++)
    y[i] = 0;
  for (i = 0; i < filterLength - 1; i++)
    x[i] = 0;
  for (i = 0; i < signalLength; i++)
    output[i] = 0;
  for (i = 0; i < signalLength; i++) {
    zeros = B[0] * signal[i] + B[1] * x[0] + B[2] * x[1] + B[3] * x[2] +
            B[4] * x[3];
    poles = A[1] * y[0] + A[2] * y[1] + A[3] * y[2] + A[4] * y[3];
    output[i] = zeros - poles;
    x[3] = x[2];
    x[2] = x[1];
    x[1] = x[0];
    x[0] = signal[i];
    y[3] = y[2];
    y[2] = y[1];
    y[1] = y[0];
    y[0] = output[i];
  }
  free(x);
  free(y);
  return output;
}


x86 assembly (clang, -O0):
<iirFilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xea5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1170 <iirFilter+0x50>
jp     1170 <iirFilter+0x50>
jmp    11da <iirFilter+0xba>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11d5 <iirFilter+0xb5>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1177 <iirFilter+0x57>
jmp    11da <iirFilter+0xba>
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1249 <iirFilter+0x129>
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    121a <iirFilter+0xfa>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    127f <iirFilter+0x15f>
mov    -0x30(%rbp),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1250 <iirFilter+0x130>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12b0 <iirFilter+0x190>
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1286 <iirFilter+0x166>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1461 <iirFilter+0x341>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x30(%rbp),%rax
mulsd  (%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x30(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x38(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x38(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x30(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x38(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12b7 <iirFilter+0x197>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iirFilter>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,(%rsp)
mov    %rcx,0x10(%rsp)
mov    %edx,%r14d
mov    %rsi,%r12
mov    %rdi,%r15
movsd  (%rsi),%xmm0
ucomisd 0xea4(%rip),%xmm0
jne    1160 <iirFilter+0x30>
jnp    11b4 <iirFilter+0x84>
test   %r14d,%r14d
jle    11b4 <iirFilter+0x84>
mov    %r14d,%eax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
movapd %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r12,%rcx,8)
movsd  (%r15,%rcx,8),%xmm0
divsd  (%r12),%xmm0
movsd  %xmm0,(%r15,%rcx,8)
cmp    %rcx,%rax
je     11b4 <iirFilter+0x84>
movsd  0x8(%r12,%rcx,8),%xmm1
movsd  (%r12),%xmm0
add    $0x1,%rcx
jmp    1180 <iirFilter+0x50>
lea    -0x1(%r14),%ebp
mov    %ebp,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %ebp,0xc(%rsp)
mov    %ebp,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%r13
mov    (%rsp),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%rbp
cmp    $0x2,%r14d
jl     1213 <iirFilter+0xe3>
mov    0xc(%rsp),%r14d
shl    $0x3,%r14
mov    %r13,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    (%rsp),%eax
test   %eax,%eax
jle    132e <iirFilter+0x1fe>
mov    %eax,%eax
mov    %rax,(%rsp)
lea    0x0(,%rax,8),%rdx
xor    %r14d,%r14d
mov    %rbp,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    (%rsp),%rcx
mov    0x10(%rsp),%rax
movsd  0x0(%r13),%xmm2
movupd 0x8(%r13),%xmm1
movsd  0x18(%r13),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x8(%r15),%xmm3
mulsd  (%rbx),%xmm3
movsd  (%r15),%xmm4
mulsd  (%rax,%r14,8),%xmm4
addsd  %xmm3,%xmm4
movsd  0x10(%r15),%xmm3
mulsd  0x8(%rbx),%xmm3
addsd  %xmm4,%xmm3
movsd  0x18(%r15),%xmm4
mulsd  0x10(%rbx),%xmm4
addsd  %xmm3,%xmm4
movsd  0x20(%r15),%xmm3
mulsd  0x18(%rbx),%xmm3
addsd  %xmm4,%xmm3
movsd  0x10(%r12),%xmm4
mulsd  %xmm1,%xmm4
mulsd  0x8(%r12),%xmm2
addsd  %xmm4,%xmm2
unpckhpd %xmm1,%xmm1
mulsd  0x18(%r12),%xmm1
addsd  %xmm2,%xmm1
mulsd  0x20(%r12),%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm0,%xmm3
movsd  %xmm3,0x0(%rbp,%r14,8)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x18(%rbx)
movups (%rbx),%xmm0
movups %xmm0,0x8(%rbx)
movsd  (%rax,%r14,8),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%r13),%xmm0
movsd  %xmm0,0x18(%r13)
movupd 0x0(%r13),%xmm1
movupd %xmm1,0x8(%r13)
movsd  0x0(%rbp,%r14,8),%xmm2
movsd  %xmm2,0x0(%r13)
add    $0x1,%r14
cmp    %r14,%rcx
jne    1260 <iirFilter+0x130>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbp,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double* @iirFilter(double* %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
store double 0.000000e+00, double* %15
store double 0.000000e+00, double* %16
%17 = load double*, double** %7
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = fcmp une double %19, 1.000000e+00
br i1 %20, label %21, label %57
21: ; preds = %5
store i32 0, i32* %11
br label %22
22: ; preds = %53, %21
%23 = load i32, i32* %11
%24 = load i32, i32* %8
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %56
26: ; preds = %22
%27 = load double*, double** %7
%28 = load i32, i32* %11
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %7
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = fdiv double %31, %34
%36 = load double*, double** %7
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
store double %35, double* %39
%40 = load double*, double** %6
%41 = load i32, i32* %11
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
%44 = load double, double* %43
%45 = load double*, double** %7
%46 = getelementptr inbounds double, double* %45, i64 0
%47 = load double, double* %46
%48 = fdiv double %44, %47
%49 = load double*, double** %6
%50 = load i32, i32* %11
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
store double %48, double* %52
br label %53
53: ; preds = %26
%54 = load i32, i32* %11
%55 = add nsw i32 %54, 1
store i32 %55, i32* %11
br label %22
56: ; preds = %22
br label %57
57: ; preds = %56, %5
%58 = load i32, i32* %8
%59 = sub nsw i32 %58, 1
%60 = call i64 @calloc(i32 %59, i32 8)
%61 = inttoptr i64 %60 to double*
store double* %61, double** %12
%62 = load i32, i32* %8
%63 = sub nsw i32 %62, 1
%64 = call i64 @calloc(i32 %63, i32 8)
%65 = inttoptr i64 %64 to double*
store double* %65, double** %13
%66 = load i32, i32* %10
%67 = call i64 @calloc(i32 %66, i32 8)
%68 = inttoptr i64 %67 to double*
store double* %68, double** %14
store i32 0, i32* %11
br label %69
69: ; preds = %79, %57
%70 = load i32, i32* %11
%71 = load i32, i32* %8
%72 = sub nsw i32 %71, 1
%73 = icmp slt i32 %70, %72
br i1 %73, label %74, label %82
74: ; preds = %69
%75 = load double*, double** %13
%76 = load i32, i32* %11
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %75, i64 %77
store double 0.000000e+00, double* %78
br label %79
79: ; preds = %74
%80 = load i32, i32* %11
%81 = add nsw i32 %80, 1
store i32 %81, i32* %11
br label %69
82: ; preds = %69
store i32 0, i32* %11
br label %83
83: ; preds = %93, %82
%84 = load i32, i32* %11
%85 = load i32, i32* %8
%86 = sub nsw i32 %85, 1
%87 = icmp slt i32 %84, %86
br i1 %87, label %88, label %96
88: ; preds = %83
%89 = load double*, double** %12
%90 = load i32, i32* %11
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
store double 0.000000e+00, double* %92
br label %93
93: ; preds = %88
%94 = load i32, i32* %11
%95 = add nsw i32 %94, 1
store i32 %95, i32* %11
br label %83
96: ; preds = %83
store i32 0, i32* %11
br label %97
97: ; preds = %106, %96
%98 = load i32, i32* %11
%99 = load i32, i32* %10
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %109
101: ; preds = %97
%102 = load double*, double** %14
%103 = load i32, i32* %11
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %102, i64 %104
store double 0.000000e+00, double* %105
br label %106
106: ; preds = %101
%107 = load i32, i32* %11
%108 = add nsw i32 %107, 1
store i32 %108, i32* %11
br label %97
109: ; preds = %97
store i32 0, i32* %11
br label %110
110: ; preds = %231, %109
%111 = load i32, i32* %11
%112 = load i32, i32* %10
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %234
114: ; preds = %110
%115 = load double*, double** %6
%116 = getelementptr inbounds double, double* %115, i64 0
%117 = load double, double* %116
%118 = load double*, double** %9
%119 = load i32, i32* %11
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %118, i64 %120
%122 = load double, double* %121
%123 = load double*, double** %6
%124 = getelementptr inbounds double, double* %123, i64 1
%125 = load double, double* %124
%126 = load double*, double** %12
%127 = getelementptr inbounds double, double* %126, i64 0
%128 = load double, double* %127
%129 = fmul double %125, %128
%130 = call double @llvm.fmuladd.f64(double %117, double %122, double %129)
%131 = load double*, double** %6
%132 = getelementptr inbounds double, double* %131, i64 2
%133 = load double, double* %132
%134 = load double*, double** %12
%135 = getelementptr inbounds double, double* %134, i64 1
%136 = load double, double* %135
%137 = call double @llvm.fmuladd.f64(double %133, double %136, double %130)
%138 = load double*, double** %6
%139 = getelementptr inbounds double, double* %138, i64 3
%140 = load double, double* %139
%141 = load double*, double** %12
%142 = getelementptr inbounds double, double* %141, i64 2
%143 = load double, double* %142
%144 = call double @llvm.fmuladd.f64(double %140, double %143, double %137)
%145 = load double*, double** %6
%146 = getelementptr inbounds double, double* %145, i64 4
%147 = load double, double* %146
%148 = load double*, double** %12
%149 = getelementptr inbounds double, double* %148, i64 3
%150 = load double, double* %149
%151 = call double @llvm.fmuladd.f64(double %147, double %150, double %144)
store double %151, double* %15
%152 = load double*, double** %7
%153 = getelementptr inbounds double, double* %152, i64 1
%154 = load double, double* %153
%155 = load double*, double** %13
%156 = getelementptr inbounds double, double* %155, i64 0
%157 = load double, double* %156
%158 = load double*, double** %7
%159 = getelementptr inbounds double, double* %158, i64 2
%160 = load double, double* %159
%161 = load double*, double** %13
%162 = getelementptr inbounds double, double* %161, i64 1
%163 = load double, double* %162
%164 = fmul double %160, %163
%165 = call double @llvm.fmuladd.f64(double %154, double %157, double %164)
%166 = load double*, double** %7
%167 = getelementptr inbounds double, double* %166, i64 3
%168 = load double, double* %167
%169 = load double*, double** %13
%170 = getelementptr inbounds double, double* %169, i64 2
%171 = load double, double* %170
%172 = call double @llvm.fmuladd.f64(double %168, double %171, double %165)
%173 = load double*, double** %7
%174 = getelementptr inbounds double, double* %173, i64 4
%175 = load double, double* %174
%176 = load double*, double** %13
%177 = getelementptr inbounds double, double* %176, i64 3
%178 = load double, double* %177
%179 = call double @llvm.fmuladd.f64(double %175, double %178, double %172)
store double %179, double* %16
%180 = load double, double* %15
%181 = load double, double* %16
%182 = fsub double %180, %181
%183 = load double*, double** %14
%184 = load i32, i32* %11
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds double, double* %183, i64 %185
store double %182, double* %186
%187 = load double*, double** %12
%188 = getelementptr inbounds double, double* %187, i64 2
%189 = load double, double* %188
%190 = load double*, double** %12
%191 = getelementptr inbounds double, double* %190, i64 3
store double %189, double* %191
%192 = load double*, double** %12
%193 = getelementptr inbounds double, double* %192, i64 1
%194 = load double, double* %193
%195 = load double*, double** %12
%196 = getelementptr inbounds double, double* %195, i64 2
store double %194, double* %196
%197 = load double*, double** %12
%198 = getelementptr inbounds double, double* %197, i64 0
%199 = load double, double* %198
%200 = load double*, double** %12
%201 = getelementptr inbounds double, double* %200, i64 1
store double %199, double* %201
%202 = load double*, double** %9
%203 = load i32, i32* %11
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds double, double* %202, i64 %204
%206 = load double, double* %205
%207 = load double*, double** %12
%208 = getelementptr inbounds double, double* %207, i64 0
store double %206, double* %208
%209 = load double*, double** %13
%210 = getelementptr inbounds double, double* %209, i64 2
%211 = load double, double* %210
%212 = load double*, double** %13
%213 = getelementptr inbounds double, double* %212, i64 3
store double %211, double* %213
%214 = load double*, double** %13
%215 = getelementptr inbounds double, double* %214, i64 1
%216 = load double, double* %215
%217 = load double*, double** %13
%218 = getelementptr inbounds double, double* %217, i64 2
store double %216, double* %218
%219 = load double*, double** %13
%220 = getelementptr inbounds double, double* %219, i64 0
%221 = load double, double* %220
%222 = load double*, double** %13
%223 = getelementptr inbounds double, double* %222, i64 1
store double %221, double* %223
%224 = load double*, double** %14
%225 = load i32, i32* %11
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds double, double* %224, i64 %226
%228 = load double, double* %227
%229 = load double*, double** %13
%230 = getelementptr inbounds double, double* %229, i64 0
store double %228, double* %230
br label %231
231: ; preds = %114
%232 = load i32, i32* %11
%233 = add nsw i32 %232, 1
store i32 %233, i32* %11
br label %110
234: ; preds = %110
%235 = load double*, double** %12
%236 = call i32 @free(double* %235)
%237 = load double*, double** %13
%238 = call i32 @free(double* %237)
%239 = load double*, double** %14
ret double* %239
}

LLVM IR (-O2):
define double* @iirFilter(double* nocapture %0, double* nocapture %1, i32 %2, double* nocapture %3, i32 %4) {
%6 = load double, double* %1
%7 = fcmp une double %6, 1.000000e+00
%8 = icmp sgt i32 %2, 0
%9 = and i1 %7, %8
br i1 %9, label %10, label %28
10: ; preds = %5
%11 = zext i32 %2 to i64
br label %12
12: ; preds = %24, %10
%13 = phi double [ %6, %10 ], [ %27, %24 ]
%14 = phi double [ %6, %10 ], [ %26, %24 ]
%15 = phi i64 [ 0, %10 ], [ %22, %24 ]
%16 = getelementptr inbounds double, double* %1, i64 %15
%17 = fdiv double %14, %13
store double %17, double* %16
%18 = getelementptr inbounds double, double* %0, i64 %15
%19 = load double, double* %18
%20 = load double, double* %1
%21 = fdiv double %19, %20
store double %21, double* %18
%22 = add nuw nsw i64 %15, 1
%23 = icmp eq i64 %22, %11
br i1 %23, label %28, label %24
24: ; preds = %12
%25 = getelementptr inbounds double, double* %1, i64 %22
%26 = load double, double* %25
%27 = load double, double* %1
br label %12
28: ; preds = %12, %5
%29 = add nsw i32 %2, -1
%30 = tail call i64 @calloc(i32 %29, i32 8)
%31 = inttoptr i64 %30 to double*
%32 = tail call i64 @calloc(i32 %29, i32 8)
%33 = inttoptr i64 %32 to double*
%34 = tail call i64 @calloc(i32 %4, i32 8)
%35 = inttoptr i64 %34 to double*
%36 = inttoptr i64 %34 to i8*
%37 = icmp sgt i32 %2, 1
br i1 %37, label %38, label %45
38: ; preds = %28
%39 = inttoptr i64 %30 to i8*
%40 = inttoptr i64 %32 to i8*
%41 = zext i32 %29 to i64
%42 = shl nuw nsw i64 %41, 3
%43 = zext i32 %29 to i64
%44 = shl nuw nsw i64 %43, 3
br label %45
45: ; preds = %28, %38
%46 = icmp sgt i32 %4, 0
br i1 %46, label %47, label %114
47: ; preds = %45
%48 = zext i32 %4 to i64
%49 = shl nuw nsw i64 %48, 3
%50 = getelementptr inbounds double, double* %0, i64 1
%51 = getelementptr inbounds double, double* %0, i64 2
%52 = getelementptr inbounds double, double* %31, i64 1
%53 = getelementptr inbounds double, double* %0, i64 3
%54 = getelementptr inbounds double, double* %31, i64 2
%55 = getelementptr inbounds double, double* %0, i64 4
%56 = getelementptr inbounds double, double* %31, i64 3
%57 = getelementptr inbounds double, double* %1, i64 1
%58 = getelementptr inbounds double, double* %1, i64 2
%59 = getelementptr inbounds double, double* %33, i64 1
%60 = getelementptr inbounds double, double* %1, i64 3
%61 = getelementptr inbounds double, double* %33, i64 2
%62 = getelementptr inbounds double, double* %1, i64 4
%63 = getelementptr inbounds double, double* %33, i64 3
%64 = zext i32 %4 to i64
%65 = load double, double* %33
%66 = bitcast double* %59 to <2 x double>*
%67 = load <2 x double>, <2 x double>* %66
%68 = load double, double* %63
%69 = inttoptr i64 %30 to <2 x double>*
%70 = bitcast double* %52 to <2 x double>*
%71 = inttoptr i64 %32 to <2 x double>*
%72 = bitcast double* %59 to <2 x double>*
br label %73
73: ; preds = %47, %73
%74 = phi double [ %68, %47 ], [ %109, %73 ]
%75 = phi double [ %65, %47 ], [ %111, %73 ]
%76 = phi i64 [ 0, %47 ], [ %112, %73 ]
%77 = phi <2 x double> [ %67, %47 ], [ %110, %73 ]
%78 = load double, double* %0
%79 = getelementptr inbounds double, double* %3, i64 %76
%80 = load double, double* %79
%81 = load double, double* %50
%82 = load double, double* %31
%83 = fmul double %81, %82
%84 = tail call double @llvm.fmuladd.f64(double %78, double %80, double %83)
%85 = load double, double* %51
%86 = load double, double* %52
%87 = tail call double @llvm.fmuladd.f64(double %85, double %86, double %84)
%88 = load double, double* %53
%89 = load double, double* %54
%90 = tail call double @llvm.fmuladd.f64(double %88, double %89, double %87)
%91 = load double, double* %55
%92 = load double, double* %56
%93 = tail call double @llvm.fmuladd.f64(double %91, double %92, double %90)
%94 = load double, double* %57
%95 = load double, double* %58
%96 = extractelement <2 x double> %77, i64 0
%97 = fmul double %95, %96
%98 = tail call double @llvm.fmuladd.f64(double %94, double %75, double %97)
%99 = load double, double* %60
%100 = extractelement <2 x double> %77, i64 1
%101 = tail call double @llvm.fmuladd.f64(double %99, double %100, double %98)
%102 = load double, double* %62
%103 = tail call double @llvm.fmuladd.f64(double %102, double %74, double %101)
%104 = fsub double %93, %103
%105 = getelementptr inbounds double, double* %35, i64 %76
store double %104, double* %105
%106 = load double, double* %54
store double %106, double* %56
%107 = load <2 x double>, <2 x double>* %69
store <2 x double> %107, <2 x double>* %70
%108 = load double, double* %79
store double %108, double* %31
%109 = load double, double* %61
store double %109, double* %63
%110 = load <2 x double>, <2 x double>* %71
store <2 x double> %110, <2 x double>* %72
%111 = load double, double* %105
store double %111, double* %33
%112 = add nuw nsw i64 %76, 1
%113 = icmp eq i64 %112, %64
br i1 %113, label %114, label %73
114: ; preds = %73, %45
%115 = tail call i32 @free(double* %31)
%116 = tail call i32 @free(double* %33)
ret double* %35
}