double volTet(double *c1, double *c2, double *c3, double *c4) {
  double ax, ay, az, bx, by, bz, vol;
  ax = c3[0] - c1[0];
  ay = c3[1] - c1[1];
  az = c3[2] - c1[2];
  bx = c4[0] - c1[0];
  by = c4[1] - c1[1];
  bz = c4[2] - c1[2];
  vol = (c2[0] - c1[0]) * (ay * bz - az * by) +
        (c2[1] - c1[1]) * (az * bx - ax * bz) +
        (c2[2] - c1[2]) * (ax * by - ay * bx);
  return (vol / 6.0);
}


x86 assembly (clang, -O0):
<volTet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  -0x38(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm5
movsd  -0x28(%rbp),%xmm4
mulsd  -0x50(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm3
mulsd  -0x40(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0xd73(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<volTet>:
movsd  (%rdx),%xmm10
movsd  0x8(%rdx),%xmm4
movsd  (%rdi),%xmm3
movsd  0x8(%rdi),%xmm8
subsd  %xmm3,%xmm10
subsd  %xmm8,%xmm4
movsd  0x10(%rdx),%xmm2
movsd  0x10(%rdi),%xmm9
subsd  %xmm9,%xmm2
movsd  (%rcx),%xmm6
movsd  0x8(%rcx),%xmm0
subsd  %xmm3,%xmm6
subsd  %xmm8,%xmm0
movsd  0x10(%rcx),%xmm7
subsd  %xmm9,%xmm7
movsd  (%rsi),%xmm5
movsd  0x8(%rsi),%xmm1
subsd  %xmm3,%xmm5
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm6,%xmm2
mulsd  %xmm4,%xmm6
mulsd  %xmm7,%xmm4
subsd  %xmm3,%xmm4
mulsd  %xmm5,%xmm4
subsd  %xmm8,%xmm1
mulsd  %xmm10,%xmm7
subsd  %xmm7,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm4,%xmm2
movsd  0x10(%rsi),%xmm1
subsd  %xmm9,%xmm1
mulsd  %xmm10,%xmm0
subsd  %xmm6,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
divsd  0xe54(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @volTet(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
%5 = load double, double* %2
%6 = load double, double* %0
%7 = fsub double %5, %6
%8 = getelementptr inbounds double, double* %2, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %0, i64 1
%11 = load double, double* %10
%12 = fsub double %9, %11
%13 = getelementptr inbounds double, double* %2, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = load double, double* %3
%19 = fsub double %18, %6
%20 = getelementptr inbounds double, double* %3, i64 1
%21 = load double, double* %20
%22 = fsub double %21, %11
%23 = getelementptr inbounds double, double* %3, i64 2
%24 = load double, double* %23
%25 = fsub double %24, %16
%26 = load double, double* %1
%27 = fsub double %26, %6
%28 = fneg double %17
%29 = fmul double %22, %28
%30 = tail call double @llvm.fmuladd.f64(double %12, double %25, double %29)
%31 = getelementptr inbounds double, double* %1, i64 1
%32 = load double, double* %31
%33 = fsub double %32, %11
%34 = fneg double %7
%35 = fmul double %25, %34
%36 = tail call double @llvm.fmuladd.f64(double %17, double %19, double %35)
%37 = fmul double %33, %36
%38 = tail call double @llvm.fmuladd.f64(double %27, double %30, double %37)
%39 = getelementptr inbounds double, double* %1, i64 2
%40 = load double, double* %39
%41 = fsub double %40, %16
%42 = fneg double %12
%43 = fmul double %19, %42
%44 = tail call double @llvm.fmuladd.f64(double %7, double %22, double %43)
%45 = tail call double @llvm.fmuladd.f64(double %41, double %44, double %38)
%46 = fdiv double %45, 6.000000e+00
ret double %46
}