void filter_r2(double *x, double *y, double *t, int len) {
  double init_val, pow_val;
  int i, lookahead;
  lookahead = (len < (8) ? len : (8));
  init_val = x[0];
  pow_val = -(0.1715728752538099023966225515806);
  for (i = 1; i <= lookahead; i++) {
    init_val += pow_val * x[i - 1];
    pow_val *= -(0.1715728752538099023966225515806);
  }
  y[0] = init_val;
  for (i = 1; i < len; i++)
    y[i] = x[i] - (0.1715728752538099023966225515806) * y[i - 1];
  init_val = x[len - 1];
  pow_val = -(0.1715728752538099023966225515806);
  for (i = 1; i <= lookahead; i++) {
    init_val += pow_val * x[len - i];
    pow_val *= -(0.1715728752538099023966225515806);
  }
  t[len - 1] = init_val;
  for (i = len - 2; i >= 0; i--)
    t[i] = x[i + 1] - (0.1715728752538099023966225515806) * t[i + 1];
  for (i = 0; i < len; i++)
    y[i] = (4.0 * (0.1715728752538099023966225515806) /
            (1.0 + (0.1715728752538099023966225515806))) *
           (y[i] + t[i]);
}


x86 assembly (clang, -O0):
<filter_r2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1128 <filter_r2+0x28>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    1135 <filter_r2+0x35>
mov    $0x8,%eax
mov    %eax,-0x3c(%rbp)
jmp    1135 <filter_r2+0x35>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     11b1 <filter_r2+0xb1>
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe67(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    115c <filter_r2+0x5c>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    121b <filter_r2+0x11b>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe08(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c5 <filter_r2+0xc5>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdc6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     129b <filter_r2+0x19b>
movsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xd7d(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1246 <filter_r2+0x146>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     1314 <filter_r2+0x214>
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xd0f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    12bb <filter_r2+0x1bb>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1368 <filter_r2+0x268>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xcbf(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    131b <filter_r2+0x21b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_r2>:
push   %r15
push   %r14
push   %rbx
cmp    $0x8,%ecx
mov    $0x8,%r8d
cmovl  %ecx,%r8d
movsd  (%rdi),%xmm1
test   %r8d,%r8d
jle    116d <filter_r2+0x6d>
lea    0x1(%r8),%eax
movsd  0xed9(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cmp    $0x2,%eax
je     121e <filter_r2+0x11e>
lea    -0x2(%rax),%r10
add    $0xfffffffffffffffd,%rax
mov    %r10d,%r9d
and    $0x3,%r9d
cmp    $0x3,%rax
jae    1176 <filter_r2+0x76>
mov    $0x1,%ebx
movsd  0xea6(%rip),%xmm1
mov    $0x2,%eax
test   %r9,%r9
jne    11f2 <filter_r2+0xf2>
jmp    121e <filter_r2+0x11e>
movapd %xmm1,%xmm0
jmp    121e <filter_r2+0x11e>
and    $0xfffffffffffffffc,%r10
neg    %r10
movsd  0xe7b(%rip),%xmm2
mov    $0x2,%eax
movapd %xmm2,%xmm1
xchg   %ax,%ax
mulsd  %xmm2,%xmm1
movsd  -0x8(%rdi,%rax,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
movsd  (%rdi,%rax,8),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
movsd  0x8(%rdi,%rax,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
movsd  0x10(%rdi,%rax,8),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
lea    (%r10,%rax,1),%rbx
add    $0x4,%rbx
add    $0x4,%rax
cmp    $0x2,%rbx
jne    1190 <filter_r2+0x90>
lea    -0x1(%rax),%rbx
test   %r9,%r9
je     121e <filter_r2+0x11e>
movsd  0xe06(%rip),%xmm2
nopw   0x0(%rax,%rax,1)
mulsd  %xmm2,%xmm1
movsd  (%rdi,%rbx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm3,%xmm0
mov    %rax,%rbx
add    $0x1,%rax
add    $0xffffffffffffffff,%r9
jne    1200 <filter_r2+0x100>
movsd  %xmm0,(%rsi)
mov    %ecx,%r10d
cmp    $0x2,%ecx
jl     12e8 <filter_r2+0x1e8>
lea    -0x1(%r10),%rax
lea    -0x2(%r10),%r11
mov    %eax,%r9d
and    $0x3,%r9d
mov    $0x1,%ebx
cmp    $0x3,%r11
jb     12ad <filter_r2+0x1ad>
and    $0xfffffffffffffffc,%rax
xor    %ebx,%ebx
movsd  0xdaa(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm0
addsd  0x8(%rdi,%rbx,8),%xmm0
movsd  %xmm0,0x8(%rsi,%rbx,8)
mulsd  %xmm1,%xmm0
addsd  0x10(%rdi,%rbx,8),%xmm0
movsd  %xmm0,0x10(%rsi,%rbx,8)
mulsd  %xmm1,%xmm0
addsd  0x18(%rdi,%rbx,8),%xmm0
movsd  %xmm0,0x18(%rsi,%rbx,8)
mulsd  %xmm1,%xmm0
addsd  0x20(%rdi,%rbx,8),%xmm0
movsd  %xmm0,0x20(%rsi,%rbx,8)
add    $0x4,%rbx
cmp    %rbx,%rax
jne    1260 <filter_r2+0x160>
add    $0x1,%rbx
test   %r9,%r9
je     12e8 <filter_r2+0x1e8>
lea    (%rsi,%rbx,8),%r11
lea    (%rdi,%rbx,8),%rbx
xor    %eax,%eax
movsd  0xd3c(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mulsd  %xmm1,%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%r11,%rax,8)
add    $0x1,%rax
cmp    %rax,%r9
jne    12d0 <filter_r2+0x1d0>
movslq %ecx,%r11
lea    -0x1(%r11),%r9
movsd  -0x8(%rdi,%r11,8),%xmm0
test   %r8d,%r8d
jle    13ea <filter_r2+0x2ea>
mov    %r8d,%r14d
lea    -0x1(%r14),%rax
mov    %r14d,%r8d
and    $0x3,%r8d
cmp    $0x3,%rax
jae    132e <filter_r2+0x22e>
movsd  0xce5(%rip),%xmm1
mov    $0x1,%eax
test   %r8,%r8
jne    13b5 <filter_r2+0x2b5>
jmp    13ea <filter_r2+0x2ea>
and    $0xfffffffc,%r14d
lea    (%rdi,%r11,8),%r15
add    $0xfffffffffffffff8,%r15
movsd  0xcbe(%rip),%xmm2
mov    $0xffffffffffffffff,%rax
movapd %xmm2,%xmm1
nopl   (%rax)
movsd  0x8(%r15,%rax,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
movsd  (%r15,%rax,8),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
movsd  -0x8(%r15,%rax,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm1
movsd  -0x10(%r15,%rax,8),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
lea    (%r14,%rax,1),%rbx
add    $0xfffffffffffffffc,%rbx
add    $0xfffffffffffffffc,%rax
cmp    $0xffffffffffffffff,%rbx
jne    1350 <filter_r2+0x250>
neg    %rax
test   %r8,%r8
je     13ea <filter_r2+0x2ea>
sub    %rax,%r11
lea    (%rdi,%r11,8),%rax
neg    %r8
xor    %ebx,%ebx
movsd  0xc37(%rip),%xmm2
nopl   0x0(%rax)
movsd  (%rax,%rbx,8),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
add    $0xffffffffffffffff,%rbx
cmp    %rbx,%r8
jne    13d0 <filter_r2+0x2d0>
movsd  %xmm0,(%rdx,%r9,8)
cmp    $0x2,%ecx
jl     145a <filter_r2+0x35a>
lea    -0x2(%rcx),%ebx
mov    %rbx,%rax
test   $0x1,%bl
jne    141d <filter_r2+0x31d>
movsd  0x8(%rdx,%rbx,8),%xmm0
mulsd  0xbf2(%rip),%xmm0
addsd  0x8(%rdi,%rbx,8),%xmm0
movsd  %xmm0,(%rdx,%rbx,8)
lea    -0x1(%rbx),%rax
test   %rbx,%rbx
je     145a <filter_r2+0x35a>
add    $0x1,%rax
movsd  0xbd2(%rip),%xmm0
xchg   %ax,%ax
movsd  (%rdx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdi,%rax,8),%xmm1
movsd  %xmm1,-0x8(%rdx,%rax,8)
mulsd  %xmm0,%xmm1
addsd  -0x8(%rdi,%rax,8),%xmm1
movsd  %xmm1,-0x10(%rdx,%rax,8)
add    $0xfffffffffffffffe,%rax
jne    1430 <filter_r2+0x330>
test   %ecx,%ecx
jle    15e6 <filter_r2+0x4e6>
cmp    $0x4,%ecx
jb     147d <filter_r2+0x37d>
lea    (%rdx,%r10,8),%rax
cmp    %rsi,%rax
jbe    14f7 <filter_r2+0x3f7>
lea    (%rsi,%r10,8),%rax
cmp    %rdx,%rax
jbe    14f7 <filter_r2+0x3f7>
xor    %ecx,%ecx
mov    %rcx,%rax
not    %rax
test   $0x1,%r10b
je     14a6 <filter_r2+0x3a6>
movsd  (%rsi,%rcx,8),%xmm0
addsd  (%rdx,%rcx,8),%xmm0
mulsd  0xb6b(%rip),%xmm0
movsd  %xmm0,(%rsi,%rcx,8)
or     $0x1,%rcx
add    %r10,%rax
je     15e6 <filter_r2+0x4e6>
movsd  0xb51(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
movsd  (%rsi,%rcx,8),%xmm1
movsd  0x8(%rsi,%rcx,8),%xmm2
addsd  (%rdx,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi,%rcx,8)
addsd  0x8(%rdx,%rcx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsi,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%r10
jne    14c0 <filter_r2+0x3c0>
jmp    15e6 <filter_r2+0x4e6>
mov    %r10d,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rax
mov    %rax,%rbx
shr    $0x2,%rbx
add    $0x1,%rbx
test   %rax,%rax
je     15ec <filter_r2+0x4ec>
mov    %rbx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %eax,%eax
movapd 0xaea(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
movupd (%rdx,%rax,8),%xmm1
movupd 0x10(%rdx,%rax,8),%xmm2
movupd (%rsi,%rax,8),%xmm3
addpd  %xmm1,%xmm3
movupd 0x10(%rsi,%rax,8),%xmm1
addpd  %xmm2,%xmm1
movupd 0x20(%rsi,%rax,8),%xmm2
movupd 0x30(%rsi,%rax,8),%xmm4
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm1
movupd %xmm3,(%rsi,%rax,8)
movupd %xmm1,0x10(%rsi,%rax,8)
movupd 0x20(%rdx,%rax,8),%xmm1
addpd  %xmm2,%xmm1
movupd 0x30(%rdx,%rax,8),%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,0x20(%rsi,%rax,8)
movupd %xmm2,0x30(%rsi,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rdi
jne    1530 <filter_r2+0x430>
test   $0x1,%bl
je     15dd <filter_r2+0x4dd>
movupd (%rsi,%rax,8),%xmm0
movupd 0x10(%rsi,%rax,8),%xmm1
movupd (%rdx,%rax,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%rdx,%rax,8),%xmm0
addpd  %xmm1,%xmm0
movapd 0xa46(%rip),%xmm1
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm0
movupd %xmm2,(%rsi,%rax,8)
movupd %xmm0,0x10(%rsi,%rax,8)
cmp    %r10,%rcx
jne    147f <filter_r2+0x37f>
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %eax,%eax
test   $0x1,%bl
jne    15a4 <filter_r2+0x4a4>
jmp    15dd <filter_r2+0x4dd>

LLVM IR (-O0):
define void @filter_r2(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 8
br i1 %14, label %15, label %17
15: ; preds = %4
%16 = load i32, i32* %8
br label %18
17: ; preds = %4
br label %18
18: ; preds = %17, %15
%19 = phi i32 [ %16, %15 ], [ 8, %17 ]
store i32 %19, i32* %12
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
store double %22, double* %9
store double 0xBFC5F619980C4337, double* %10
store i32 1, i32* %11
br label %23
23: ; preds = %39, %18
%24 = load i32, i32* %11
%25 = load i32, i32* %12
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %42
27: ; preds = %23
%28 = load double, double* %10
%29 = load double*, double** %5
%30 = load i32, i32* %11
%31 = sub nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %29, i64 %32
%34 = load double, double* %33
%35 = load double, double* %9
%36 = call double @llvm.fmuladd.f64(double %28, double %34, double %35)
store double %36, double* %9
%37 = load double, double* %10
%38 = fmul double %37, 0xBFC5F619980C4337
store double %38, double* %10
br label %39
39: ; preds = %27
%40 = load i32, i32* %11
%41 = add nsw i32 %40, 1
store i32 %41, i32* %11
br label %23
42: ; preds = %23
%43 = load double, double* %9
%44 = load double*, double** %6
%45 = getelementptr inbounds double, double* %44, i64 0
store double %43, double* %45
store i32 1, i32* %11
br label %46
46: ; preds = %67, %42
%47 = load i32, i32* %11
%48 = load i32, i32* %8
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %70
50: ; preds = %46
%51 = load double*, double** %5
%52 = load i32, i32* %11
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
%56 = load double*, double** %6
%57 = load i32, i32* %11
%58 = sub nsw i32 %57, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %56, i64 %59
%61 = load double, double* %60
%62 = call double @llvm.fmuladd.f64(double 0xBFC5F619980C4337, double %61, double %55)
%63 = load double*, double** %6
%64 = load i32, i32* %11
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
store double %62, double* %66
br label %67
67: ; preds = %50
%68 = load i32, i32* %11
%69 = add nsw i32 %68, 1
store i32 %69, i32* %11
br label %46
70: ; preds = %46
%71 = load double*, double** %5
%72 = load i32, i32* %8
%73 = sub nsw i32 %72, 1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %71, i64 %74
%76 = load double, double* %75
store double %76, double* %9
store double 0xBFC5F619980C4337, double* %10
store i32 1, i32* %11
br label %77
77: ; preds = %94, %70
%78 = load i32, i32* %11
%79 = load i32, i32* %12
%80 = icmp sle i32 %78, %79
br i1 %80, label %81, label %97
81: ; preds = %77
%82 = load double, double* %10
%83 = load double*, double** %5
%84 = load i32, i32* %8
%85 = load i32, i32* %11
%86 = sub nsw i32 %84, %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %83, i64 %87
%89 = load double, double* %88
%90 = load double, double* %9
%91 = call double @llvm.fmuladd.f64(double %82, double %89, double %90)
store double %91, double* %9
%92 = load double, double* %10
%93 = fmul double %92, 0xBFC5F619980C4337
store double %93, double* %10
br label %94
94: ; preds = %81
%95 = load i32, i32* %11
%96 = add nsw i32 %95, 1
store i32 %96, i32* %11
br label %77
97: ; preds = %77
%98 = load double, double* %9
%99 = load double*, double** %7
%100 = load i32, i32* %8
%101 = sub nsw i32 %100, 1
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %99, i64 %102
store double %98, double* %103
%104 = load i32, i32* %8
%105 = sub nsw i32 %104, 2
store i32 %105, i32* %11
br label %106
106: ; preds = %127, %97
%107 = load i32, i32* %11
%108 = icmp sge i32 %107, 0
br i1 %108, label %109, label %130
109: ; preds = %106
%110 = load double*, double** %5
%111 = load i32, i32* %11
%112 = add nsw i32 %111, 1
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %110, i64 %113
%115 = load double, double* %114
%116 = load double*, double** %7
%117 = load i32, i32* %11
%118 = add nsw i32 %117, 1
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %116, i64 %119
%121 = load double, double* %120
%122 = call double @llvm.fmuladd.f64(double 0xBFC5F619980C4337, double %121, double %115)
%123 = load double*, double** %7
%124 = load i32, i32* %11
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %123, i64 %125
store double %122, double* %126
br label %127
127: ; preds = %109
%128 = load i32, i32* %11
%129 = add nsw i32 %128, -1
store i32 %129, i32* %11
br label %106
130: ; preds = %106
store i32 0, i32* %11
br label %131
131: ; preds = %152, %130
%132 = load i32, i32* %11
%133 = load i32, i32* %8
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %155
135: ; preds = %131
%136 = load double*, double** %6
%137 = load i32, i32* %11
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
%140 = load double, double* %139
%141 = load double*, double** %7
%142 = load i32, i32* %11
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
%146 = fadd double %140, %145
%147 = fmul double 0x3FE2BEC333018867, %146
%148 = load double*, double** %6
%149 = load i32, i32* %11
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds double, double* %148, i64 %150
store double %147, double* %151
br label %152
152: ; preds = %135
%153 = load i32, i32* %11
%154 = add nsw i32 %153, 1
store i32 %154, i32* %11
br label %131
155: ; preds = %131
ret void
}

LLVM IR (-O2):
define void @filter_r2(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32 %3) {
%5 = icmp slt i32 %3, 8
%6 = select i1 %5, i32 %3, i32 8
%7 = load double, double* %0
%8 = icmp slt i32 %6, 1
br i1 %8, label %69, label %9
9: ; preds = %4
%10 = add nuw nsw i32 %6, 1
%11 = zext i32 %10 to i64
%12 = tail call double @llvm.fmuladd.f64(double %7, double 0xBFC5F619980C4337, double %7)
%13 = icmp eq i32 %10, 2
br i1 %13, label %69, label %14
14: ; preds = %9
%15 = add nsw i64 %11, -2
%16 = add nsw i64 %11, -3
%17 = and i64 %15, 3
%18 = icmp ult i64 %16, 3
br i1 %18, label %49, label %19
19: ; preds = %14
%20 = and i64 %15, -4
br label %21
21: ; preds = %21, %19
%22 = phi i64 [ 2, %19 ], [ %46, %21 ]
%23 = phi double [ %12, %19 ], [ %45, %21 ]
%24 = phi double [ 0xBFC5F619980C4337, %19 ], [ %42, %21 ]
%25 = phi i64 [ 1, %19 ], [ %41, %21 ]
%26 = phi i64 [ 0, %19 ], [ %47, %21 ]
%27 = fmul double %24, 0xBFC5F619980C4337
%28 = getelementptr inbounds double, double* %0, i64 %25
%29 = load double, double* %28
%30 = tail call double @llvm.fmuladd.f64(double %27, double %29, double %23)
%31 = or i64 %22, 1
%32 = fmul double %27, 0xBFC5F619980C4337
%33 = getelementptr inbounds double, double* %0, i64 %22
%34 = load double, double* %33
%35 = tail call double @llvm.fmuladd.f64(double %32, double %34, double %30)
%36 = add nuw nsw i64 %22, 2
%37 = fmul double %32, 0xBFC5F619980C4337
%38 = getelementptr inbounds double, double* %0, i64 %31
%39 = load double, double* %38
%40 = tail call double @llvm.fmuladd.f64(double %37, double %39, double %35)
%41 = add nuw nsw i64 %22, 3
%42 = fmul double %37, 0xBFC5F619980C4337
%43 = getelementptr inbounds double, double* %0, i64 %36
%44 = load double, double* %43
%45 = tail call double @llvm.fmuladd.f64(double %42, double %44, double %40)
%46 = add nuw nsw i64 %22, 4
%47 = add i64 %26, 4
%48 = icmp eq i64 %47, %20
br i1 %48, label %49, label %21
49: ; preds = %21, %14
%50 = phi double [ undef, %14 ], [ %45, %21 ]
%51 = phi i64 [ 2, %14 ], [ %46, %21 ]
%52 = phi double [ %12, %14 ], [ %45, %21 ]
%53 = phi double [ 0xBFC5F619980C4337, %14 ], [ %42, %21 ]
%54 = phi i64 [ 1, %14 ], [ %41, %21 ]
%55 = icmp eq i64 %17, 0
br i1 %55, label %69, label %56
56: ; preds = %49, %56
%57 = phi i64 [ %66, %56 ], [ %51, %49 ]
%58 = phi double [ %65, %56 ], [ %52, %49 ]
%59 = phi double [ %62, %56 ], [ %53, %49 ]
%60 = phi i64 [ %57, %56 ], [ %54, %49 ]
%61 = phi i64 [ %67, %56 ], [ 0, %49 ]
%62 = fmul double %59, 0xBFC5F619980C4337
%63 = getelementptr inbounds double, double* %0, i64 %60
%64 = load double, double* %63
%65 = tail call double @llvm.fmuladd.f64(double %62, double %64, double %58)
%66 = add nuw nsw i64 %57, 1
%67 = add i64 %61, 1
%68 = icmp eq i64 %67, %17
br i1 %68, label %69, label %56
69: ; preds = %49, %56, %9, %4
%70 = phi double [ %7, %4 ], [ %12, %9 ], [ %50, %49 ], [ %65, %56 ]
store double %70, double* %1
%71 = icmp sgt i32 %3, 1
br i1 %71, label %72, label %121
72: ; preds = %69
%73 = zext i32 %3 to i64
%74 = add nsw i64 %73, -1
%75 = add nsw i64 %73, -2
%76 = and i64 %74, 3
%77 = icmp ult i64 %75, 3
br i1 %77, label %106, label %78
78: ; preds = %72
%79 = and i64 %74, -4
br label %80
80: ; preds = %80, %78
%81 = phi double [ %70, %78 ], [ %101, %80 ]
%82 = phi i64 [ 1, %78 ], [ %103, %80 ]
%83 = phi i64 [ 0, %78 ], [ %104, %80 ]
%84 = getelementptr inbounds double, double* %0, i64 %82
%85 = load double, double* %84
%86 = tail call double @llvm.fmuladd.f64(double %81, double 0xBFC5F619980C4337, double %85)
%87 = getelementptr inbounds double, double* %1, i64 %82
store double %86, double* %87
%88 = add nuw nsw i64 %82, 1
%89 = getelementptr inbounds double, double* %0, i64 %88
%90 = load double, double* %89
%91 = tail call double @llvm.fmuladd.f64(double %86, double 0xBFC5F619980C4337, double %90)
%92 = getelementptr inbounds double, double* %1, i64 %88
store double %91, double* %92
%93 = add nuw nsw i64 %82, 2
%94 = getelementptr inbounds double, double* %0, i64 %93
%95 = load double, double* %94
%96 = tail call double @llvm.fmuladd.f64(double %91, double 0xBFC5F619980C4337, double %95)
%97 = getelementptr inbounds double, double* %1, i64 %93
store double %96, double* %97
%98 = add nuw nsw i64 %82, 3
%99 = getelementptr inbounds double, double* %0, i64 %98
%100 = load double, double* %99
%101 = tail call double @llvm.fmuladd.f64(double %96, double 0xBFC5F619980C4337, double %100)
%102 = getelementptr inbounds double, double* %1, i64 %98
store double %101, double* %102
%103 = add nuw nsw i64 %82, 4
%104 = add i64 %83, 4
%105 = icmp eq i64 %104, %79
br i1 %105, label %106, label %80
106: ; preds = %80, %72
%107 = phi double [ %70, %72 ], [ %101, %80 ]
%108 = phi i64 [ 1, %72 ], [ %103, %80 ]
%109 = icmp eq i64 %76, 0
br i1 %109, label %121, label %110
110: ; preds = %106, %110
%111 = phi double [ %116, %110 ], [ %107, %106 ]
%112 = phi i64 [ %118, %110 ], [ %108, %106 ]
%113 = phi i64 [ %119, %110 ], [ 0, %106 ]
%114 = getelementptr inbounds double, double* %0, i64 %112
%115 = load double, double* %114
%116 = tail call double @llvm.fmuladd.f64(double %111, double 0xBFC5F619980C4337, double %115)
%117 = getelementptr inbounds double, double* %1, i64 %112
store double %116, double* %117
%118 = add nuw nsw i64 %112, 1
%119 = add i64 %113, 1
%120 = icmp eq i64 %119, %76
br i1 %120, label %121, label %110
121: ; preds = %106, %110, %69
%122 = add nsw i32 %3, -1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %0, i64 %123
%125 = load double, double* %124
br i1 %8, label %186, label %126
126: ; preds = %121
%127 = sext i32 %3 to i64
%128 = add nuw nsw i32 %6, 1
%129 = zext i32 %128 to i64
%130 = add nsw i64 %129, -1
%131 = add nsw i64 %129, -2
%132 = and i64 %130, 3
%133 = icmp ult i64 %131, 3
br i1 %133, label %167, label %134
134: ; preds = %126
%135 = and i64 %130, -4
br label %136
136: ; preds = %136, %134
%137 = phi i64 [ 1, %134 ], [ %164, %136 ]
%138 = phi double [ %125, %134 ], [ %162, %136 ]
%139 = phi double [ 0xBFC5F619980C4337, %134 ], [ %163, %136 ]
%140 = phi i64 [ 0, %134 ], [ %165, %136 ]
%141 = sub nsw i64 %127, %137
%142 = getelementptr inbounds double, double* %0, i64 %141
%143 = load double, double* %142
%144 = tail call double @llvm.fmuladd.f64(double %139, double %143, double %138)
%145 = fmul double %139, 0xBFC5F619980C4337
%146 = xor i64 %137, -1
%147 = add i64 %146, %127
%148 = getelementptr inbounds double, double* %0, i64 %147
%149 = load double, double* %148
%150 = tail call double @llvm.fmuladd.f64(double %145, double %149, double %144)
%151 = fmul double %145, 0xBFC5F619980C4337
%152 = add nuw nsw i64 %137, 2
%153 = sub nsw i64 %127, %152
%154 = getelementptr inbounds double, double* %0, i64 %153
%155 = load double, double* %154
%156 = tail call double @llvm.fmuladd.f64(double %151, double %155, double %150)
%157 = fmul double %151, 0xBFC5F619980C4337
%158 = add nuw nsw i64 %137, 3
%159 = sub nsw i64 %127, %158
%160 = getelementptr inbounds double, double* %0, i64 %159
%161 = load double, double* %160
%162 = tail call double @llvm.fmuladd.f64(double %157, double %161, double %156)
%163 = fmul double %157, 0xBFC5F619980C4337
%164 = add nuw nsw i64 %137, 4
%165 = add nuw i64 %140, 4
%166 = icmp eq i64 %165, %135
br i1 %166, label %167, label %136
167: ; preds = %136, %126
%168 = phi double [ undef, %126 ], [ %162, %136 ]
%169 = phi i64 [ 1, %126 ], [ %164, %136 ]
%170 = phi double [ %125, %126 ], [ %162, %136 ]
%171 = phi double [ 0xBFC5F619980C4337, %126 ], [ %163, %136 ]
%172 = icmp eq i64 %132, 0
br i1 %172, label %186, label %173
173: ; preds = %167, %173
%174 = phi i64 [ %183, %173 ], [ %169, %167 ]
%175 = phi double [ %181, %173 ], [ %170, %167 ]
%176 = phi double [ %182, %173 ], [ %171, %167 ]
%177 = phi i64 [ %184, %173 ], [ 0, %167 ]
%178 = sub nsw i64 %127, %174
%179 = getelementptr inbounds double, double* %0, i64 %178
%180 = load double, double* %179
%181 = tail call double @llvm.fmuladd.f64(double %176, double %180, double %175)
%182 = fmul double %176, 0xBFC5F619980C4337
%183 = add nuw nsw i64 %174, 1
%184 = add i64 %177, 1
%185 = icmp eq i64 %184, %132
br i1 %185, label %186, label %173
186: ; preds = %167, %173, %121
%187 = phi double [ %125, %121 ], [ %168, %167 ], [ %181, %173 ]
%188 = getelementptr inbounds double, double* %2, i64 %123
store double %187, double* %188
br i1 %71, label %189, label %206
189: ; preds = %186
%190 = add nsw i32 %3, -2
%191 = zext i32 %190 to i64
%192 = and i64 %191, 1
%193 = icmp eq i64 %192, 0
br i1 %193, label %194, label %203
194: ; preds = %189
%195 = add nuw nsw i64 %191, 1
%196 = getelementptr inbounds double, double* %0, i64 %195
%197 = load double, double* %196
%198 = getelementptr inbounds double, double* %2, i64 %195
%199 = load double, double* %198
%200 = tail call double @llvm.fmuladd.f64(double %199, double 0xBFC5F619980C4337, double %197)
%201 = getelementptr inbounds double, double* %2, i64 %191
store double %200, double* %201
%202 = add nsw i64 %191, -1
br label %203
203: ; preds = %194, %189
%204 = phi i64 [ %191, %189 ], [ %202, %194 ]
%205 = icmp eq i32 %190, 0
br i1 %205, label %206, label %310
206: ; preds = %203, %310, %186
%207 = icmp sgt i32 %3, 0
br i1 %207, label %208, label %343
208: ; preds = %206
%209 = zext i32 %3 to i64
%210 = icmp ult i32 %3, 4
br i1 %210, label %293, label %211
211: ; preds = %208
%212 = getelementptr double, double* %1, i64 %209
%213 = getelementptr double, double* %2, i64 %209
%214 = icmp ugt double* %213, %1
%215 = icmp ugt double* %212, %2
%216 = and i1 %214, %215
br i1 %216, label %293, label %217
217: ; preds = %211
%218 = and i64 %209, 4294967292
%219 = add nsw i64 %218, -4
%220 = lshr exact i64 %219, 2
%221 = add nuw nsw i64 %220, 1
%222 = and i64 %221, 1
%223 = icmp eq i64 %219, 0
br i1 %223, label %269, label %224
224: ; preds = %217
%225 = and i64 %221, 9223372036854775806
br label %226
226: ; preds = %226, %224
%227 = phi i64 [ 0, %224 ], [ %266, %226 ]
%228 = phi i64 [ 0, %224 ], [ %267, %226 ]
%229 = getelementptr inbounds double, double* %1, i64 %227
%230 = bitcast double* %229 to <2 x double>*
%231 = load <2 x double>, <2 x double>* %230
%232 = getelementptr inbounds double, double* %229, i64 2
%233 = bitcast double* %232 to <2 x double>*
%234 = load <2 x double>, <2 x double>* %233
%235 = getelementptr inbounds double, double* %2, i64 %227
%236 = bitcast double* %235 to <2 x double>*
%237 = load <2 x double>, <2 x double>* %236
%238 = getelementptr inbounds double, double* %235, i64 2
%239 = bitcast double* %238 to <2 x double>*
%240 = load <2 x double>, <2 x double>* %239
%241 = fadd <2 x double> %231, %237
%242 = fadd <2 x double> %234, %240
%243 = fmul <2 x double> %241, <double 0x3FE2BEC333018867, double 0x3FE2BEC333018867>
%244 = fmul <2 x double> %242, <double 0x3FE2BEC333018867, double 0x3FE2BEC333018867>
%245 = bitcast double* %229 to <2 x double>*
store <2 x double> %243, <2 x double>* %245
%246 = bitcast double* %232 to <2 x double>*
store <2 x double> %244, <2 x double>* %246
%247 = or i64 %227, 4
%248 = getelementptr inbounds double, double* %1, i64 %247
%249 = bitcast double* %248 to <2 x double>*
%250 = load <2 x double>, <2 x double>* %249
%251 = getelementptr inbounds double, double* %248, i64 2
%252 = bitcast double* %251 to <2 x double>*
%253 = load <2 x double>, <2 x double>* %252
%254 = getelementptr inbounds double, double* %2, i64 %247
%255 = bitcast double* %254 to <2 x double>*
%256 = load <2 x double>, <2 x double>* %255
%257 = getelementptr inbounds double, double* %254, i64 2
%258 = bitcast double* %257 to <2 x double>*
%259 = load <2 x double>, <2 x double>* %258
%260 = fadd <2 x double> %250, %256
%261 = fadd <2 x double> %253, %259
%262 = fmul <2 x double> %260, <double 0x3FE2BEC333018867, double 0x3FE2BEC333018867>
%263 = fmul <2 x double> %261, <double 0x3FE2BEC333018867, double 0x3FE2BEC333018867>
%264 = bitcast double* %248 to <2 x double>*
store <2 x double> %262, <2 x double>* %264
%265 = bitcast double* %251 to <2 x double>*
store <2 x double> %263, <2 x double>* %265
%266 = add nuw i64 %227, 8
%267 = add i64 %228, 2
%268 = icmp eq i64 %267, %225
br i1 %268, label %269, label %226
269: ; preds = %226, %217
%270 = phi i64 [ 0, %217 ], [ %266, %226 ]
%271 = icmp eq i64 %222, 0
br i1 %271, label %291, label %272
272: ; preds = %269
%273 = getelementptr inbounds double, double* %1, i64 %270
%274 = bitcast double* %273 to <2 x double>*
%275 = load <2 x double>, <2 x double>* %274
%276 = getelementptr inbounds double, double* %273, i64 2
%277 = bitcast double* %276 to <2 x double>*
%278 = load <2 x double>, <2 x double>* %277
%279 = getelementptr inbounds double, double* %2, i64 %270
%280 = bitcast double* %279 to <2 x double>*
%281 = load <2 x double>, <2 x double>* %280
%282 = getelementptr inbounds double, double* %279, i64 2
%283 = bitcast double* %282 to <2 x double>*
%284 = load <2 x double>, <2 x double>* %283
%285 = fadd <2 x double> %275, %281
%286 = fadd <2 x double> %278, %284
%287 = fmul <2 x double> %285, <double 0x3FE2BEC333018867, double 0x3FE2BEC333018867>
%288 = fmul <2 x double> %286, <double 0x3FE2BEC333018867, double 0x3FE2BEC333018867>
%289 = bitcast double* %273 to <2 x double>*
store <2 x double> %287, <2 x double>* %289
%290 = bitcast double* %276 to <2 x double>*
store <2 x double> %288, <2 x double>* %290
br label %291
291: ; preds = %269, %272
%292 = icmp eq i64 %218, %209
br i1 %292, label %343, label %293
293: ; preds = %211, %208, %291
%294 = phi i64 [ 0, %211 ], [ 0, %208 ], [ %218, %291 ]
%295 = xor i64 %294, -1
%296 = and i64 %209, 1
%297 = icmp eq i64 %296, 0
br i1 %297, label %306, label %298
298: ; preds = %293
%299 = getelementptr inbounds double, double* %1, i64 %294
%300 = load double, double* %299
%301 = getelementptr inbounds double, double* %2, i64 %294
%302 = load double, double* %301
%303 = fadd double %300, %302
%304 = fmul double %303, 0x3FE2BEC333018867
store double %304, double* %299
%305 = or i64 %294, 1
br label %306
306: ; preds = %298, %293
%307 = phi i64 [ %294, %293 ], [ %305, %298 ]
%308 = sub nsw i64 0, %209
%309 = icmp eq i64 %295, %308
br i1 %309, label %343, label %326
310: ; preds = %203, %310
%311 = phi i64 [ %324, %310 ], [ %204, %203 ]
%312 = add nuw nsw i64 %311, 1
%313 = getelementptr inbounds double, double* %0, i64 %312
%314 = load double, double* %313
%315 = getelementptr inbounds double, double* %2, i64 %312
%316 = load double, double* %315
%317 = tail call double @llvm.fmuladd.f64(double %316, double 0xBFC5F619980C4337, double %314)
%318 = getelementptr inbounds double, double* %2, i64 %311
store double %317, double* %318
%319 = add nsw i64 %311, -1
%320 = getelementptr inbounds double, double* %0, i64 %311
%321 = load double, double* %320
%322 = tail call double @llvm.fmuladd.f64(double %317, double 0xBFC5F619980C4337, double %321)
%323 = getelementptr inbounds double, double* %2, i64 %319
store double %322, double* %323
%324 = add nsw i64 %311, -2
%325 = icmp eq i64 %319, 0
br i1 %325, label %206, label %310
326: ; preds = %306, %326
%327 = phi i64 [ %341, %326 ], [ %307, %306 ]
%328 = getelementptr inbounds double, double* %1, i64 %327
%329 = load double, double* %328
%330 = getelementptr inbounds double, double* %2, i64 %327
%331 = load double, double* %330
%332 = fadd double %329, %331
%333 = fmul double %332, 0x3FE2BEC333018867
store double %333, double* %328
%334 = add nuw nsw i64 %327, 1
%335 = getelementptr inbounds double, double* %1, i64 %334
%336 = load double, double* %335
%337 = getelementptr inbounds double, double* %2, i64 %334
%338 = load double, double* %337
%339 = fadd double %336, %338
%340 = fmul double %339, 0x3FE2BEC333018867
store double %340, double* %335
%341 = add nuw nsw i64 %327, 2
%342 = icmp eq i64 %341, %209
br i1 %342, label %343, label %326
343: ; preds = %306, %326, %291, %206
ret void
}