#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*/ Frustum16fv(float *, float, float, float, float, float,
                               float);
scalar_t__ tan(float);
float *Perspective(float *M, float Yfov, float Aspect, float Ndist,
                   float Fdist) {
  Yfov *= 0.0174532f;
  float wT = (float)tan(Yfov * 0.5f) * Ndist, wB = -wT;
  float wR = wT * Aspect, wL = -wR;
  Frustum16fv(M, wL, wR, wB, wT, Ndist, Fdist);
  return (M);
}


x86 assembly (clang, -O0):
<Perspective>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  0xebc(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xea6(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1040 <tan@plt>
cvtsi2ss %rax,%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0x28(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
call   1030 <Frustum16fv@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Perspective>:
push   %rbx
sub    $0x20,%rsp
movss  %xmm3,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
movaps %xmm1,0x10(%rsp)
mov    %rdi,%rbx
mulss  0xebf(%rip),%xmm0
mulss  0xebb(%rip),%xmm0
call   1040 <tan@plt>
xorps  %xmm3,%xmm3
cvtsi2ss %rax,%xmm3
movss  0x8(%rsp),%xmm4
mulss  %xmm4,%xmm3
movaps 0xea9(%rip),%xmm0
movaps %xmm3,%xmm2
xorps  %xmm0,%xmm2
movaps 0x10(%rsp),%xmm1
mulss  %xmm3,%xmm1
xorps  %xmm1,%xmm0
mov    %rbx,%rdi
movss  0xc(%rsp),%xmm5
call   1030 <Frustum16fv@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float* @Perspective(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%15 = load float, float* %7
%16 = fmul float %15, 0x3F91DF4060000000
store float %16, float* %7
%17 = load float, float* %7
%18 = fmul float %17, 5.000000e-01
%19 = call i64 @tan(float %18)
%20 = sitofp i64 %19 to float
%21 = load float, float* %9
%22 = fmul float %20, %21
store float %22, float* %11
%23 = load float, float* %11
%24 = fneg float %23
store float %24, float* %12
%25 = load float, float* %11
%26 = load float, float* %8
%27 = fmul float %25, %26
store float %27, float* %13
%28 = load float, float* %13
%29 = fneg float %28
store float %29, float* %14
%30 = load float*, float** %6
%31 = load float, float* %14
%32 = load float, float* %13
%33 = load float, float* %12
%34 = load float, float* %11
%35 = load float, float* %9
%36 = load float, float* %10
%37 = call i32 @Frustum16fv(float* %30, float %31, float %32, float %33, float %34, float %35, float %36)
%38 = load float*, float** %6
ret float* %38
}

LLVM IR (-O2):
define float* @Perspective(float* returned %0, float %1, float %2, float %3, float %4) {
%6 = fmul float %1, 0x3F91DF4060000000
%7 = fmul float %6, 5.000000e-01
%8 = tail call i64 @tan(float %7)
%9 = sitofp i64 %8 to float
%10 = fmul float %9, %3
%11 = fneg float %10
%12 = fmul float %10, %2
%13 = fneg float %12
%14 = tail call i32 @Frustum16fv(float* %0, float %13, float %12, float %11, float %10, float %3, float %4)
ret float* %0
}