double ProfileScore(A, AC, B, BC)
double *A;
double *AC;
double *B;
double *BC;
{
  int i;
  double score;
  score = 0;
  for (i = 0; i < 20; i++) {
    score += AC[i] * B[i] + BC[i] * A[i];
  }
  return score;
}


x86 assembly (clang, -O0):
<ProfileScore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x14,-0x24(%rbp)
jge    1181 <ProfileScore+0x81>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1123 <ProfileScore+0x23>
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProfileScore>:
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
nopl   0x0(%rax)
movsd  -0x8(%rcx,%rax,8),%xmm1
mulsd  -0x8(%rdi,%rax,8),%xmm1
movsd  -0x8(%rsi,%rax,8),%xmm2
mulsd  -0x8(%rdx,%rax,8),%xmm2
movsd  (%rcx,%rax,8),%xmm3
addsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  (%rsi,%rax,8),%xmm0
mulsd  (%rdi,%rax,8),%xmm3
mulsd  (%rdx,%rax,8),%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%rax
cmp    $0x15,%rax
jne    1110 <ProfileScore+0x10>
ret

LLVM IR (-O0):
define double @ProfileScore(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
store double 0.000000e+00, double* %10
store i32 0, i32* %9
br label %11
11: ; preds = %39, %4
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 20
br i1 %13, label %14, label %42
14: ; preds = %11
%15 = load double*, double** %6
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = load double*, double** %7
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = load double*, double** %8
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %25, i64 %27
%29 = load double, double* %28
%30 = load double*, double** %5
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
%34 = load double, double* %33
%35 = fmul double %29, %34
%36 = call double @llvm.fmuladd.f64(double %19, double %24, double %35)
%37 = load double, double* %10
%38 = fadd double %37, %36
store double %38, double* %10
br label %39
39: ; preds = %14
%40 = load i32, i32* %9
%41 = add nsw i32 %40, 1
store i32 %41, i32* %9
br label %11
42: ; preds = %11
%43 = load double, double* %10
ret double %43
}

LLVM IR (-O2):
define double @ProfileScore(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
br label %5
5: ; preds = %5, %4
%6 = phi i64 [ 0, %4 ], [ %31, %5 ]
%7 = phi double [ 0.000000e+00, %4 ], [ %30, %5 ]
%8 = getelementptr inbounds double, double* %1, i64 %6
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %2, i64 %6
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %3, i64 %6
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %0, i64 %6
%15 = load double, double* %14
%16 = fmul double %13, %15
%17 = tail call double @llvm.fmuladd.f64(double %9, double %11, double %16)
%18 = fadd double %7, %17
%19 = or i64 %6, 1
%20 = getelementptr inbounds double, double* %1, i64 %19
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %2, i64 %19
%23 = load double, double* %22
%24 = getelementptr inbounds double, double* %3, i64 %19
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %0, i64 %19
%27 = load double, double* %26
%28 = fmul double %25, %27
%29 = tail call double @llvm.fmuladd.f64(double %21, double %23, double %28)
%30 = fadd double %18, %29
%31 = add nuw nsw i64 %6, 2
%32 = icmp eq i64 %31, 20
br i1 %32, label %33, label %5
33: ; preds = %5
ret double %30
}