#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 Det2x2(double, double, double, double);
double Det3x3(double a1, double a2, double a3, double b1, double b2, double b3,
              double c1, double c2, double c3) {
  return (a1 * Det2x2(b2, b3, c2, c3) - b1 * Det2x2(a2, a3, c2, c3) +
          c1 * Det2x2(a2, a3, b2, b3));
}


x86 assembly (clang, -O0):
<Det3x3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  0x10(%rbp),%xmm3
call   1030 <Det2x2@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  0x10(%rbp),%xmm3
call   1030 <Det2x2@plt>
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
call   1030 <Det2x2@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Det3x3>:
sub    $0x48,%rsp
movsd  %xmm7,0x18(%rsp)
movsd  %xmm6,0x40(%rsp)
movsd  %xmm5,0x38(%rsp)
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  0x50(%rsp),%xmm3
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm7,%xmm2
call   1030 <Det2x2@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x50(%rsp),%xmm3
call   1030 <Det2x2@plt>
mulsd  0x28(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
movsd  0x38(%rsp),%xmm3
call   1030 <Det2x2@plt>
mulsd  0x40(%rsp),%xmm0
addsd  (%rsp),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @Det3x3(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
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
%19 = load double, double* %10
%20 = load double, double* %14
%21 = load double, double* %15
%22 = load double, double* %17
%23 = load double, double* %18
%24 = call double @Det2x2(double %20, double %21, double %22, double %23)
%25 = load double, double* %13
%26 = load double, double* %11
%27 = load double, double* %12
%28 = load double, double* %17
%29 = load double, double* %18
%30 = call double @Det2x2(double %26, double %27, double %28, double %29)
%31 = fmul double %25, %30
%32 = fneg double %31
%33 = call double @llvm.fmuladd.f64(double %19, double %24, double %32)
%34 = load double, double* %16
%35 = load double, double* %11
%36 = load double, double* %12
%37 = load double, double* %14
%38 = load double, double* %15
%39 = call double @Det2x2(double %35, double %36, double %37, double %38)
%40 = call double @llvm.fmuladd.f64(double %34, double %39, double %33)
ret double %40
}

LLVM IR (-O2):
define double @Det3x3(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8) {
%10 = tail call double @Det2x2(double %4, double %5, double %7, double %8)
%11 = tail call double @Det2x2(double %1, double %2, double %7, double %8)
%12 = fneg double %11
%13 = fmul double %12, %3
%14 = tail call double @llvm.fmuladd.f64(double %0, double %10, double %13)
%15 = tail call double @Det2x2(double %1, double %2, double %4, double %5)
%16 = tail call double @llvm.fmuladd.f64(double %6, double %15, double %14)
ret double %16
}