void Mass_2D_Evaluate(const int nPoints, double rho, double *p, double *u,
                      double *v, double *mom_p_acc, double *mom_u_acc,
                      double *mom_v_acc, double *dmom_p_acc_p,
                      double *dmom_u_acc_u, double *dmom_v_acc_v) {
  int k;
  for (k = 0; k < nPoints; k++) {
    mom_p_acc[k] = p[k];
    dmom_p_acc_p[k] = 1.0;
    mom_u_acc[k] = u[k];
    dmom_u_acc_u[k] = 1.0;
    mom_v_acc[k] = v[k];
    dmom_v_acc_v[k] = 1.0;
  }
}


x86 assembly (clang, -O0):
<Mass_2D_Evaluate>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11de <Mass_2D_Evaluate+0xde>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe93(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe64(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe35(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1137 <Mass_2D_Evaluate+0x37>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mass_2D_Evaluate>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1166 <Mass_2D_Evaluate+0x66>
mov    0x38(%rsp),%r10
mov    0x30(%rsp),%r11
mov    0x28(%rsp),%r14
mov    0x20(%rsp),%r15
mov    %edi,%edi
xor    %eax,%eax
movabs $0x3ff0000000000000,%rbx
nopl   0x0(%rax,%rax,1)
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%r8,%rax,8)
mov    %rbx,(%r14,%rax,8)
movsd  (%rdx,%rax,8),%xmm0
movsd  %xmm0,(%r9,%rax,8)
mov    %rbx,(%r11,%rax,8)
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%r15,%rax,8)
mov    %rbx,(%r10,%rax,8)
add    $0x1,%rax
cmp    %rax,%rdi
jne    1130 <Mass_2D_Evaluate+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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