#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 fabs(double);
double area(double x1, double y1, double x2, double y2, double x3, double y3) {
  return fabs((x1 * y2 + x2 * y3 + x3 * y1) - (y1 * x2 + y2 * x3 + y3 * x1)) /
         2;
}


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
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  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x30(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
push   %rax
movapd %xmm2,%xmm6
unpcklpd %xmm3,%xmm6
movapd %xmm5,%xmm7
unpcklpd %xmm4,%xmm7
mulpd  %xmm6,%xmm7
movapd %xmm0,%xmm6
unpcklpd %xmm1,%xmm6
unpcklpd %xmm2,%xmm3
mulpd  %xmm3,%xmm6
addpd  %xmm7,%xmm6
unpcklpd %xmm5,%xmm4
unpcklpd %xmm0,%xmm1
mulpd  %xmm4,%xmm1
addpd  %xmm1,%xmm6
movapd %xmm6,%xmm0
unpckhpd %xmm6,%xmm0
subsd  %xmm0,%xmm6
movapd %xmm6,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @area(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = load double, double* %9
%16 = load double, double* %12
%17 = fmul double %15, %16
%18 = call double @llvm.fmuladd.f64(double %13, double %14, double %17)
%19 = load double, double* %11
%20 = load double, double* %8
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double %18)
%22 = load double, double* %8
%23 = load double, double* %9
%24 = load double, double* %10
%25 = load double, double* %11
%26 = fmul double %24, %25
%27 = call double @llvm.fmuladd.f64(double %22, double %23, double %26)
%28 = load double, double* %12
%29 = load double, double* %7
%30 = call double @llvm.fmuladd.f64(double %28, double %29, double %27)
%31 = fsub double %21, %30
%32 = call i32 @fabs(double %31)
%33 = sdiv i32 %32, 2
%34 = sitofp i32 %33 to double
ret double %34
}

LLVM IR (-O2):
define double @area(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = insertelement <2 x double> poison, double %2, i64 0
%8 = insertelement <2 x double> %7, double %3, i64 1
%9 = insertelement <2 x double> poison, double %5, i64 0
%10 = insertelement <2 x double> %9, double %4, i64 1
%11 = fmul <2 x double> %8, %10
%12 = insertelement <2 x double> poison, double %0, i64 0
%13 = insertelement <2 x double> %12, double %1, i64 1
%14 = insertelement <2 x double> poison, double %3, i64 0
%15 = insertelement <2 x double> %14, double %2, i64 1
%16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %15, <2 x double> %11)
%17 = insertelement <2 x double> poison, double %4, i64 0
%18 = insertelement <2 x double> %17, double %5, i64 1
%19 = insertelement <2 x double> poison, double %1, i64 0
%20 = insertelement <2 x double> %19, double %0, i64 1
%21 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %20, <2 x double> %16)
%22 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%23 = fsub <2 x double> %21, %22
%24 = extractelement <2 x double> %23, i64 0
%25 = tail call i32 @fabs(double %24)
%26 = sdiv i32 %25, 2
%27 = sitofp i32 %26 to double
ret double %27
}