#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 */
typedef int GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gluPerspective(float, int, float, float);
void ReSizeGLScene(int Width, int Height) {
  float hfov = 90.0, vfov;
  if (Height == 0)
    Height = 1;
  glViewport(0, 0, Width, Height);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  vfov = hfov / (1.0 * Width / Height);
  gluPerspective(vfov, (GLfloat)Width / (GLfloat)Height, 0.1f, 100.0f);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<ReSizeGLScene>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  0xeaa(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    116c <ReSizeGLScene+0x2c>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
movss  0xe2e(%rip),%xmm1
movss  0xe2a(%rip),%xmm2
call   1040 <gluPerspective@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReSizeGLScene>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
test   %esi,%esi
mov    $0x1,%ebp
cmovne %esi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1060 <glViewport@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
cvtsi2sd %ebx,%xmm0
cvtsi2sd %ebp,%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7b(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
mov    %ebx,%eax
cltd
idiv   %ebp
movss  0xe6b(%rip),%xmm1
movss  0xe67(%rip),%xmm2
mov    %eax,%edi
call   1040 <gluPerspective@plt>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @ReSizeGLScene(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
store float 9.000000e+01, float* %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %4
br label %10
10: ; preds = %9, %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @glViewport(i32 0, i32 0, i32 %11, i32 %12)
%14 = load i32, i32* @GL_PROJECTION
%15 = call i32 @glMatrixMode(i32 %14)
%16 = call i32 (...) @glLoadIdentity()
%17 = load float, float* %5
%18 = fpext float %17 to double
%19 = load i32, i32* %3
%20 = sitofp i32 %19 to double
%21 = fmul double 1.000000e+00, %20
%22 = load i32, i32* %4
%23 = sitofp i32 %22 to double
%24 = fdiv double %21, %23
%25 = fdiv double %18, %24
%26 = fptrunc double %25 to float
store float %26, float* %6
%27 = load float, float* %6
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = sdiv i32 %28, %29
%31 = call i32 @gluPerspective(float %27, i32 %30, float 0x3FB99999A0000000, float 1.000000e+02)
%32 = load i32, i32* @GL_MODELVIEW
%33 = call i32 @glMatrixMode(i32 %32)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @ReSizeGLScene(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %4)
%6 = load i32, i32* @GL_PROJECTION
%7 = tail call i32 @glMatrixMode(i32 %6)
%8 = tail call i32 (...) @glLoadIdentity()
%9 = sitofp i32 %0 to double
%10 = sitofp i32 %4 to double
%11 = fdiv double %9, %10
%12 = fdiv double 9.000000e+01, %11
%13 = fptrunc double %12 to float
%14 = sdiv i32 %0, %4
%15 = tail call i32 @gluPerspective(float %13, i32 %14, float 0x3FB99999A0000000, float 1.000000e+02)
%16 = load i32, i32* @GL_MODELVIEW
%17 = tail call i32 @glMatrixMode(i32 %16)
ret void
}