void VolumeAveragedVOFCoefficientsEvaluate(int nPoints, int nSpace, double eps,
                                           double *v, double *phi,
                                           double *porosity, double *u,
                                           double *m, double *dm, double *f,
                                           double *df) {
  int i, I;
  for (i = 0; i < nPoints; i++) {
    m[i] = u[i] * porosity[i];
    dm[i] = porosity[i];
    for (I = 0; I < nSpace; I++) {
      f[i * nSpace + I] = porosity[i] * v[i * nSpace + I] * u[i];
      df[i * nSpace + I] = porosity[i] * v[i * nSpace + I];
    }
  }
}


x86 assembly (clang, -O0):
<VolumeAveragedVOFCoefficientsEvaluate>:
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)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1236 <VolumeAveragedVOFCoefficientsEvaluate+0x136>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1223 <VolumeAveragedVOFCoefficientsEvaluate+0x123>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    118a <VolumeAveragedVOFCoefficientsEvaluate+0x8a>
jmp    1228 <VolumeAveragedVOFCoefficientsEvaluate+0x128>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1136 <VolumeAveragedVOFCoefficientsEvaluate+0x36>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VolumeAveragedVOFCoefficientsEvaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,-0x30(%rsp)
test   %edi,%edi
jle    13b8 <VolumeAveragedVOFCoefficientsEvaluate+0x2b8>
mov    0x50(%rsp),%r10
mov    0x48(%rsp),%r11
mov    0x40(%rsp),%r14
mov    0x38(%rsp),%r15
movslq %esi,%rax
mov    %edi,%ecx
mov    %eax,%ebx
mov    %ebx,%r12d
and    $0xfffffffe,%r12d
mov    %rax,-0x20(%rsp)
lea    0x0(,%rax,8),%rdx
xor    %edi,%edi
mov    -0x30(%rsp),%rbp
mov    %esi,-0x54(%rsp)
mov    %rcx,-0x40(%rsp)
mov    %rdx,-0x48(%rsp)
mov    %r12,-0x28(%rsp)
jmp    1186 <VolumeAveragedVOFCoefficientsEvaluate+0x86>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
add    %rdx,%r10
add    %rdx,%r11
add    %rdx,%rbp
cmp    %rcx,%rdi
je     13b8 <VolumeAveragedVOFCoefficientsEvaluate+0x2b8>
movsd  (%r9,%rdi,8),%xmm0
mulsd  (%r8,%rdi,8),%xmm0
movsd  %xmm0,(%r15,%rdi,8)
movsd  (%r8,%rdi,8),%xmm0
movsd  %xmm0,(%r14,%rdi,8)
test   %esi,%esi
jle    1170 <VolumeAveragedVOFCoefficientsEvaluate+0x70>
cmp    $0x1,%esi
jne    11c0 <VolumeAveragedVOFCoefficientsEvaluate+0xc0>
xor    %eax,%eax
jmp    1380 <VolumeAveragedVOFCoefficientsEvaluate+0x280>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdi,%rcx
imul   -0x20(%rsp),%rcx
lea    (%rcx,%rbx,1),%rdx
mov    0x48(%rsp),%rax
lea    (%rax,%rcx,8),%rsi
lea    (%rax,%rdx,8),%r13
mov    0x50(%rsp),%rax
lea    (%rax,%rcx,8),%r15
lea    (%rax,%rdx,8),%rax
mov    %rax,-0x18(%rsp)
lea    (%r8,%rdi,8),%rax
mov    %rax,-0x38(%rsp)
lea    0x8(%r8,%rdi,8),%r12
mov    -0x30(%rsp),%r14
lea    (%r14,%rcx,8),%rcx
mov    %rcx,-0x8(%rsp)
lea    (%r14,%rdx,8),%r14
mov    %r14,-0x10(%rsp)
lea    (%r9,%rdi,8),%rdx
add    $0x8,%rdx
mov    -0x18(%rsp),%rax
cmp    %rax,%rsi
setb   -0x49(%rsp)
cmp    %r13,%r15
setb   -0x4a(%rsp)
cmp    %r12,%rsi
setb   -0x4b(%rsp)
mov    -0x38(%rsp),%rcx
cmp    %r13,%rcx
setb   -0x4c(%rsp)
cmp    %r14,%rsi
setb   -0x4d(%rsp)
mov    -0x8(%rsp),%r14
cmp    %r13,%r14
setb   -0x4e(%rsp)
cmp    %rdx,%rsi
lea    (%r9,%rdi,8),%rsi
setb   -0x4f(%rsp)
cmp    %r13,%rsi
setb   -0x50(%rsp)
cmp    %r12,%r15
setb   %r13b
cmp    %rax,%rcx
setb   -0x38(%rsp)
cmp    -0x10(%rsp),%r15
setb   %cl
cmp    %rax,%r14
setb   %r14b
cmp    %rdx,%r15
setb   %r15b
cmp    %rax,%rsi
setb   %dl
mov    -0x4a(%rsp),%al
test   %al,-0x49(%rsp)
jne    135a <VolumeAveragedVOFCoefficientsEvaluate+0x25a>
mov    -0x4c(%rsp),%al
and    %al,-0x4b(%rsp)
jne    135a <VolumeAveragedVOFCoefficientsEvaluate+0x25a>
mov    -0x4e(%rsp),%al
and    %al,-0x4d(%rsp)
jne    135a <VolumeAveragedVOFCoefficientsEvaluate+0x25a>
mov    -0x50(%rsp),%al
and    %al,-0x4f(%rsp)
jne    135a <VolumeAveragedVOFCoefficientsEvaluate+0x25a>
and    -0x38(%rsp),%r13b
jne    135a <VolumeAveragedVOFCoefficientsEvaluate+0x25a>
and    %r14b,%cl
mov    -0x28(%rsp),%r12
jne    135a <VolumeAveragedVOFCoefficientsEvaluate+0x25a>
mov    $0x0,%eax
and    %dl,%r15b
mov    -0x54(%rsp),%esi
mov    0x40(%rsp),%r14
mov    0x38(%rsp),%r15
mov    -0x40(%rsp),%rcx
mov    -0x48(%rsp),%rdx
jne    1380 <VolumeAveragedVOFCoefficientsEvaluate+0x280>
movsd  (%r8,%rdi,8),%xmm0
unpcklpd %xmm0,%xmm0
movsd  (%r9,%rdi,8),%xmm1
unpcklpd %xmm1,%xmm1
xor    %eax,%eax
nopl   0x0(%rax)
movupd 0x0(%rbp,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
mulpd  %xmm1,%xmm2
movupd %xmm2,(%r11,%rax,8)
movupd 0x0(%rbp,%rax,8),%xmm2
mulpd  %xmm0,%xmm2
movupd %xmm2,(%r10,%rax,8)
add    $0x2,%rax
cmp    %rax,%r12
jne    1320 <VolumeAveragedVOFCoefficientsEvaluate+0x220>
mov    %r12,%rax
cmp    %rbx,%r12
jne    1380 <VolumeAveragedVOFCoefficientsEvaluate+0x280>
jmp    1170 <VolumeAveragedVOFCoefficientsEvaluate+0x70>
xor    %eax,%eax
mov    -0x54(%rsp),%esi
mov    0x40(%rsp),%r14
mov    0x38(%rsp),%r15
mov    -0x40(%rsp),%rcx
mov    -0x48(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r8,%rdi,8),%xmm0
mulsd  0x0(%rbp,%rax,8),%xmm0
mulsd  (%r9,%rdi,8),%xmm0
movsd  %xmm0,(%r11,%rax,8)
movsd  (%r8,%rdi,8),%xmm0
mulsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%r10,%rax,8)
add    $0x1,%rax
cmp    %rax,%rbx
jne    1380 <VolumeAveragedVOFCoefficientsEvaluate+0x280>
jmp    1170 <VolumeAveragedVOFCoefficientsEvaluate+0x70>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @VolumeAveragedVOFCoefficientsEvaluate(i32 %0, i32 %1, double %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9, double* %10) {
%12 = alloca i32
%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 i32
%24 = alloca i32
store i32 %0, i32* %12
store i32 %1, i32* %13
store double %2, double* %14
store double* %3, double** %15
store double* %4, double** %16
store double* %5, double** %17
store double* %6, double** %18
store double* %7, double** %19
store double* %8, double** %20
store double* %9, double** %21
store double* %10, double** %22
store i32 0, i32* %23
br label %25
25: ; preds = %115, %11
%26 = load i32, i32* %23
%27 = load i32, i32* %12
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %118
29: ; preds = %25
%30 = load double*, double** %18
%31 = load i32, i32* %23
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
%34 = load double, double* %33
%35 = load double*, double** %17
%36 = load i32, i32* %23
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = fmul double %34, %39
%41 = load double*, double** %19
%42 = load i32, i32* %23
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
store double %40, double* %44
%45 = load double*, double** %17
%46 = load i32, i32* %23
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
%49 = load double, double* %48
%50 = load double*, double** %20
%51 = load i32, i32* %23
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
store double %49, double* %53
store i32 0, i32* %24
br label %54
54: ; preds = %111, %29
%55 = load i32, i32* %24
%56 = load i32, i32* %13
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %114
58: ; preds = %54
%59 = load double*, double** %17
%60 = load i32, i32* %23
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = load double*, double** %15
%65 = load i32, i32* %23
%66 = load i32, i32* %13
%67 = mul nsw i32 %65, %66
%68 = load i32, i32* %24
%69 = add nsw i32 %67, %68
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %64, i64 %70
%72 = load double, double* %71
%73 = fmul double %63, %72
%74 = load double*, double** %18
%75 = load i32, i32* %23
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
%78 = load double, double* %77
%79 = fmul double %73, %78
%80 = load double*, double** %21
%81 = load i32, i32* %23
%82 = load i32, i32* %13
%83 = mul nsw i32 %81, %82
%84 = load i32, i32* %24
%85 = add nsw i32 %83, %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %80, i64 %86
store double %79, double* %87
%88 = load double*, double** %17
%89 = load i32, i32* %23
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
%92 = load double, double* %91
%93 = load double*, double** %15
%94 = load i32, i32* %23
%95 = load i32, i32* %13
%96 = mul nsw i32 %94, %95
%97 = load i32, i32* %24
%98 = add nsw i32 %96, %97
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %93, i64 %99
%101 = load double, double* %100
%102 = fmul double %92, %101
%103 = load double*, double** %22
%104 = load i32, i32* %23
%105 = load i32, i32* %13
%106 = mul nsw i32 %104, %105
%107 = load i32, i32* %24
%108 = add nsw i32 %106, %107
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %103, i64 %109
store double %102, double* %110
br label %111
111: ; preds = %58
%112 = load i32, i32* %24
%113 = add nsw i32 %112, 1
store i32 %113, i32* %24
br label %54
114: ; preds = %54
br label %115
115: ; preds = %114
%116 = load i32, i32* %23
%117 = add nsw i32 %116, 1
store i32 %117, i32* %23
br label %25
118: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @VolumeAveragedVOFCoefficientsEvaluate(i32 %0, i32 %1, double %2, double* nocapture %3, double* nocapture readnone %4, double* nocapture %5, double* nocapture %6, double* nocapture writeonly %7, double* nocapture writeonly %8, double* nocapture writeonly %9, double* nocapture writeonly %10) {
%12 = icmp sgt i32 %0, 0
br i1 %12, label %13, label %123
13: ; preds = %11
%14 = icmp sgt i32 %1, 0
%15 = sext i32 %1 to i64
%16 = zext i32 %0 to i64
%17 = zext i32 %1 to i64
%18 = icmp eq i32 %1, 1
%19 = and i64 %17, 4294967294
%20 = icmp eq i64 %19, %17
br label %21
21: ; preds = %13, %120
%22 = phi i64 [ 0, %13 ], [ %121, %120 ]
%23 = mul i64 %22, %15
%24 = getelementptr double, double* %9, i64 %23
%25 = add i64 %23, %17
%26 = getelementptr double, double* %9, i64 %25
%27 = getelementptr double, double* %10, i64 %23
%28 = getelementptr double, double* %10, i64 %25
%29 = getelementptr double, double* %5, i64 %22
%30 = add nuw i64 %22, 1
%31 = getelementptr double, double* %5, i64 %30
%32 = getelementptr double, double* %3, i64 %23
%33 = getelementptr double, double* %3, i64 %25
%34 = getelementptr double, double* %6, i64 %22
%35 = getelementptr double, double* %6, i64 %30
%36 = getelementptr inbounds double, double* %6, i64 %22
%37 = load double, double* %36
%38 = getelementptr inbounds double, double* %5, i64 %22
%39 = load double, double* %38
%40 = fmul double %37, %39
%41 = getelementptr inbounds double, double* %7, i64 %22
store double %40, double* %41
%42 = load double, double* %38
%43 = getelementptr inbounds double, double* %8, i64 %22
store double %42, double* %43
br i1 %14, label %44, label %120
44: ; preds = %21
%45 = mul nsw i64 %22, %15
br i1 %18, label %102, label %46
46: ; preds = %44
%47 = icmp ult double* %24, %28
%48 = icmp ult double* %27, %26
%49 = and i1 %47, %48
%50 = icmp ult double* %24, %31
%51 = icmp ult double* %29, %26
%52 = and i1 %50, %51
%53 = or i1 %49, %52
%54 = icmp ult double* %24, %33
%55 = icmp ult double* %32, %26
%56 = and i1 %54, %55
%57 = or i1 %53, %56
%58 = icmp ult double* %24, %35
%59 = icmp ult double* %34, %26
%60 = and i1 %58, %59
%61 = or i1 %57, %60
%62 = icmp ult double* %27, %31
%63 = icmp ult double* %29, %28
%64 = and i1 %62, %63
%65 = or i1 %61, %64
%66 = icmp ult double* %27, %33
%67 = icmp ult double* %32, %28
%68 = and i1 %66, %67
%69 = or i1 %65, %68
%70 = icmp ult double* %27, %35
%71 = icmp ult double* %34, %28
%72 = and i1 %70, %71
%73 = or i1 %69, %72
br i1 %73, label %102, label %74
74: ; preds = %46
%75 = load double, double* %38
%76 = insertelement <2 x double> poison, double %75, i64 0
%77 = shufflevector <2 x double> %76, <2 x double> poison, <2 x i32> zeroinitializer
%78 = load double, double* %36
%79 = insertelement <2 x double> poison, double %78, i64 0
%80 = shufflevector <2 x double> %79, <2 x double> poison, <2 x i32> zeroinitializer
%81 = load double, double* %38
%82 = insertelement <2 x double> poison, double %81, i64 0
%83 = shufflevector <2 x double> %82, <2 x double> poison, <2 x i32> zeroinitializer
br label %84
84: ; preds = %84, %74
%85 = phi i64 [ 0, %74 ], [ %99, %84 ]
%86 = add nsw i64 %85, %45
%87 = getelementptr inbounds double, double* %3, i64 %86
%88 = bitcast double* %87 to <2 x double>*
%89 = load <2 x double>, <2 x double>* %88
%90 = fmul <2 x double> %77, %89
%91 = fmul <2 x double> %90, %80
%92 = getelementptr inbounds double, double* %9, i64 %86
%93 = bitcast double* %92 to <2 x double>*
store <2 x double> %91, <2 x double>* %93
%94 = bitcast double* %87 to <2 x double>*
%95 = load <2 x double>, <2 x double>* %94
%96 = fmul <2 x double> %83, %95
%97 = getelementptr inbounds double, double* %10, i64 %86
%98 = bitcast double* %97 to <2 x double>*
store <2 x double> %96, <2 x double>* %98
%99 = add nuw i64 %85, 2
%100 = icmp eq i64 %99, %19
br i1 %100, label %101, label %84
101: ; preds = %84
br i1 %20, label %120, label %102
102: ; preds = %46, %44, %101
%103 = phi i64 [ 0, %46 ], [ 0, %44 ], [ %19, %101 ]
br label %104
104: ; preds = %102, %104
%105 = phi i64 [ %118, %104 ], [ %103, %102 ]
%106 = load double, double* %38
%107 = add nsw i64 %105, %45
%108 = getelementptr inbounds double, double* %3, i64 %107
%109 = load double, double* %108
%110 = fmul double %106, %109
%111 = load double, double* %36
%112 = fmul double %110, %111
%113 = getelementptr inbounds double, double* %9, i64 %107
store double %112, double* %113
%114 = load double, double* %38
%115 = load double, double* %108
%116 = fmul double %114, %115
%117 = getelementptr inbounds double, double* %10, i64 %107
store double %116, double* %117
%118 = add nuw nsw i64 %105, 1
%119 = icmp eq i64 %118, %17
br i1 %119, label %120, label %104
120: ; preds = %104, %101, %21
%121 = add nuw nsw i64 %22, 1
%122 = icmp eq i64 %121, %16
br i1 %122, label %123, label %21
123: ; preds = %120, %11
ret void
}