#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*/ GLUT_SCREEN_HEIGHT;
int /*<<< orphan*/ GLUT_SCREEN_WIDTH;
int /*<<< orphan*/ glutCreateWindow(char *);
int glutGet(int /*<<< orphan*/);
int /*<<< orphan*/ glutInitWindowPosition(int, int);
int /*<<< orphan*/ glutInitWindowSize(int, int);
void initGlutWindow(int iWidth, int iHeight) {
  glutInitWindowSize(iWidth, iHeight);
  glutInitWindowPosition((glutGet(GLUT_SCREEN_WIDTH) - iWidth) / 2,
                         (glutGet(GLUT_SCREEN_HEIGHT) - iHeight) / 2);
  glutCreateWindow("Pacman NG");
}


x86 assembly (clang, -O0):
<initGlutWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <glutInitWindowSize@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
sub    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
mov    -0xc(%rbp),%edi
sub    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1050 <glutInitWindowPosition@plt>
lea    0xe61(%rip),%rdi
call   1040 <glutCreateWindow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initGlutWindow>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1060 <glutInitWindowSize@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
sub    %ebp,%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
sub    %ebx,%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
mov    %ebp,%edi
call   1050 <glutInitWindowPosition@plt>
lea    0xe74(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glutCreateWindow@plt>

LLVM IR (-O0):
@GLUT_SCREEN_WIDTH = global i32 0
@GLUT_SCREEN_HEIGHT = global i32 0
@.str = [10 x i8] c"Pacman NG\00"
define void @initGlutWindow(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 @glutInitWindowSize(i32 %5, i32 %6)
%8 = load i32, i32* @GLUT_SCREEN_WIDTH
%9 = call i32 @glutGet(i32 %8)
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = sdiv i32 %11, 2
%13 = load i32, i32* @GLUT_SCREEN_HEIGHT
%14 = call i32 @glutGet(i32 %13)
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = sdiv i32 %16, 2
%18 = call i32 @glutInitWindowPosition(i32 %12, i32 %17)
%19 = call i32 @glutCreateWindow(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@GLUT_SCREEN_WIDTH = global i32 0
@GLUT_SCREEN_HEIGHT = global i32 0
@.str = [10 x i8] c"Pacman NG\00"
define void @initGlutWindow(i32 %0, i32 %1) {
%3 = tail call i32 @glutInitWindowSize(i32 %0, i32 %1)
%4 = load i32, i32* @GLUT_SCREEN_WIDTH
%5 = tail call i32 @glutGet(i32 %4)
%6 = sub nsw i32 %5, %0
%7 = sdiv i32 %6, 2
%8 = load i32, i32* @GLUT_SCREEN_HEIGHT
%9 = tail call i32 @glutGet(i32 %8)
%10 = sub nsw i32 %9, %1
%11 = sdiv i32 %10, 2
%12 = tail call i32 @glutInitWindowPosition(i32 %7, i32 %11)
%13 = tail call i32 @glutCreateWindow(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}