void fnFilterAlphaAsymC(int *n, double *u, double *beta, double *vstar,
                        double *vstarstar, double *lstar) {
  int i;
  vstar[0] = (u[0] * u[0]);
  vstarstar[0] = (u[0] * u[0]);
  lstar[0] = 0;
  for (i = 1; i < *n; i++) {
    vstar[i] = *beta * vstar[i - 1];
    if (u[i] >= 0)
      vstar[i] = vstar[i] + (u[i] * u[i]);
    vstarstar[i] = *beta * vstarstar[i - 1];
    if (u[i] < 0)
      vstarstar[i] = vstarstar[i] + (u[i] * u[i]);
    lstar[i] = 1 + *beta * lstar[i - 1];
  }
}


x86 assembly (clang, -O0):
<fnFilterAlphaAsymC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    12a8 <fnFilterAlphaAsymC+0x1a8>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11ea <fnFilterAlphaAsymC+0xea>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
xorps  %xmm0,%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    1263 <fnFilterAlphaAsymC+0x163>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd77(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    115e <fnFilterAlphaAsymC+0x5e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnFilterAlphaAsymC>:
movsd  (%rsi),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,(%rcx)
movsd  (%rsi),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,(%r8)
movq   $0x0,(%r9)
mov    (%rdi),%eax
cmp    $0x2,%eax
jl     11b1 <fnFilterAlphaAsymC+0xb1>
mov    $0x1,%edi
xorpd  %xmm0,%xmm0
movsd  0xec4(%rip),%xmm1
jmp    115e <fnFilterAlphaAsymC+0x5e>
xchg   %ax,%ax
movsd  (%rdx),%xmm2
mulsd  -0x8(%r9,%rdi,8),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r9,%rdi,8)
add    $0x1,%rdi
cmp    %rdi,%rax
je     11b1 <fnFilterAlphaAsymC+0xb1>
movsd  (%rdx),%xmm2
mulsd  -0x8(%rcx,%rdi,8),%xmm2
movsd  %xmm2,(%rcx,%rdi,8)
movsd  (%rsi,%rdi,8),%xmm3
ucomisd %xmm0,%xmm3
jb     1185 <fnFilterAlphaAsymC+0x85>
mulsd  %xmm3,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%rcx,%rdi,8)
movsd  (%rdx),%xmm2
mulsd  -0x8(%r8,%rdi,8),%xmm2
movsd  %xmm2,(%r8,%rdi,8)
movsd  (%rsi,%rdi,8),%xmm3
ucomisd %xmm3,%xmm0
jbe    1140 <fnFilterAlphaAsymC+0x40>
mulsd  %xmm3,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%r8,%rdi,8)
jmp    1140 <fnFilterAlphaAsymC+0x40>
ret

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

LLVM IR (-O2):
define void @fnFilterAlphaAsymC(i32* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = load double, double* %1
%8 = fmul double %7, %7
store double %8, double* %3
%9 = load double, double* %1
%10 = fmul double %9, %9
store double %10, double* %4
store double 0.000000e+00, double* %5
%11 = load i32, i32* %0
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %46
13: ; preds = %6
%14 = zext i32 %11 to i64
br label %15
15: ; preds = %13, %38
%16 = phi i64 [ 1, %13 ], [ %44, %38 ]
%17 = load double, double* %2
%18 = add nsw i64 %16, -1
%19 = getelementptr inbounds double, double* %3, i64 %18
%20 = load double, double* %19
%21 = fmul double %17, %20
%22 = getelementptr inbounds double, double* %3, i64 %16
store double %21, double* %22
%23 = getelementptr inbounds double, double* %1, i64 %16
%24 = load double, double* %23
%25 = fcmp ult double %24, 0.000000e+00
br i1 %25, label %28, label %26
26: ; preds = %15
%27 = tail call double @llvm.fmuladd.f64(double %24, double %24, double %21)
store double %27, double* %22
br label %28
28: ; preds = %26, %15
%29 = load double, double* %2
%30 = getelementptr inbounds double, double* %4, i64 %18
%31 = load double, double* %30
%32 = fmul double %29, %31
%33 = getelementptr inbounds double, double* %4, i64 %16
store double %32, double* %33
%34 = load double, double* %23
%35 = fcmp olt double %34, 0.000000e+00
br i1 %35, label %36, label %38
36: ; preds = %28
%37 = tail call double @llvm.fmuladd.f64(double %34, double %34, double %32)
store double %37, double* %33
br label %38
38: ; preds = %36, %28
%39 = load double, double* %2
%40 = getelementptr inbounds double, double* %5, i64 %18
%41 = load double, double* %40
%42 = tail call double @llvm.fmuladd.f64(double %39, double %41, double 1.000000e+00)
%43 = getelementptr inbounds double, double* %5, i64 %16
store double %42, double* %43
%44 = add nuw nsw i64 %16, 1
%45 = icmp eq i64 %44, %14
br i1 %45, label %46, label %15
46: ; preds = %38, %6
ret void
}