#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_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *);
void resize(unsigned int width, unsigned int height) {
  printf("Resize event\n");
  glViewport(0, 0, width, height);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
}


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
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   1060 <glLoadIdentity@plt>
movsd  0xe6a(%rip),%xmm4
movsd  0xe6a(%rip),%xmm5
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm4,%xmm2
movaps %xmm5,%xmm3
call   1050 <glOrtho@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1070 <glViewport@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1040 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
movsd  0xe73(%rip),%xmm0
movsd  0xe73(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
movaps %xmm0,%xmm4
movaps %xmm1,%xmm5
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <glOrtho@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Resize event\0A\00"
@GL_PROJECTION = 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 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @glViewport(i32 0, i32 0, i32 %6, i32 %7)
%9 = load i32, i32* @GL_PROJECTION
%10 = call i32 @glMatrixMode(i32 %9)
%11 = call i32 (...) @glLoadIdentity()
%12 = call i32 @glOrtho(double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@str = [13 x i8] c"Resize event\00"
define void @resize(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%5 = load i32, i32* @GL_PROJECTION
%6 = tail call i32 @glMatrixMode(i32 %5)
%7 = tail call i32 (...) @glLoadIdentity()
%8 = tail call i32 @glOrtho(double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}