#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*/ glTranslatef(float, float, float);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gluPerspective(float, int, float, float);
void myReshape(int w, int h) {
  GLfloat fAspect;
  if (h == 0)
    h = 1;
  glViewport(0, 0, w, h);
  fAspect = (GLfloat)w / (GLfloat)h;
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(60.0f, fAspect, 0.1f, 40.0f);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glTranslatef(0.0f, -0.6f, -21.0f);
}


x86 assembly (clang, -O0):
<myReshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    116f <myReshape+0x1f>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1070 <glViewport@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0xc(%rbp),%edi
movss  0xe60(%rip),%xmm0
movss  0xe5c(%rip),%xmm1
movss  0xe58(%rip),%xmm2
call   1040 <gluPerspective@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
xorps  %xmm0,%xmm0
movss  0xe23(%rip),%xmm1
movss  0xe1f(%rip),%xmm2
call   1060 <glTranslatef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myReshape>:
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    %ebx,%eax
cltd
idiv   %ebp
mov    %eax,%ebx
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
movss  0xe70(%rip),%xmm0
movss  0xe6c(%rip),%xmm1
movss  0xe68(%rip),%xmm2
mov    %ebx,%edi
call   1040 <gluPerspective@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
movss  0xe48(%rip),%xmm1
movss  0xe44(%rip),%xmm2
xorps  %xmm0,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <glTranslatef@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @myReshape(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %4
br label %9
9: ; preds = %8, %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @glViewport(i32 0, i32 0, i32 %10, i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sdiv i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* @GL_PROJECTION
%17 = call i32 @glMatrixMode(i32 %16)
%18 = call i32 (...) @glLoadIdentity()
%19 = load i32, i32* %5
%20 = call i32 @gluPerspective(float 6.000000e+01, i32 %19, float 0x3FB99999A0000000, float 4.000000e+01)
%21 = load i32, i32* @GL_MODELVIEW
%22 = call i32 @glMatrixMode(i32 %21)
%23 = call i32 (...) @glLoadIdentity()
%24 = call i32 @glTranslatef(float 0.000000e+00, float 0xBFE3333340000000, float -2.100000e+01)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @myReshape(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 = sdiv i32 %0, %4
%7 = load i32, i32* @GL_PROJECTION
%8 = tail call i32 @glMatrixMode(i32 %7)
%9 = tail call i32 (...) @glLoadIdentity()
%10 = tail call i32 @gluPerspective(float 6.000000e+01, i32 %6, float 0x3FB99999A0000000, float 4.000000e+01)
%11 = load i32, i32* @GL_MODELVIEW
%12 = tail call i32 @glMatrixMode(i32 %11)
%13 = tail call i32 (...) @glLoadIdentity()
%14 = tail call i32 @glTranslatef(float 0.000000e+00, float 0xBFE3333340000000, float -2.100000e+01)
ret void
}