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


x86 assembly (clang, -O0):
<EPIdiagTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x18(%rbp),%rax
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  0xebb(%rip),%xmm0
call   1030 <cofactor2D@plt>
movsd  -0x60(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  0xe94(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xe4c(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  0xe47(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
movsd  0xe06(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  0xdf1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  0xdb9(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
movsd  0xda4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  0xd5e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  (%rax),%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  0xcf7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIdiagTriangle>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %r9,%r15
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x60(%rsp),%r12
mov    0x68(%rsp),%r13
lea    0x10(%rsp),%rdi
movsd  0xeb4(%rip),%xmm0
call   1030 <cofactor2D@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm9
movsd  0xea1(%rip),%xmm8
movapd %xmm9,%xmm5
movapd %xmm9,%xmm3
mulsd  %xmm8,%xmm3
movsd  0xe92(%rip),%xmm6
movapd %xmm0,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm3,%xmm7
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm7
mulsd  0x0(%r13),%xmm7
addsd  (%rbx),%xmm7
movsd  %xmm7,(%rbx)
movsd  0x20(%rsp),%xmm1
movsd  0x28(%rsp),%xmm10
movapd %xmm1,%xmm3
mulsd  %xmm6,%xmm3
mulsd  %xmm6,%xmm5
mulsd  %xmm10,%xmm6
movapd %xmm10,%xmm4
mulsd  %xmm8,%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm2,%xmm3
mulsd  0x8(%r13),%xmm3
addsd  %xmm7,%xmm3
movsd  %xmm3,(%rbx)
movapd %xmm0,%xmm3
mulsd  %xmm8,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm2,%xmm3
mulsd  0x0(%r13),%xmm3
addsd  (%r14),%xmm3
addsd  %xmm9,%xmm0
movsd  %xmm3,(%r14)
movapd %xmm1,%xmm4
mulsd  %xmm8,%xmm4
addsd  %xmm6,%xmm4
mulsd  %xmm2,%xmm4
mulsd  0x8(%r13),%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,(%r14)
mulsd  %xmm8,%xmm0
mulsd  %xmm2,%xmm0
movsd  0x0(%r13),%xmm3
mulsd  %xmm0,%xmm3
addsd  (%r15),%xmm3
movsd  %xmm3,(%r15)
mulsd  0x0(%r13),%xmm0
addsd  (%r12),%xmm0
addsd  %xmm10,%xmm1
movsd  %xmm0,(%r12)
mulsd  %xmm8,%xmm1
mulsd  %xmm2,%xmm1
movsd  0x8(%r13),%xmm0
mulsd  %xmm1,%xmm0
addsd  (%r15),%xmm0
movsd  %xmm0,(%r15)
mulsd  0x8(%r13),%xmm1
addsd  (%r12),%xmm1
movsd  %xmm1,(%r12)
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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