#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 triangleArea(double vertices[][2]) {
  double area = 0;
  area =
      0.5 *
      ((vertices[1][0] - vertices[0][0]) * (vertices[2][1] - vertices[0][1]) -
       (vertices[2][0] - vertices[0][0]) * (vertices[1][1] - vertices[0][1]));
  area = fabs(area);
  return area;
}


x86 assembly (clang, -O0):
<triangleArea>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm3
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xe6a(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangleArea>:
movsd  0x10(%rdi),%xmm1
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm3
subsd  %xmm2,%xmm1
movsd  0x28(%rdi),%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x20(%rdi),%xmm1
subsd  %xmm2,%xmm1
movsd  0x18(%rdi),%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
mulsd  0xebf(%rip),%xmm0
andpd  0xec7(%rip),%xmm0
ret

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

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