#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 float GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glFrustum(float, float, double, double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void reshape(int w, int h) {
  GLfloat aspect = (float)w / (float)h;
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glFrustum(-aspect, aspect, -1.0, 1.0, 4.0, 300.0);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0xc(%rbp),%xmm1
movsd  0xe5c(%rip),%xmm2
movsd  0xe5c(%rip),%xmm3
movsd  0xe5c(%rip),%xmm4
movsd  0xe5c(%rip),%xmm5
call   1050 <glFrustum@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
sub    $0x18,%rsp
mov    %esi,%ecx
mov    %edi,%edx
cvtsi2ss %edi,%xmm1
cvtsi2ss %esi,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
call   1060 <glViewport@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
movaps 0xe83(%rip),%xmm0
movaps (%rsp),%xmm1
xorps  %xmm1,%xmm0
movsd  0xe84(%rip),%xmm2
movsd  0xe84(%rip),%xmm3
movsd  0xe84(%rip),%xmm4
movsd  0xe84(%rip),%xmm5
call   1050 <glFrustum@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1040 <glLoadIdentity@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to float
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = fdiv float %7, %9
store float %10, float* %5
%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 = fneg float %17
%19 = load float, float* %5
%20 = call i32 @glFrustum(float %18, float %19, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 3.000000e+02)
%21 = load i32, i32* @GL_MODELVIEW
%22 = call i32 @glMatrixMode(i32 %21)
%23 = call i32 (...) @glLoadIdentity()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = sitofp i32 %1 to float
%5 = fdiv float %3, %4
%6 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%7 = load i32, i32* @GL_PROJECTION
%8 = tail call i32 @glMatrixMode(i32 %7)
%9 = tail call i32 (...) @glLoadIdentity()
%10 = fneg float %5
%11 = tail call i32 @glFrustum(float %10, float %5, double -1.000000e+00, double 1.000000e+00, double 4.000000e+00, double 3.000000e+02)
%12 = load i32, i32* @GL_MODELVIEW
%13 = tail call i32 @glMatrixMode(i32 %12)
%14 = tail call i32 (...) @glLoadIdentity()
ret void
}