#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 VAMPIREdiagTriangle(double *y1, double *y2, double *yM, double *r1,
                         double *r2, double *r3, double *r4, double Ti) {
  double dVx, cof[4];
  cofactor2D(cof, y1, y2, yM, 1.0);
  dVx = cof[0] * (0.75) + cof[1] * (-0.25);
  r1[0] += Ti * dVx;
  dVx = cof[2] * (0.75) + cof[3] * (-0.25);
  r1[1] += Ti * dVx;
  dVx = cof[0] * (-0.25) + cof[1] * (0.75);
  r2[0] += Ti * dVx;
  dVx = cof[2] * (-0.25) + cof[3] * (0.75);
  r2[1] += Ti * dVx;
  ;
  dVx = (cof[0] + cof[1]) * (-0.25);
  r3[0] += Ti * dVx;
  r4[0] += Ti * dVx;
  dVx = (cof[2] + cof[3]) * (-0.25);
  r3[1] += Ti * dVx;
  r4[1] += Ti * dVx;
}


x86 assembly (clang, -O0):
<VAMPIREdiagTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movsd  0xebf(%rip),%xmm0
call   1030 <cofactor2D@plt>
movsd  -0x60(%rbp),%xmm0
movsd  0xe9d(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  0xe98(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xe58(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  0xe53(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x60(%rbp),%xmm0
movsd  0xe19(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  0xe04(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xdd4(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  0xdbf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x60(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  0xd80(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  0xd29(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x30(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VAMPIREdiagTriangle>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
movaps %xmm0,0x20(%rsp)
mov    %r9,%rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x60(%rsp),%r12
mov    %rsp,%rdi
movsd  0xebe(%rip),%xmm0
call   1030 <cofactor2D@plt>
movsd  (%rsp),%xmm2
movsd  0x8(%rsp),%xmm4
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm8
movapd %xmm2,%xmm1
addsd  %xmm4,%xmm2
unpcklpd %xmm8,%xmm4
movapd 0xe9b(%rip),%xmm9
movapd %xmm4,%xmm6
mulpd  %xmm9,%xmm6
unpcklpd %xmm0,%xmm1
movapd 0xe95(%rip),%xmm10
movapd %xmm1,%xmm3
mulpd  %xmm10,%xmm3
addpd  %xmm6,%xmm3
movupd (%r15),%xmm6
movapd 0x20(%rsp),%xmm7
movapd %xmm7,%xmm5
unpcklpd %xmm7,%xmm5
mulpd  %xmm5,%xmm3
addpd  %xmm6,%xmm3
movupd %xmm3,(%r15)
mulpd  %xmm10,%xmm4
mulpd  %xmm9,%xmm1
addpd  %xmm4,%xmm1
movupd (%r14),%xmm3
mulpd  %xmm5,%xmm1
addpd  %xmm3,%xmm1
movupd %xmm1,(%r14)
movsd  0xe28(%rip),%xmm1
mulsd  %xmm1,%xmm2
mulsd  %xmm7,%xmm2
movsd  (%rbx),%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%rbx)
addsd  (%r12),%xmm2
movsd  %xmm2,(%r12)
addsd  %xmm8,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm7,%xmm0
movsd  0x8(%rbx),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rbx)
addsd  0x8(%r12),%xmm0
movsd  %xmm0,0x8(%r12)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @VAMPIREdiagTriangle(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double
%17 = alloca double
%18 = alloca [4 x double]
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store double %7, double* %16
%19 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 0
%20 = load double*, double** %9
%21 = load double*, double** %10
%22 = load double*, double** %11
%23 = call i32 @cofactor2D(double* %19, double* %20, double* %21, double* %22, double 1.000000e+00)
%24 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 0
%25 = load double, double* %24
%26 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 1
%27 = load double, double* %26
%28 = fmul double %27, -2.500000e-01
%29 = call double @llvm.fmuladd.f64(double %25, double 7.500000e-01, double %28)
store double %29, double* %17
%30 = load double, double* %16
%31 = load double, double* %17
%32 = load double*, double** %12
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = call double @llvm.fmuladd.f64(double %30, double %31, double %34)
store double %35, double* %33
%36 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 2
%37 = load double, double* %36
%38 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 3
%39 = load double, double* %38
%40 = fmul double %39, -2.500000e-01
%41 = call double @llvm.fmuladd.f64(double %37, double 7.500000e-01, double %40)
store double %41, double* %17
%42 = load double, double* %16
%43 = load double, double* %17
%44 = load double*, double** %12
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = call double @llvm.fmuladd.f64(double %42, double %43, double %46)
store double %47, double* %45
%48 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 0
%49 = load double, double* %48
%50 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 1
%51 = load double, double* %50
%52 = fmul double %51, 7.500000e-01
%53 = call double @llvm.fmuladd.f64(double %49, double -2.500000e-01, double %52)
store double %53, double* %17
%54 = load double, double* %16
%55 = load double, double* %17
%56 = load double*, double** %13
%57 = getelementptr inbounds double, double* %56, i64 0
%58 = load double, double* %57
%59 = call double @llvm.fmuladd.f64(double %54, double %55, double %58)
store double %59, double* %57
%60 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 2
%61 = load double, double* %60
%62 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 3
%63 = load double, double* %62
%64 = fmul double %63, 7.500000e-01
%65 = call double @llvm.fmuladd.f64(double %61, double -2.500000e-01, double %64)
store double %65, double* %17
%66 = load double, double* %16
%67 = load double, double* %17
%68 = load double*, double** %13
%69 = getelementptr inbounds double, double* %68, i64 1
%70 = load double, double* %69
%71 = call double @llvm.fmuladd.f64(double %66, double %67, double %70)
store double %71, double* %69
%72 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 0
%73 = load double, double* %72
%74 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 1
%75 = load double, double* %74
%76 = fadd double %73, %75
%77 = fmul double %76, -2.500000e-01
store double %77, double* %17
%78 = load double, double* %16
%79 = load double, double* %17
%80 = load double*, double** %14
%81 = getelementptr inbounds double, double* %80, i64 0
%82 = load double, double* %81
%83 = call double @llvm.fmuladd.f64(double %78, double %79, double %82)
store double %83, double* %81
%84 = load double, double* %16
%85 = load double, double* %17
%86 = load double*, double** %15
%87 = getelementptr inbounds double, double* %86, i64 0
%88 = load double, double* %87
%89 = call double @llvm.fmuladd.f64(double %84, double %85, double %88)
store double %89, double* %87
%90 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 2
%91 = load double, double* %90
%92 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 0, i64 3
%93 = load double, double* %92
%94 = fadd double %91, %93
%95 = fmul double %94, -2.500000e-01
store double %95, double* %17
%96 = load double, double* %16
%97 = load double, double* %17
%98 = load double*, double** %14
%99 = getelementptr inbounds double, double* %98, i64 1
%100 = load double, double* %99
%101 = call double @llvm.fmuladd.f64(double %96, double %97, double %100)
store double %101, double* %99
%102 = load double, double* %16
%103 = load double, double* %17
%104 = load double*, double** %15
%105 = getelementptr inbounds double, double* %104, i64 1
%106 = load double, double* %105
%107 = call double @llvm.fmuladd.f64(double %102, double %103, double %106)
store double %107, double* %105
ret void
}

LLVM IR (-O2):
define void @VAMPIREdiagTriangle(double* %0, double* %1, double* %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double %7) {
%9 = alloca [4 x double]
%10 = bitcast [4 x double]* %9 to i8*
%11 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%12 = call i32 @cofactor2D(double* %11, double* %0, double* %1, double* %2, double 1.000000e+00)
%13 = load double, double* %11
%14 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 2
%17 = load double, double* %16
%18 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 3
%19 = load double, double* %18
%20 = insertelement <2 x double> poison, double %15, i64 0
%21 = insertelement <2 x double> %20, double %19, i64 1
%22 = fmul <2 x double> %21, <double -2.500000e-01, double -2.500000e-01>
%23 = insertelement <2 x double> poison, double %13, i64 0
%24 = insertelement <2 x double> %23, double %17, i64 1
%25 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> <double 7.500000e-01, double 7.500000e-01>, <2 x double> %22)
%26 = bitcast double* %3 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = insertelement <2 x double> poison, double %7, i64 0
%29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
%30 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %25, <2 x double> %27)
%31 = bitcast double* %3 to <2 x double>*
store <2 x double> %30, <2 x double>* %31
%32 = fmul <2 x double> %21, <double 7.500000e-01, double 7.500000e-01>
%33 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> <double -2.500000e-01, double -2.500000e-01>, <2 x double> %32)
%34 = bitcast double* %4 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %33, <2 x double> %35)
%37 = bitcast double* %4 to <2 x double>*
store <2 x double> %36, <2 x double>* %37
%38 = fadd double %13, %15
%39 = fmul double %38, -2.500000e-01
%40 = load double, double* %5
%41 = call double @llvm.fmuladd.f64(double %7, double %39, double %40)
store double %41, double* %5
%42 = load double, double* %6
%43 = call double @llvm.fmuladd.f64(double %7, double %39, double %42)
store double %43, double* %6
%44 = fadd double %17, %19
%45 = fmul double %44, -2.500000e-01
%46 = getelementptr inbounds double, double* %5, i64 1
%47 = load double, double* %46
%48 = call double @llvm.fmuladd.f64(double %7, double %45, double %47)
store double %48, double* %46
%49 = getelementptr inbounds double, double* %6, i64 1
%50 = load double, double* %49
%51 = call double @llvm.fmuladd.f64(double %7, double %45, double %50)
store double %51, double* %49
ret void
}