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


x86 assembly (clang, -O0):
<nsl_geom_three_point_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
subsd  -0x30(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe78(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsl_geom_three_point_area>:
push   %rax
movapd %xmm3,%xmm6
subsd  %xmm5,%xmm6
subsd  %xmm1,%xmm5
mulsd  %xmm2,%xmm5
mulsd  %xmm6,%xmm0
addsd  %xmm5,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm1,%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xeb7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @nsl_geom_three_point_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* %12
%16 = fsub double %14, %15
%17 = load double, double* %9
%18 = load double, double* %12
%19 = load double, double* %8
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = call double @llvm.fmuladd.f64(double %13, double %16, double %21)
%23 = load double, double* %11
%24 = load double, double* %8
%25 = load double, double* %10
%26 = fsub double %24, %25
%27 = call double @llvm.fmuladd.f64(double %23, double %26, double %22)
%28 = call i32 @fabs(double %27)
%29 = sitofp i32 %28 to double
%30 = fdiv double %29, 2.000000e+00
ret double %30
}

LLVM IR (-O2):
define double @nsl_geom_three_point_area(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %3, %5
%8 = fsub double %5, %1
%9 = fmul double %8, %2
%10 = tail call double @llvm.fmuladd.f64(double %0, double %7, double %9)
%11 = fsub double %1, %3
%12 = tail call double @llvm.fmuladd.f64(double %4, double %11, double %10)
%13 = tail call i32 @fabs(double %12)
%14 = sitofp i32 %13 to double
%15 = fmul double %14, 5.000000e-01
ret double %15
}