#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 */
scalar_t__ calloc(int, int);
float *OrthoReplacement(float left, float right, float bottom, float top,
                        float nearVal, float farVal) {
  float *r;
  float tx, ty, tz;
  r = (float *)calloc(sizeof(float), 16);
  tx = -1.0 * ((right + left) / (right - left));
  ty = -1.0 * ((top + bottom) / (top - bottom));
  tz = -1.0 * ((farVal + nearVal) / (farVal - nearVal));
  r[0] = 2.0 / (right - left);
  r[1] = 0.0;
  r[2] = 0.0;
  r[3] = 0.0;
  r[4] = 0.0;
  r[5] = 2.0 / (top - bottom);
  r[6] = 0.0;
  r[7] = 0.0;
  r[8] = 0.0;
  r[9] = 0.0;
  r[10] = -2.0 / (farVal - nearVal);
  r[11] = 0.0;
  r[12] = tx;
  r[13] = ty;
  r[14] = tz;
  r[15] = 1.0;
  return r;
}


x86 assembly (clang, -O0):
<OrthoReplacement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
mov    $0x4,%edi
mov    $0x10,%esi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe7a(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
subss  -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe49(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe1e(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rax)
movss  -0x10(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdc8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x14(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x24(%rax)
movss  -0x18(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd69(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x28(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x2c(%rax)
movss  -0x24(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x30(%rax)
movss  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x34(%rax)
movss  -0x2c(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x38(%rax)
mov    -0x20(%rbp),%rax
movss  0xd0e(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OrthoReplacement>:
sub    $0x18,%rsp
movss  %xmm5,0x14(%rsp)
movss  %xmm4,0x10(%rsp)
movss  %xmm3,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
mov    $0x4,%edi
mov    $0x10,%esi
call   1030 <calloc@plt>
movss  (%rsp),%xmm1
movaps %xmm1,%xmm0
movss  0x4(%rsp),%xmm2
addss  %xmm2,%xmm0
subss  %xmm1,%xmm2
movaps 0xe9d(%rip),%xmm1
xorps  %xmm1,%xmm0
divss  %xmm2,%xmm0
movaps %xmm2,%xmm7
movss  0x8(%rsp),%xmm4
movaps %xmm4,%xmm2
movss  0xc(%rsp),%xmm3
addss  %xmm3,%xmm2
subss  %xmm4,%xmm3
xorps  %xmm1,%xmm2
divss  %xmm3,%xmm2
movaps %xmm3,%xmm6
movss  0x10(%rsp),%xmm5
movaps %xmm5,%xmm3
movss  0x14(%rsp),%xmm4
addss  %xmm4,%xmm3
subss  %xmm5,%xmm4
xorps  %xmm1,%xmm3
divss  %xmm4,%xmm3
movaps %xmm4,%xmm5
movss  0xe59(%rip),%xmm1
movaps %xmm1,%xmm4
divss  %xmm7,%xmm4
movss  %xmm4,(%rax)
divss  %xmm6,%xmm1
xorps  %xmm4,%xmm4
movups %xmm4,0x4(%rax)
movss  %xmm1,0x14(%rax)
movss  0xe3a(%rip),%xmm1
divss  %xmm5,%xmm1
movups %xmm4,0x18(%rax)
movss  %xmm1,0x28(%rax)
movl   $0x0,0x2c(%rax)
movss  %xmm0,0x30(%rax)
movss  %xmm2,0x34(%rax)
movss  %xmm3,0x38(%rax)
movl   $0x3f800000,0x3c(%rax)
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define float* @OrthoReplacement(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call i64 @calloc(i32 4, i32 16)
%8 = inttoptr i64 %7 to float*
%9 = fadd float %0, %1
%10 = fsub float %1, %0
%11 = fneg float %9
%12 = fdiv float %11, %10
%13 = fadd float %2, %3
%14 = fsub float %3, %2
%15 = fneg float %13
%16 = fdiv float %15, %14
%17 = fadd float %4, %5
%18 = fsub float %5, %4
%19 = fneg float %17
%20 = fdiv float %19, %18
%21 = fdiv float 2.000000e+00, %10
store float %21, float* %8
%22 = getelementptr inbounds float, float* %8, i64 1
%23 = fdiv float 2.000000e+00, %14
%24 = getelementptr inbounds float, float* %8, i64 5
%25 = bitcast float* %22 to i8*
store float %23, float* %24
%26 = getelementptr inbounds float, float* %8, i64 6
%27 = fdiv float -2.000000e+00, %18
%28 = getelementptr inbounds float, float* %8, i64 10
%29 = bitcast float* %26 to i8*
store float %27, float* %28
%30 = getelementptr inbounds float, float* %8, i64 11
store float 0.000000e+00, float* %30
%31 = getelementptr inbounds float, float* %8, i64 12
store float %12, float* %31
%32 = getelementptr inbounds float, float* %8, i64 13
store float %16, float* %32
%33 = getelementptr inbounds float, float* %8, i64 14
store float %20, float* %33
%34 = getelementptr inbounds float, float* %8, i64 15
store float 1.000000e+00, float* %34
ret float* %8
}