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


x86 assembly (clang, -O0):
<Laplace_Evaluate2D>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e2 <Laplace_Evaluate2D+0xe2>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xe6b(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xe4e(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xe31(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111a <Laplace_Evaluate2D+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Laplace_Evaluate2D>:
test   %edi,%edi
jle    11c5 <Laplace_Evaluate2D+0xc5>
mov    %edi,%r9d
lea    -0x1(%r9),%rax
mov    %r9d,%r8d
and    $0x3,%r8d
cmp    $0x3,%rax
jae    1120 <Laplace_Evaluate2D+0x20>
xor    %edi,%edi
jmp    1186 <Laplace_Evaluate2D+0x86>
and    $0xfffffffc,%r9d
mov    $0x30,%eax
xor    %edi,%edi
movaps 0xece(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movups %xmm0,-0x30(%rsi,%rax,1)
movups %xmm0,-0x30(%rdx,%rax,1)
movups %xmm0,-0x30(%rcx,%rax,1)
movups %xmm0,-0x20(%rsi,%rax,1)
movups %xmm0,-0x20(%rdx,%rax,1)
movups %xmm0,-0x20(%rcx,%rax,1)
movups %xmm0,-0x10(%rsi,%rax,1)
movups %xmm0,-0x10(%rdx,%rax,1)
movups %xmm0,-0x10(%rcx,%rax,1)
movups %xmm0,(%rsi,%rax,1)
movups %xmm0,(%rdx,%rax,1)
movups %xmm0,(%rcx,%rax,1)
add    $0x4,%rdi
add    $0x40,%rax
cmp    %rdi,%r9
jne    1140 <Laplace_Evaluate2D+0x40>
test   %r8,%r8
je     11c5 <Laplace_Evaluate2D+0xc5>
shl    $0x4,%rdi
add    %rdi,%rcx
add    %rdi,%rdx
add    %rdi,%rsi
shl    $0x4,%r8
xor    %eax,%eax
movaps 0xe5b(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movups %xmm0,(%rsi,%rax,1)
movups %xmm0,(%rdx,%rax,1)
movups %xmm0,(%rcx,%rax,1)
add    $0x10,%rax
cmp    %rax,%r8
jne    11b0 <Laplace_Evaluate2D+0xb0>
ret

LLVM IR (-O0):
define void @Laplace_Evaluate2D(i32 %0, double* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
store i32 %0, i32* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
store i32 0, i32* %9
br label %10
10: ; preds = %51, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %54
14: ; preds = %10
%15 = load double*, double** %6
%16 = load i32, i32* %9
%17 = mul nsw i32 %16, 2
%18 = add nsw i32 %17, 0
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %15, i64 %19
store double 1.000000e+00, double* %20
%21 = load double*, double** %6
%22 = load i32, i32* %9
%23 = mul nsw i32 %22, 2
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %21, i64 %25
store double 1.000000e+00, double* %26
%27 = load double*, double** %7
%28 = load i32, i32* %9
%29 = mul nsw i32 %28, 2
%30 = add nsw i32 %29, 0
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %27, i64 %31
store double 1.000000e+00, double* %32
%33 = load double*, double** %7
%34 = load i32, i32* %9
%35 = mul nsw i32 %34, 2
%36 = add nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %33, i64 %37
store double 1.000000e+00, double* %38
%39 = load double*, double** %8
%40 = load i32, i32* %9
%41 = mul nsw i32 %40, 2
%42 = add nsw i32 %41, 0
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %39, i64 %43
store double 1.000000e+00, double* %44
%45 = load double*, double** %8
%46 = load i32, i32* %9
%47 = mul nsw i32 %46, 2
%48 = add nsw i32 %47, 1
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %45, i64 %49
store double 1.000000e+00, double* %50
br label %51
51: ; preds = %14
%52 = load i32, i32* %9
%53 = add nsw i32 %52, 1
store i32 %53, i32* %9
br label %10
54: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @Laplace_Evaluate2D(i32 %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %66
6: ; preds = %4
%7 = zext i32 %0 to i64
%8 = add nsw i64 %7, -1
%9 = and i64 %7, 3
%10 = icmp ult i64 %8, 3
br i1 %10, label %50, label %11
11: ; preds = %6
%12 = and i64 %7, 4294967292
br label %13
13: ; preds = %13, %11
%14 = phi i64 [ 0, %11 ], [ %47, %13 ]
%15 = phi i64 [ 0, %11 ], [ %48, %13 ]
%16 = shl nuw nsw i64 %14, 1
%17 = getelementptr inbounds double, double* %1, i64 %16
%18 = bitcast double* %17 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %18
%19 = getelementptr inbounds double, double* %2, i64 %16
%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 %16
%22 = bitcast double* %21 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %22
%23 = shl nuw i64 %14, 1
%24 = or i64 %23, 2
%25 = getelementptr inbounds double, double* %1, i64 %24
%26 = bitcast double* %25 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %26
%27 = getelementptr inbounds double, double* %2, i64 %24
%28 = bitcast double* %27 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %28
%29 = getelementptr inbounds double, double* %3, i64 %24
%30 = bitcast double* %29 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %30
%31 = shl nuw i64 %14, 1
%32 = or i64 %31, 4
%33 = getelementptr inbounds double, double* %1, i64 %32
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %34
%35 = getelementptr inbounds double, double* %2, i64 %32
%36 = bitcast double* %35 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %36
%37 = getelementptr inbounds double, double* %3, i64 %32
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %38
%39 = shl nuw i64 %14, 1
%40 = or i64 %39, 6
%41 = getelementptr inbounds double, double* %1, i64 %40
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %42
%43 = getelementptr inbounds double, double* %2, i64 %40
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %44
%45 = getelementptr inbounds double, double* %3, i64 %40
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %46
%47 = add nuw nsw i64 %14, 4
%48 = add i64 %15, 4
%49 = icmp eq i64 %48, %12
br i1 %49, label %50, label %13
50: ; preds = %13, %6
%51 = phi i64 [ 0, %6 ], [ %47, %13 ]
%52 = icmp eq i64 %9, 0
br i1 %52, label %66, label %53
53: ; preds = %50, %53
%54 = phi i64 [ %63, %53 ], [ %51, %50 ]
%55 = phi i64 [ %64, %53 ], [ 0, %50 ]
%56 = shl nuw nsw i64 %54, 1
%57 = getelementptr inbounds double, double* %1, i64 %56
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %58
%59 = getelementptr inbounds double, double* %2, i64 %56
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %60
%61 = getelementptr inbounds double, double* %3, i64 %56
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %62
%63 = add nuw nsw i64 %54, 1
%64 = add i64 %55, 1
%65 = icmp eq i64 %64, %9
br i1 %65, label %66, label %53
66: ; preds = %50, %53, %4
ret void
}