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


x86 assembly (clang, -O0):
<VOFCoefficientsEvaluate>:
push   %rbp
mov    %rsp,%rbp
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    1206 <VOFCoefficientsEvaluate+0x106>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  0xe98(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f3 <VOFCoefficientsEvaluate+0xf3>
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%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    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1174 <VOFCoefficientsEvaluate+0x74>
jmp    11f8 <VOFCoefficientsEvaluate+0xf8>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1132 <VOFCoefficientsEvaluate+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VOFCoefficientsEvaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,-0x58(%rsp)
test   %edi,%edi
jle    1412 <VOFCoefficientsEvaluate+0x312>
mov    0x48(%rsp),%r10
mov    0x40(%rsp),%rdx
movslq %esi,%rcx
mov    %edi,%eax
mov    %rax,-0x8(%rsp)
mov    %ecx,%ebx
mov    %ebx,%eax
and    $0xfffffffc,%eax
mov    %rax,-0x40(%rsp)
mov    %rbx,%rax
neg    %rax
mov    %rax,-0x38(%rsp)
lea    0x10(%r10),%rax
mov    %rcx,-0x18(%rsp)
lea    0x0(,%rcx,8),%rcx
mov    %rcx,-0x10(%rsp)
lea    0x10(%rdx),%rbp
mov    -0x58(%rsp),%rcx
lea    0x10(%rcx),%r14
lea    0x0(,%rbx,8),%rdi
and    $0xffffffffffffffe0,%rdi
mov    %rdi,-0x48(%rsp)
lea    0x8(%rcx),%r11
lea    0x8(%rdx),%r15
lea    0x8(%r10),%r12
xor    %r13d,%r13d
mov    %r9,-0x70(%rsp)
mov    %esi,-0x64(%rsp)
jmp    11b6 <VOFCoefficientsEvaluate+0xb6>
add    $0x1,%r13
mov    -0x10(%rsp),%rcx
add    %rcx,%rax
add    %rcx,%rbp
add    %rcx,%r14
add    %rcx,%r11
add    %rcx,%r15
add    %rcx,%r12
cmp    -0x8(%rsp),%r13
je     1412 <VOFCoefficientsEvaluate+0x312>
movsd  (%r8,%r13,8),%xmm0
movsd  %xmm0,(%r9,%r13,8)
mov    0x38(%rsp),%rcx
movabs $0x3ff0000000000000,%rdx
mov    %rdx,(%rcx,%r13,8)
test   %esi,%esi
jle    1190 <VOFCoefficientsEvaluate+0x90>
mov    %r13,%rdi
imul   -0x18(%rsp),%rdi
cmp    $0x4,%esi
jae    1290 <VOFCoefficientsEvaluate+0x190>
xor    %r10d,%r10d
mov    %r10,%rcx
test   $0x1,%bl
je     1229 <VOFCoefficientsEvaluate+0x129>
add    %r10,%rdi
mov    -0x58(%rsp),%rcx
movsd  (%rcx,%rdi,8),%xmm0
mulsd  (%r8,%r13,8),%xmm0
mov    0x40(%rsp),%rdx
movsd  %xmm0,(%rdx,%rdi,8)
movsd  (%rcx,%rdi,8),%xmm0
mov    0x48(%rsp),%rcx
movsd  %xmm0,(%rcx,%rdi,8)
mov    %r10,%rcx
or     $0x1,%rcx
not    %r10
cmp    -0x38(%rsp),%r10
je     1190 <VOFCoefficientsEvaluate+0x90>
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%r11,%rcx,8),%xmm0
mulsd  (%r8,%r13,8),%xmm0
movsd  %xmm0,-0x8(%r15,%rcx,8)
movsd  -0x8(%r11,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%r12,%rcx,8)
movsd  (%r11,%rcx,8),%xmm0
mulsd  (%r8,%r13,8),%xmm0
movsd  %xmm0,(%r15,%rcx,8)
movsd  (%r11,%rcx,8),%xmm0
movsd  %xmm0,(%r12,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rbx
jne    1240 <VOFCoefficientsEvaluate+0x140>
jmp    1190 <VOFCoefficientsEvaluate+0x90>
xchg   %ax,%ax
lea    (%rdi,%rbx,1),%rdx
mov    0x40(%rsp),%rcx
lea    (%rcx,%rdi,8),%rsi
lea    (%rcx,%rdx,8),%r9
mov    0x48(%rsp),%r10
lea    (%r10,%rdi,8),%rcx
mov    %rcx,-0x30(%rsp)
lea    (%r10,%rdx,8),%rcx
mov    %rcx,-0x50(%rsp)
mov    -0x58(%rsp),%rcx
lea    (%rcx,%rdi,8),%r10
mov    %r10,-0x60(%rsp)
lea    (%rcx,%rdx,8),%rcx
mov    %rcx,-0x28(%rsp)
lea    (%r8,%r13,8),%r10
add    $0x8,%r10
mov    %r10,-0x20(%rsp)
cmp    -0x50(%rsp),%rsi
setb   -0x71(%rsp)
mov    -0x30(%rsp),%rdx
cmp    %r9,%rdx
setb   -0x72(%rsp)
cmp    %rcx,%rsi
setb   -0x73(%rsp)
mov    -0x60(%rsp),%rcx
cmp    %r9,%rcx
setb   -0x74(%rsp)
cmp    %r10,%rsi
lea    (%r8,%r13,8),%rsi
setb   -0x75(%rsp)
cmp    %r9,%rsi
setb   -0x76(%rsp)
cmp    -0x28(%rsp),%rdx
mov    %rdx,%r10
setb   %r9b
mov    -0x50(%rsp),%rdx
cmp    %rdx,%rcx
setb   -0x60(%rsp)
cmp    -0x20(%rsp),%r10
setb   %cl
cmp    %rdx,%rsi
setb   %r10b
mov    -0x72(%rsp),%dl
test   %dl,-0x71(%rsp)
jne    1401 <VOFCoefficientsEvaluate+0x301>
mov    -0x74(%rsp),%dl
and    %dl,-0x73(%rsp)
mov    -0x64(%rsp),%esi
jne    13f4 <VOFCoefficientsEvaluate+0x2f4>
mov    -0x76(%rsp),%dl
and    %dl,-0x75(%rsp)
jne    13f4 <VOFCoefficientsEvaluate+0x2f4>
and    -0x60(%rsp),%r9b
jne    13f4 <VOFCoefficientsEvaluate+0x2f4>
mov    %r10d,%edx
mov    $0x0,%r10d
and    %dl,%cl
mov    -0x70(%rsp),%r9
jne    11ee <VOFCoefficientsEvaluate+0xee>
movsd  (%r8,%r13,8),%xmm0
unpcklpd %xmm0,%xmm0
xor    %edx,%edx
mov    -0x48(%rsp),%rcx
movupd -0x10(%r14,%rdx,1),%xmm1
movupd (%r14,%rdx,1),%xmm2
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,-0x10(%rbp,%rdx,1)
movupd %xmm2,0x0(%rbp,%rdx,1)
movups -0x10(%r14,%rdx,1),%xmm1
movups (%r14,%rdx,1),%xmm2
movups %xmm1,-0x10(%rax,%rdx,1)
movups %xmm2,(%rax,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rcx
jne    13a0 <VOFCoefficientsEvaluate+0x2a0>
mov    -0x40(%rsp),%rcx
mov    %rcx,%r10
cmp    %rbx,%rcx
je     1190 <VOFCoefficientsEvaluate+0x90>
jmp    11ee <VOFCoefficientsEvaluate+0xee>
xor    %r10d,%r10d
mov    -0x70(%rsp),%r9
jmp    11ee <VOFCoefficientsEvaluate+0xee>
xor    %r10d,%r10d
mov    -0x70(%rsp),%r9
mov    -0x64(%rsp),%esi
jmp    11ee <VOFCoefficientsEvaluate+0xee>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @VOFCoefficientsEvaluate(i32 %0, i32 %1, double %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32
%22 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store double %2, double* %13
store double* %3, double** %14
store double* %4, double** %15
store double* %5, double** %16
store double* %6, double** %17
store double* %7, double** %18
store double* %8, double** %19
store double* %9, double** %20
store i32 0, i32* %21
br label %23
23: ; preds = %90, %10
%24 = load i32, i32* %21
%25 = load i32, i32* %11
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %93
27: ; preds = %23
%28 = load double*, double** %16
%29 = load i32, i32* %21
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
%33 = load double*, double** %17
%34 = load i32, i32* %21
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
store double %32, double* %36
%37 = load double*, double** %18
%38 = load i32, i32* %21
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
store double 1.000000e+00, double* %40
store i32 0, i32* %22
br label %41
41: ; preds = %86, %27
%42 = load i32, i32* %22
%43 = load i32, i32* %12
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %89
45: ; preds = %41
%46 = load double*, double** %14
%47 = load i32, i32* %21
%48 = load i32, i32* %12
%49 = mul nsw i32 %47, %48
%50 = load i32, i32* %22
%51 = add nsw i32 %49, %50
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %46, i64 %52
%54 = load double, double* %53
%55 = load double*, double** %16
%56 = load i32, i32* %21
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
%59 = load double, double* %58
%60 = fmul double %54, %59
%61 = load double*, double** %19
%62 = load i32, i32* %21
%63 = load i32, i32* %12
%64 = mul nsw i32 %62, %63
%65 = load i32, i32* %22
%66 = add nsw i32 %64, %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %61, i64 %67
store double %60, double* %68
%69 = load double*, double** %14
%70 = load i32, i32* %21
%71 = load i32, i32* %12
%72 = mul nsw i32 %70, %71
%73 = load i32, i32* %22
%74 = add nsw i32 %72, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %69, i64 %75
%77 = load double, double* %76
%78 = load double*, double** %20
%79 = load i32, i32* %21
%80 = load i32, i32* %12
%81 = mul nsw i32 %79, %80
%82 = load i32, i32* %22
%83 = add nsw i32 %81, %82
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %78, i64 %84
store double %77, double* %85
br label %86
86: ; preds = %45
%87 = load i32, i32* %22
%88 = add nsw i32 %87, 1
store i32 %88, i32* %22
br label %41
89: ; preds = %41
br label %90
90: ; preds = %89
%91 = load i32, i32* %21
%92 = add nsw i32 %91, 1
store i32 %92, i32* %21
br label %23
93: ; preds = %23
ret void
}

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