void EulerCromerUpdate(int nAtom, double dt, double *mass, double *x, double *y,
                       double *z, double *vx, double *vy, double *vz,
                       double *fx, double *fy, double *fz) {
  int n;
  for (n = 0; n < nAtom; n++) {
    vx[n] += dt * fx[n] / mass[n];
    vy[n] += dt * fy[n] / mass[n];
    vz[n] += dt * fz[n] / mass[n];
  }
  for (n = 0; n < nAtom; n++) {
    x[n] += dt * vx[n];
    y[n] += dt * vy[n];
    z[n] += dt * vz[n];
  }
}


x86 assembly (clang, -O0):
<EulerCromerUpdate>:
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)
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    11e8 <EulerCromerUpdate+0xe8>
movsd  -0x10(%rbp),%xmm0
mov    0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mov    0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mov    0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    113b <EulerCromerUpdate+0x3b>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    128d <EulerCromerUpdate+0x18d>
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11ef <EulerCromerUpdate+0xef>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EulerCromerUpdate>:
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    11d7 <EulerCromerUpdate+0xd7>
mov    0x48(%rsp),%r14
mov    0x40(%rsp),%r15
mov    0x38(%rsp),%r12
mov    0x30(%rsp),%r10
mov    0x28(%rsp),%r11
mov    %edi,%eax
xor    %ebx,%ebx
nopl   0x0(%rax)
movsd  (%r12,%rbx,8),%xmm1
mulsd  %xmm0,%xmm1
divsd  (%rsi,%rbx,8),%xmm1
addsd  (%r9,%rbx,8),%xmm1
movsd  %xmm1,(%r9,%rbx,8)
movsd  (%r15,%rbx,8),%xmm1
mulsd  %xmm0,%xmm1
divsd  (%rsi,%rbx,8),%xmm1
addsd  (%r11,%rbx,8),%xmm1
movsd  %xmm1,(%r11,%rbx,8)
movsd  (%r14,%rbx,8),%xmm1
mulsd  %xmm0,%xmm1
divsd  (%rsi,%rbx,8),%xmm1
addsd  (%r10,%rbx,8),%xmm1
movsd  %xmm1,(%r10,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rax
jne    1130 <EulerCromerUpdate+0x30>
test   %edi,%edi
jle    11d7 <EulerCromerUpdate+0xd7>
xor    %esi,%esi
movsd  (%r9,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdx,%rsi,8),%xmm1
movsd  %xmm1,(%rdx,%rsi,8)
movsd  (%r11,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx,%rsi,8),%xmm1
movsd  %xmm1,(%rcx,%rsi,8)
movsd  (%r10,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r8,%rsi,8),%xmm1
movsd  %xmm1,(%r8,%rsi,8)
add    $0x1,%rsi
cmp    %rsi,%rax
jne    1190 <EulerCromerUpdate+0x90>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @EulerCromerUpdate(i32 %0, double %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double* nocapture %7, double* nocapture %8, double* nocapture %9, double* nocapture %10, double* nocapture %11) {
%13 = icmp sgt i32 %0, 0
br i1 %13, label %14, label %67
14: ; preds = %12
%15 = zext i32 %0 to i64
br label %19
16: ; preds = %19
br i1 %13, label %17, label %67
17: ; preds = %16
%18 = zext i32 %0 to i64
br label %48
19: ; preds = %14, %19
%20 = phi i64 [ 0, %14 ], [ %46, %19 ]
%21 = getelementptr inbounds double, double* %9, i64 %20
%22 = load double, double* %21
%23 = fmul double %22, %1
%24 = getelementptr inbounds double, double* %2, i64 %20
%25 = load double, double* %24
%26 = fdiv double %23, %25
%27 = getelementptr inbounds double, double* %6, i64 %20
%28 = load double, double* %27
%29 = fadd double %28, %26
store double %29, double* %27
%30 = getelementptr inbounds double, double* %10, i64 %20
%31 = load double, double* %30
%32 = fmul double %31, %1
%33 = load double, double* %24
%34 = fdiv double %32, %33
%35 = getelementptr inbounds double, double* %7, i64 %20
%36 = load double, double* %35
%37 = fadd double %36, %34
store double %37, double* %35
%38 = getelementptr inbounds double, double* %11, i64 %20
%39 = load double, double* %38
%40 = fmul double %39, %1
%41 = load double, double* %24
%42 = fdiv double %40, %41
%43 = getelementptr inbounds double, double* %8, i64 %20
%44 = load double, double* %43
%45 = fadd double %44, %42
store double %45, double* %43
%46 = add nuw nsw i64 %20, 1
%47 = icmp eq i64 %46, %15
br i1 %47, label %16, label %19
48: ; preds = %17, %48
%49 = phi i64 [ 0, %17 ], [ %65, %48 ]
%50 = getelementptr inbounds double, double* %6, i64 %49
%51 = load double, double* %50
%52 = getelementptr inbounds double, double* %3, i64 %49
%53 = load double, double* %52
%54 = tail call double @llvm.fmuladd.f64(double %1, double %51, double %53)
store double %54, double* %52
%55 = getelementptr inbounds double, double* %7, i64 %49
%56 = load double, double* %55
%57 = getelementptr inbounds double, double* %4, i64 %49
%58 = load double, double* %57
%59 = tail call double @llvm.fmuladd.f64(double %1, double %56, double %58)
store double %59, double* %57
%60 = getelementptr inbounds double, double* %8, i64 %49
%61 = load double, double* %60
%62 = getelementptr inbounds double, double* %5, i64 %49
%63 = load double, double* %62
%64 = tail call double @llvm.fmuladd.f64(double %1, double %61, double %63)
store double %64, double* %62
%65 = add nuw nsw i64 %49, 1
%66 = icmp eq i64 %65, %18
br i1 %66, label %67, label %48
67: ; preds = %48, %12, %16
ret void
}