#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 GL_RENDERER;
int GL_VENDOR;
int GL_VERSION;
int /*<<< orphan*/ checkError(char *);
char *glGetString(int);
int /*<<< orphan*/ printf(char *, char *);
void dumpInfo(void) {
  printf("Vendor: %s\n", glGetString(GL_VENDOR));
  printf("Renderer: %s\n", glGetString(GL_RENDERER));
  printf("Version: %s\n", glGetString(GL_VERSION));
  printf("GLSL: %s\n", glGetString(0x8B8C));
  checkError("dumpInfo");
}


x86 assembly (clang, -O0):
<dumpInfo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
mov    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
mov    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
mov    %rax,%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8b8c,%edi
call   1050 <glGetString@plt>
mov    %rax,%rsi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
call   1040 <checkError@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpInfo>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
lea    0xea9(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
lea    0xe9a(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x8b8c,%edi
call   1050 <glGetString@plt>
lea    0xe8e(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
pop    %rax
jmp    1040 <checkError@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Vendor: %s\0A\00"
@GL_VENDOR = global i32 0
@.str.1 = [14 x i8] c"Renderer: %s\0A\00"
@GL_RENDERER = global i32 0
@.str.2 = [13 x i8] c"Version: %s\0A\00"
@GL_VERSION = global i32 0
@.str.3 = [10 x i8] c"GLSL: %s\0A\00"
@.str.4 = [9 x i8] c"dumpInfo\00"
define void @dumpInfo() {
%1 = load i32, i32* @GL_VENDOR
%2 = call i8* @glGetString(i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @GL_RENDERER
%5 = call i8* @glGetString(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @GL_VERSION
%8 = call i8* @glGetString(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = call i8* @glGetString(i32 35724)
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = call i32 @checkError(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Vendor: %s\0A\00"
@GL_VENDOR = global i32 0
@.str.1 = [14 x i8] c"Renderer: %s\0A\00"
@GL_RENDERER = global i32 0
@.str.2 = [13 x i8] c"Version: %s\0A\00"
@GL_VERSION = global i32 0
@.str.3 = [10 x i8] c"GLSL: %s\0A\00"
@.str.4 = [9 x i8] c"dumpInfo\00"
define void @dumpInfo() {
%1 = load i32, i32* @GL_VENDOR
%2 = tail call i8* @glGetString(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @GL_RENDERER
%5 = tail call i8* @glGetString(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @GL_VERSION
%8 = tail call i8* @glGetString(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = tail call i8* @glGetString(i32 35724)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = tail call i32 @checkError(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret void
}