void MovingMesh_2D_Evaluate(const int nPoints, const double E0, const double nu,
                            const double *g, const double *det_J,
                            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) {
  double E;
  int k;
  for (k = 0; k < nPoints; k++) {
    E = E0 / det_J[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):
<MovingMesh_2D_Evaluate>:
push   %rbp
mov    %rsp,%rbp
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)
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,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13f2 <MovingMesh_2D_Evaluate+0x2f2>
movsd  -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xe71(%rip),%xmm1
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xe61(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
movsd  0xe37(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe2e(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
movsd  0xe00(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xde1(%rip),%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
movsd  0xdb3(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdaa(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
movsd  0xd7c(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd73(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
movsd  0xd45(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xd26(%rip),%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
movsd  0xcf8(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcef(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
movsd  0xcc1(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xca2(%rip),%xmm1
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xc92(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    0x20(%rbp),%rax
mov    -0x4c(%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    0x28(%rbp),%rax
movslq -0x4c(%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    0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1140 <MovingMesh_2D_Evaluate+0x40>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MovingMesh_2D_Evaluate>:
push   %rbx
test   %edi,%edi
jle    11ea <MovingMesh_2D_Evaluate+0xea>
mov    0x30(%rsp),%r8
mov    0x28(%rsp),%r10
mov    0x20(%rsp),%r11
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%rax
movsd  0xed6(%rip),%xmm2
movapd %xmm1,%xmm3
addsd  %xmm2,%xmm3
movapd %xmm1,%xmm4
addsd  %xmm1,%xmm4
movapd %xmm2,%xmm5
subsd  %xmm4,%xmm5
divsd  %xmm5,%xmm1
addsd  %xmm1,%xmm2
mov    %edi,%edi
shl    $0x3,%rdi
xor    %ebx,%ebx
movsd  0xead(%rip),%xmm8
movapd 0xead(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm0,%xmm6
divsd  (%rdx,%rbx,1),%xmm6
divsd  %xmm3,%xmm6
movapd %xmm2,%xmm7
mulsd  %xmm6,%xmm7
movsd  %xmm7,(%r9,%rbx,4)
movapd %xmm1,%xmm4
mulsd  %xmm6,%xmm4
mulsd  %xmm8,%xmm6
movsd  %xmm6,0x18(%r9,%rbx,4)
movsd  %xmm4,0x8(%rax,%rbx,4)
movsd  %xmm6,0x10(%rax,%rbx,4)
movsd  %xmm6,0x8(%rcx,%rbx,4)
movsd  %xmm4,0x10(%rcx,%rbx,4)
movsd  %xmm6,(%r11,%rbx,4)
movsd  %xmm7,0x18(%r11,%rbx,4)
movsd  (%rsi),%xmm4
xorpd  %xmm5,%xmm4
movlpd %xmm4,(%r10,%rbx,1)
movsd  0x8(%rsi),%xmm4
xorpd  %xmm5,%xmm4
movlpd %xmm4,(%r8,%rbx,1)
add    $0x8,%rbx
cmp    %rbx,%rdi
jne    1170 <MovingMesh_2D_Evaluate+0x70>
pop    %rbx
ret

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

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