#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 glmDotProduct3d(double const *, double const *);
void glmGenerateShadowMatrix4d(double m[16], const double planeOrigin[3],
                               const double planeNormal[3],
                               const double light[3]) {
  double d = -glmDotProduct3d(planeOrigin, planeNormal);
  double p = light[0] * planeNormal[0] + light[1] * planeNormal[1] +
             light[2] * planeNormal[2] + d;
  m[0] = p - light[0] * planeNormal[0];
  m[4] = -light[0] * planeNormal[1];
  m[8] = -light[0] * planeNormal[2];
  m[12] = -light[0] * d;
  m[1] = -light[1] * planeNormal[0];
  m[5] = p - light[1] * planeNormal[1];
  m[9] = -light[1] * planeNormal[2];
  m[13] = -light[1] * d;
  m[2] = -light[2] * planeNormal[0];
  m[6] = -light[2] * planeNormal[1];
  m[10] = p - light[2] * planeNormal[2];
  m[14] = -light[2] * d;
  m[3] = -planeNormal[0];
  m[7] = -planeNormal[1];
  m[11] = -planeNormal[2];
  m[15] = p - d;
}


x86 assembly (clang, -O0):
<glmGenerateShadowMatrix4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <glmDotProduct3d@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x60(%rax)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x30(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x68(%rax)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x30(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x70(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x58(%rax)
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x78(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateShadowMatrix4d>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <glmDotProduct3d@plt>
movsd  (%r15),%xmm2
movsd  0x8(%r15),%xmm3
mulsd  0x8(%r14),%xmm3
mulsd  (%r14),%xmm2
addsd  %xmm2,%xmm3
movsd  0x10(%r15),%xmm1
mulsd  0x10(%r14),%xmm1
addsd  %xmm3,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm3
subsd  %xmm2,%xmm3
movsd  %xmm3,(%rbx)
movsd  (%r15),%xmm3
movapd 0xe90(%rip),%xmm2
xorpd  %xmm2,%xmm3
mulsd  0x8(%r14),%xmm3
movsd  %xmm3,0x20(%rbx)
movsd  (%r15),%xmm3
xorpd  %xmm2,%xmm3
mulsd  0x10(%r14),%xmm3
movsd  %xmm3,0x40(%rbx)
movsd  (%r15),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x60(%rbx)
movsd  0x8(%r15),%xmm3
xorpd  %xmm2,%xmm3
mulsd  (%r14),%xmm3
movsd  %xmm3,0x8(%rbx)
movsd  0x8(%r15),%xmm3
mulsd  0x8(%r14),%xmm3
movapd %xmm1,%xmm4
subsd  %xmm3,%xmm4
movsd  %xmm4,0x28(%rbx)
movsd  0x8(%r15),%xmm3
xorpd  %xmm2,%xmm3
mulsd  0x10(%r14),%xmm3
movsd  %xmm3,0x48(%rbx)
movsd  0x8(%r15),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x68(%rbx)
movsd  0x10(%r15),%xmm3
xorpd  %xmm2,%xmm3
mulsd  (%r14),%xmm3
movsd  %xmm3,0x10(%rbx)
movsd  0x10(%r15),%xmm3
xorpd  %xmm2,%xmm3
mulsd  0x8(%r14),%xmm3
movsd  %xmm3,0x30(%rbx)
movsd  0x10(%r15),%xmm3
mulsd  0x10(%r14),%xmm3
movapd %xmm1,%xmm4
subsd  %xmm3,%xmm4
movsd  %xmm4,0x50(%rbx)
movsd  0x10(%r15),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x70(%rbx)
movsd  (%r14),%xmm3
xorpd  %xmm2,%xmm3
movlpd %xmm3,0x18(%rbx)
movsd  0x8(%r14),%xmm3
xorpd  %xmm2,%xmm3
movlpd %xmm3,0x38(%rbx)
movsd  0x10(%r14),%xmm3
xorpd  %xmm2,%xmm3
movlpd %xmm3,0x58(%rbx)
addsd  %xmm0,%xmm1
movsd  %xmm1,0x78(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @glmGenerateShadowMatrix4d(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double*, double** %6
%12 = load double*, double** %7
%13 = call double @glmDotProduct3d(double* %11, double* %12)
%14 = fneg double %13
store double %14, double* %9
%15 = load double*, double** %8
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = load double*, double** %7
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = load double*, double** %8
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = load double*, double** %7
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fmul double %23, %26
%28 = call double @llvm.fmuladd.f64(double %17, double %20, double %27)
%29 = load double*, double** %8
%30 = getelementptr inbounds double, double* %29, i64 2
%31 = load double, double* %30
%32 = load double*, double** %7
%33 = getelementptr inbounds double, double* %32, i64 2
%34 = load double, double* %33
%35 = call double @llvm.fmuladd.f64(double %31, double %34, double %28)
%36 = load double, double* %9
%37 = fadd double %35, %36
store double %37, double* %10
%38 = load double, double* %10
%39 = load double*, double** %8
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = load double*, double** %7
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
%45 = fneg double %41
%46 = call double @llvm.fmuladd.f64(double %45, double %44, double %38)
%47 = load double*, double** %5
%48 = getelementptr inbounds double, double* %47, i64 0
store double %46, double* %48
%49 = load double*, double** %8
%50 = getelementptr inbounds double, double* %49, i64 0
%51 = load double, double* %50
%52 = fneg double %51
%53 = load double*, double** %7
%54 = getelementptr inbounds double, double* %53, i64 1
%55 = load double, double* %54
%56 = fmul double %52, %55
%57 = load double*, double** %5
%58 = getelementptr inbounds double, double* %57, i64 4
store double %56, double* %58
%59 = load double*, double** %8
%60 = getelementptr inbounds double, double* %59, i64 0
%61 = load double, double* %60
%62 = fneg double %61
%63 = load double*, double** %7
%64 = getelementptr inbounds double, double* %63, i64 2
%65 = load double, double* %64
%66 = fmul double %62, %65
%67 = load double*, double** %5
%68 = getelementptr inbounds double, double* %67, i64 8
store double %66, double* %68
%69 = load double*, double** %8
%70 = getelementptr inbounds double, double* %69, i64 0
%71 = load double, double* %70
%72 = fneg double %71
%73 = load double, double* %9
%74 = fmul double %72, %73
%75 = load double*, double** %5
%76 = getelementptr inbounds double, double* %75, i64 12
store double %74, double* %76
%77 = load double*, double** %8
%78 = getelementptr inbounds double, double* %77, i64 1
%79 = load double, double* %78
%80 = fneg double %79
%81 = load double*, double** %7
%82 = getelementptr inbounds double, double* %81, i64 0
%83 = load double, double* %82
%84 = fmul double %80, %83
%85 = load double*, double** %5
%86 = getelementptr inbounds double, double* %85, i64 1
store double %84, double* %86
%87 = load double, double* %10
%88 = load double*, double** %8
%89 = getelementptr inbounds double, double* %88, i64 1
%90 = load double, double* %89
%91 = load double*, double** %7
%92 = getelementptr inbounds double, double* %91, i64 1
%93 = load double, double* %92
%94 = fneg double %90
%95 = call double @llvm.fmuladd.f64(double %94, double %93, double %87)
%96 = load double*, double** %5
%97 = getelementptr inbounds double, double* %96, i64 5
store double %95, double* %97
%98 = load double*, double** %8
%99 = getelementptr inbounds double, double* %98, i64 1
%100 = load double, double* %99
%101 = fneg double %100
%102 = load double*, double** %7
%103 = getelementptr inbounds double, double* %102, i64 2
%104 = load double, double* %103
%105 = fmul double %101, %104
%106 = load double*, double** %5
%107 = getelementptr inbounds double, double* %106, i64 9
store double %105, double* %107
%108 = load double*, double** %8
%109 = getelementptr inbounds double, double* %108, i64 1
%110 = load double, double* %109
%111 = fneg double %110
%112 = load double, double* %9
%113 = fmul double %111, %112
%114 = load double*, double** %5
%115 = getelementptr inbounds double, double* %114, i64 13
store double %113, double* %115
%116 = load double*, double** %8
%117 = getelementptr inbounds double, double* %116, i64 2
%118 = load double, double* %117
%119 = fneg double %118
%120 = load double*, double** %7
%121 = getelementptr inbounds double, double* %120, i64 0
%122 = load double, double* %121
%123 = fmul double %119, %122
%124 = load double*, double** %5
%125 = getelementptr inbounds double, double* %124, i64 2
store double %123, double* %125
%126 = load double*, double** %8
%127 = getelementptr inbounds double, double* %126, i64 2
%128 = load double, double* %127
%129 = fneg double %128
%130 = load double*, double** %7
%131 = getelementptr inbounds double, double* %130, i64 1
%132 = load double, double* %131
%133 = fmul double %129, %132
%134 = load double*, double** %5
%135 = getelementptr inbounds double, double* %134, i64 6
store double %133, double* %135
%136 = load double, double* %10
%137 = load double*, double** %8
%138 = getelementptr inbounds double, double* %137, i64 2
%139 = load double, double* %138
%140 = load double*, double** %7
%141 = getelementptr inbounds double, double* %140, i64 2
%142 = load double, double* %141
%143 = fneg double %139
%144 = call double @llvm.fmuladd.f64(double %143, double %142, double %136)
%145 = load double*, double** %5
%146 = getelementptr inbounds double, double* %145, i64 10
store double %144, double* %146
%147 = load double*, double** %8
%148 = getelementptr inbounds double, double* %147, i64 2
%149 = load double, double* %148
%150 = fneg double %149
%151 = load double, double* %9
%152 = fmul double %150, %151
%153 = load double*, double** %5
%154 = getelementptr inbounds double, double* %153, i64 14
store double %152, double* %154
%155 = load double*, double** %7
%156 = getelementptr inbounds double, double* %155, i64 0
%157 = load double, double* %156
%158 = fneg double %157
%159 = load double*, double** %5
%160 = getelementptr inbounds double, double* %159, i64 3
store double %158, double* %160
%161 = load double*, double** %7
%162 = getelementptr inbounds double, double* %161, i64 1
%163 = load double, double* %162
%164 = fneg double %163
%165 = load double*, double** %5
%166 = getelementptr inbounds double, double* %165, i64 7
store double %164, double* %166
%167 = load double*, double** %7
%168 = getelementptr inbounds double, double* %167, i64 2
%169 = load double, double* %168
%170 = fneg double %169
%171 = load double*, double** %5
%172 = getelementptr inbounds double, double* %171, i64 11
store double %170, double* %172
%173 = load double, double* %10
%174 = load double, double* %9
%175 = fsub double %173, %174
%176 = load double*, double** %5
%177 = getelementptr inbounds double, double* %176, i64 15
store double %175, double* %177
ret void
}

LLVM IR (-O2):
define void @glmGenerateShadowMatrix4d(double* nocapture writeonly %0, double* %1, double* %2, double* nocapture %3) {
%5 = tail call double @glmDotProduct3d(double* %1, double* %2)
%6 = load double, double* %3
%7 = load double, double* %2
%8 = getelementptr inbounds double, double* %3, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %2, i64 1
%11 = load double, double* %10
%12 = fmul double %9, %11
%13 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %12)
%14 = getelementptr inbounds double, double* %3, i64 2
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %2, i64 2
%17 = load double, double* %16
%18 = tail call double @llvm.fmuladd.f64(double %15, double %17, double %13)
%19 = fsub double %18, %5
%20 = fneg double %6
%21 = tail call double @llvm.fmuladd.f64(double %20, double %7, double %19)
store double %21, double* %0
%22 = load double, double* %3
%23 = fneg double %22
%24 = load double, double* %10
%25 = fmul double %24, %23
%26 = getelementptr inbounds double, double* %0, i64 4
store double %25, double* %26
%27 = load double, double* %3
%28 = fneg double %27
%29 = load double, double* %16
%30 = fmul double %29, %28
%31 = getelementptr inbounds double, double* %0, i64 8
store double %30, double* %31
%32 = load double, double* %3
%33 = fmul double %5, %32
%34 = getelementptr inbounds double, double* %0, i64 12
store double %33, double* %34
%35 = load double, double* %8
%36 = fneg double %35
%37 = load double, double* %2
%38 = fmul double %37, %36
%39 = getelementptr inbounds double, double* %0, i64 1
store double %38, double* %39
%40 = load double, double* %8
%41 = load double, double* %10
%42 = fneg double %40
%43 = tail call double @llvm.fmuladd.f64(double %42, double %41, double %19)
%44 = getelementptr inbounds double, double* %0, i64 5
store double %43, double* %44
%45 = load double, double* %8
%46 = fneg double %45
%47 = load double, double* %16
%48 = fmul double %47, %46
%49 = getelementptr inbounds double, double* %0, i64 9
store double %48, double* %49
%50 = load double, double* %8
%51 = fmul double %5, %50
%52 = getelementptr inbounds double, double* %0, i64 13
store double %51, double* %52
%53 = load double, double* %14
%54 = fneg double %53
%55 = load double, double* %2
%56 = fmul double %55, %54
%57 = getelementptr inbounds double, double* %0, i64 2
store double %56, double* %57
%58 = load double, double* %14
%59 = fneg double %58
%60 = load double, double* %10
%61 = fmul double %60, %59
%62 = getelementptr inbounds double, double* %0, i64 6
store double %61, double* %62
%63 = load double, double* %14
%64 = load double, double* %16
%65 = fneg double %63
%66 = tail call double @llvm.fmuladd.f64(double %65, double %64, double %19)
%67 = getelementptr inbounds double, double* %0, i64 10
store double %66, double* %67
%68 = load double, double* %14
%69 = fmul double %5, %68
%70 = getelementptr inbounds double, double* %0, i64 14
store double %69, double* %70
%71 = load double, double* %2
%72 = fneg double %71
%73 = getelementptr inbounds double, double* %0, i64 3
store double %72, double* %73
%74 = load double, double* %10
%75 = fneg double %74
%76 = getelementptr inbounds double, double* %0, i64 7
store double %75, double* %76
%77 = load double, double* %16
%78 = fneg double %77
%79 = getelementptr inbounds double, double* %0, i64 11
store double %78, double* %79
%80 = fadd double %5, %19
%81 = getelementptr inbounds double, double* %0, i64 15
store double %80, double* %81
ret void
}