#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_frustum(float, float, float, float, float, float);
scalar_t__ tan(float);
void glu_perspective(float vfov, float aspect, float znear, float zfar) {
  float vfov_rad = (float)3.141592653589793 * vfov / 180.f;
  float x = znear * (float)tan(vfov_rad / 2.f);
  gl_frustum(-aspect * x, aspect * x, -x, x, znear, zfar);
}


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)
movss  0xec4(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xeb3(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe8f(%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)
mulss  0xec3(%rip),%xmm0
divss  0xebf(%rip),%xmm0
mulss  0xebb(%rip),%xmm0
call   1030 <tan@plt>
xorps  %xmm3,%xmm3
cvtsi2ss %rax,%xmm3
movss  0x8(%rsp),%xmm4
mulss  %xmm4,%xmm3
movaps 0xea5(%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):
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 float, float* %5
%12 = fmul float 0x400921FB60000000, %11
%13 = fdiv float %12, 1.800000e+02
store float %13, float* %9
%14 = load float, float* %7
%15 = load float, float* %9
%16 = fdiv float %15, 2.000000e+00
%17 = call i64 @tan(float %16)
%18 = sitofp i64 %17 to float
%19 = fmul float %14, %18
store float %19, float* %10
%20 = load float, float* %6
%21 = fneg float %20
%22 = load float, float* %10
%23 = fmul float %21, %22
%24 = load float, float* %6
%25 = load float, float* %10
%26 = fmul float %24, %25
%27 = load float, float* %10
%28 = fneg float %27
%29 = load float, float* %10
%30 = load float, float* %7
%31 = load float, float* %8
%32 = call i32 @gl_frustum(float %23, float %26, float %28, float %29, float %30, float %31)
ret void
}

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