#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 */
float det2x2(float, float, float, float);
float det3x3(float a1, float a2, float a3, float b1, float b2, float b3,
             float c1, float c2, float 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    $0x40,%rsp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
movss  0x10(%rbp),%xmm3
call   1030 <det2x2@plt>
movss  %xmm0,-0x30(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
movss  0x10(%rbp),%xmm3
call   1030 <det2x2@plt>
movss  -0x34(%rbp),%xmm1
movss  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x2c(%rbp),%xmm0
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
call   1030 <det2x2@plt>
movss  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x24(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<det3x3>:
sub    $0x28,%rsp
movss  %xmm7,0x10(%rsp)
movss  %xmm6,0x24(%rsp)
movss  %xmm5,0x20(%rsp)
movss  %xmm4,0x1c(%rsp)
movss  %xmm3,0x18(%rsp)
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x14(%rsp)
movss  0x30(%rsp),%xmm3
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm7,%xmm2
call   1030 <det2x2@plt>
movss  %xmm0,0x4(%rsp)
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
movss  0x30(%rsp),%xmm3
call   1030 <det2x2@plt>
mulss  0x18(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
mulss  0x14(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
movss  0x20(%rsp),%xmm3
call   1030 <det2x2@plt>
mulss  0x24(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @det3x3(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
%19 = load float, float* %10
%20 = load float, float* %14
%21 = load float, float* %15
%22 = load float, float* %17
%23 = load float, float* %18
%24 = call float @det2x2(float %20, float %21, float %22, float %23)
%25 = load float, float* %13
%26 = load float, float* %11
%27 = load float, float* %12
%28 = load float, float* %17
%29 = load float, float* %18
%30 = call float @det2x2(float %26, float %27, float %28, float %29)
%31 = fmul float %25, %30
%32 = fneg float %31
%33 = call float @llvm.fmuladd.f32(float %19, float %24, float %32)
%34 = load float, float* %16
%35 = load float, float* %11
%36 = load float, float* %12
%37 = load float, float* %14
%38 = load float, float* %15
%39 = call float @det2x2(float %35, float %36, float %37, float %38)
%40 = call float @llvm.fmuladd.f32(float %34, float %39, float %33)
ret float %40
}

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