#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 GLUT_RGB;
int GLUT_SINGLE;
int /*<<< orphan*/ GLU_VERSION;
int /*<<< orphan*/ GL_EXTENSIONS;
int /*<<< orphan*/ GL_MAX_VERTEX_ATTRIBS;
int /*<<< orphan*/ GL_RENDERER;
int /*<<< orphan*/ GL_SHADING_LANGUAGE_VERSION;
int /*<<< orphan*/ GL_VENDOR;
int /*<<< orphan*/ GL_VERSION;
int /*<<< orphan*/ glGetIntegerv(int /*<<< orphan*/, int *);
char *glGetString(int /*<<< orphan*/);
char *gluGetString(int /*<<< orphan*/);
int /*<<< orphan*/ glutCreateWindow(char *);
int /*<<< orphan*/ glutInit(int *, char **);
int /*<<< orphan*/ glutInitDisplayMode(int);
int /*<<< orphan*/ glutInitWindowPosition(int, int);
int /*<<< orphan*/ glutInitWindowSize(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
  glutInitWindowPosition(100, 100);
  glutInitWindowSize(100, 100);
  glutCreateWindow("OpenGL Test");
  const GLubyte *name = glGetString(GL_VENDOR);
  const GLubyte *biaoshifu = glGetString(GL_RENDERER);
  const GLubyte *OpenGLVersion = glGetString(GL_VERSION);
  const GLubyte *Extensions = glGetString(GL_EXTENSIONS);
  const GLubyte *gluVersion = gluGetString(GLU_VERSION);
  const GLubyte *glslVersion = glGetString(GL_SHADING_LANGUAGE_VERSION);
  printf("OpenGL实现厂商的名字：%s\n", name);
  printf("渲染器标识符：%s\n", biaoshifu);
  printf("OpenGL实现的版本号：%s\n", OpenGLVersion);
  printf("OpenGL支持的扩展：%s\n", Extensions);
  printf("OGLU工具库版本：%s\n", gluVersion);
  printf("GLSL版本: %s\n", glslVersion);
  GLint nrAttributes;
  glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &nrAttributes);
  printf("Maximum nr of vertex attributes supported: %d\n", nrAttributes);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1090 <glutInit@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
mov    0x2e0d(%rip),%rax
or     (%rax),%edi
call   1030 <glutInitDisplayMode@plt>
mov    $0x64,%esi
mov    %esi,%edi
call   1080 <glutInitWindowPosition@plt>
mov    $0x64,%esi
mov    %esi,%edi
call   10a0 <glutInitWindowSize@plt>
lea    0xe17(%rip),%rdi
call   1070 <glutCreateWindow@plt>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,-0x18(%rbp)
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,-0x20(%rbp)
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,-0x28(%rbp)
mov    0x2d7d(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,-0x30(%rbp)
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
call   1050 <gluGetString@plt>
mov    %rax,-0x38(%rbp)
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsi
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d0b(%rip),%rax
mov    (%rax),%edi
lea    -0x44(%rbp),%rsi
call   10b0 <glGetIntegerv@plt>
mov    -0x44(%rbp),%esi
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1090 <glutInit@plt>
mov    0x2e38(%rip),%rax
mov    0x2e19(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glutInitDisplayMode@plt>
mov    $0x64,%edi
mov    $0x64,%esi
call   1080 <glutInitWindowPosition@plt>
mov    $0x64,%edi
mov    $0x64,%esi
call   10a0 <glutInitWindowSize@plt>
lea    0xe1b(%rip),%rdi
call   1070 <glutCreateWindow@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,%rbx
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,%r14
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,%r15
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,%r12
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
call   1050 <gluGetString@plt>
mov    %rax,%r13
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
call   1060 <glGetString@plt>
mov    %rax,%rbp
lea    0xdb5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdc6(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdce(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xddc(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xde7(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdf0(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   10b0 <glGetIntegerv@plt>
mov    (%rsp),%esi
lea    0xddb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@GLUT_RGB = global i32 0
@GLUT_SINGLE = global i32 0
@.str = [12 x i8] c"OpenGL Test\00"
@GL_VENDOR = global i32 0
@GL_RENDERER = global i32 0
@GL_VERSION = global i32 0
@GL_EXTENSIONS = global i32 0
@GLU_VERSION = global i32 0
@GL_SHADING_LANGUAGE_VERSION = global i32 0
@.str.1 = [34 x i8] c"OpenGL\E5\AE\9E\E7\8E\B0\E5\8E\82\E5\95\86\E7\9A\84\E5\90\8D\E5\AD\97\EF\BC\9A%s\0A\00"
@.str.2 = [25 x i8] c"\E6\B8\B2\E6\9F\93\E5\99\A8\E6\A0\87\E8\AF\86\E7\AC\A6\EF\BC\9A%s\0A\00"
@.str.3 = [31 x i8] c"OpenGL\E5\AE\9E\E7\8E\B0\E7\9A\84\E7\89\88\E6\9C\AC\E5\8F\B7\EF\BC\9A%s\0A\00"
@.str.4 = [28 x i8] c"OpenGL\E6\94\AF\E6\8C\81\E7\9A\84\E6\89\A9\E5\B1\95\EF\BC\9A%s\0A\00"
@.str.5 = [26 x i8] c"OGLU\E5\B7\A5\E5\85\B7\E5\BA\93\E7\89\88\E6\9C\AC\EF\BC\9A%s\0A\00"
@.str.6 = [16 x i8] c"GLSL\E7\89\88\E6\9C\AC: %s\0A\00"
@GL_MAX_VERTEX_ATTRIBS = global i32 0
@.str.7 = [47 x i8] c"Maximum nr of vertex attributes supported: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i8**, i8*** %5
%14 = call i32 @glutInit(i32* %4, i8** %13)
%15 = load i32, i32* @GLUT_RGB
%16 = load i32, i32* @GLUT_SINGLE
%17 = or i32 %15, %16
%18 = call i32 @glutInitDisplayMode(i32 %17)
%19 = call i32 @glutInitWindowPosition(i32 100, i32 100)
%20 = call i32 @glutInitWindowSize(i32 100, i32 100)
%21 = call i32 @glutCreateWindow(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* @GL_VENDOR
%23 = call i8* @glGetString(i32 %22)
store i8* %23, i8** %6
%24 = load i32, i32* @GL_RENDERER
%25 = call i8* @glGetString(i32 %24)
store i8* %25, i8** %7
%26 = load i32, i32* @GL_VERSION
%27 = call i8* @glGetString(i32 %26)
store i8* %27, i8** %8
%28 = load i32, i32* @GL_EXTENSIONS
%29 = call i8* @glGetString(i32 %28)
store i8* %29, i8** %9
%30 = load i32, i32* @GLU_VERSION
%31 = call i8* @gluGetString(i32 %30)
store i8* %31, i8** %10
%32 = load i32, i32* @GL_SHADING_LANGUAGE_VERSION
%33 = call i8* @glGetString(i32 %32)
store i8* %33, i8** %11
%34 = load i8*, i8** %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %34)
%36 = load i8*, i8** %7
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%38 = load i8*, i8** %8
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %38)
%40 = load i8*, i8** %9
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** %10
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %42)
%44 = load i8*, i8** %11
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %44)
%46 = load i32, i32* @GL_MAX_VERTEX_ATTRIBS
%47 = call i32 @glGetIntegerv(i32 %46, i32* %12)
%48 = load i32, i32* %12
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), i32 %48)
ret i32 0
}

LLVM IR (-O2):
@GLUT_RGB = global i32 0
@GLUT_SINGLE = global i32 0
@.str = [12 x i8] c"OpenGL Test\00"
@GL_VENDOR = global i32 0
@GL_RENDERER = global i32 0
@GL_VERSION = global i32 0
@GL_EXTENSIONS = global i32 0
@GLU_VERSION = global i32 0
@GL_SHADING_LANGUAGE_VERSION = global i32 0
@.str.1 = [34 x i8] c"OpenGL\E5\AE\9E\E7\8E\B0\E5\8E\82\E5\95\86\E7\9A\84\E5\90\8D\E5\AD\97\EF\BC\9A%s\0A\00"
@.str.2 = [25 x i8] c"\E6\B8\B2\E6\9F\93\E5\99\A8\E6\A0\87\E8\AF\86\E7\AC\A6\EF\BC\9A%s\0A\00"
@.str.3 = [31 x i8] c"OpenGL\E5\AE\9E\E7\8E\B0\E7\9A\84\E7\89\88\E6\9C\AC\E5\8F\B7\EF\BC\9A%s\0A\00"
@.str.4 = [28 x i8] c"OpenGL\E6\94\AF\E6\8C\81\E7\9A\84\E6\89\A9\E5\B1\95\EF\BC\9A%s\0A\00"
@.str.5 = [26 x i8] c"OGLU\E5\B7\A5\E5\85\B7\E5\BA\93\E7\89\88\E6\9C\AC\EF\BC\9A%s\0A\00"
@.str.6 = [16 x i8] c"GLSL\E7\89\88\E6\9C\AC: %s\0A\00"
@GL_MAX_VERTEX_ATTRIBS = global i32 0
@.str.7 = [47 x i8] c"Maximum nr of vertex attributes supported: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 @glutInit(i32* %3, i8** %1)
%6 = load i32, i32* @GLUT_RGB
%7 = load i32, i32* @GLUT_SINGLE
%8 = or i32 %7, %6
%9 = call i32 @glutInitDisplayMode(i32 %8)
%10 = call i32 @glutInitWindowPosition(i32 100, i32 100)
%11 = call i32 @glutInitWindowSize(i32 100, i32 100)
%12 = call i32 @glutCreateWindow(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @GL_VENDOR
%14 = call i8* @glGetString(i32 %13)
%15 = load i32, i32* @GL_RENDERER
%16 = call i8* @glGetString(i32 %15)
%17 = load i32, i32* @GL_VERSION
%18 = call i8* @glGetString(i32 %17)
%19 = load i32, i32* @GL_EXTENSIONS
%20 = call i8* @glGetString(i32 %19)
%21 = load i32, i32* @GLU_VERSION
%22 = call i8* @gluGetString(i32 %21)
%23 = load i32, i32* @GL_SHADING_LANGUAGE_VERSION
%24 = call i8* @glGetString(i32 %23)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* %24)
%31 = bitcast i32* %4 to i8*
%32 = load i32, i32* @GL_MAX_VERTEX_ATTRIBS
%33 = call i32 @glGetIntegerv(i32 %32, i32* %4)
%34 = load i32, i32* %4
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), i32 %34)
ret i32 0
}