#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 */
int /*<<< orphan*/ cofactor3D(double *, double const *, double const *,
                              double const *, double const *, double const);
void dVTTetra3D(const double *yA, const double *yB, const double *yC,
                const double *yM, const double x, double *rA, double *rB,
                double *rC, double *rM) {
  int i, j, k;
  double cof[9];
  cofactor3D(cof, yA, yB, yC, yM, x);
  k = 0;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      rM[i] -= cof[j + k];
    }
    rA[i] += cof[0 + k];
    rB[i] += cof[1 + k];
    rC[i] += cof[2 + k];
    k += 3;
  }
}


x86 assembly (clang, -O0):
<dVTTetra3D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
movsd  -0x28(%rbp),%xmm0
call   1030 <cofactor3D@plt>
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jge    123f <dVTTetra3D+0x12f>
movl   $0x0,-0x40(%rbp)
cmpl   $0x3,-0x40(%rbp)
jge    11bf <dVTTetra3D+0xaf>
mov    -0x40(%rbp),%eax
add    -0x44(%rbp),%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm1
ff ff
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1180 <dVTTetra3D+0x70>
mov    -0x44(%rbp),%eax
add    $0x0,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x2,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    116f <dVTTetra3D+0x5f>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dVTTetra3D>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,%r14
mov    %r8,%rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x70(%rsp),%r15
mov    0x78(%rsp),%r12
mov    %rsp,%rdi
call   1030 <cofactor3D@plt>
movsd  (%r12),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm3
subsd  %xmm3,%xmm0
movsd  %xmm0,(%r12)
addsd  (%rbx),%xmm1
movsd  %xmm1,(%rbx)
addsd  (%r14),%xmm2
movsd  %xmm2,(%r14)
addsd  (%r15),%xmm3
movsd  %xmm3,(%r15)
movsd  0x8(%r12),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
movsd  0x28(%rsp),%xmm3
subsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%r12)
addsd  0x8(%rbx),%xmm1
movsd  %xmm1,0x8(%rbx)
addsd  0x8(%r14),%xmm2
movsd  %xmm2,0x8(%r14)
addsd  0x8(%r15),%xmm3
movsd  %xmm3,0x8(%r15)
movsd  0x10(%r12),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x38(%rsp),%xmm2
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
movsd  0x40(%rsp),%xmm3
subsd  %xmm3,%xmm0
movsd  %xmm0,0x10(%r12)
addsd  0x10(%rbx),%xmm1
movsd  %xmm1,0x10(%rbx)
addsd  0x10(%r14),%xmm2
movsd  %xmm2,0x10(%r14)
addsd  0x10(%r15),%xmm3
movsd  %xmm3,0x10(%r15)
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @dVTTetra3D(double* %0, double* %1, double* %2, double* %3, double %4, double* nocapture %5, double* nocapture %6, double* nocapture %7, double* nocapture %8) {
%10 = alloca [9 x double]
%11 = bitcast [9 x double]* %10 to i8*
%12 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%13 = call i32 @cofactor3D(double* %12, double* %0, double* %1, double* %2, double* %3, double %4)
%14 = load double, double* %8
%15 = load double, double* %12
%16 = fsub double %14, %15
%17 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 1
%18 = load double, double* %17
%19 = fsub double %16, %18
%20 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 2
%21 = load double, double* %20
%22 = fsub double %19, %21
store double %22, double* %8
%23 = load double, double* %5
%24 = fadd double %15, %23
store double %24, double* %5
%25 = load double, double* %6
%26 = fadd double %18, %25
store double %26, double* %6
%27 = load double, double* %7
%28 = fadd double %21, %27
store double %28, double* %7
%29 = getelementptr inbounds double, double* %8, i64 1
%30 = load double, double* %29
%31 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 3
%32 = load double, double* %31
%33 = fsub double %30, %32
%34 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 4
%35 = load double, double* %34
%36 = fsub double %33, %35
%37 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 5
%38 = load double, double* %37
%39 = fsub double %36, %38
store double %39, double* %29
%40 = getelementptr inbounds double, double* %5, i64 1
%41 = load double, double* %40
%42 = fadd double %32, %41
store double %42, double* %40
%43 = getelementptr inbounds double, double* %6, i64 1
%44 = load double, double* %43
%45 = fadd double %35, %44
store double %45, double* %43
%46 = getelementptr inbounds double, double* %7, i64 1
%47 = load double, double* %46
%48 = fadd double %38, %47
store double %48, double* %46
%49 = getelementptr inbounds double, double* %8, i64 2
%50 = load double, double* %49
%51 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 6
%52 = load double, double* %51
%53 = fsub double %50, %52
%54 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 7
%55 = load double, double* %54
%56 = fsub double %53, %55
%57 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 8
%58 = load double, double* %57
%59 = fsub double %56, %58
store double %59, double* %49
%60 = getelementptr inbounds double, double* %5, i64 2
%61 = load double, double* %60
%62 = fadd double %52, %61
store double %62, double* %60
%63 = getelementptr inbounds double, double* %6, i64 2
%64 = load double, double* %63
%65 = fadd double %55, %64
store double %65, double* %63
%66 = getelementptr inbounds double, double* %7, i64 2
%67 = load double, double* %66
%68 = fadd double %58, %67
store double %68, double* %66
ret void
}