#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 char GLubyte;
typedef int GLint;

/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_BITS;
int /*<<< orphan*/ GL_MAX_MODELVIEW_STACK_DEPTH;
int /*<<< orphan*/ GL_RENDERER;
int /*<<< orphan*/ GL_STENCIL_BITS;
int /*<<< orphan*/ GL_VENDOR;
int /*<<< orphan*/ GL_VERSION;
int /*<<< orphan*/ glGetIntegerv(int /*<<< orphan*/, int *);
char *glGetString(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_opengl_information() {
  const GLubyte *version = glGetString(GL_VERSION);
  const GLubyte *vendor = glGetString(GL_VENDOR);
  const GLubyte *renderer = glGetString(GL_RENDERER);
  GLint max_stack_depth;
  GLint depth_bits;
  GLint stencil_bits;
  glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &max_stack_depth);
  glGetIntegerv(GL_DEPTH_BITS, &depth_bits);
  glGetIntegerv(GL_STENCIL_BITS, &stencil_bits);
  printf("Version: %s\n", version);
  printf("Vendor: %s\n", vendor);
  printf("Renderer: %s\n", renderer);
  printf("max stack depth: %d\n", max_stack_depth);
  printf("depth bits: %d\n", depth_bits);
  printf("stencil bits: %d\n", stencil_bits);
}


x86 assembly (clang, -O0):
<print_opengl_information>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <glGetString@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <glGetString@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <glGetString@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    -0x1c(%rbp),%rsi
call   1050 <glGetIntegerv@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1050 <glGetIntegerv@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    -0x24(%rbp),%rsi
call   1050 <glGetIntegerv@plt>
mov    -0x8(%rbp),%rsi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_opengl_information>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <glGetString@plt>
mov    %rax,%rbx
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <glGetString@plt>
mov    %rax,%r14
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1040 <glGetString@plt>
mov    %rax,%r15
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1050 <glGetIntegerv@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1050 <glGetIntegerv@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
call   1050 <glGetIntegerv@plt>
lea    0xe54(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe50(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe4b(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe44(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe47(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@GL_VERSION = global i32 0
@GL_VENDOR = global i32 0
@GL_RENDERER = global i32 0
@GL_MAX_MODELVIEW_STACK_DEPTH = global i32 0
@GL_DEPTH_BITS = global i32 0
@GL_STENCIL_BITS = global i32 0
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [12 x i8] c"Vendor: %s\0A\00"
@.str.2 = [14 x i8] c"Renderer: %s\0A\00"
@.str.3 = [21 x i8] c"max stack depth: %d\0A\00"
@.str.4 = [16 x i8] c"depth bits: %d\0A\00"
@.str.5 = [18 x i8] c"stencil bits: %d\0A\00"
define void @print_opengl_information() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = load i32, i32* @GL_VERSION
%8 = call i8* @glGetString(i32 %7)
store i8* %8, i8** %1
%9 = load i32, i32* @GL_VENDOR
%10 = call i8* @glGetString(i32 %9)
store i8* %10, i8** %2
%11 = load i32, i32* @GL_RENDERER
%12 = call i8* @glGetString(i32 %11)
store i8* %12, i8** %3
%13 = load i32, i32* @GL_MAX_MODELVIEW_STACK_DEPTH
%14 = call i32 @glGetIntegerv(i32 %13, i32* %4)
%15 = load i32, i32* @GL_DEPTH_BITS
%16 = call i32 @glGetIntegerv(i32 %15, i32* %5)
%17 = load i32, i32* @GL_STENCIL_BITS
%18 = call i32 @glGetIntegerv(i32 %17, i32* %6)
%19 = load i8*, i8** %1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = load i8*, i8** %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = load i32, i32* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %29)
ret void
}

LLVM IR (-O2):
@GL_VERSION = global i32 0
@GL_VENDOR = global i32 0
@GL_RENDERER = global i32 0
@GL_MAX_MODELVIEW_STACK_DEPTH = global i32 0
@GL_DEPTH_BITS = global i32 0
@GL_STENCIL_BITS = global i32 0
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [12 x i8] c"Vendor: %s\0A\00"
@.str.2 = [14 x i8] c"Renderer: %s\0A\00"
@.str.3 = [21 x i8] c"max stack depth: %d\0A\00"
@.str.4 = [16 x i8] c"depth bits: %d\0A\00"
@.str.5 = [18 x i8] c"stencil bits: %d\0A\00"
define void @print_opengl_information() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* @GL_VERSION
%5 = tail call i8* @glGetString(i32 %4)
%6 = load i32, i32* @GL_VENDOR
%7 = tail call i8* @glGetString(i32 %6)
%8 = load i32, i32* @GL_RENDERER
%9 = tail call i8* @glGetString(i32 %8)
%10 = bitcast i32* %1 to i8*
%11 = bitcast i32* %2 to i8*
%12 = bitcast i32* %3 to i8*
%13 = load i32, i32* @GL_MAX_MODELVIEW_STACK_DEPTH
%14 = call i32 @glGetIntegerv(i32 %13, i32* %1)
%15 = load i32, i32* @GL_DEPTH_BITS
%16 = call i32 @glGetIntegerv(i32 %15, i32* %2)
%17 = load i32, i32* @GL_STENCIL_BITS
%18 = call i32 @glGetIntegerv(i32 %17, i32* %3)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%22 = load i32, i32* %1
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %2
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %3
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %26)
ret void
}