void kernel_durbin(int n, double r[2000 + 0], double y[2000 + 0]) {
  double z[2000];
  double alpha;
  double beta;
  double sum;
  int i, k;
#pragma scop
  y[0] = -r[0];
  beta = 1.0;
  alpha = -r[0];
  for (k = 1; k < n; k++) {
    beta = (1 - alpha * alpha) * beta;
    sum = 0.0;
    for (i = 0; i < k; i++) {
      sum += r[k - i - 1] * y[i];
    }
    alpha = -(r[k] + sum) / beta;
    for (i = 0; i < k; i++) {
      z[i] = y[i] + alpha * y[k - i - 1];
    }
    for (i = 0; i < k; i++) {
      y[i] = z[i];
    }
    y[k] = alpha;
  }
#pragma endscop
}


x86 assembly (clang, -O0):
<kernel_durbin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3e40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x3eb0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x3ea8(%rbp)
ff
movl   $0x1,-0x3ec0(%rbp)
mov    -0x3ec0(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1388 <kernel_durbin+0x288>
movsd  -0x3ea8(%rbp),%xmm0
ff
movsd  -0x3ea8(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe40(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x3eb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x3eb0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x3eb8(%rbp)
ff
movl   $0x0,-0x3ebc(%rbp)
mov    -0x3ebc(%rbp),%eax
cmp    -0x3ec0(%rbp),%eax
jge    1252 <kernel_durbin+0x152>
mov    -0x10(%rbp),%rax
mov    -0x3ec0(%rbp),%ecx
sub    -0x3ebc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3ebc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x3eb8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3eb8(%rbp)
ff
mov    -0x3ebc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3ebc(%rbp)
jmp    11e9 <kernel_durbin+0xe9>
mov    -0x10(%rbp),%rax
movslq -0x3ec0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x3eb8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x3eb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x3ea8(%rbp)
ff
movl   $0x0,-0x3ebc(%rbp)
mov    -0x3ebc(%rbp),%eax
cmp    -0x3ec0(%rbp),%eax
jge    130c <kernel_durbin+0x20c>
mov    -0x18(%rbp),%rax
movslq -0x3ebc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x3ea8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    -0x3ec0(%rbp),%ecx
sub    -0x3ebc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x3ebc(%rbp),%rax
movsd  %xmm0,-0x3ea0(%rbp,%rax,8)
ff ff
mov    -0x3ebc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3ebc(%rbp)
jmp    129b <kernel_durbin+0x19b>
movl   $0x0,-0x3ebc(%rbp)
mov    -0x3ebc(%rbp),%eax
cmp    -0x3ec0(%rbp),%eax
jge    135c <kernel_durbin+0x25c>
movslq -0x3ebc(%rbp),%rax
movsd  -0x3ea0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x3ebc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3ebc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3ebc(%rbp)
jmp    1316 <kernel_durbin+0x216>
movsd  -0x3ea8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movslq -0x3ec0(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3ec0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3ec0(%rbp)
jmp    117e <kernel_durbin+0x7e>
add    $0x3e40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_durbin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3eb8,%rsp
mov    %rsi,0x8(%rsp)
movsd  (%rsi),%xmm0
xorpd  0xece(%rip),%xmm0
movlpd %xmm0,(%rdx)
mov    %rdi,(%rsp)
cmp    $0x2,%edi
jl     1375 <kernel_durbin+0x265>
mov    %rdx,%rbx
mov    0x8(%rsp),%r14
movsd  (%r14),%xmm2
xorpd  0xea8(%rip),%xmm2
mov    (%rsp),%rax
add    $0xffffffff,%eax
mov    %rax,(%rsp)
lea    0x8(%rdx),%rax
mov    %rax,0x10(%rsp)
movsd  0xe9c(%rip),%xmm3
mov    $0x1,%ebp
mov    $0xfffffffffffffffd,%r12
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    11da <kernel_durbin+0xca>
nopl   0x0(%rax,%rax,1)
lea    0x8(,%r15,8),%rdx
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
movapd %xmm5,0x20(%rsp)
call   1030 <memcpy@plt>
movapd 0x20(%rsp),%xmm2
movsd  %xmm2,(%rbx,%rbp,8)
add    $0x1,%rbp
add    $0x1,%r15
add    $0x8,%r14
add    $0x1,%r12
add    $0x8,%r13
cmp    (%rsp),%r15
movsd  0x18(%rsp),%xmm3
je     1375 <kernel_durbin+0x265>
test   %r15,%r15
je     1360 <kernel_durbin+0x250>
mov    %rbp,%rcx
and    $0xfffffffffffffffe,%rcx
neg    %rcx
xorpd  %xmm0,%xmm0
xor    %eax,%eax
mov    0x10(%rsp),%rdx
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rax,8),%xmm1
mulsd  -0x8(%rdx),%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%r14,%rax,8),%xmm0
mulsd  (%rdx),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rdx
add    $0xfffffffffffffffe,%rax
cmp    %rax,%rcx
jne    1200 <kernel_durbin+0xf0>
neg    %rax
test   $0x1,%bpl
je     1250 <kernel_durbin+0x140>
mov    %rax,%rcx
not    %rcx
add    %rbp,%rcx
mov    0x8(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm1
mulsd  (%rbx,%rax,8),%xmm1
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
movsd  0xdb4(%rip),%xmm1
subsd  %xmm2,%xmm1
mov    0x8(%rsp),%rax
addsd  (%rax,%rbp,8),%xmm0
mulsd  %xmm1,%xmm3
xorpd  0xd8a(%rip),%xmm0
movapd %xmm0,%xmm5
divsd  %xmm3,%xmm5
cmp    $0x4,%rbp
movsd  %xmm3,0x18(%rsp)
jae    12a0 <kernel_durbin+0x190>
xor    %eax,%eax
jmp    1322 <kernel_durbin+0x212>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rcx
and    $0xfffffffffffffffc,%rcx
mov    %rbp,%rax
movabs $0x7ffffffffffffffc,%rdx
ff ff 7f
and    %rdx,%rax
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
mov    %r12,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd (%rbx,%rsi,8),%xmm1
movupd 0x10(%rbx,%rsi,8),%xmm2
movupd (%rbx,%rdx,8),%xmm3
movupd 0x10(%rbx,%rdx,8),%xmm4
shufpd $0x1,%xmm4,%xmm4
shufpd $0x1,%xmm3,%xmm3
mulpd  %xmm0,%xmm4
addpd  %xmm1,%xmm4
mulpd  %xmm0,%xmm3
addpd  %xmm2,%xmm3
movapd %xmm4,0x30(%rsp,%rsi,8)
movapd %xmm3,0x40(%rsp,%rsi,8)
add    $0x4,%rsi
add    $0xfffffffffffffffc,%rdx
cmp    %rsi,%rcx
jne    12d0 <kernel_durbin+0x1c0>
cmp    %rax,%rbp
je     1190 <kernel_durbin+0x80>
lea    0x0(,%rax,8),%rdx
mov    %r13,%rcx
sub    %rdx,%rcx
movsd  (%rbx,%rcx,1),%xmm0
mulsd  %xmm5,%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,0x30(%rsp,%rax,8)
add    $0x1,%rax
add    $0xfffffffffffffff8,%rcx
cmp    %rax,%rbp
jne    1330 <kernel_durbin+0x220>
jmp    1190 <kernel_durbin+0x80>
cs nopw 0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
test   $0x1,%bpl
jne    1234 <kernel_durbin+0x124>
jmp    1250 <kernel_durbin+0x140>
add    $0x3eb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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