#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*/ gluLookAt(float, float, float, float, float, float, float,
                             float, float);
int /*<<< orphan*/ gluPerspective(float, int, float, float);
void ReSizeGLScene(int Width, int Height) {
  if (Height == 0)
    Height = 1;
  glViewport(0, 0, Width, Height);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0f, (GLfloat)Width / (GLfloat)Height, 0.1f, 100.0f);
  gluLookAt(10.0f, 20.0f, 20.0f, 0.0f, -5.0f, 0.0f, 0.0f, 1.0f, 0.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)
cmpl   $0x0,-0x8(%rbp)
jne    116f <ReSizeGLScene+0x1f>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1070 <glViewport@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
movss  0xe6c(%rip),%xmm0
movss  0xe68(%rip),%xmm1
movss  0xe64(%rip),%xmm2
call   1050 <gluPerspective@plt>
movss  0xe3f(%rip),%xmm0
movss  0xe3b(%rip),%xmm2
xorps  %xmm8,%xmm8
movss  0xe33(%rip),%xmm4
movss  0xe2f(%rip),%xmm7
movaps %xmm2,%xmm1
movaps %xmm8,%xmm3
movaps %xmm8,%xmm5
movaps %xmm8,%xmm6
movss  %xmm8,(%rsp)
call   1030 <gluLookAt@plt>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
call   1040 <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   1070 <glViewport@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
mov    %ebx,%eax
cltd
idiv   %ebp
movss  0xe72(%rip),%xmm0
movss  0xe6e(%rip),%xmm1
movss  0xe6a(%rip),%xmm2
mov    %eax,%edi
call   1050 <gluPerspective@plt>
movl   $0x0,(%rsp)
movss  0xe58(%rip),%xmm0
movss  0xe54(%rip),%xmm1
movss  0xe50(%rip),%xmm4
movss  0xe4c(%rip),%xmm7
xorps  %xmm3,%xmm3
xorps  %xmm5,%xmm5
xorps  %xmm6,%xmm6
movaps %xmm1,%xmm2
call   1030 <gluLookAt@plt>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <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
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 1, i32* %4
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @glViewport(i32 0, i32 0, i32 %9, i32 %10)
%12 = load i32, i32* @GL_PROJECTION
%13 = call i32 @glMatrixMode(i32 %12)
%14 = call i32 (...) @glLoadIdentity()
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sdiv i32 %15, %16
%18 = call i32 @gluPerspective(float 4.500000e+01, i32 %17, float 0x3FB99999A0000000, float 1.000000e+02)
%19 = call i32 @gluLookAt(float 1.000000e+01, float 2.000000e+01, float 2.000000e+01, float 0.000000e+00, float -5.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%20 = load i32, i32* @GL_MODELVIEW
%21 = call i32 @glMatrixMode(i32 %20)
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 = sdiv i32 %0, %4
%10 = tail call i32 @gluPerspective(float 4.500000e+01, i32 %9, float 0x3FB99999A0000000, float 1.000000e+02)
%11 = tail call i32 @gluLookAt(float 1.000000e+01, float 2.000000e+01, float 2.000000e+01, float 0.000000e+00, float -5.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00)
%12 = load i32, i32* @GL_MODELVIEW
%13 = tail call i32 @glMatrixMode(i32 %12)
ret void
}