void Laplace_Evaluate3D(const int nPoints, double *mom_p_diff_ten,
                        double *mom_u_diff_ten, double *mom_v_diff_ten,
                        double *mom_w_diff_ten) {
  int k;
  for (k = 0; k < nPoints; k++) {
    mom_p_diff_ten[k * 3 + 0] = 1.0;
    mom_p_diff_ten[k * 3 + 1] = 1.0;
    mom_p_diff_ten[k * 3 + 2] = 1.0;
    mom_u_diff_ten[k * 3 + 0] = 1.0;
    mom_u_diff_ten[k * 3 + 1] = 1.0;
    mom_u_diff_ten[k * 3 + 2] = 1.0;
    mom_v_diff_ten[k * 3 + 0] = 1.0;
    mom_v_diff_ten[k * 3 + 1] = 1.0;
    mom_v_diff_ten[k * 3 + 2] = 1.0;
    mom_w_diff_ten[k * 3 + 0] = 1.0;
    mom_w_diff_ten[k * 3 + 1] = 1.0;
    mom_w_diff_ten[k * 3 + 2] = 1.0;
  }
}


x86 assembly (clang, -O0):
<Laplace_Evaluate3D>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    127c <Laplace_Evaluate3D+0x17c>
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xe54(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xe39(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xe1e(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xe03(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xde8(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xdcd(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xdb2(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xd97(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    111e <Laplace_Evaluate3D+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Laplace_Evaluate3D>:
test   %edi,%edi
jle    115e <Laplace_Evaluate3D+0x5e>
mov    %edi,%eax
shl    $0x3,%rax
lea    (%rax,%rax,2),%r9
xor    %edi,%edi
movaps 0xee9(%rip),%xmm0
movabs $0x3ff0000000000000,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups %xmm0,(%rsi,%rdi,1)
mov    %rax,0x10(%rsi,%rdi,1)
movups %xmm0,(%rdx,%rdi,1)
mov    %rax,0x10(%rdx,%rdi,1)
movups %xmm0,(%rcx,%rdi,1)
mov    %rax,0x10(%rcx,%rdi,1)
movups %xmm0,(%r8,%rdi,1)
mov    %rax,0x10(%r8,%rdi,1)
add    $0x18,%rdi
cmp    %rdi,%r9
jne    1130 <Laplace_Evaluate3D+0x30>
ret

LLVM IR (-O0):
define void @Laplace_Evaluate3D(i32 %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
store i32 0, i32* %11
br label %12
12: ; preds = %89, %5
%13 = load i32, i32* %11
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %92
16: ; preds = %12
%17 = load double*, double** %7
%18 = load i32, i32* %11
%19 = mul nsw i32 %18, 3
%20 = add nsw i32 %19, 0
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %17, i64 %21
store double 1.000000e+00, double* %22
%23 = load double*, double** %7
%24 = load i32, i32* %11
%25 = mul nsw i32 %24, 3
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %23, i64 %27
store double 1.000000e+00, double* %28
%29 = load double*, double** %7
%30 = load i32, i32* %11
%31 = mul nsw i32 %30, 3
%32 = add nsw i32 %31, 2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %29, i64 %33
store double 1.000000e+00, double* %34
%35 = load double*, double** %8
%36 = load i32, i32* %11
%37 = mul nsw i32 %36, 3
%38 = add nsw i32 %37, 0
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %35, i64 %39
store double 1.000000e+00, double* %40
%41 = load double*, double** %8
%42 = load i32, i32* %11
%43 = mul nsw i32 %42, 3
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %41, i64 %45
store double 1.000000e+00, double* %46
%47 = load double*, double** %8
%48 = load i32, i32* %11
%49 = mul nsw i32 %48, 3
%50 = add nsw i32 %49, 2
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %47, i64 %51
store double 1.000000e+00, double* %52
%53 = load double*, double** %9
%54 = load i32, i32* %11
%55 = mul nsw i32 %54, 3
%56 = add nsw i32 %55, 0
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %53, i64 %57
store double 1.000000e+00, double* %58
%59 = load double*, double** %9
%60 = load i32, i32* %11
%61 = mul nsw i32 %60, 3
%62 = add nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %59, i64 %63
store double 1.000000e+00, double* %64
%65 = load double*, double** %9
%66 = load i32, i32* %11
%67 = mul nsw i32 %66, 3
%68 = add nsw i32 %67, 2
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %65, i64 %69
store double 1.000000e+00, double* %70
%71 = load double*, double** %10
%72 = load i32, i32* %11
%73 = mul nsw i32 %72, 3
%74 = add nsw i32 %73, 0
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %71, i64 %75
store double 1.000000e+00, double* %76
%77 = load double*, double** %10
%78 = load i32, i32* %11
%79 = mul nsw i32 %78, 3
%80 = add nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %77, i64 %81
store double 1.000000e+00, double* %82
%83 = load double*, double** %10
%84 = load i32, i32* %11
%85 = mul nsw i32 %84, 3
%86 = add nsw i32 %85, 2
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %83, i64 %87
store double 1.000000e+00, double* %88
br label %89
89: ; preds = %16
%90 = load i32, i32* %11
%91 = add nsw i32 %90, 1
store i32 %91, i32* %11
br label %12
92: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @Laplace_Evaluate3D(i32 %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %27
7: ; preds = %5
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %25, %9 ]
%11 = mul nuw nsw i64 %10, 3
%12 = getelementptr inbounds double, double* %1, i64 %11
%13 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %13
%14 = add nuw nsw i64 %11, 2
%15 = getelementptr inbounds double, double* %1, i64 %14
store double 1.000000e+00, double* %15
%16 = getelementptr inbounds double, double* %2, i64 %11
%17 = bitcast double* %16 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %17
%18 = getelementptr inbounds double, double* %2, i64 %14
store double 1.000000e+00, double* %18
%19 = getelementptr inbounds double, double* %3, i64 %11
%20 = bitcast double* %19 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %20
%21 = getelementptr inbounds double, double* %3, i64 %14
store double 1.000000e+00, double* %21
%22 = getelementptr inbounds double, double* %4, i64 %11
%23 = bitcast double* %22 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %23
%24 = getelementptr inbounds double, double* %4, i64 %14
store double 1.000000e+00, double* %24
%25 = add nuw nsw i64 %10, 1
%26 = icmp eq i64 %25, %8
br i1 %26, label %27, label %9
27: ; preds = %9, %5
ret void
}