#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 qAbs(double);
double triarea2d(const double *P1, const double *P2, const double *P3) {
  return qAbs(0.5 * ((P1[0] - P2[0]) * (P3[1] - P2[1]) -
                     (P1[1] - P2[1]) * (P3[0] - P2[0])));
}


x86 assembly (clang, -O0):
<triarea2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <qAbs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triarea2d>:
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
movsd  (%rdi),%xmm3
movsd  0x8(%rdi),%xmm4
subsd  %xmm1,%xmm3
movsd  (%rdx),%xmm5
movsd  0x8(%rdx),%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm0
subsd  %xmm2,%xmm4
subsd  %xmm1,%xmm5
mulsd  %xmm4,%xmm5
subsd  %xmm5,%xmm0
mulsd  0xeb1(%rip),%xmm0
jmp    1030 <qAbs@plt>

LLVM IR (-O0):
define double @triarea2d(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 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fsub double %16, %19
%21 = load double*, double** %4
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fsub double %23, %26
%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 0
%33 = load double, double* %32
%34 = fsub double %30, %33
%35 = fmul double %27, %34
%36 = fneg double %35
%37 = call double @llvm.fmuladd.f64(double %13, double %20, double %36)
%38 = fmul double 5.000000e-01, %37
%39 = call double @qAbs(double %38)
ret double %39
}

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