#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 */
struct gl_test {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ GL_RENDERER;
int /*<<< orphan*/ GL_SHADING_LANGUAGE_VERSION;
int /*<<< orphan*/ GL_VENDOR;
int /*<<< orphan*/ GL_VERSION;
scalar_t__ glGetString(int /*<<< orphan*/);
int /*<<< orphan*/ gl_test_free(struct gl_test *);
struct gl_test *gl_test_make(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  struct gl_test *test = gl_test_make(0);
  printf("GL_VERSION"
         ": %s\n",
         (char *)glGetString(GL_VERSION));
  printf("GL_SHADING_LANGUAGE_VERSION"
         ": %s\n",
         (char *)glGetString(GL_SHADING_LANGUAGE_VERSION));
  printf("GL_RENDERER"
         ": %s\n",
         (char *)glGetString(GL_RENDERER));
  printf("GL_VENDOR"
         ": %s\n",
         (char *)glGetString(GL_VENDOR));
  gl_test_free(test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <gl_test_make@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
mov    %rax,%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
mov    %rax,%rsi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
mov    %rax,%rsi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
mov    %rax,%rsi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <gl_test_free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1060 <gl_test_make@plt>
mov    %rax,%rbx
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
lea    0xea0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
lea    0xe93(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
lea    0xe97(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1050 <glGetString@plt>
lea    0xe8b(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <gl_test_free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.gl_test = type { i32 }
@.str = [16 x i8] c"GL_VERSION: %s\0A\00"
@GL_VERSION = global i32 0
@.str.1 = [33 x i8] c"GL_SHADING_LANGUAGE_VERSION: %s\0A\00"
@GL_SHADING_LANGUAGE_VERSION = global i32 0
@.str.2 = [17 x i8] c"GL_RENDERER: %s\0A\00"
@GL_RENDERER = global i32 0
@.str.3 = [15 x i8] c"GL_VENDOR: %s\0A\00"
@GL_VENDOR = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.gl_test*
store i32 0, i32* %1
%3 = call %struct.gl_test* @gl_test_make(i32 0)
store %struct.gl_test* %3, %struct.gl_test** %2
%4 = load i32, i32* @GL_VERSION
%5 = call i64 @glGetString(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @GL_SHADING_LANGUAGE_VERSION
%9 = call i64 @glGetString(i32 %8)
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @GL_RENDERER
%13 = call i64 @glGetString(i32 %12)
%14 = inttoptr i64 %13 to i8*
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @GL_VENDOR
%17 = call i64 @glGetString(i32 %16)
%18 = inttoptr i64 %17 to i8*
%19 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = load %struct.gl_test*, %struct.gl_test** %2
%21 = call i32 @gl_test_free(%struct.gl_test* %20)
ret i32 0
}

LLVM IR (-O2):
%struct.gl_test = type { i32 }
@.str = [16 x i8] c"GL_VERSION: %s\0A\00"
@GL_VERSION = global i32 0
@.str.1 = [33 x i8] c"GL_SHADING_LANGUAGE_VERSION: %s\0A\00"
@GL_SHADING_LANGUAGE_VERSION = global i32 0
@.str.2 = [17 x i8] c"GL_RENDERER: %s\0A\00"
@GL_RENDERER = global i32 0
@.str.3 = [15 x i8] c"GL_VENDOR: %s\0A\00"
@GL_VENDOR = global i32 0
define i32 @main() {
%1 = tail call %struct.gl_test* @gl_test_make(i32 0)
%2 = load i32, i32* @GL_VERSION
%3 = tail call i64 @glGetString(i32 %2)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @GL_SHADING_LANGUAGE_VERSION
%7 = tail call i64 @glGetString(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @GL_RENDERER
%11 = tail call i64 @glGetString(i32 %10)
%12 = inttoptr i64 %11 to i8*
%13 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @GL_VENDOR
%15 = tail call i64 @glGetString(i32 %14)
%16 = inttoptr i64 %15 to i8*
%17 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%18 = tail call i32 @gl_test_free(%struct.gl_test* %1)
ret i32 0
}