#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*/ glOrtho(int, int, int, int, int, int);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void ReSizeGLScene(int Width, int Height) {
  int xRange = 10, yRange = 10, zRange = 100;
  if (Height == 0)
    Height = 1;
  glViewport(0, 0, Width, Height);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  if (Width <= Height)
    glOrtho(-xRange, xRange, -yRange * Height / Width, yRange * Height / Width,
            -zRange, zRange);
  else
    glOrtho(-xRange * Width / Height, xRange * Width / Height, -yRange, yRange,
            -zRange, zRange);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<ReSizeGLScene>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1174 <ReSizeGLScene+0x34>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e1 <ReSizeGLScene+0xa1>
xor    %edi,%edi
sub    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %eax,%eax
sub    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
xor    %r8d,%r8d
sub    -0x14(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1040 <glOrtho@plt>
jmp    1215 <ReSizeGLScene+0xd5>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%esi
xor    %edx,%edx
sub    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
xor    %r8d,%r8d
sub    -0x14(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   1040 <glOrtho@plt>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReSizeGLScene>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
test   %esi,%esi
mov    $0x1,%ebx
cmovne %esi,%ebx
xor    %edi,%edi
xor    %esi,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
cmp    %r14d,%ebx
jge    119c <ReSizeGLScene+0x5c>
add    %r14d,%r14d
lea    (%r14,%r14,4),%ecx
mov    %ecx,%eax
neg    %eax
cltd
idiv   %ebx
mov    %eax,%edi
mov    %ecx,%eax
cltd
idiv   %ebx
mov    %eax,%esi
mov    $0xfffffff6,%edx
mov    $0xa,%ecx
jmp    11bf <ReSizeGLScene+0x7f>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ecx
mov    %ecx,%eax
neg    %eax
cltd
idiv   %r14d
mov    %eax,%ebx
mov    %ecx,%eax
cltd
idiv   %r14d
mov    $0xfffffff6,%edi
mov    $0xa,%esi
mov    %ebx,%edx
mov    %eax,%ecx
mov    $0xffffff9c,%r8d
mov    $0x64,%r9d
call   1040 <glOrtho@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @ReSizeGLScene(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 10, i32* %5
store i32 10, i32* %6
store i32 100, i32* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %4
br label %11
11: ; preds = %10, %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @glViewport(i32 0, i32 0, i32 %12, i32 %13)
%15 = load i32, i32* @GL_PROJECTION
%16 = call i32 @glMatrixMode(i32 %15)
%17 = call i32 (...) @glLoadIdentity()
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %40
21: ; preds = %11
%22 = load i32, i32* %5
%23 = sub nsw i32 0, %22
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = sub nsw i32 0, %25
%27 = load i32, i32* %4
%28 = mul nsw i32 %26, %27
%29 = load i32, i32* %3
%30 = sdiv i32 %28, %29
%31 = load i32, i32* %6
%32 = load i32, i32* %4
%33 = mul nsw i32 %31, %32
%34 = load i32, i32* %3
%35 = sdiv i32 %33, %34
%36 = load i32, i32* %7
%37 = sub nsw i32 0, %36
%38 = load i32, i32* %7
%39 = call i32 @glOrtho(i32 %23, i32 %24, i32 %30, i32 %35, i32 %37, i32 %38)
br label %59
40: ; preds = %11
%41 = load i32, i32* %5
%42 = sub nsw i32 0, %41
%43 = load i32, i32* %3
%44 = mul nsw i32 %42, %43
%45 = load i32, i32* %4
%46 = sdiv i32 %44, %45
%47 = load i32, i32* %5
%48 = load i32, i32* %3
%49 = mul nsw i32 %47, %48
%50 = load i32, i32* %4
%51 = sdiv i32 %49, %50
%52 = load i32, i32* %6
%53 = sub nsw i32 0, %52
%54 = load i32, i32* %6
%55 = load i32, i32* %7
%56 = sub nsw i32 0, %55
%57 = load i32, i32* %7
%58 = call i32 @glOrtho(i32 %46, i32 %51, i32 %53, i32 %54, i32 %56, i32 %57)
br label %59
59: ; preds = %40, %21
%60 = load i32, i32* @GL_MODELVIEW
%61 = call i32 @glMatrixMode(i32 %60)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @ReSizeGLScene(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %4)
%6 = load i32, i32* @GL_PROJECTION
%7 = tail call i32 @glMatrixMode(i32 %6)
%8 = tail call i32 (...) @glLoadIdentity()
%9 = icmp slt i32 %4, %0
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = mul nsw i32 %4, -10
%12 = sdiv i32 %11, %0
%13 = mul nsw i32 %4, 10
%14 = sdiv i32 %13, %0
%15 = tail call i32 @glOrtho(i32 -10, i32 10, i32 %12, i32 %14, i32 -100, i32 100)
br label %22
16: ; preds = %2
%17 = mul nsw i32 %0, -10
%18 = sdiv i32 %17, %4
%19 = mul nsw i32 %0, 10
%20 = sdiv i32 %19, %4
%21 = tail call i32 @glOrtho(i32 %18, i32 %20, i32 -10, i32 10, i32 -100, i32 100)
br label %22
22: ; preds = %16, %10
%23 = load i32, i32* @GL_MODELVIEW
%24 = tail call i32 @glMatrixMode(i32 %23)
ret void
}