#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 int /*<<< orphan*/ GLubyte;

/* Variables and functions */
int /*<<< orphan*/ GL_RENDERER;
int /*<<< orphan*/ GL_SHADING_LANGUAGE_VERSION;
int /*<<< orphan*/ GL_VENDOR;
int /*<<< orphan*/ GL_VERSION;
int /*<<< orphan*/ *glGetString(int /*<<< orphan*/);
int /*<<< orphan*/ platform_log(char *, int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ const *);
void print_gl_info() {
  const GLubyte *vendor = glGetString(GL_VENDOR);
  const GLubyte *renderer = glGetString(GL_RENDERER);
  const GLubyte *version = glGetString(GL_VERSION);
  const GLubyte *glsl_version = glGetString(GL_SHADING_LANGUAGE_VERSION);
  platform_log("%s (glsl %s)\n%s (%s)\n", version, glsl_version, renderer,
               vendor);
}


x86 assembly (clang, -O0):
<print_gl_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xe79(%rip),%rdi
call   1040 <platform_log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_gl_info>:
push   %r15
push   %r14
push   %rbx
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
mov    %rax,%r14
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
mov    %rax,%r15
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
mov    %rax,%rbx
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1030 <glGetString@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %r15,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <platform_log@plt>

LLVM IR (-O0):
@GL_VENDOR = global i32 0
@GL_RENDERER = global i32 0
@GL_VERSION = global i32 0
@GL_SHADING_LANGUAGE_VERSION = global i32 0
@.str = [22 x i8] c"%s (glsl %s)\0A%s (%s)\0A\00"
define void @print_gl_info() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = load i32, i32* @GL_VENDOR
%6 = call i32* @glGetString(i32 %5)
store i32* %6, i32** %1
%7 = load i32, i32* @GL_RENDERER
%8 = call i32* @glGetString(i32 %7)
store i32* %8, i32** %2
%9 = load i32, i32* @GL_VERSION
%10 = call i32* @glGetString(i32 %9)
store i32* %10, i32** %3
%11 = load i32, i32* @GL_SHADING_LANGUAGE_VERSION
%12 = call i32* @glGetString(i32 %11)
store i32* %12, i32** %4
%13 = load i32*, i32** %3
%14 = load i32*, i32** %4
%15 = load i32*, i32** %2
%16 = load i32*, i32** %1
%17 = call i32 @platform_log(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32* %13, i32* %14, i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
@GL_VENDOR = global i32 0
@GL_RENDERER = global i32 0
@GL_VERSION = global i32 0
@GL_SHADING_LANGUAGE_VERSION = global i32 0
@.str = [22 x i8] c"%s (glsl %s)\0A%s (%s)\0A\00"
define void @print_gl_info() {
%1 = load i32, i32* @GL_VENDOR
%2 = tail call i32* @glGetString(i32 %1)
%3 = load i32, i32* @GL_RENDERER
%4 = tail call i32* @glGetString(i32 %3)
%5 = load i32, i32* @GL_VERSION
%6 = tail call i32* @glGetString(i32 %5)
%7 = load i32, i32* @GL_SHADING_LANGUAGE_VERSION
%8 = tail call i32* @glGetString(i32 %7)
%9 = tail call i32 @platform_log(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %8, i32* %4, i32* %2)
ret void
}