#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 GLUT_DEPTH;
int GLUT_DOUBLE;
int GLUT_RGB;
int /*<<< orphan*/ GL_VERSION;
char *glGetString(int /*<<< orphan*/);
int /*<<< orphan*/ glutCreateWindow(char *);
int /*<<< orphan*/ glutInit(int *, char **);
int /*<<< orphan*/ glutInitDisplayMode(int);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *, char *);
main(int argc, char **argv) {
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
  glutCreateWindow("Why am I here?");
  pause();
  printf("GL_VERSION = %s\n", glGetString(GL_VERSION));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1080 <glutInit@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
mov    0x2e55(%rip),%rax
or     (%rax),%edi
mov    0x2e44(%rip),%rax
or     (%rax),%edi
call   1030 <glutInitDisplayMode@plt>
lea    0xe56(%rip),%rdi
call   1070 <glutCreateWindow@plt>
mov    $0x0,%al
call   1050 <pause@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,%rsi
lea    0xe41(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1080 <glutInit@plt>
mov    0x2e52(%rip),%rax
mov    0x2e6b(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
mov    0x2e58(%rip),%rax
or     (%rax),%edi
call   1030 <glutInitDisplayMode@plt>
lea    0xe6a(%rip),%rdi
call   1070 <glutCreateWindow@plt>
xor    %eax,%eax
call   1050 <pause@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
lea    0xe58(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@GLUT_DOUBLE = global i32 0
@GLUT_RGB = global i32 0
@GLUT_DEPTH = global i32 0
@.str = [15 x i8] c"Why am I here?\00"
@.str.1 = [17 x i8] c"GL_VERSION = %s\0A\00"
@GL_VERSION = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = call i32 @glutInit(i32* %4, i8** %6)
%8 = load i32, i32* @GLUT_DOUBLE
%9 = load i32, i32* @GLUT_RGB
%10 = or i32 %8, %9
%11 = load i32, i32* @GLUT_DEPTH
%12 = or i32 %10, %11
%13 = call i32 @glutInitDisplayMode(i32 %12)
%14 = call i32 @glutCreateWindow(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @pause()
%16 = load i32, i32* @GL_VERSION
%17 = call i8* @glGetString(i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %17)
ret i32 0
}

LLVM IR (-O2):
@GLUT_DOUBLE = global i32 0
@GLUT_RGB = global i32 0
@GLUT_DEPTH = global i32 0
@.str = [15 x i8] c"Why am I here?\00"
@.str.1 = [17 x i8] c"GL_VERSION = %s\0A\00"
@GL_VERSION = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @glutInit(i32* %3, i8** %1)
%5 = load i32, i32* @GLUT_DOUBLE
%6 = load i32, i32* @GLUT_RGB
%7 = or i32 %6, %5
%8 = load i32, i32* @GLUT_DEPTH
%9 = or i32 %7, %8
%10 = call i32 @glutInitDisplayMode(i32 %9)
%11 = call i32 @glutCreateWindow(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (...) @pause()
%13 = load i32, i32* @GL_VERSION
%14 = call i8* @glGetString(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %14)
ret i32 0
}