#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double const d2phicaley(double);
double dVxTetra3D(double *, double *, double *, double *, double *, double *,
                  double *, double *, double *);
void d2SvolTetra3D(double *yA, double *yB, double *yC, double *yM, double *xA,
                   double *xB, double *xC, double *xM, const double VRef,
                   double *rA, double *rB, double *rC, double *rM,
                   const double inv, const double alphaVolume) {
  double dVx, vol, vol2, d2S, cof[9];
  int i, j, k;
  dVx = dVxTetra3D(cof, yA, yB, yC, yM, xA, xB, xC, xM);
  vol = inv * ((yA[0] - yM[0]) * cof[0] + (yB[0] - yM[0]) * cof[1] +
               (yC[0] - yM[0]) * cof[2]);
  d2S = alphaVolume * d2phicaley(vol / VRef) / (VRef * VRef) * dVx;
  k = 0;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      rM[i] -= cof[j + k] * d2S;
    }
    rA[i] += cof[k] * d2S;
    rB[i] += cof[1 + k] * d2S;
    rC[i] += cof[2 + k] * d2S;
    k += 3;
  }
}


x86 assembly (clang, -O0):
<d2SvolTetra3D>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
movsd  %xmm2,-0x48(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r11
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <dVxTetra3D@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm2
movsd  -0xb0(%rbp),%xmm3
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm1
mulsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm1
movsd  -0xa0(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
call   1030 <d2phicaley@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0xbc(%rbp)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x3,-0xb4(%rbp)
jge    13af <d2SvolTetra3D+0x28f>
movl   $0x0,-0xb8(%rbp)
cmpl   $0x3,-0xb8(%rbp)
jge    12ee <d2SvolTetra3D+0x1ce>
mov    -0xb8(%rbp),%eax
add    -0xbc(%rbp),%eax
cltq
movsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x68(%rbp),%xmm2
mov    0x38(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    127d <d2SvolTetra3D+0x15d>
movslq -0xbc(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x68(%rbp),%xmm2
mov    0x20(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
cltq
movsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x68(%rbp),%xmm2
mov    0x28(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xbc(%rbp),%eax
add    $0x2,%eax
cltq
movsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x68(%rbp),%xmm2
mov    0x30(%rbp),%rax
movslq -0xb4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xbc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xbc(%rbp)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1266 <d2SvolTetra3D+0x146>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2SvolTetra3D>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
movsd  %xmm2,0x38(%rsp)
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %r8,%rax
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0xd0(%rsp),%r13
mov    0xe8(%rsp),%rbp
movaps 0xc0(%rsp),%xmm0
movups %xmm0,0x8(%rsp)
mov    %r9,(%rsp)
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r12,%r8
mov    %rax,%r9
call   1040 <dVxTetra3D@plt>
movsd  %xmm0,0x28(%rsp)
movsd  (%rbx),%xmm1
movsd  (%r12),%xmm2
subsd  %xmm2,%xmm1
movsd  (%r15),%xmm3
subsd  %xmm2,%xmm3
movsd  (%r14),%xmm0
subsd  %xmm2,%xmm0
mulsd  0x48(%rsp),%xmm3
mulsd  0x40(%rsp),%xmm1
mulsd  0x50(%rsp),%xmm0
addsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
divsd  0x20(%rsp),%xmm0
call   1030 <d2phicaley@plt>
mulsd  0x38(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  0x0(%rbp),%xmm1
movsd  0x40(%rsp),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  0x48(%rsp),%xmm3
mulsd  %xmm0,%xmm3
subsd  %xmm3,%xmm1
movsd  0x50(%rsp),%xmm4
mulsd  %xmm0,%xmm4
subsd  %xmm4,%xmm1
movsd  %xmm1,0x0(%rbp)
addsd  0x0(%r13),%xmm2
movsd  %xmm2,0x0(%r13)
mov    0xd8(%rsp),%rcx
addsd  (%rcx),%xmm3
movsd  %xmm3,(%rcx)
mov    0xe0(%rsp),%rax
addsd  (%rax),%xmm4
movsd  %xmm4,(%rax)
movsd  0x8(%rbp),%xmm1
movsd  0x58(%rsp),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  0x60(%rsp),%xmm3
mulsd  %xmm0,%xmm3
subsd  %xmm3,%xmm1
movsd  0x68(%rsp),%xmm4
mulsd  %xmm0,%xmm4
subsd  %xmm4,%xmm1
movsd  %xmm1,0x8(%rbp)
addsd  0x8(%r13),%xmm2
movsd  %xmm2,0x8(%r13)
addsd  0x8(%rcx),%xmm3
movsd  %xmm3,0x8(%rcx)
addsd  0x8(%rax),%xmm4
movsd  %xmm4,0x8(%rax)
movsd  0x10(%rbp),%xmm1
movsd  0x70(%rsp),%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movsd  0x78(%rsp),%xmm3
mulsd  %xmm0,%xmm3
subsd  %xmm3,%xmm1
mulsd  0x80(%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rbp)
addsd  0x10(%r13),%xmm2
movsd  %xmm2,0x10(%r13)
addsd  0x10(%rcx),%xmm3
movsd  %xmm3,0x10(%rcx)
addsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @d2SvolTetra3D(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double %8, double* nocapture %9, double* nocapture %10, double* nocapture %11, double* nocapture %12, double %13, double %14) {
%16 = alloca [9 x double]
%17 = bitcast [9 x double]* %16 to i8*
%18 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 0
%19 = call double @dVxTetra3D(double* %18, double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7)
%20 = load double, double* %0
%21 = load double, double* %3
%22 = fsub double %20, %21
%23 = load double, double* %18
%24 = load double, double* %1
%25 = fsub double %24, %21
%26 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 1
%27 = load double, double* %26
%28 = fmul double %25, %27
%29 = call double @llvm.fmuladd.f64(double %22, double %23, double %28)
%30 = load double, double* %2
%31 = fsub double %30, %21
%32 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 2
%33 = load double, double* %32
%34 = call double @llvm.fmuladd.f64(double %31, double %33, double %29)
%35 = fmul double %34, %13
%36 = fdiv double %35, %8
%37 = call double @d2phicaley(double %36)
%38 = fmul double %37, %14
%39 = fmul double %8, %8
%40 = fdiv double %38, %39
%41 = fmul double %19, %40
%42 = load double, double* %12
%43 = load double, double* %18
%44 = fneg double %43
%45 = call double @llvm.fmuladd.f64(double %44, double %41, double %42)
%46 = load double, double* %26
%47 = fneg double %46
%48 = call double @llvm.fmuladd.f64(double %47, double %41, double %45)
%49 = load double, double* %32
%50 = fneg double %49
%51 = call double @llvm.fmuladd.f64(double %50, double %41, double %48)
store double %51, double* %12
%52 = load double, double* %9
%53 = call double @llvm.fmuladd.f64(double %43, double %41, double %52)
store double %53, double* %9
%54 = load double, double* %10
%55 = call double @llvm.fmuladd.f64(double %46, double %41, double %54)
store double %55, double* %10
%56 = load double, double* %11
%57 = call double @llvm.fmuladd.f64(double %49, double %41, double %56)
store double %57, double* %11
%58 = getelementptr inbounds double, double* %12, i64 1
%59 = load double, double* %58
%60 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 3
%61 = load double, double* %60
%62 = fneg double %61
%63 = call double @llvm.fmuladd.f64(double %62, double %41, double %59)
%64 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 4
%65 = load double, double* %64
%66 = fneg double %65
%67 = call double @llvm.fmuladd.f64(double %66, double %41, double %63)
%68 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 5
%69 = load double, double* %68
%70 = fneg double %69
%71 = call double @llvm.fmuladd.f64(double %70, double %41, double %67)
store double %71, double* %58
%72 = getelementptr inbounds double, double* %9, i64 1
%73 = load double, double* %72
%74 = call double @llvm.fmuladd.f64(double %61, double %41, double %73)
store double %74, double* %72
%75 = getelementptr inbounds double, double* %10, i64 1
%76 = load double, double* %75
%77 = call double @llvm.fmuladd.f64(double %65, double %41, double %76)
store double %77, double* %75
%78 = getelementptr inbounds double, double* %11, i64 1
%79 = load double, double* %78
%80 = call double @llvm.fmuladd.f64(double %69, double %41, double %79)
store double %80, double* %78
%81 = getelementptr inbounds double, double* %12, i64 2
%82 = load double, double* %81
%83 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 6
%84 = load double, double* %83
%85 = fneg double %84
%86 = call double @llvm.fmuladd.f64(double %85, double %41, double %82)
%87 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 7
%88 = load double, double* %87
%89 = fneg double %88
%90 = call double @llvm.fmuladd.f64(double %89, double %41, double %86)
%91 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 8
%92 = load double, double* %91
%93 = fneg double %92
%94 = call double @llvm.fmuladd.f64(double %93, double %41, double %90)
store double %94, double* %81
%95 = getelementptr inbounds double, double* %9, i64 2
%96 = load double, double* %95
%97 = call double @llvm.fmuladd.f64(double %84, double %41, double %96)
store double %97, double* %95
%98 = getelementptr inbounds double, double* %10, i64 2
%99 = load double, double* %98
%100 = call double @llvm.fmuladd.f64(double %88, double %41, double %99)
store double %100, double* %98
%101 = getelementptr inbounds double, double* %11, i64 2
%102 = load double, double* %101
%103 = call double @llvm.fmuladd.f64(double %92, double %41, double %102)
store double %103, double* %101
ret void
}