#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*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gluOrtho2D(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
void reshapeCB(int w, int h) {
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0, w, 0, h);
  glScalef(1.0, -1.0, 1.0);
  glTranslatef(0.0, -h, 0.0);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glTranslatef(0.375, 0.375, 0.0);
}


x86 assembly (clang, -O0):
<reshapeCB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1080 <glViewport@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
mov    %edx,%edi
call   1060 <gluOrtho2D@plt>
movsd  0xe5f(%rip),%xmm2
movsd  0xe5f(%rip),%xmm1
movaps %xmm2,%xmm0
call   1050 <glScalef@plt>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
call   1070 <glTranslatef@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
movsd  0xe16(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1070 <glTranslatef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshapeCB>:
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   1080 <glViewport@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
xor    %edi,%edi
mov    %ebp,%esi
xor    %edx,%edx
mov    %ebx,%ecx
call   1060 <gluOrtho2D@plt>
movsd  0xe62(%rip),%xmm1
movsd  0xe62(%rip),%xmm0
movaps %xmm0,%xmm2
call   1050 <glScalef@plt>
neg    %ebx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1070 <glTranslatef@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
movsd  0xe31(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <glTranslatef@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshapeCB(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @gluOrtho2D(i32 0, i32 %11, i32 0, i32 %12)
%14 = call i32 @glScalef(double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
%15 = load i32, i32* %4
%16 = sub nsw i32 0, %15
%17 = sitofp i32 %16 to double
%18 = call i32 @glTranslatef(double 0.000000e+00, double %17, double 0.000000e+00)
%19 = load i32, i32* @GL_MODELVIEW
%20 = call i32 @glMatrixMode(i32 %19)
%21 = call i32 (...) @glLoadIdentity()
%22 = call i32 @glTranslatef(double 3.750000e-01, double 3.750000e-01, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshapeCB(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @gluOrtho2D(i32 0, i32 %0, i32 0, i32 %1)
%8 = tail call i32 @glScalef(double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
%9 = sub nsw i32 0, %1
%10 = sitofp i32 %9 to double
%11 = tail call i32 @glTranslatef(double 0.000000e+00, double %10, double 0.000000e+00)
%12 = load i32, i32* @GL_MODELVIEW
%13 = tail call i32 @glMatrixMode(i32 %12)
%14 = tail call i32 (...) @glLoadIdentity()
%15 = tail call i32 @glTranslatef(double 3.750000e-01, double 3.750000e-01, double 0.000000e+00)
ret void
}