#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 scalar_t__ GLsizei;
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*/,
                              scalar_t__, scalar_t__);
int /*<<< orphan*/ gluPerspective(double, int, double, double);
void myReshape(GLsizei w, GLsizei h) {
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(40.0, (GLfloat)w / (GLfloat)h, 1.0, 100.0);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<myReshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cltd
idiv   %ecx
mov    %eax,%edi
movsd  0xe75(%rip),%xmm0
movsd  0xe75(%rip),%xmm1
movsd  0xe75(%rip),%xmm2
call   1040 <gluPerspective@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myReshape>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1060 <glViewport@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
mov    %ebx,%eax
cltd
idiv   %r14d
movsd  0xe84(%rip),%xmm0
movsd  0xe84(%rip),%xmm1
movsd  0xe84(%rip),%xmm2
mov    %eax,%edi
call   1040 <gluPerspective@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @myReshape(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @glViewport(i32 0, i32 0, i64 %5, i64 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i64, i64* %3
%12 = trunc i64 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = sdiv i32 %12, %14
%16 = call i32 @gluPerspective(double 4.000000e+01, i32 %15, double 1.000000e+00, double 1.000000e+02)
%17 = load i32, i32* @GL_MODELVIEW
%18 = call i32 @glMatrixMode(i32 %17)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @myReshape(i64 %0, i64 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i64 %0, i64 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = trunc i64 %0 to i32
%8 = trunc i64 %1 to i32
%9 = sdiv i32 %7, %8
%10 = tail call i32 @gluPerspective(double 4.000000e+01, i32 %9, double 1.000000e+00, double 1.000000e+02)
%11 = load i32, i32* @GL_MODELVIEW
%12 = tail call i32 @glMatrixMode(i32 %11)
ret void
}