void LinearElasticity_1D_Evaluate(const int nPoints, const double E,
                                  const double nu, const double *g,
                                  const double *u, double *uu_diff_ten,
                                  double *u_force) {
  int k;
  for (k = 0; k < nPoints; k++) {
    uu_diff_ten[k * 1 + 0] = (E / (1.0 + nu)) * (1.0 + nu / (1.0 - 2.0 * nu));
  }
}


x86 assembly (clang, -O0):
<LinearElasticity_1D_Evaluate>:
push   %rbp
mov    %rsp,%rbp
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)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119b <LinearElasticity_1D_Evaluate+0x9b>
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
addsd  %xmm3,%xmm3
movsd  0xea0(%rip),%xmm1
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xe90(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
shl    $0x0,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1128 <LinearElasticity_1D_Evaluate+0x28>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LinearElasticity_1D_Evaluate>:
test   %edi,%edi
jle    124e <LinearElasticity_1D_Evaluate+0x14e>
movsd  0xef0(%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  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mov    %edi,%eax
cmp    $0x4,%edi
jae    1146 <LinearElasticity_1D_Evaluate+0x46>
xor    %edx,%edx
jmp    1240 <LinearElasticity_1D_Evaluate+0x140>
mov    %eax,%edx
and    $0xfffffffc,%edx
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
lea    -0x4(%rdx),%rsi
mov    %rsi,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%r8d
and    $0x7,%r8d
cmp    $0x1c,%rsi
jae    1176 <LinearElasticity_1D_Evaluate+0x76>
xor    %esi,%esi
jmp    1205 <LinearElasticity_1D_Evaluate+0x105>
and    $0xfffffffffffffff8,%rdi
xor    %esi,%esi
nopl   0x0(%rax)
movupd %xmm0,(%rcx,%rsi,8)
movupd %xmm0,0x10(%rcx,%rsi,8)
movupd %xmm0,0x20(%rcx,%rsi,8)
movupd %xmm0,0x30(%rcx,%rsi,8)
movupd %xmm0,0x40(%rcx,%rsi,8)
movupd %xmm0,0x50(%rcx,%rsi,8)
movupd %xmm0,0x60(%rcx,%rsi,8)
movupd %xmm0,0x70(%rcx,%rsi,8)
movupd %xmm0,0x80(%rcx,%rsi,8)
movupd %xmm0,0x90(%rcx,%rsi,8)
movupd %xmm0,0xa0(%rcx,%rsi,8)
movupd %xmm0,0xb0(%rcx,%rsi,8)
movupd %xmm0,0xc0(%rcx,%rsi,8)
movupd %xmm0,0xd0(%rcx,%rsi,8)
movupd %xmm0,0xe0(%rcx,%rsi,8)
movupd %xmm0,0xf0(%rcx,%rsi,8)
add    $0x20,%rsi
add    $0xfffffffffffffff8,%rdi
jne    1180 <LinearElasticity_1D_Evaluate+0x80>
test   %r8,%r8
je     1234 <LinearElasticity_1D_Evaluate+0x134>
lea    (%rcx,%rsi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%r8
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movupd %xmm0,-0x10(%rsi,%rdi,1)
movupd %xmm0,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%r8
jne    1220 <LinearElasticity_1D_Evaluate+0x120>
cmp    %rax,%rdx
je     124e <LinearElasticity_1D_Evaluate+0x14e>
nopl   0x0(%rax)
movsd  %xmm1,(%rcx,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1240 <LinearElasticity_1D_Evaluate+0x140>
ret

LLVM IR (-O0):
define void @LinearElasticity_1D_Evaluate(i32 %0, double %1, double %2, double* %3, double* %4, double* %5, double* %6) {
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
store i32 %0, i32* %8
store double %1, double* %9
store double %2, double* %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
store i32 0, i32* %15
br label %16
16: ; preds = %37, %7
%17 = load i32, i32* %15
%18 = load i32, i32* %8
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %40
20: ; preds = %16
%21 = load double, double* %9
%22 = load double, double* %10
%23 = fadd double 1.000000e+00, %22
%24 = fdiv double %21, %23
%25 = load double, double* %10
%26 = load double, double* %10
%27 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %26, double 1.000000e+00)
%28 = fdiv double %25, %27
%29 = fadd double 1.000000e+00, %28
%30 = fmul double %24, %29
%31 = load double*, double** %13
%32 = load i32, i32* %15
%33 = mul nsw i32 %32, 1
%34 = add nsw i32 %33, 0
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %31, i64 %35
store double %30, double* %36
br label %37
37: ; preds = %20
%38 = load i32, i32* %15
%39 = add nsw i32 %38, 1
store i32 %39, i32* %15
br label %16
40: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @LinearElasticity_1D_Evaluate(i32 %0, double %1, double %2, double* nocapture readnone %3, double* nocapture readnone %4, double* nocapture writeonly %5, double* nocapture readnone %6) {
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %98
9: ; preds = %7
%10 = fadd double %2, 1.000000e+00
%11 = fdiv double %1, %10
%12 = tail call double @llvm.fmuladd.f64(double %2, double -2.000000e+00, double 1.000000e+00)
%13 = fdiv double %2, %12
%14 = fadd double %13, 1.000000e+00
%15 = fmul double %11, %14
%16 = zext i32 %0 to i64
%17 = icmp ult i32 %0, 4
br i1 %17, label %91, label %18
18: ; preds = %9
%19 = and i64 %16, 4294967292
%20 = insertelement <2 x double> poison, double %15, i64 0
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> zeroinitializer
%22 = insertelement <2 x double> poison, double %15, i64 0
%23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> zeroinitializer
%24 = add nsw i64 %19, -4
%25 = lshr exact i64 %24, 2
%26 = add nuw nsw i64 %25, 1
%27 = and i64 %26, 7
%28 = icmp ult i64 %24, 28
br i1 %28, label %76, label %29
29: ; preds = %18
%30 = and i64 %26, 9223372036854775800
br label %31
31: ; preds = %31, %29
%32 = phi i64 [ 0, %29 ], [ %73, %31 ]
%33 = phi i64 [ 0, %29 ], [ %74, %31 ]
%34 = getelementptr inbounds double, double* %5, i64 %32
%35 = bitcast double* %34 to <2 x double>*
store <2 x double> %21, <2 x double>* %35
%36 = getelementptr inbounds double, double* %34, i64 2
%37 = bitcast double* %36 to <2 x double>*
store <2 x double> %23, <2 x double>* %37
%38 = or i64 %32, 4
%39 = getelementptr inbounds double, double* %5, i64 %38
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> %21, <2 x double>* %40
%41 = getelementptr inbounds double, double* %39, i64 2
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> %23, <2 x double>* %42
%43 = or i64 %32, 8
%44 = getelementptr inbounds double, double* %5, i64 %43
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> %21, <2 x double>* %45
%46 = getelementptr inbounds double, double* %44, i64 2
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> %23, <2 x double>* %47
%48 = or i64 %32, 12
%49 = getelementptr inbounds double, double* %5, i64 %48
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> %21, <2 x double>* %50
%51 = getelementptr inbounds double, double* %49, i64 2
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> %23, <2 x double>* %52
%53 = or i64 %32, 16
%54 = getelementptr inbounds double, double* %5, i64 %53
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> %21, <2 x double>* %55
%56 = getelementptr inbounds double, double* %54, i64 2
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %23, <2 x double>* %57
%58 = or i64 %32, 20
%59 = getelementptr inbounds double, double* %5, i64 %58
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> %21, <2 x double>* %60
%61 = getelementptr inbounds double, double* %59, i64 2
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %23, <2 x double>* %62
%63 = or i64 %32, 24
%64 = getelementptr inbounds double, double* %5, i64 %63
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> %21, <2 x double>* %65
%66 = getelementptr inbounds double, double* %64, i64 2
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %23, <2 x double>* %67
%68 = or i64 %32, 28
%69 = getelementptr inbounds double, double* %5, i64 %68
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %21, <2 x double>* %70
%71 = getelementptr inbounds double, double* %69, i64 2
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %23, <2 x double>* %72
%73 = add nuw i64 %32, 32
%74 = add i64 %33, 8
%75 = icmp eq i64 %74, %30
br i1 %75, label %76, label %31
76: ; preds = %31, %18
%77 = phi i64 [ 0, %18 ], [ %73, %31 ]
%78 = icmp eq i64 %27, 0
br i1 %78, label %89, label %79
79: ; preds = %76, %79
%80 = phi i64 [ %86, %79 ], [ %77, %76 ]
%81 = phi i64 [ %87, %79 ], [ 0, %76 ]
%82 = getelementptr inbounds double, double* %5, i64 %80
%83 = bitcast double* %82 to <2 x double>*
store <2 x double> %21, <2 x double>* %83
%84 = getelementptr inbounds double, double* %82, i64 2
%85 = bitcast double* %84 to <2 x double>*
store <2 x double> %23, <2 x double>* %85
%86 = add nuw i64 %80, 4
%87 = add i64 %81, 1
%88 = icmp eq i64 %87, %27
br i1 %88, label %89, label %79
89: ; preds = %79, %76
%90 = icmp eq i64 %19, %16
br i1 %90, label %98, label %91
91: ; preds = %9, %89
%92 = phi i64 [ 0, %9 ], [ %19, %89 ]
br label %93
93: ; preds = %91, %93
%94 = phi i64 [ %96, %93 ], [ %92, %91 ]
%95 = getelementptr inbounds double, double* %5, i64 %94
store double %15, double* %95
%96 = add nuw nsw i64 %94, 1
%97 = icmp eq i64 %96, %16
br i1 %97, label %98, label %93
98: ; preds = %93, %89, %7
ret void
}