#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 fabs(double);
double area(double x[2], double y[2], double z[2]) {
  return fabs((x[0] * y[1] + z[0] * x[1] + y[0] * z[1] - z[0] * y[1] -
               x[0] * z[1] - y[0] * x[1]) /
              2);
}


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe25(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps 0xe0a(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
movsd  (%rdi),%xmm3
movsd  0x8(%rdi),%xmm4
movsd  (%rdx),%xmm5
movsd  0x8(%rdx),%xmm6
movapd %xmm5,%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm3,%xmm7
mulsd  %xmm2,%xmm7
addsd  %xmm0,%xmm7
movapd %xmm1,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm7,%xmm0
mulsd  %xmm2,%xmm5
subsd  %xmm5,%xmm0
mulsd  %xmm6,%xmm3
subsd  %xmm3,%xmm0
mulsd  %xmm4,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xea5(%rip),%xmm0
andpd  0xead(%rip),%xmm0
ret

LLVM IR (-O0):
define double @area(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = fmul double %15, %18
%20 = call double @llvm.fmuladd.f64(double %9, double %12, double %19)
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = call double @llvm.fmuladd.f64(double %23, double %26, double %20)
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 0
%30 = load double, double* %29
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = fneg double %30
%35 = call double @llvm.fmuladd.f64(double %34, double %33, double %27)
%36 = load double*, double** %4
%37 = getelementptr inbounds double, double* %36, i64 0
%38 = load double, double* %37
%39 = load double*, double** %6
%40 = getelementptr inbounds double, double* %39, i64 1
%41 = load double, double* %40
%42 = fneg double %38
%43 = call double @llvm.fmuladd.f64(double %42, double %41, double %35)
%44 = load double*, double** %5
%45 = getelementptr inbounds double, double* %44, i64 0
%46 = load double, double* %45
%47 = load double*, double** %4
%48 = getelementptr inbounds double, double* %47, i64 1
%49 = load double, double* %48
%50 = fneg double %46
%51 = call double @llvm.fmuladd.f64(double %50, double %49, double %43)
%52 = fdiv double %51, 2.000000e+00
%53 = call double @llvm.fabs.f64(double %52)
ret double %53
}

LLVM IR (-O2):
define double @area(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = load double, double* %2
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fmul double %7, %9
%11 = tail call double @llvm.fmuladd.f64(double %4, double %6, double %10)
%12 = load double, double* %1
%13 = getelementptr inbounds double, double* %2, i64 1
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %11)
%16 = fneg double %7
%17 = tail call double @llvm.fmuladd.f64(double %16, double %6, double %15)
%18 = fneg double %4
%19 = tail call double @llvm.fmuladd.f64(double %18, double %14, double %17)
%20 = fneg double %12
%21 = tail call double @llvm.fmuladd.f64(double %20, double %9, double %19)
%22 = fmul double %21, 5.000000e-01
%23 = tail call double @llvm.fabs.f64(double %22)
ret double %23
}