#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 /*<<< orphan*/ GLvoid;
typedef int 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*/, int, int);
int /*<<< orphan*/ gluPerspective(double, int, double, double);
GLvoid resize(GLsizei width, GLsizei height) {
  GLfloat aspect;
  glViewport(0, 0, width, height);
  aspect = (GLfloat)width / height;
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0, aspect, 3.0, 7.0);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0x10(%rbp),%edi
movsd  0xe79(%rip),%xmm0
movsd  0xe79(%rip),%xmm1
movsd  0xe79(%rip),%xmm2
call   1040 <gluPerspective@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %eax,%ebx
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
movsd  0xe88(%rip),%xmm0
movsd  0xe88(%rip),%xmm1
movsd  0xe88(%rip),%xmm2
mov    %ebx,%edi
call   1040 <gluPerspective@plt>
mov    0x2e52(%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 i32 @resize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @glViewport(i32 0, i32 0, i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* @GL_PROJECTION
%14 = call i32 @glMatrixMode(i32 %13)
%15 = call i32 (...) @glLoadIdentity()
%16 = load i32, i32* %6
%17 = call i32 @gluPerspective(double 4.500000e+01, i32 %16, double 3.000000e+00, double 7.000000e+00)
%18 = load i32, i32* @GL_MODELVIEW
%19 = call i32 @glMatrixMode(i32 %18)
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define i32 @resize(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = sdiv i32 %0, %1
%5 = load i32, i32* @GL_PROJECTION
%6 = tail call i32 @glMatrixMode(i32 %5)
%7 = tail call i32 (...) @glLoadIdentity()
%8 = tail call i32 @gluPerspective(double 4.500000e+01, i32 %4, double 3.000000e+00, double 7.000000e+00)
%9 = load i32, i32* @GL_MODELVIEW
%10 = tail call i32 @glMatrixMode(i32 %9)
ret i32 undef
}