#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 lldet2(long double, long double, long double, long double);
double orient2d(double *pa, double *pb, double *pc) {
  long double a = pa[0] - pc[0], b = pb[0] - pc[0];
  long double c = pa[1] - pc[1], d = pb[1] - pc[1];
  return lldet2(a, b, c, d);
}


x86 assembly (clang, -O0):
<orient2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
fldl   -0x68(%rbp)
fstpt  -0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
fldl   -0x70(%rbp)
fstpt  -0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
fldl   -0x78(%rbp)
fstpt  -0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
fldl   -0x80(%rbp)
fstpt  -0x60(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fldt   -0x50(%rbp)
fldt   -0x60(%rbp)
mov    %rsp,%rax
fstpt  0x30(%rax)
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <lldet2@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orient2d>:
sub    $0x68,%rsp
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  (%rdx),%xmm2
movsd  0x8(%rdx),%xmm3
subsd  %xmm2,%xmm0
movsd  %xmm0,0x58(%rsp)
fldl   0x58(%rsp)
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm4
subsd  %xmm2,%xmm0
movsd  %xmm0,0x60(%rsp)
fldl   0x60(%rsp)
subsd  %xmm3,%xmm1
movsd  %xmm1,0x48(%rsp)
fldl   0x48(%rsp)
subsd  %xmm3,%xmm4
movsd  %xmm4,0x50(%rsp)
fldl   0x50(%rsp)
fstpt  0x30(%rsp)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <lldet2@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
define double @orient2d(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca x86_fp80
%8 = alloca x86_fp80
%9 = alloca x86_fp80
%10 = alloca x86_fp80
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = fsub double %13, %16
%18 = fpext double %17 to x86_fp80
store x86_fp80 %18, x86_fp80* %7
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = fsub double %21, %24
%26 = fpext double %25 to x86_fp80
store x86_fp80 %26, x86_fp80* %8
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 1
%29 = load double, double* %28
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
%33 = fsub double %29, %32
%34 = fpext double %33 to x86_fp80
store x86_fp80 %34, x86_fp80* %9
%35 = load double*, double** %5
%36 = getelementptr inbounds double, double* %35, i64 1
%37 = load double, double* %36
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 1
%40 = load double, double* %39
%41 = fsub double %37, %40
%42 = fpext double %41 to x86_fp80
store x86_fp80 %42, x86_fp80* %10
%43 = load x86_fp80, x86_fp80* %7
%44 = load x86_fp80, x86_fp80* %8
%45 = load x86_fp80, x86_fp80* %9
%46 = load x86_fp80, x86_fp80* %10
%47 = call double @lldet2(x86_fp80 %43, x86_fp80 %44, x86_fp80 %45, x86_fp80 %46)
ret double %47
}

LLVM IR (-O2):
define double @orient2d(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %0
%5 = load double, double* %2
%6 = fsub double %4, %5
%7 = fpext double %6 to x86_fp80
%8 = load double, double* %1
%9 = fsub double %8, %5
%10 = fpext double %9 to x86_fp80
%11 = getelementptr inbounds double, double* %0, i64 1
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %2, i64 1
%14 = load double, double* %13
%15 = fsub double %12, %14
%16 = fpext double %15 to x86_fp80
%17 = getelementptr inbounds double, double* %1, i64 1
%18 = load double, double* %17
%19 = fsub double %18, %14
%20 = fpext double %19 to x86_fp80
%21 = tail call double @lldet2(x86_fp80 %7, x86_fp80 %10, x86_fp80 %16, x86_fp80 %20)
ret double %21
}