#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 float GLsizei;
typedef float GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(float, float, float, float, float, float);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, float,
                              float);
void changeSize(GLsizei w, GLsizei h) {
  GLfloat range = 120.f;
  if (h == 0) {
    h = 1;
  }
  if (w == 0) {
    w = 1;
  }
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  if (w <= h) {
    glOrtho(-range, range, -range * h / w, range * h / w, -range * 2.f,
            range * 2.f);
  } else {
    glOrtho(-range * w / h, range * w / h, -range, range, -range * 2.f,
            range * 2.f);
  }
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
}


x86 assembly (clang, -O0):
<changeSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xea6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1183 <changeSize+0x43>
jp     1183 <changeSize+0x43>
movss  0xe86(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11a7 <changeSize+0x67>
jp     11a7 <changeSize+0x67>
movss  0xe62(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1259 <changeSize+0x119>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  -0x8(%rbp),%xmm2
divss  -0x4(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
mulss  -0x8(%rbp),%xmm3
divss  -0x4(%rbp),%xmm3
movss  -0xc(%rbp),%xmm4
movd   %xmm4,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm4
movss  0xdca(%rip),%xmm5
mulss  %xmm5,%xmm4
movss  0xdbe(%rip),%xmm5
mulss  -0xc(%rbp),%xmm5
call   1040 <glOrtho@plt>
jmp    12cb <changeSize+0x18b>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movss  -0xc(%rbp),%xmm3
movss  -0xc(%rbp),%xmm4
movd   %xmm4,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm4
movss  0xd53(%rip),%xmm5
mulss  %xmm5,%xmm4
movss  0xd47(%rip),%xmm5
mulss  -0xc(%rbp),%xmm5
call   1040 <glOrtho@plt>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeSize>:
sub    $0x28,%rsp
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm4
cmpeqss %xmm2,%xmm4
movss  0xea9(%rip),%xmm2
movaps %xmm4,%xmm3
andps  %xmm2,%xmm3
andnps %xmm1,%xmm4
orps   %xmm3,%xmm4
movaps %xmm4,(%rsp)
xorps  %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,0x10(%rsp)
xor    %edi,%edi
xor    %esi,%esi
movaps %xmm1,%xmm0
movaps %xmm4,%xmm1
call   1060 <glViewport@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
movaps 0x10(%rsp),%xmm7
movaps (%rsp),%xmm6
ucomiss %xmm7,%xmm6
jae    11e7 <changeSize+0xa7>
movss  0xe4d(%rip),%xmm2
movaps %xmm7,%xmm0
mulss  %xmm2,%xmm0
divss  %xmm6,%xmm0
movss  0xe3e(%rip),%xmm3
mulss  %xmm3,%xmm7
divss  %xmm6,%xmm7
movss  0xe32(%rip),%xmm4
movss  0xe2e(%rip),%xmm5
movaps %xmm7,%xmm1
jmp    121d <changeSize+0xdd>
movss  0xe15(%rip),%xmm0
movaps %xmm6,%xmm2
mulss  %xmm0,%xmm2
divss  %xmm7,%xmm2
movss  0xe06(%rip),%xmm1
mulss  %xmm1,%xmm6
divss  %xmm7,%xmm6
movss  0xdfa(%rip),%xmm4
movss  0xdf6(%rip),%xmm5
movaps %xmm6,%xmm3
call   1040 <glOrtho@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1050 <glLoadIdentity@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @changeSize(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 1.200000e+02, float* %5
%6 = load float, float* %4
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store float 1.000000e+00, float* %4
br label %9
9: ; preds = %8, %2
%10 = load float, float* %3
%11 = fcmp oeq float %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %9
store float 1.000000e+00, float* %3
br label %13
13: ; preds = %12, %9
%14 = load float, float* %3
%15 = load float, float* %4
%16 = call i32 @glViewport(i32 0, i32 0, float %14, float %15)
%17 = load i32, i32* @GL_PROJECTION
%18 = call i32 @glMatrixMode(i32 %17)
%19 = call i32 (...) @glLoadIdentity()
%20 = load float, float* %3
%21 = load float, float* %4
%22 = fcmp ole float %20, %21
br i1 %22, label %23, label %44
23: ; preds = %13
%24 = load float, float* %5
%25 = fneg float %24
%26 = load float, float* %5
%27 = load float, float* %5
%28 = fneg float %27
%29 = load float, float* %4
%30 = fmul float %28, %29
%31 = load float, float* %3
%32 = fdiv float %30, %31
%33 = load float, float* %5
%34 = load float, float* %4
%35 = fmul float %33, %34
%36 = load float, float* %3
%37 = fdiv float %35, %36
%38 = load float, float* %5
%39 = fneg float %38
%40 = fmul float %39, 2.000000e+00
%41 = load float, float* %5
%42 = fmul float %41, 2.000000e+00
%43 = call i32 @glOrtho(float %25, float %26, float %32, float %37, float %40, float %42)
br label %65
44: ; preds = %13
%45 = load float, float* %5
%46 = fneg float %45
%47 = load float, float* %3
%48 = fmul float %46, %47
%49 = load float, float* %4
%50 = fdiv float %48, %49
%51 = load float, float* %5
%52 = load float, float* %3
%53 = fmul float %51, %52
%54 = load float, float* %4
%55 = fdiv float %53, %54
%56 = load float, float* %5
%57 = fneg float %56
%58 = load float, float* %5
%59 = load float, float* %5
%60 = fneg float %59
%61 = fmul float %60, 2.000000e+00
%62 = load float, float* %5
%63 = fmul float %62, 2.000000e+00
%64 = call i32 @glOrtho(float %50, float %55, float %57, float %58, float %61, float %63)
br label %65
65: ; preds = %44, %23
%66 = load i32, i32* @GL_MODELVIEW
%67 = call i32 @glMatrixMode(i32 %66)
%68 = call i32 (...) @glLoadIdentity()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @changeSize(float %0, float %1) {
%3 = fcmp oeq float %1, 0.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %1
%5 = fcmp oeq float %0, 0.000000e+00
%6 = select i1 %5, float 1.000000e+00, float %0
%7 = tail call i32 @glViewport(i32 0, i32 0, float %6, float %4)
%8 = load i32, i32* @GL_PROJECTION
%9 = tail call i32 @glMatrixMode(i32 %8)
%10 = tail call i32 (...) @glLoadIdentity()
%11 = fcmp ugt float %6, %4
br i1 %11, label %18, label %12
12: ; preds = %2
%13 = fmul float %4, -1.200000e+02
%14 = fdiv float %13, %6
%15 = fmul float %4, 1.200000e+02
%16 = fdiv float %15, %6
%17 = tail call i32 @glOrtho(float -1.200000e+02, float 1.200000e+02, float %14, float %16, float -2.400000e+02, float 2.400000e+02)
br label %24
18: ; preds = %2
%19 = fmul float %6, -1.200000e+02
%20 = fdiv float %19, %4
%21 = fmul float %6, 1.200000e+02
%22 = fdiv float %21, %4
%23 = tail call i32 @glOrtho(float %20, float %22, float -1.200000e+02, float 1.200000e+02, float -2.400000e+02, float 2.400000e+02)
br label %24
24: ; preds = %18, %12
%25 = load i32, i32* @GL_MODELVIEW
%26 = tail call i32 @glMatrixMode(i32 %25)
%27 = tail call i32 (...) @glLoadIdentity()
ret void
}