#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 /*<<< orphan*/ cofactor2D(double *, double *, double *, double *, double);
void dVTTriangle2D(double *y1, double *y2, double *yM, double x, double *r1,
                   double *r2, double *rM) {
  double cof[4];
  cofactor2D(cof, y1, y2, yM, x);
  r1[0] += cof[0];
  r1[1] += cof[2];
  r2[0] += cof[1];
  r2[1] += cof[3];
  rM[0] -= (cof[0] + cof[1]);
  rM[1] -= (cof[2] + cof[3]);
}


x86 assembly (clang, -O0):
<dVTTriangle2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
call   1030 <cofactor2D@plt>
movsd  -0x60(%rbp),%xmm0
mov    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x58(%rbp),%xmm0
mov    -0x30(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x60(%rbp),%xmm1
addsd  -0x58(%rbp),%xmm1
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
mov    -0x38(%rbp),%rax
movsd  0x8(%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dVTTriangle2D>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <cofactor2D@plt>
movapd (%rsp),%xmm0
movupd (%rbx),%xmm1
movupd 0x8(%rsp),%xmm2
movapd %xmm2,%xmm3
movsd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
movupd %xmm3,(%rbx)
movupd (%r15),%xmm1
movsd  0x18(%rsp),%xmm3
unpcklpd %xmm3,%xmm0
addpd  %xmm2,%xmm0
unpcklpd %xmm3,%xmm2
addpd  %xmm1,%xmm2
movupd %xmm2,(%r15)
movupd (%r14),%xmm1
subpd  %xmm0,%xmm1
movupd %xmm1,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @dVTTriangle2D(double* %0, double* %1, double* %2, double %3, double* %4, double* %5, double* %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca [4 x double]
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double %3, double* %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%16 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%17 = load double*, double** %8
%18 = load double*, double** %9
%19 = load double*, double** %10
%20 = load double, double* %11
%21 = call i32 @cofactor2D(double* %16, double* %17, double* %18, double* %19, double %20)
%22 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%23 = load double, double* %22
%24 = load double*, double** %12
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = fadd double %26, %23
store double %27, double* %25
%28 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
%29 = load double, double* %28
%30 = load double*, double** %12
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
%33 = fadd double %32, %29
store double %33, double* %31
%34 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 1
%35 = load double, double* %34
%36 = load double*, double** %13
%37 = getelementptr inbounds double, double* %36, i64 0
%38 = load double, double* %37
%39 = fadd double %38, %35
store double %39, double* %37
%40 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
%41 = load double, double* %40
%42 = load double*, double** %13
%43 = getelementptr inbounds double, double* %42, i64 1
%44 = load double, double* %43
%45 = fadd double %44, %41
store double %45, double* %43
%46 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
%47 = load double, double* %46
%48 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 1
%49 = load double, double* %48
%50 = fadd double %47, %49
%51 = load double*, double** %14
%52 = getelementptr inbounds double, double* %51, i64 0
%53 = load double, double* %52
%54 = fsub double %53, %50
store double %54, double* %52
%55 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 2
%56 = load double, double* %55
%57 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 3
%58 = load double, double* %57
%59 = fadd double %56, %58
%60 = load double*, double** %14
%61 = getelementptr inbounds double, double* %60, i64 1
%62 = load double, double* %61
%63 = fsub double %62, %59
store double %63, double* %61
ret void
}

LLVM IR (-O2):
define void @dVTTriangle2D(double* %0, double* %1, double* %2, double %3, double* nocapture %4, double* nocapture %5, double* nocapture %6) {
%8 = alloca [4 x double]
%9 = bitcast [4 x double]* %8 to i8*
%10 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 0
%11 = call i32 @cofactor2D(double* %10, double* %0, double* %1, double* %2, double %3)
%12 = bitcast [4 x double]* %8 to <2 x double>*
%13 = load <2 x double>, <2 x double>* %12
%14 = bitcast double* %4 to <2 x double>*
%15 = load <2 x double>, <2 x double>* %14
%16 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 1
%17 = bitcast double* %16 to <2 x double>*
%18 = load <2 x double>, <2 x double>* %17
%19 = shufflevector <2 x double> %13, <2 x double> %18, <2 x i32> <i32 0, i32 3>
%20 = fadd <2 x double> %19, %15
%21 = bitcast double* %4 to <2 x double>*
store <2 x double> %20, <2 x double>* %21
%22 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 3
%23 = load double, double* %22
%24 = bitcast double* %5 to <2 x double>*
%25 = load <2 x double>, <2 x double>* %24
%26 = insertelement <2 x double> %18, double %23, i64 1
%27 = fadd <2 x double> %26, %25
%28 = bitcast double* %5 to <2 x double>*
store <2 x double> %27, <2 x double>* %28
%29 = insertelement <2 x double> %13, double %23, i64 1
%30 = fadd <2 x double> %18, %29
%31 = bitcast double* %6 to <2 x double>*
%32 = load <2 x double>, <2 x double>* %31
%33 = fsub <2 x double> %32, %30
%34 = bitcast double* %6 to <2 x double>*
store <2 x double> %33, <2 x double>* %34
ret void
}