#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__ M_PI;
int /*<<< orphan*/ gl_frustum(float, float, float, float, float, float);
scalar_t__ tan(float);
void glu_perspective(float vfov, float aspect, float near, float far) {
  float vfov_rad = (float)M_PI * vfov / 180.f;
  float x = near * (float)tan(vfov_rad / 2.f);
  gl_frustum(-aspect * x, aspect * x, -x, x, near, far);
}


x86 assembly (clang, -O0):
<glu_perspective>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
cvtsi2ssq (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xeaf(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe8b(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <tan@plt>
movss  -0x1c(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x18(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movss  -0x18(%rbp),%xmm3
movss  -0xc(%rbp),%xmm4
movss  -0x10(%rbp),%xmm5
call   1040 <gl_frustum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glu_perspective>:
sub    $0x28,%rsp
movss  %xmm3,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
movaps %xmm1,0x10(%rsp)
mov    0x2eac(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
mulss  %xmm1,%xmm0
divss  0xeb0(%rip),%xmm0
mulss  0xeac(%rip),%xmm0
call   1030 <tan@plt>
xorps  %xmm3,%xmm3
cvtsi2ss %rax,%xmm3
movss  0x8(%rsp),%xmm4
mulss  %xmm4,%xmm3
movaps 0xe9a(%rip),%xmm2
movaps %xmm3,%xmm1
movaps 0x10(%rsp),%xmm0
mulss  %xmm0,%xmm1
xorps  %xmm2,%xmm0
mulss  %xmm3,%xmm0
xorps  %xmm3,%xmm2
movss  0xc(%rsp),%xmm5
add    $0x28,%rsp
jmp    1040 <gl_frustum@plt>

LLVM IR (-O0):
@M_PI = global i64 0
define void @glu_perspective(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load i64, i64* @M_PI
%12 = sitofp i64 %11 to float
%13 = load float, float* %5
%14 = fmul float %12, %13
%15 = fdiv float %14, 1.800000e+02
store float %15, float* %9
%16 = load float, float* %7
%17 = load float, float* %9
%18 = fdiv float %17, 2.000000e+00
%19 = call i64 @tan(float %18)
%20 = sitofp i64 %19 to float
%21 = fmul float %16, %20
store float %21, float* %10
%22 = load float, float* %6
%23 = fneg float %22
%24 = load float, float* %10
%25 = fmul float %23, %24
%26 = load float, float* %6
%27 = load float, float* %10
%28 = fmul float %26, %27
%29 = load float, float* %10
%30 = fneg float %29
%31 = load float, float* %10
%32 = load float, float* %7
%33 = load float, float* %8
%34 = call i32 @gl_frustum(float %25, float %28, float %30, float %31, float %32, float %33)
ret void
}

LLVM IR (-O2):
@M_PI = global i64 0
define void @glu_perspective(float %0, float %1, float %2, float %3) {
%5 = load i64, i64* @M_PI
%6 = sitofp i64 %5 to float
%7 = fmul float %6, %0
%8 = fdiv float %7, 1.800000e+02
%9 = fmul float %8, 5.000000e-01
%10 = tail call i64 @tan(float %9)
%11 = sitofp i64 %10 to float
%12 = fmul float %11, %2
%13 = fneg float %1
%14 = fmul float %12, %13
%15 = fmul float %12, %1
%16 = fneg float %12
%17 = tail call i32 @gl_frustum(float %14, float %15, float %16, float %12, float %2, float %3)
ret void
}