int levnsn(n, r, a, e, refl)
int n;
double r[], a[], e[], refl[];
{
  int k, km1, i, kmi, j;
  double ai, akk, err, err1, r0, t, akmi;
  double *pa, *pr;
  for (i = 0; i < n; i++) {
    a[i] = 0.0;
    e[i] = 0.0;
    refl[i] = 0.0;
  }
  r0 = r[0];
  e[0] = r0;
  err = r0;
  akk = -r[1] / err;
  err = (1.0 - akk * akk) * err;
  e[1] = err;
  a[1] = akk;
  refl[1] = akk;
  if (err < 1.0e-2)
    return 0;
  for (k = 2; k < n; k++) {
    t = 0.0;
    pa = &a[1];
    pr = &r[k - 1];
    for (j = 1; j < k; j++)
      t += *pa++ * *pr--;
    akk = -(r[k] + t) / err;
    refl[k] = akk;
    km1 = k / 2;
    for (j = 1; j <= km1; j++) {
      kmi = k - j;
      ai = a[j];
      akmi = a[kmi];
      a[j] = ai + akk * akmi;
      if (i == kmi)
        goto nxtk;
      a[kmi] = akmi + akk * ai;
    }
  nxtk:
    a[k] = akk;
    err1 = (1.0 - akk * akk) * err;
    e[k] = err1;
    if (err1 < 0)
      err1 = -err1;
    if (err1 < 1.0e-2)
      return 0;
    err = err1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<levnsn>:
push   %rbp
mov    %rsp,%rbp
push   %rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1169 <levnsn+0x69>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    111f <levnsn+0x1f>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe24(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  0xddc(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    123b <levnsn+0x13b>
movl   $0x0,-0x4(%rbp)
jmp    14a7 <levnsn+0x3a7>
movl   $0x2,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14a0 <levnsn+0x3a0>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x88(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12dc <levnsn+0x1dc>
mov    -0x80(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x80(%rbp)
movsd  (%rax),%xmm0
mov    -0x88(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x88(%rbp)
movsd  (%rax),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1284 <levnsn+0x184>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     13d6 <levnsn+0x2d6>
mov    -0x2c(%rbp),%eax
sub    -0x3c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jne    13a4 <levnsn+0x2a4>
jmp    13db <levnsn+0x2db>
movsd  -0x78(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1336 <levnsn+0x236>
jmp    13db <levnsn+0x2db>
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xbee(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    1469 <levnsn+0x369>
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xb8f(%rip),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    1488 <levnsn+0x388>
movl   $0x0,-0x4(%rbp)
jmp    14a7 <levnsn+0x3a7>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1242 <levnsn+0x142>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<levnsn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %edi,%ebp
test   %edi,%edi
mov    %rbp,-0x8(%rsp)
jle    1191 <levnsn+0x91>
cmp    $0x4,%edi
jae    1199 <levnsn+0x99>
xor    %eax,%eax
mov    %rax,%rbx
not    %rbx
test   $0x1,%bpl
je     1144 <levnsn+0x44>
movq   $0x0,(%rdx,%rax,8)
movq   $0x0,(%rcx,%rax,8)
movq   $0x0,(%r8,%rax,8)
or     $0x1,%rax
add    %rbp,%rbx
je     12a9 <levnsn+0x1a9>
nopl   (%rax)
movq   $0x0,(%rdx,%rax,8)
movq   $0x0,(%rcx,%rax,8)
movq   $0x0,(%r8,%rax,8)
movq   $0x0,0x8(%rdx,%rax,8)
movq   $0x0,0x8(%rcx,%rax,8)
movq   $0x0,0x8(%r8,%rax,8)
add    $0x2,%rax
cmp    %rax,%rbp
jne    1150 <levnsn+0x50>
jmp    12a9 <levnsn+0x1a9>
xor    %r12d,%r12d
jmp    12ac <levnsn+0x1ac>
lea    (%rcx,%rbp,8),%r11
cmp    %rdx,%r11
seta   %r14b
lea    (%rdx,%rbp,8),%rax
cmp    %rcx,%rax
seta   %r15b
lea    (%r8,%rbp,8),%rbx
cmp    %rdx,%rbx
seta   %r12b
cmp    %r8,%rax
seta   %r10b
cmp    %rcx,%rbx
seta   %r9b
cmp    %r8,%r11
seta   %r11b
xor    %eax,%eax
test   %r15b,%r14b
jne    111c <levnsn+0x1c>
and    %r10b,%r12b
jne    111c <levnsn+0x1c>
and    %r11b,%r9b
jne    111c <levnsn+0x1c>
mov    %ebp,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rbx
mov    %rbx,%r10
shr    $0x2,%r10
add    $0x1,%r10
test   %rbx,%rbx
je     14b8 <levnsn+0x3b8>
mov    %r10,%r11
and    $0xfffffffffffffffe,%r11
xor    %ebx,%ebx
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
movupd %xmm0,(%rdx,%rbx,8)
movupd %xmm0,0x10(%rdx,%rbx,8)
movupd %xmm0,(%rcx,%rbx,8)
movupd %xmm0,0x10(%rcx,%rbx,8)
movupd %xmm0,(%r8,%rbx,8)
movupd %xmm0,0x10(%r8,%rbx,8)
movupd %xmm0,0x20(%rdx,%rbx,8)
movupd %xmm0,0x30(%rdx,%rbx,8)
movupd %xmm0,0x20(%rcx,%rbx,8)
movupd %xmm0,0x30(%rcx,%rbx,8)
movupd %xmm0,0x20(%r8,%rbx,8)
movupd %xmm0,0x30(%r8,%rbx,8)
add    $0x8,%rbx
add    $0xfffffffffffffffe,%r11
jne    1220 <levnsn+0x120>
test   $0x1,%r10b
je     12a0 <levnsn+0x1a0>
xorpd  %xmm0,%xmm0
movupd %xmm0,(%rdx,%rbx,8)
movupd %xmm0,0x10(%rdx,%rbx,8)
movupd %xmm0,(%rcx,%rbx,8)
movupd %xmm0,0x10(%rcx,%rbx,8)
movupd %xmm0,(%r8,%rbx,8)
movupd %xmm0,0x10(%r8,%rbx,8)
cmp    %rbp,%rax
jne    111c <levnsn+0x1c>
movslq %edi,%r12
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rcx)
movsd  0x8(%rsi),%xmm3
xorpd  0xd3f(%rip),%xmm3
divsd  %xmm1,%xmm3
movapd %xmm3,%xmm4
mulsd  %xmm3,%xmm4
movsd  0xd3a(%rip),%xmm8
movapd %xmm8,%xmm2
subsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rcx)
movsd  %xmm3,0x8(%rdx)
movsd  %xmm3,0x8(%r8)
movsd  0xd1d(%rip),%xmm1
ucomisd %xmm2,%xmm1
ja     14ab <levnsn+0x3ab>
cmp    $0x3,%edi
jl     14ab <levnsn+0x3ab>
lea    0x8(%rdx),%r10
add    $0xffffffffffffffff,%r12
mov    $0x2,%r15d
mov    $0x1,%r11d
xor    %r14d,%r14d
movapd 0xcd3(%rip),%xmm3
xorpd  %xmm4,%xmm4
mov    %r10,%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rax
add    $0x1,%r14
lea    (%rsi,%r15,8),%rdi
add    $0xfffffffffffffff8,%rdi
cmp    $0x3,%rax
jae    1360 <levnsn+0x260>
mov    %r10,%rax
xorpd  %xmm0,%xmm0
jmp    13b4 <levnsn+0x2b4>
xchg   %ax,%ax
mov    %r11,%rbx
and    $0xfffffffffffffffc,%rbx
xorpd  %xmm0,%xmm0
mov    %r10,%rax
xchg   %ax,%ax
movsd  (%rax),%xmm6
mulsd  (%rdi),%xmm6
movsd  0x8(%rax),%xmm7
addsd  %xmm0,%xmm6
mulsd  -0x8(%rdi),%xmm7
addsd  %xmm6,%xmm7
movsd  0x10(%rax),%xmm6
mulsd  -0x10(%rdi),%xmm6
addsd  %xmm7,%xmm6
movsd  0x18(%rax),%xmm0
mulsd  -0x18(%rdi),%xmm0
add    $0x20,%rax
add    $0xffffffffffffffe0,%rdi
addsd  %xmm6,%xmm0
add    $0xfffffffffffffffc,%rbx
jne    1370 <levnsn+0x270>
mov    %r15,%rbx
shr    %rbx
test   $0x3,%r14b
je     13eb <levnsn+0x2eb>
mov    %r11d,%ebp
and    $0x3,%ebp
xor    %r9d,%r9d
nopl   0x0(%rax)
movsd  (%rax,%r9,8),%xmm6
mulsd  (%rdi),%xmm6
add    $0xfffffffffffffff8,%rdi
addsd  %xmm6,%xmm0
add    $0x1,%r9
cmp    %r9,%rbp
jne    13d0 <levnsn+0x2d0>
neg    %rbx
addsd  (%rsi,%r15,8),%xmm0
xorpd  %xmm3,%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,(%r8,%r15,8)
mov    %r10,%rax
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movsd  (%rax),%xmm6
movsd  0x0(%r13,%rdi,8),%xmm7
movapd %xmm0,%xmm5
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
movsd  %xmm5,(%rax)
cmp    %rdi,%r12
je     144c <levnsn+0x34c>
mulsd  %xmm0,%xmm6
addsd  %xmm7,%xmm6
movsd  %xmm6,0x0(%r13,%rdi,8)
add    $0xffffffffffffffff,%rdi
add    $0x8,%rax
cmp    %rdi,%rbx
jne    1410 <levnsn+0x310>
movsd  %xmm0,(%rdx,%r15,8)
mulsd  %xmm0,%xmm0
movapd %xmm8,%xmm5
subsd  %xmm0,%xmm5
mulsd  %xmm5,%xmm2
movsd  %xmm2,(%rcx,%r15,8)
movapd %xmm2,%xmm0
xorpd  %xmm3,%xmm0
movapd %xmm2,%xmm5
cmpltsd %xmm4,%xmm5
andpd  %xmm5,%xmm0
andnpd %xmm2,%xmm5
orpd   %xmm0,%xmm5
ucomisd %xmm5,%xmm1
ja     14ab <levnsn+0x3ab>
add    $0x1,%r15
add    $0x1,%r11
add    $0xffffffffffffffff,%r12
add    $0x8,%r13
movapd %xmm5,%xmm2
cmp    -0x8(%rsp),%r15
jb     1340 <levnsn+0x240>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
test   $0x1,%r10b
jne    1279 <levnsn+0x179>
jmp    12a0 <levnsn+0x1a0>

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

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