#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 /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, int /*<<< orphan*/, double,
                           int /*<<< orphan*/, double, double);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              scalar_t__, scalar_t__);
int /*<<< orphan*/ set_screen_wh(scalar_t__, scalar_t__);
void reshape(GLsizei w, GLsizei h) {
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0.0, (GLdouble)w, 0.0, (GLdouble)h, -1.0, 1.0);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  set_screen_wh(w, h);
}


x86 assembly (clang, -O0):
<reshape>:
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   1070 <glViewport@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
xorps  %xmm1,%xmm1
movsd  0xe63(%rip),%xmm2
movsd  0xe63(%rip),%xmm3
movaps %xmm1,%xmm0
call   1040 <glOrtho@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <set_screen_wh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
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   1070 <glViewport@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
movsd  0xe7a(%rip),%xmm2
movsd  0xe7a(%rip),%xmm3
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %ebx,%edi
mov    %r14d,%esi
call   1040 <glOrtho@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <set_screen_wh@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(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 = call i32 @glOrtho(double 0.000000e+00, i32 %12, double 0.000000e+00, i32 %14, double -1.000000e+00, double 1.000000e+00)
%16 = load i32, i32* @GL_MODELVIEW
%17 = call i32 @glMatrixMode(i32 %16)
%18 = call i32 (...) @glLoadIdentity()
%19 = load i64, i64* %3
%20 = load i64, i64* %4
%21 = call i32 @set_screen_wh(i64 %19, i64 %20)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(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 = tail call i32 @glOrtho(double 0.000000e+00, i32 %7, double 0.000000e+00, i32 %8, double -1.000000e+00, double 1.000000e+00)
%10 = load i32, i32* @GL_MODELVIEW
%11 = tail call i32 @glMatrixMode(i32 %10)
%12 = tail call i32 (...) @glLoadIdentity()
%13 = tail call i32 @set_screen_wh(i64 %0, i64 %1)
ret void
}