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 *)malloc((filterLength - 1) * sizeof(double));
  y = (double *)malloc((filterLength - 1) * sizeof(double));
  output = (double *)malloc((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];
  }
  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  0xeb5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1160 <iirFilter+0x50>
jp     1160 <iirFilter+0x50>
jmp    11ca <iirFilter+0xba>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c5 <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    1167 <iirFilter+0x57>
jmp    11ca <iirFilter+0xba>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x38(%rbp)
movslq -0x24(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    123d <iirFilter+0x12d>
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    120e <iirFilter+0xfe>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1273 <iirFilter+0x163>
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    1244 <iirFilter+0x134>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12a4 <iirFilter+0x194>
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    127a <iirFilter+0x16a>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1455 <iirFilter+0x345>
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    12ab <iirFilter+0x19b>
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    $0x48,%rsp
mov    %r8d,%r13d
mov    %rcx,%r12
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
movsd  (%rsi),%xmm0
ucomisd 0xeb7(%rip),%xmm0
jne    114d <iirFilter+0x2d>
jnp    118e <iirFilter+0x6e>
test   %r14d,%r14d
jle    118e <iirFilter+0x6e>
mov    %r14d,%eax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
movapd %xmm0,%xmm1
nop
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
movsd  0x0(%rbp,%rcx,8),%xmm0
divsd  (%rbx),%xmm0
movsd  %xmm0,0x0(%rbp,%rcx,8)
cmp    %rcx,%rax
je     118e <iirFilter+0x6e>
movsd  0x8(%rbx,%rcx,8),%xmm1
movsd  (%rbx),%xmm0
add    $0x1,%rcx
jmp    1160 <iirFilter+0x40>
movslq %r14d,%rax
lea    -0x8(,%rax,8),%r15
ff
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
mov    %r13d,%r15d
movslq %r13d,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,%r13
cmp    $0x2,%r14d
jl     11f2 <iirFilter+0xd2>
add    $0xffffffff,%r14d
mov    %r14d,%r14d
shl    $0x3,%r14
mov    (%rsp),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
test   %r15d,%r15d
jle    1398 <iirFilter+0x278>
mov    %r15d,%r14d
lea    0x0(,%r14,8),%rdx
xor    %r15d,%r15d
mov    %r13,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
movsd  0x0(%rbp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x8(%rbp),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x10(%rbp),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x18(%rbp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x20(%rbp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rbx),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rbx),%xmm7
movsd  0x20(%rbx),%xmm15
mov    0x8(%rsp),%rax
movsd  (%rax),%xmm14
movsd  0x8(%rax),%xmm1
movsd  0x10(%rax),%xmm0
movsd  0x18(%rax),%xmm6
mov    (%rsp),%rdx
movsd  (%rdx),%xmm12
movsd  0x8(%rdx),%xmm5
movsd  0x10(%rdx),%xmm3
mov    %rdx,%rcx
movsd  0x18(%rdx),%xmm2
nop
movapd %xmm14,%xmm8
movapd %xmm1,%xmm13
movapd %xmm0,%xmm10
movapd %xmm12,%xmm9
movapd %xmm5,%xmm11
movapd %xmm3,%xmm4
mulsd  %xmm15,%xmm2
mulsd  0x20(%rsp),%xmm6
movsd  (%r12,%r15,8),%xmm14
movsd  0x38(%rsp),%xmm0
mulsd  %xmm8,%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  %xmm14,%xmm1
addsd  %xmm0,%xmm1
movsd  0x30(%rsp),%xmm0
mulsd  %xmm13,%xmm0
addsd  %xmm1,%xmm0
movsd  0x28(%rsp),%xmm12
mulsd  %xmm10,%xmm12
addsd  %xmm0,%xmm12
addsd  %xmm6,%xmm12
movsd  0x10(%rsp),%xmm0
mulsd  %xmm5,%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  %xmm9,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm7,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
subsd  %xmm0,%xmm12
movsd  %xmm12,0x0(%r13,%r15,8)
add    $0x1,%r15
movapd %xmm3,%xmm2
movapd %xmm5,%xmm3
movapd %xmm9,%xmm5
movapd %xmm10,%xmm6
movapd %xmm13,%xmm0
movapd %xmm8,%xmm1
cmp    %r15,%r14
jne    12a0 <iirFilter+0x180>
movsd  %xmm14,(%rax)
movsd  %xmm8,0x8(%rax)
movsd  %xmm13,0x10(%rax)
movsd  %xmm10,0x18(%rax)
movsd  %xmm12,(%rcx)
movsd  %xmm9,0x8(%rcx)
movsd  %xmm11,0x10(%rcx)
movsd  %xmm4,0x18(%rcx)
mov    %r13,%rax
add    $0x48,%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 = sext i32 %59 to i64
%61 = mul i64 %60, 8
%62 = call i8* @malloc(i64 %61)
%63 = bitcast i8* %62 to double*
store double* %63, double** %12
%64 = load i32, i32* %8
%65 = sub nsw i32 %64, 1
%66 = sext i32 %65 to i64
%67 = mul i64 %66, 8
%68 = call i8* @malloc(i64 %67)
%69 = bitcast i8* %68 to double*
store double* %69, double** %13
%70 = load i32, i32* %10
%71 = sext i32 %70 to i64
%72 = mul i64 %71, 8
%73 = call i8* @malloc(i64 %72)
%74 = bitcast i8* %73 to double*
store double* %74, double** %14
store i32 0, i32* %11
br label %75
75: ; preds = %85, %57
%76 = load i32, i32* %11
%77 = load i32, i32* %8
%78 = sub nsw i32 %77, 1
%79 = icmp slt i32 %76, %78
br i1 %79, label %80, label %88
80: ; preds = %75
%81 = load double*, double** %13
%82 = load i32, i32* %11
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
store double 0.000000e+00, double* %84
br label %85
85: ; preds = %80
%86 = load i32, i32* %11
%87 = add nsw i32 %86, 1
store i32 %87, i32* %11
br label %75
88: ; preds = %75
store i32 0, i32* %11
br label %89
89: ; preds = %99, %88
%90 = load i32, i32* %11
%91 = load i32, i32* %8
%92 = sub nsw i32 %91, 1
%93 = icmp slt i32 %90, %92
br i1 %93, label %94, label %102
94: ; preds = %89
%95 = load double*, double** %12
%96 = load i32, i32* %11
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %95, i64 %97
store double 0.000000e+00, double* %98
br label %99
99: ; preds = %94
%100 = load i32, i32* %11
%101 = add nsw i32 %100, 1
store i32 %101, i32* %11
br label %89
102: ; preds = %89
store i32 0, i32* %11
br label %103
103: ; preds = %112, %102
%104 = load i32, i32* %11
%105 = load i32, i32* %10
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %115
107: ; preds = %103
%108 = load double*, double** %14
%109 = load i32, i32* %11
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
store double 0.000000e+00, double* %111
br label %112
112: ; preds = %107
%113 = load i32, i32* %11
%114 = add nsw i32 %113, 1
store i32 %114, i32* %11
br label %103
115: ; preds = %103
store i32 0, i32* %11
br label %116
116: ; preds = %237, %115
%117 = load i32, i32* %11
%118 = load i32, i32* %10
%119 = icmp slt i32 %117, %118
br i1 %119, label %120, label %240
120: ; preds = %116
%121 = load double*, double** %6
%122 = getelementptr inbounds double, double* %121, i64 0
%123 = load double, double* %122
%124 = load double*, double** %9
%125 = load i32, i32* %11
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %124, i64 %126
%128 = load double, double* %127
%129 = load double*, double** %6
%130 = getelementptr inbounds double, double* %129, i64 1
%131 = load double, double* %130
%132 = load double*, double** %12
%133 = getelementptr inbounds double, double* %132, i64 0
%134 = load double, double* %133
%135 = fmul double %131, %134
%136 = call double @llvm.fmuladd.f64(double %123, double %128, double %135)
%137 = load double*, double** %6
%138 = getelementptr inbounds double, double* %137, i64 2
%139 = load double, double* %138
%140 = load double*, double** %12
%141 = getelementptr inbounds double, double* %140, i64 1
%142 = load double, double* %141
%143 = call double @llvm.fmuladd.f64(double %139, double %142, double %136)
%144 = load double*, double** %6
%145 = getelementptr inbounds double, double* %144, i64 3
%146 = load double, double* %145
%147 = load double*, double** %12
%148 = getelementptr inbounds double, double* %147, i64 2
%149 = load double, double* %148
%150 = call double @llvm.fmuladd.f64(double %146, double %149, double %143)
%151 = load double*, double** %6
%152 = getelementptr inbounds double, double* %151, i64 4
%153 = load double, double* %152
%154 = load double*, double** %12
%155 = getelementptr inbounds double, double* %154, i64 3
%156 = load double, double* %155
%157 = call double @llvm.fmuladd.f64(double %153, double %156, double %150)
store double %157, double* %15
%158 = load double*, double** %7
%159 = getelementptr inbounds double, double* %158, i64 1
%160 = load double, double* %159
%161 = load double*, double** %13
%162 = getelementptr inbounds double, double* %161, i64 0
%163 = load double, double* %162
%164 = load double*, double** %7
%165 = getelementptr inbounds double, double* %164, i64 2
%166 = load double, double* %165
%167 = load double*, double** %13
%168 = getelementptr inbounds double, double* %167, i64 1
%169 = load double, double* %168
%170 = fmul double %166, %169
%171 = call double @llvm.fmuladd.f64(double %160, double %163, double %170)
%172 = load double*, double** %7
%173 = getelementptr inbounds double, double* %172, i64 3
%174 = load double, double* %173
%175 = load double*, double** %13
%176 = getelementptr inbounds double, double* %175, i64 2
%177 = load double, double* %176
%178 = call double @llvm.fmuladd.f64(double %174, double %177, double %171)
%179 = load double*, double** %7
%180 = getelementptr inbounds double, double* %179, i64 4
%181 = load double, double* %180
%182 = load double*, double** %13
%183 = getelementptr inbounds double, double* %182, i64 3
%184 = load double, double* %183
%185 = call double @llvm.fmuladd.f64(double %181, double %184, double %178)
store double %185, double* %16
%186 = load double, double* %15
%187 = load double, double* %16
%188 = fsub double %186, %187
%189 = load double*, double** %14
%190 = load i32, i32* %11
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds double, double* %189, i64 %191
store double %188, double* %192
%193 = load double*, double** %12
%194 = getelementptr inbounds double, double* %193, i64 2
%195 = load double, double* %194
%196 = load double*, double** %12
%197 = getelementptr inbounds double, double* %196, i64 3
store double %195, double* %197
%198 = load double*, double** %12
%199 = getelementptr inbounds double, double* %198, i64 1
%200 = load double, double* %199
%201 = load double*, double** %12
%202 = getelementptr inbounds double, double* %201, i64 2
store double %200, double* %202
%203 = load double*, double** %12
%204 = getelementptr inbounds double, double* %203, i64 0
%205 = load double, double* %204
%206 = load double*, double** %12
%207 = getelementptr inbounds double, double* %206, i64 1
store double %205, double* %207
%208 = load double*, double** %9
%209 = load i32, i32* %11
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds double, double* %208, i64 %210
%212 = load double, double* %211
%213 = load double*, double** %12
%214 = getelementptr inbounds double, double* %213, i64 0
store double %212, double* %214
%215 = load double*, double** %13
%216 = getelementptr inbounds double, double* %215, i64 2
%217 = load double, double* %216
%218 = load double*, double** %13
%219 = getelementptr inbounds double, double* %218, i64 3
store double %217, double* %219
%220 = load double*, double** %13
%221 = getelementptr inbounds double, double* %220, i64 1
%222 = load double, double* %221
%223 = load double*, double** %13
%224 = getelementptr inbounds double, double* %223, i64 2
store double %222, double* %224
%225 = load double*, double** %13
%226 = getelementptr inbounds double, double* %225, i64 0
%227 = load double, double* %226
%228 = load double*, double** %13
%229 = getelementptr inbounds double, double* %228, i64 1
store double %227, double* %229
%230 = load double*, double** %14
%231 = load i32, i32* %11
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %230, i64 %232
%234 = load double, double* %233
%235 = load double*, double** %13
%236 = getelementptr inbounds double, double* %235, i64 0
store double %234, double* %236
br label %237
237: ; preds = %120
%238 = load i32, i32* %11
%239 = add nsw i32 %238, 1
store i32 %239, i32* %11
br label %116
240: ; preds = %116
%241 = load double*, double** %14
ret double* %241
}

LLVM IR (-O2):
define noalias 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 = sext i32 %29 to i64
%31 = shl nsw i64 %30, 3
%32 = tail call i8* @malloc(i64 %31)
%33 = bitcast i8* %32 to double*
%34 = tail call i8* @malloc(i64 %31)
%35 = bitcast i8* %34 to double*
%36 = sext i32 %4 to i64
%37 = shl nsw i64 %36, 3
%38 = tail call i8* @malloc(i64 %37)
%39 = bitcast i8* %38 to double*
%40 = icmp sgt i32 %2, 1
br i1 %40, label %41, label %46
41: ; preds = %28
%42 = zext i32 %29 to i64
%43 = shl nuw nsw i64 %42, 3
%44 = zext i32 %29 to i64
%45 = shl nuw nsw i64 %44, 3
br label %46
46: ; preds = %28, %41
%47 = icmp sgt i32 %4, 0
br i1 %47, label %48, label %109
48: ; preds = %46
%49 = zext i32 %4 to i64
%50 = shl nuw nsw i64 %49, 3
%51 = load double, double* %0
%52 = getelementptr inbounds double, double* %0, i64 1
%53 = load double, double* %52
%54 = getelementptr inbounds double, double* %0, i64 2
%55 = load double, double* %54
%56 = getelementptr inbounds double, double* %33, i64 1
%57 = getelementptr inbounds double, double* %0, i64 3
%58 = load double, double* %57
%59 = getelementptr inbounds double, double* %33, i64 2
%60 = getelementptr inbounds double, double* %0, i64 4
%61 = load double, double* %60
%62 = getelementptr inbounds double, double* %33, i64 3
%63 = getelementptr inbounds double, double* %1, i64 1
%64 = load double, double* %63
%65 = getelementptr inbounds double, double* %1, i64 2
%66 = load double, double* %65
%67 = getelementptr inbounds double, double* %35, i64 1
%68 = getelementptr inbounds double, double* %1, i64 3
%69 = load double, double* %68
%70 = getelementptr inbounds double, double* %35, i64 2
%71 = getelementptr inbounds double, double* %1, i64 4
%72 = load double, double* %71
%73 = getelementptr inbounds double, double* %35, i64 3
%74 = load double, double* %33
%75 = load double, double* %56
%76 = load double, double* %59
%77 = load double, double* %62
%78 = load double, double* %35
%79 = load double, double* %67
%80 = load double, double* %70
%81 = load double, double* %73
%82 = zext i32 %4 to i64
br label %83
83: ; preds = %48, %83
%84 = phi i64 [ 0, %48 ], [ %106, %83 ]
%85 = phi double [ %81, %48 ], [ %86, %83 ]
%86 = phi double [ %80, %48 ], [ %87, %83 ]
%87 = phi double [ %79, %48 ], [ %88, %83 ]
%88 = phi double [ %78, %48 ], [ %104, %83 ]
%89 = phi double [ %77, %48 ], [ %90, %83 ]
%90 = phi double [ %76, %48 ], [ %91, %83 ]
%91 = phi double [ %75, %48 ], [ %92, %83 ]
%92 = phi double [ %74, %48 ], [ %94, %83 ]
%93 = getelementptr inbounds double, double* %3, i64 %84
%94 = load double, double* %93
%95 = fmul double %53, %92
%96 = tail call double @llvm.fmuladd.f64(double %51, double %94, double %95)
%97 = tail call double @llvm.fmuladd.f64(double %55, double %91, double %96)
%98 = tail call double @llvm.fmuladd.f64(double %58, double %90, double %97)
%99 = tail call double @llvm.fmuladd.f64(double %61, double %89, double %98)
%100 = fmul double %66, %87
%101 = tail call double @llvm.fmuladd.f64(double %64, double %88, double %100)
%102 = tail call double @llvm.fmuladd.f64(double %69, double %86, double %101)
%103 = tail call double @llvm.fmuladd.f64(double %72, double %85, double %102)
%104 = fsub double %99, %103
%105 = getelementptr inbounds double, double* %39, i64 %84
store double %104, double* %105
%106 = add nuw nsw i64 %84, 1
%107 = icmp eq i64 %106, %82
br i1 %107, label %108, label %83
108: ; preds = %83
store double %94, double* %33
store double %92, double* %56
store double %91, double* %59
store double %90, double* %62
store double %104, double* %35
store double %88, double* %67
store double %87, double* %70
store double %86, double* %73
br label %109
109: ; preds = %46, %108
ret double* %39
}