void Mass_3D_Evaluate(const int nPoints, double rho, double *p, double *u,
                      double *v, double *w, double *mom_p_acc,
                      double *mom_u_acc, double *mom_v_acc, double *mom_w_acc,
                      double *dmom_p_acc_p, double *dmom_u_acc_u,
                      double *dmom_v_acc_v, double *dmom_w_acc_w) {
  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;
    mom_w_acc[k] = w[k];
    dmom_w_acc_w[k] = 1.0;
  }
}


x86 assembly (clang, -O0):
<Mass_3D_Evaluate>:
push   %rbp
mov    %rsp,%rbp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
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    1219 <Mass_3D_Evaluate+0x119>
mov    -0x18(%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    0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%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    0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe58(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe29(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x40(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xdfa(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1143 <Mass_3D_Evaluate+0x43>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mass_3D_Evaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
jle    1196 <Mass_3D_Evaluate+0x96>
mov    0x68(%rsp),%r10
mov    0x60(%rsp),%r11
mov    0x58(%rsp),%r14
mov    0x50(%rsp),%r15
mov    0x48(%rsp),%r12
mov    0x40(%rsp),%r13
mov    0x38(%rsp),%rax
mov    %edi,%edi
shl    $0x3,%rdi
xor    %ebx,%ebx
movabs $0x3ff0000000000000,%rbp
nopw   0x0(%rax,%rax,1)
movsd  (%rsi,%rbx,1),%xmm0
movsd  %xmm0,(%r9,%rbx,1)
mov    %rbp,(%r15,%rbx,1)
movsd  (%rdx,%rbx,1),%xmm0
movsd  %xmm0,(%rax,%rbx,1)
mov    %rbp,(%r14,%rbx,1)
movsd  (%rcx,%rbx,1),%xmm0
movsd  %xmm0,0x0(%r13,%rbx,1)
mov    %rbp,(%r11,%rbx,1)
movsd  (%r8,%rbx,1),%xmm0
movsd  %xmm0,(%r12,%rbx,1)
mov    %rbp,(%r10,%rbx,1)
add    $0x8,%rbx
cmp    %rbx,%rdi
jne    1150 <Mass_3D_Evaluate+0x50>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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