void LinearElasticity_2D_Evaluate(const int nPoints, const double E,
                                  const double nu, const double *g,
                                  const double *u, const double *v,
                                  double *uu_diff_ten, double *uv_diff_ten,
                                  double *vu_diff_ten, double *vv_diff_ten,
                                  double *u_force, double *v_force) {
  int k;
  for (k = 0; k < nPoints; k++) {
    uu_diff_ten[k * 4 + 0] = (E / (1.0 + nu)) * (1.0 + nu / (1.0 - 2.0 * nu));
    uu_diff_ten[k * 4 + 3] = (E / (1.0 + nu)) * 0.5;
    uv_diff_ten[k * 4 + 1] = (E / (1.0 + nu)) * (nu / (1.0 - 2.0 * nu));
    uv_diff_ten[k * 4 + 2] = (E / (1.0 + nu)) * 0.5;
    vu_diff_ten[k * 4 + 1] = (E / (1.0 + nu)) * 0.5;
    vu_diff_ten[k * 4 + 2] = (E / (1.0 + nu)) * (nu / (1.0 - 2.0 * nu));
    vv_diff_ten[k * 4 + 0] = (E / (1.0 + nu)) * 0.5;
    vv_diff_ten[k * 4 + 3] = (E / (1.0 + nu)) * (1.0 + nu / (1.0 - 2.0 * nu));
    u_force[k] = -g[0];
    v_force[k] = -g[1];
  }
}


x86 assembly (clang, -O0):
<LinearElasticity_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)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13d7 <LinearElasticity_2D_Evaluate+0x2d7>
movsd  -0x10(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xe8c(%rip),%xmm1
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xe7c(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movsd  0xe52(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe49(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movsd  0xe1b(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xdfc(%rip),%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movsd  0xdce(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdc5(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movsd  0xd97(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd8e(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movsd  0xd60(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xd41(%rip),%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movsd  0xd13(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd0a(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movsd  0xcdc(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xcbd(%rip),%xmm1
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xcad(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    113c <LinearElasticity_2D_Evaluate+0x3c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LinearElasticity_2D_Evaluate>:
test   %edi,%edi
jle    11c8 <LinearElasticity_2D_Evaluate+0xc8>
mov    0x20(%rsp),%r10
mov    0x18(%rsp),%r11
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%rax
movsd  0xedc(%rip),%xmm2
movapd %xmm1,%xmm3
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm0
movapd %xmm1,%xmm3
addsd  %xmm1,%xmm3
movapd %xmm2,%xmm4
subsd  %xmm3,%xmm4
divsd  %xmm4,%xmm1
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeb4(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm1
mov    %edi,%edi
shl    $0x3,%rdi
xor    %ecx,%ecx
movapd 0xea4(%rip),%xmm0
nopl   0x0(%rax)
movsd  %xmm2,(%r8,%rcx,4)
movsd  %xmm3,0x18(%r8,%rcx,4)
movsd  %xmm1,0x8(%r9,%rcx,4)
movsd  %xmm3,0x10(%r9,%rcx,4)
movsd  %xmm3,0x8(%rax,%rcx,4)
movsd  %xmm1,0x10(%rax,%rcx,4)
movsd  %xmm3,(%rdx,%rcx,4)
movsd  %xmm2,0x18(%rdx,%rcx,4)
movsd  (%rsi),%xmm4
xorpd  %xmm0,%xmm4
movlpd %xmm4,(%r11,%rcx,1)
movsd  0x8(%rsi),%xmm4
xorpd  %xmm0,%xmm4
movlpd %xmm4,(%r10,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rdi
jne    1170 <LinearElasticity_2D_Evaluate+0x70>
ret

LLVM IR (-O0):
define void @LinearElasticity_2D_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) {
%13 = alloca i32
%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 double*
%24 = alloca double*
%25 = alloca i32
store i32 %0, i32* %13
store double %1, double* %14
store double %2, double* %15
store double* %3, double** %16
store double* %4, double** %17
store double* %5, double** %18
store double* %6, double** %19
store double* %7, double** %20
store double* %8, double** %21
store double* %9, double** %22
store double* %10, double** %23
store double* %11, double** %24
store i32 0, i32* %25
br label %26
26: ; preds = %153, %12
%27 = load i32, i32* %25
%28 = load i32, i32* %13
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %156
30: ; preds = %26
%31 = load double, double* %14
%32 = load double, double* %15
%33 = fadd double 1.000000e+00, %32
%34 = fdiv double %31, %33
%35 = load double, double* %15
%36 = load double, double* %15
%37 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %36, double 1.000000e+00)
%38 = fdiv double %35, %37
%39 = fadd double 1.000000e+00, %38
%40 = fmul double %34, %39
%41 = load double*, double** %19
%42 = load i32, i32* %25
%43 = mul nsw i32 %42, 4
%44 = add nsw i32 %43, 0
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %41, i64 %45
store double %40, double* %46
%47 = load double, double* %14
%48 = load double, double* %15
%49 = fadd double 1.000000e+00, %48
%50 = fdiv double %47, %49
%51 = fmul double %50, 5.000000e-01
%52 = load double*, double** %19
%53 = load i32, i32* %25
%54 = mul nsw i32 %53, 4
%55 = add nsw i32 %54, 3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %52, i64 %56
store double %51, double* %57
%58 = load double, double* %14
%59 = load double, double* %15
%60 = fadd double 1.000000e+00, %59
%61 = fdiv double %58, %60
%62 = load double, double* %15
%63 = load double, double* %15
%64 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %63, double 1.000000e+00)
%65 = fdiv double %62, %64
%66 = fmul double %61, %65
%67 = load double*, double** %20
%68 = load i32, i32* %25
%69 = mul nsw i32 %68, 4
%70 = add nsw i32 %69, 1
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %67, i64 %71
store double %66, double* %72
%73 = load double, double* %14
%74 = load double, double* %15
%75 = fadd double 1.000000e+00, %74
%76 = fdiv double %73, %75
%77 = fmul double %76, 5.000000e-01
%78 = load double*, double** %20
%79 = load i32, i32* %25
%80 = mul nsw i32 %79, 4
%81 = add nsw i32 %80, 2
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %78, i64 %82
store double %77, double* %83
%84 = load double, double* %14
%85 = load double, double* %15
%86 = fadd double 1.000000e+00, %85
%87 = fdiv double %84, %86
%88 = fmul double %87, 5.000000e-01
%89 = load double*, double** %21
%90 = load i32, i32* %25
%91 = mul nsw i32 %90, 4
%92 = add nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %89, i64 %93
store double %88, double* %94
%95 = load double, double* %14
%96 = load double, double* %15
%97 = fadd double 1.000000e+00, %96
%98 = fdiv double %95, %97
%99 = load double, double* %15
%100 = load double, double* %15
%101 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %100, double 1.000000e+00)
%102 = fdiv double %99, %101
%103 = fmul double %98, %102
%104 = load double*, double** %21
%105 = load i32, i32* %25
%106 = mul nsw i32 %105, 4
%107 = add nsw i32 %106, 2
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %104, i64 %108
store double %103, double* %109
%110 = load double, double* %14
%111 = load double, double* %15
%112 = fadd double 1.000000e+00, %111
%113 = fdiv double %110, %112
%114 = fmul double %113, 5.000000e-01
%115 = load double*, double** %22
%116 = load i32, i32* %25
%117 = mul nsw i32 %116, 4
%118 = add nsw i32 %117, 0
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %115, i64 %119
store double %114, double* %120
%121 = load double, double* %14
%122 = load double, double* %15
%123 = fadd double 1.000000e+00, %122
%124 = fdiv double %121, %123
%125 = load double, double* %15
%126 = load double, double* %15
%127 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %126, double 1.000000e+00)
%128 = fdiv double %125, %127
%129 = fadd double 1.000000e+00, %128
%130 = fmul double %124, %129
%131 = load double*, double** %22
%132 = load i32, i32* %25
%133 = mul nsw i32 %132, 4
%134 = add nsw i32 %133, 3
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %131, i64 %135
store double %130, double* %136
%137 = load double*, double** %16
%138 = getelementptr inbounds double, double* %137, i64 0
%139 = load double, double* %138
%140 = fneg double %139
%141 = load double*, double** %23
%142 = load i32, i32* %25
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
store double %140, double* %144
%145 = load double*, double** %16
%146 = getelementptr inbounds double, double* %145, i64 1
%147 = load double, double* %146
%148 = fneg double %147
%149 = load double*, double** %24
%150 = load i32, i32* %25
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %149, i64 %151
store double %148, double* %152
br label %153
153: ; preds = %30
%154 = load i32, i32* %25
%155 = add nsw i32 %154, 1
store i32 %155, i32* %25
br label %26
156: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @LinearElasticity_2D_Evaluate(i32 %0, double %1, double %2, double* nocapture %3, double* nocapture readnone %4, double* nocapture readnone %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) {
%13 = icmp sgt i32 %0, 0
br i1 %13, label %14, label %47
14: ; preds = %12
%15 = fadd double %2, 1.000000e+00
%16 = fdiv double %1, %15
%17 = tail call double @llvm.fmuladd.f64(double %2, double -2.000000e+00, double 1.000000e+00)
%18 = fdiv double %2, %17
%19 = fadd double %18, 1.000000e+00
%20 = fmul double %16, %19
%21 = fmul double %16, 5.000000e-01
%22 = fmul double %16, %18
%23 = getelementptr inbounds double, double* %3, i64 1
%24 = zext i32 %0 to i64
br label %25
25: ; preds = %14, %25
%26 = phi i64 [ 0, %14 ], [ %45, %25 ]
%27 = shl nsw i64 %26, 2
%28 = getelementptr inbounds double, double* %6, i64 %27
store double %20, double* %28
%29 = or i64 %27, 3
%30 = getelementptr inbounds double, double* %6, i64 %29
store double %21, double* %30
%31 = or i64 %27, 1
%32 = getelementptr inbounds double, double* %7, i64 %31
store double %22, double* %32
%33 = or i64 %27, 2
%34 = getelementptr inbounds double, double* %7, i64 %33
store double %21, double* %34
%35 = getelementptr inbounds double, double* %8, i64 %31
store double %21, double* %35
%36 = getelementptr inbounds double, double* %8, i64 %33
store double %22, double* %36
%37 = getelementptr inbounds double, double* %9, i64 %27
store double %21, double* %37
%38 = getelementptr inbounds double, double* %9, i64 %29
store double %20, double* %38
%39 = load double, double* %3
%40 = fneg double %39
%41 = getelementptr inbounds double, double* %10, i64 %26
store double %40, double* %41
%42 = load double, double* %23
%43 = fneg double %42
%44 = getelementptr inbounds double, double* %11, i64 %26
store double %43, double* %44
%45 = add nuw nsw i64 %26, 1
%46 = icmp eq i64 %45, %24
br i1 %46, label %47, label %25
47: ; preds = %25, %12
ret void
}