void StepUp(int fOrder, double *kArray, double *aArray) {
  double aTemp[20 + 2];
  int i, order;
  aArray[0] = 1.0;
  aTemp[0] = 1.0;
  for (order = 1; order <= fOrder; order++) {
    aArray[order] = 0.0;
    for (i = 1; i <= order; i++) {
      aTemp[i] = aArray[i] + kArray[order] * aArray[order - i];
    }
    for (i = 1; i <= order; i++) {
      aArray[i] = aTemp[i];
    }
  }
}


x86 assembly (clang, -O0):
<StepUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movl   $0x1,-0xd8(%rbp)
mov    -0xd8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1248 <StepUp+0x148>
mov    -0x18(%rbp),%rax
movslq -0xd8(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0xd8(%rbp),%eax
jg     11df <StepUp+0xdf>
mov    -0x18(%rbp),%rax
movslq -0xd4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0xd8(%rbp),%ecx
sub    -0xd4(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0xd4(%rbp),%rax
movsd  %xmm0,-0xd0(%rbp,%rax,8)
ff ff
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1169 <StepUp+0x69>
movl   $0x1,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0xd8(%rbp),%eax
jg     122f <StepUp+0x12f>
movslq -0xd4(%rbp),%rax
movsd  -0xd0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0xd4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    11e9 <StepUp+0xe9>
jmp    1234 <StepUp+0x134>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    113d <StepUp+0x3d>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StepUp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,0x18(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rdx)
test   %edi,%edi
jle    1275 <StepUp+0x165>
mov    %rdx,%rbx
lea    0x8(%rdx),%r15
mov    %edi,%eax
mov    %rax,0x8(%rsp)
lea    -0x8(%rdx),%rbp
mov    $0x2,%r12d
mov    $0x1,%r14d
xor    %r13d,%r13d
mov    %r15,0x10(%rsp)
jmp    11a6 <StepUp+0x96>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x8(,%r13,8),%rdx
mov    0x10(%rsp),%rdi
lea    0x28(%rsp),%rsi
call   1030 <memcpy@plt>
add    $0x1,%r14
add    $0x1,%r12
add    $0x1,%r13
add    $0x8,%rbp
add    $0x8,%r15
cmp    0x8(%rsp),%r13
je     1275 <StepUp+0x165>
movq   $0x0,(%rbx,%r14,8)
mov    0x18(%rsp),%rax
movsd  (%rax,%r14,8),%xmm0
mov    $0x1,%eax
cmp    $0x4,%r14
jb     1241 <StepUp+0x131>
mov    %r14,%rcx
and    $0xfffffffffffffffc,%rcx
mov    %r14,%rdx
movabs $0x7ffffffffffffffc,%rax
ff ff 7f
and    %rax,%rdx
lea    0x1(%rdx),%rax
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
mov    %rbp,%rsi
xor    %edi,%edi
nopl   0x0(%rax)
movupd 0x8(%rbx,%rdi,8),%xmm2
movupd 0x18(%rbx,%rdi,8),%xmm3
movupd -0x10(%rsi),%xmm4
movupd (%rsi),%xmm5
shufpd $0x1,%xmm5,%xmm5
shufpd $0x1,%xmm4,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm3,%xmm4
movupd %xmm5,0x28(%rsp,%rdi,8)
movupd %xmm4,0x38(%rsp,%rdi,8)
add    $0x4,%rdi
add    $0xffffffffffffffe0,%rsi
cmp    %rdi,%rcx
jne    11f0 <StepUp+0xe0>
cmp    %rdx,%r14
je     1170 <StepUp+0x60>
lea    0x0(,%rax,8),%rdx
mov    %r15,%rcx
sub    %rdx,%rcx
nop
movsd  (%rcx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rax,8),%xmm1
movsd  %xmm1,0x20(%rsp,%rax,8)
add    $0x1,%rax
add    $0xfffffffffffffff8,%rcx
cmp    %rax,%r12
jne    1250 <StepUp+0x140>
jmp    1170 <StepUp+0x60>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @StepUp(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca [22 x double]
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
store double 1.000000e+00, double* %11
%12 = getelementptr inbounds [22 x double], [22 x double]* %7, i64 0, i64 0
store double 1.000000e+00, double* %12
store i32 1, i32* %9
br label %13
13: ; preds = %69, %3
%14 = load i32, i32* %9
%15 = load i32, i32* %4
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %72
17: ; preds = %13
%18 = load double*, double** %6
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
store double 0.000000e+00, double* %21
store i32 1, i32* %8
br label %22
22: ; preds = %48, %17
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = icmp sle i32 %23, %24
br i1 %25, label %26, label %51
26: ; preds = %22
%27 = load double*, double** %6
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %5
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
%36 = load double, double* %35
%37 = load double*, double** %6
%38 = load i32, i32* %9
%39 = load i32, i32* %8
%40 = sub nsw i32 %38, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %37, i64 %41
%43 = load double, double* %42
%44 = call double @llvm.fmuladd.f64(double %36, double %43, double %31)
%45 = load i32, i32* %8
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [22 x double], [22 x double]* %7, i64 0, i64 %46
store double %44, double* %47
br label %48
48: ; preds = %26
%49 = load i32, i32* %8
%50 = add nsw i32 %49, 1
store i32 %50, i32* %8
br label %22
51: ; preds = %22
store i32 1, i32* %8
br label %52
52: ; preds = %65, %51
%53 = load i32, i32* %8
%54 = load i32, i32* %9
%55 = icmp sle i32 %53, %54
br i1 %55, label %56, label %68
56: ; preds = %52
%57 = load i32, i32* %8
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [22 x double], [22 x double]* %7, i64 0, i64 %58
%60 = load double, double* %59
%61 = load double*, double** %6
%62 = load i32, i32* %8
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
store double %60, double* %64
br label %65
65: ; preds = %56
%66 = load i32, i32* %8
%67 = add nsw i32 %66, 1
store i32 %67, i32* %8
br label %52
68: ; preds = %52
br label %69
69: ; preds = %68
%70 = load i32, i32* %9
%71 = add nsw i32 %70, 1
store i32 %71, i32* %9
br label %13
72: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @StepUp(i32 %0, double* nocapture %1, double* nocapture %2) {
%4 = alloca [22 x double]
%5 = bitcast [22 x double]* %4 to i8*
store double 1.000000e+00, double* %2
%6 = icmp slt i32 %0, 1
br i1 %6, label %78, label %7
7: ; preds = %3
%8 = getelementptr double, double* %2, i64 1
%9 = bitcast double* %8 to i8*
%10 = getelementptr inbounds [22 x double], [22 x double]* %4, i64 0, i64 1
%11 = bitcast double* %10 to i8*
%12 = zext i32 %0 to i64
br label %13
13: ; preds = %7, %73
%14 = phi i64 [ 1, %7 ], [ %74, %73 ]
%15 = phi i64 [ 2, %7 ], [ %75, %73 ]
%16 = phi i64 [ 0, %7 ], [ %76, %73 ]
%17 = shl nuw nsw i64 %16, 3
%18 = add nuw nsw i64 %17, 8
%19 = getelementptr inbounds double, double* %2, i64 %14
store double 0.000000e+00, double* %19
%20 = getelementptr inbounds double, double* %1, i64 %14
%21 = load double, double* %20
%22 = icmp ult i64 %14, 4
br i1 %22, label %60, label %23
23: ; preds = %13
%24 = and i64 %14, 9223372036854775804
%25 = or i64 %24, 1
%26 = insertelement <2 x double> poison, double %21, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = insertelement <2 x double> poison, double %21, i64 0
%29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
br label %30
30: ; preds = %30, %23
%31 = phi i64 [ 0, %23 ], [ %56, %30 ]
%32 = or i64 %31, 1
%33 = getelementptr inbounds double, double* %2, i64 %32
%34 = bitcast double* %33 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = getelementptr inbounds double, double* %33, i64 2
%37 = bitcast double* %36 to <2 x double>*
%38 = load <2 x double>, <2 x double>* %37
%39 = sub nsw i64 %14, %32
%40 = getelementptr inbounds double, double* %2, i64 %39
%41 = getelementptr inbounds double, double* %40, i64 -1
%42 = bitcast double* %41 to <2 x double>*
%43 = load <2 x double>, <2 x double>* %42
%44 = shufflevector <2 x double> %43, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%45 = getelementptr inbounds double, double* %40, i64 -2
%46 = getelementptr inbounds double, double* %45, i64 -1
%47 = bitcast double* %46 to <2 x double>*
%48 = load <2 x double>, <2 x double>* %47
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%50 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %27, <2 x double> %44, <2 x double> %35)
%51 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %49, <2 x double> %38)
%52 = getelementptr inbounds [22 x double], [22 x double]* %4, i64 0, i64 %32
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> %50, <2 x double>* %53
%54 = getelementptr inbounds double, double* %52, i64 2
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> %51, <2 x double>* %55
%56 = add nuw i64 %31, 4
%57 = icmp eq i64 %56, %24
br i1 %57, label %58, label %30
58: ; preds = %30
%59 = icmp eq i64 %14, %24
br i1 %59, label %73, label %60
60: ; preds = %13, %58
%61 = phi i64 [ 1, %13 ], [ %25, %58 ]
br label %62
62: ; preds = %60, %62
%63 = phi i64 [ %71, %62 ], [ %61, %60 ]
%64 = getelementptr inbounds double, double* %2, i64 %63
%65 = load double, double* %64
%66 = sub nsw i64 %14, %63
%67 = getelementptr inbounds double, double* %2, i64 %66
%68 = load double, double* %67
%69 = tail call double @llvm.fmuladd.f64(double %21, double %68, double %65)
%70 = getelementptr inbounds [22 x double], [22 x double]* %4, i64 0, i64 %63
store double %69, double* %70
%71 = add nuw nsw i64 %63, 1
%72 = icmp eq i64 %71, %15
br i1 %72, label %73, label %62
73: ; preds = %62, %58
%74 = add nuw nsw i64 %14, 1
%75 = add nuw nsw i64 %15, 1
%76 = add nuw nsw i64 %16, 1
%77 = icmp eq i64 %76, %12
br i1 %77, label %78, label %13
78: ; preds = %73, %3
ret void
}