#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 */

/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(float, float, float, float);
int /*<<< orphan*/ glColor3f(float, float, float);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ gluPerspective(float, float, float, float);
void resize(int w, int h) {
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(60.0f, (float)w / h, 1.0f, 10.0f);
  glMatrixMode(GL_MODELVIEW);
  glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
  glColor3f(1.0f, 1.0f, 1.0f);
}


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
cvtsi2ssl -0x4(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm0
divss  %xmm0,%xmm1
movss  0xe7b(%rip),%xmm0
movss  0xe6f(%rip),%xmm2
movss  0xe6f(%rip),%xmm3
call   1040 <gluPerspective@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
movss  0xe3b(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1070 <glColor3f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
cvtsi2ss %ebp,%xmm1
cvtsi2ss %ebx,%xmm0
divss  %xmm0,%xmm1
movss  0xe80(%rip),%xmm0
movss  0xe7c(%rip),%xmm2
movss  0xe78(%rip),%xmm3
call   1040 <gluPerspective@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
movss  0xe48(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <glColor3f@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @resize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_PROJECTION
%6 = call i32 @glMatrixMode(i32 %5)
%7 = call i32 (...) @glLoadIdentity()
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = fdiv float %9, %11
%13 = call i32 @gluPerspective(float 6.000000e+01, float %12, float 1.000000e+00, float 1.000000e+01)
%14 = load i32, i32* @GL_MODELVIEW
%15 = call i32 @glMatrixMode(i32 %14)
%16 = call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%17 = call i32 @glColor3f(float 1.000000e+00, float 1.000000e+00, float 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @resize(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_PROJECTION
%4 = tail call i32 @glMatrixMode(i32 %3)
%5 = tail call i32 (...) @glLoadIdentity()
%6 = sitofp i32 %0 to float
%7 = sitofp i32 %1 to float
%8 = fdiv float %6, %7
%9 = tail call i32 @gluPerspective(float 6.000000e+01, float %8, float 1.000000e+00, float 1.000000e+01)
%10 = load i32, i32* @GL_MODELVIEW
%11 = tail call i32 @glMatrixMode(i32 %10)
%12 = tail call i32 @glClearColor(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%13 = tail call i32 @glColor3f(float 1.000000e+00, float 1.000000e+00, float 1.000000e+00)
ret void
}