#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*/ gl_mult_matrixf(float *);
void gl_ortho(float left, float right, float bottom, float top, float near,
              float far) {
  float mat[] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
  float dx = right - left;
  float dy = top - bottom;
  float dz = far - near;
  float tx = -(right + left) / dx;
  float ty = -(top + bottom) / dy;
  float tz = -(far + near) / dz;
  float sx = 2.f / dx;
  float sy = 2.f / dy;
  float sz = -2.f / dz;
  mat[0] = sx;
  mat[5] = sy;
  mat[10] = sz;
  mat[12] = tx;
  mat[13] = ty;
  mat[14] = tz;
  gl_mult_matrixf(mat);
}


x86 assembly (clang, -O0):
<gl_ortho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%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)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movss  0xea7(%rip),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  0xe9a(%rip),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  0xe8d(%rip),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  0xe80(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x18(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x64(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x68(%rbp),%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  0xddf(%rip),%xmm0
divss  -0x64(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  0xdcd(%rip),%xmm0
divss  -0x68(%rbp),%xmm0
movss  %xmm0,-0x80(%rbp)
movss  0xdb7(%rip),%xmm0
divss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x7c(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x80(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x84(%rbp),%xmm0
ff
movss  %xmm0,-0x38(%rbp)
movss  -0x70(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x74(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x78(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <gl_mult_matrixf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_ortho>:
sub    $0x48,%rsp
xorps  %xmm6,%xmm6
movaps %xmm6,(%rsp)
movaps %xmm6,0x10(%rsp)
movaps %xmm6,0x20(%rsp)
movl   $0x3f800000,0x3c(%rsp)
3f
movaps %xmm1,%xmm6
subss  %xmm0,%xmm6
movaps %xmm3,%xmm7
subss  %xmm2,%xmm7
movaps %xmm5,%xmm8
subss  %xmm4,%xmm8
addss  %xmm1,%xmm0
movaps 0xeb1(%rip),%xmm1
xorps  %xmm1,%xmm0
divss  %xmm6,%xmm0
addss  %xmm3,%xmm2
xorps  %xmm1,%xmm2
divss  %xmm7,%xmm2
addss  %xmm5,%xmm4
xorps  %xmm1,%xmm4
divss  %xmm8,%xmm4
movss  0xe9b(%rip),%xmm1
movaps %xmm1,%xmm3
divss  %xmm6,%xmm3
divss  %xmm7,%xmm1
movss  0xe8c(%rip),%xmm5
divss  %xmm8,%xmm5
movss  %xmm3,(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm5,0x28(%rsp)
movss  %xmm0,0x30(%rsp)
movss  %xmm2,0x34(%rsp)
movss  %xmm4,0x38(%rsp)
mov    %rsp,%rdi
call   1030 <gl_mult_matrixf@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @gl_ortho(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 [16 x float]
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = 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
%23 = bitcast [16 x float]* %13 to i8*
%24 = bitcast i8* %23 to [16 x float]*
%25 = getelementptr inbounds [16 x float], [16 x float]* %24, i32 0, i32 0
store float 1.000000e+00, float* %25
%26 = getelementptr inbounds [16 x float], [16 x float]* %24, i32 0, i32 5
store float 1.000000e+00, float* %26
%27 = getelementptr inbounds [16 x float], [16 x float]* %24, i32 0, i32 10
store float 1.000000e+00, float* %27
%28 = getelementptr inbounds [16 x float], [16 x float]* %24, i32 0, i32 15
store float 1.000000e+00, float* %28
%29 = load float, float* %8
%30 = load float, float* %7
%31 = fsub float %29, %30
store float %31, float* %14
%32 = load float, float* %10
%33 = load float, float* %9
%34 = fsub float %32, %33
store float %34, float* %15
%35 = load float, float* %12
%36 = load float, float* %11
%37 = fsub float %35, %36
store float %37, float* %16
%38 = load float, float* %8
%39 = load float, float* %7
%40 = fadd float %38, %39
%41 = fneg float %40
%42 = load float, float* %14
%43 = fdiv float %41, %42
store float %43, float* %17
%44 = load float, float* %10
%45 = load float, float* %9
%46 = fadd float %44, %45
%47 = fneg float %46
%48 = load float, float* %15
%49 = fdiv float %47, %48
store float %49, float* %18
%50 = load float, float* %12
%51 = load float, float* %11
%52 = fadd float %50, %51
%53 = fneg float %52
%54 = load float, float* %16
%55 = fdiv float %53, %54
store float %55, float* %19
%56 = load float, float* %14
%57 = fdiv float 2.000000e+00, %56
store float %57, float* %20
%58 = load float, float* %15
%59 = fdiv float 2.000000e+00, %58
store float %59, float* %21
%60 = load float, float* %16
%61 = fdiv float -2.000000e+00, %60
store float %61, float* %22
%62 = load float, float* %20
%63 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 0
store float %62, float* %63
%64 = load float, float* %21
%65 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 5
store float %64, float* %65
%66 = load float, float* %22
%67 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 10
store float %66, float* %67
%68 = load float, float* %17
%69 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 12
store float %68, float* %69
%70 = load float, float* %18
%71 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 13
store float %70, float* %71
%72 = load float, float* %19
%73 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 14
store float %72, float* %73
%74 = getelementptr inbounds [16 x float], [16 x float]* %13, i64 0, i64 0
%75 = call i32 @gl_mult_matrixf(float* %74)
ret void
}

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