#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*/ sizes;
typedef int /*<<< orphan*/ exts;
typedef int GLint;

/* Variables and functions */
int GLUT_RGB;
int GLUT_SINGLE;
int /*<<< orphan*/ GL_DEPTH_BITS;
int /*<<< orphan*/ GL_EXTENSIONS;
int /*<<< orphan*/ GL_MAX_TEXTURE_SIZE;
int /*<<< orphan*/ GL_PROXY_TEXTURE_2D;
int /*<<< orphan*/ GL_RGBA;
int /*<<< orphan*/ GL_TEXTURE_HEIGHT;
int /*<<< orphan*/ GL_TEXTURE_WIDTH;
int /*<<< orphan*/ GL_UNSIGNED_BYTE;
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ glGetIntegerv(int /*<<< orphan*/, int *);
scalar_t__ glGetString(int /*<<< orphan*/);
int /*<<< orphan*/ glGetTexLevelParameteriv(int /*<<< orphan*/,
                                            int /*<<< orphan*/,
                                            int /*<<< orphan*/, int *);
int /*<<< orphan*/ glTexImage2D(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                int, int, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                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 *, ...);
scalar_t__ strstr(char const *, char const *);
int main(int argc, char **argv) {
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
  glutInitWindowSize(250, 250);
  glutInitWindowPosition(100, 100);
  glutCreateWindow("Hello World!");
  GLint size, bits;
  glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
  glGetIntegerv(GL_DEPTH_BITS, &bits);
  printf("\nGL_MAX_TEXTURE_SIZE = %d\n", size);
  printf("\nGL_DEPTH_BITS = %d\n", bits);
  const char *exts[] = {
      "GL_ARB_texture_rectangle",
      "GL_ARB_texture_non_power_of_two",
      "GL_ARB_does_not_exist",
  };
  printf("\nChecking some extensions...\n");
  const char *avail = (char *)glGetString(GL_EXTENSIONS);
  for (int i = 0; i < (sizeof(exts) / sizeof(exts[0])); i++)
    printf("\t%s: %s\n", exts[i], strstr(avail, exts[i]) ? "OK" : "Error");
  GLint sizes[][2] = {
      {120, 40},    {120, 120},   {128, 32},    {128, 64},    {128, 128},
      {3400, 1600}, {1024, 1024}, {4096, 4096}, {8192, 8192},
  };
  printf("\nTrying some sizes...\n");
  for (int i = 0; i < (sizeof(sizes) / sizeof(sizes[0])); i++) {
    GLint width = sizes[i][0];
    GLint height = sizes[i][1];
    printf("\t%dx%d: ", width, height);
    glTexImage2D(GL_PROXY_TEXTURE_2D, 0, 4, width, height, 0, GL_RGBA,
                 GL_UNSIGNED_BYTE, NULL);
    glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
    glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT,
                             &height);
    printf("%s\n", width && height ? "OK" : "Error");
  }
  printf("\nPress any key to exit..\n");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   10c0 <glutInit@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
mov    0x2dd2(%rip),%rax
or     (%rax),%edi
call   1030 <glutInitDisplayMode@plt>
mov    $0xfa,%esi
mov    %esi,%edi
call   10d0 <glutInitWindowSize@plt>
mov    $0x64,%esi
mov    %esi,%edi
call   10b0 <glutInitWindowPosition@plt>
lea    0xdd4(%rip),%rdi
call   10a0 <glutCreateWindow@plt>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
lea    -0x14(%rbp),%rsi
call   10e0 <glGetIntegerv@plt>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   10e0 <glGetIntegerv@plt>
mov    -0x14(%rbp),%esi
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2b32(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2b2f(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2b2c(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2cfb(%rip),%rax
mov    (%rax),%edi
call   1080 <glGetString@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movslq -0x3c(%rbp),%rax
cmp    $0x3,%rax
jae    132b <main+0x15b>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x38(%rbp),%rdi
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rsi
call   10f0 <strstr@plt>
mov    -0xa8(%rbp),%rsi
mov    %rax,%rcx
lea    0xdb6(%rip),%rdx
lea    0xdac(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12bf <main+0xef>
lea    -0x90(%rbp),%rdi
lea    0xdc7(%rip),%rsi
mov    $0x48,%edx
call   1070 <memcpy@plt>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x94(%rbp)
movslq -0x94(%rbp),%rax
cmp    $0x9,%rax
jae    149c <main+0x2cc>
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,8),%eax
mov    %eax,-0x98(%rbp)
movslq -0x94(%rbp),%rax
mov    -0x8c(%rbp,%rax,8),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x98(%rbp),%esi
mov    -0x9c(%rbp),%edx
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2beb(%rip),%rax
mov    (%rax),%edi
mov    -0x98(%rbp),%ecx
mov    -0x9c(%rbp),%r8d
mov    0x2c1d(%rip),%rax
mov    (%rax),%r10d
mov    0x2bc3(%rip),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
mov    $0x4,%edx
xor    %esi,%esi
mov    %r9d,%esi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1050 <glTexImage2D@plt>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
mov    0x2bc6(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
lea    -0x98(%rbp),%rcx
call   1090 <glGetTexLevelParameteriv@plt>
mov    0x2b7f(%rip),%rax
mov    (%rax),%edi
mov    0x2b9e(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
lea    -0x9c(%rbp),%rcx
call   1090 <glGetTexLevelParameteriv@plt>
xor    %eax,%eax
cmpl   $0x0,-0x98(%rbp)
mov    %al,-0xa9(%rbp)
je     145f <main+0x28f>
cmpl   $0x0,-0x9c(%rbp)
setne  %al
mov    %al,-0xa9(%rbp)
mov    -0xa9(%rbp),%cl
lea    0xc4a(%rip),%rsi
lea    0xc40(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0xc2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    135b <main+0x18b>
lea    0xc39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
lea    0x14(%rsp),%rdi
call   10c0 <glutInit@plt>
mov    0x2dcd(%rip),%rax
mov    0x2de6(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glutInitDisplayMode@plt>
mov    $0xfa,%edi
mov    $0xfa,%esi
call   10d0 <glutInitWindowSize@plt>
mov    $0x64,%edi
mov    $0x64,%esi
call   10b0 <glutInitWindowPosition@plt>
lea    0xdd8(%rip),%rdi
call   10a0 <glutCreateWindow@plt>
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
lea    0x10(%rsp),%rsi
call   10e0 <glGetIntegerv@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   10e0 <glGetIntegerv@plt>
mov    0x10(%rsp),%esi
lea    0xdaf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xdb8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe29(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
call   1080 <glGetString@plt>
mov    %rax,%r12
lea    0xda2(%rip),%r15
mov    %rax,%rdi
mov    %r15,%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
lea    0xde8(%rip),%r14
lea    0xdde(%rip),%rbp
mov    %rbp,%rdx
cmove  %r14,%rdx
lea    0xdc7(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd7d(%rip),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
mov    %rbp,%rdx
cmove  %r14,%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd74(%rip),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
mov    %rbp,%rdx
cmove  %r14,%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd99(%rip),%rdi
call   1040 <puts@plt>
lea    0xdc9(%rip),%rbp
mov    0x2c6a(%rip),%r13
lea    0x4(%rsp),%r12
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%rbp,%r15,8),%esi
mov    0x4(%rbp,%r15,8),%edx
mov    %esi,0x8(%rsp)
mov    %edx,0x4(%rsp)
lea    0xd35(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13),%edi
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    0x2c6c(%rip),%rax
mov    (%rax),%eax
mov    0x2c13(%rip),%rdx
mov    (%rdx),%ebx
sub    $0x8,%rsp
xor    %esi,%esi
mov    $0x4,%edx
xor    %r9d,%r9d
push   $0x0
push   %rbx
push   %rax
call   1060 <glTexImage2D@plt>
add    $0x20,%rsp
mov    0x0(%r13),%edi
mov    0x2c23(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
lea    0x8(%rsp),%rcx
call   1090 <glGetTexLevelParameteriv@plt>
mov    0x0(%r13),%edi
mov    0x2c02(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
mov    %r12,%rcx
call   1090 <glGetTexLevelParameteriv@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xcaf(%rip),%rdi
cmove  %r14,%rdi
cmpl   $0x0,0x8(%rsp)
cmove  %r14,%rdi
call   1040 <puts@plt>
add    $0x1,%r15
cmp    $0x9,%r15
jne    1350 <main+0x180>
lea    0xccd(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@GLUT_SINGLE = global i32 0
@GLUT_RGB = global i32 0
@.str = [13 x i8] c"Hello World!\00"
@GL_MAX_TEXTURE_SIZE = global i32 0
@GL_DEPTH_BITS = global i32 0
@.str.1 = [27 x i8] c"\0AGL_MAX_TEXTURE_SIZE = %d\0A\00"
@.str.2 = [21 x i8] c"\0AGL_DEPTH_BITS = %d\0A\00"
@.str.3 = [25 x i8] c"GL_ARB_texture_rectangle\00"
@.str.4 = [32 x i8] c"GL_ARB_texture_non_power_of_two\00"
@.str.5 = [22 x i8] c"GL_ARB_does_not_exist\00"
@__const.main.exts = [3 x i8*] [i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i32 0, i32 0)]
@.str.6 = [30 x i8] c"\0AChecking some extensions...\0A\00"
@GL_EXTENSIONS = global i32 0
@.str.7 = [9 x i8] c"\09%s: %s\0A\00"
@.str.8 = [3 x i8] c"OK\00"
@.str.9 = [6 x i8] c"Error\00"
@__const.main.sizes = [9 x [2 x i32]] [[2 x i32] [i32 120, i32 40], [2 x i32] [i32 120, i32 120], [2 x i32] [i32 128, i32 32], [2 x i32] [i32 128, i32 64], [2 x i32] [i32 128, i32 128], [2 x i32] [i32 3400, i32 1600], [2 x i32] [i32 1024, i32 1024], [2 x i32] [i32 4096, i32 4096], [2 x i32] [i32 8192, i32 8192]]
@.str.10 = [23 x i8] c"\0ATrying some sizes...\0A\00"
@.str.11 = [9 x i8] c"\09%dx%d: \00"
@GL_PROXY_TEXTURE_2D = global i32 0
@GL_RGBA = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@GL_TEXTURE_WIDTH = global i32 0
@GL_TEXTURE_HEIGHT = global i32 0
@.str.12 = [4 x i8] c"%s\0A\00"
@.str.13 = [26 x i8] c"\0APress any key to exit..\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [3 x i8*]
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [9 x [2 x i32]]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i8**, i8*** %5
%16 = call i32 @glutInit(i32* %4, i8** %15)
%17 = load i32, i32* @GLUT_SINGLE
%18 = load i32, i32* @GLUT_RGB
%19 = or i32 %17, %18
%20 = call i32 @glutInitDisplayMode(i32 %19)
%21 = call i32 @glutInitWindowSize(i32 250, i32 250)
%22 = call i32 @glutInitWindowPosition(i32 100, i32 100)
%23 = call i32 @glutCreateWindow(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* @GL_MAX_TEXTURE_SIZE
%25 = call i32 @glGetIntegerv(i32 %24, i32* %6)
%26 = load i32, i32* @GL_DEPTH_BITS
%27 = call i32 @glGetIntegerv(i32 %26, i32* %7)
%28 = load i32, i32* %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = bitcast [3 x i8*]* %8 to i8*
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%34 = load i32, i32* @GL_EXTENSIONS
%35 = call i64 @glGetString(i32 %34)
%36 = inttoptr i64 %35 to i8*
store i8* %36, i8** %9
store i32 0, i32* %10
br label %37
37: ; preds = %56, %2
%38 = load i32, i32* %10
%39 = sext i32 %38 to i64
%40 = icmp ult i64 %39, 3
br i1 %40, label %41, label %59
41: ; preds = %37
%42 = load i32, i32* %10
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [3 x i8*], [3 x i8*]* %8, i64 0, i64 %43
%45 = load i8*, i8** %44
%46 = load i8*, i8** %9
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [3 x i8*], [3 x i8*]* %8, i64 0, i64 %48
%50 = load i8*, i8** %49
%51 = call i64 @strstr(i8* %46, i8* %50)
%52 = icmp ne i64 %51, 0
%53 = zext i1 %52 to i64
%54 = select i1 %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* %45, i8* %54)
br label %56
56: ; preds = %41
%57 = load i32, i32* %10
%58 = add nsw i32 %57, 1
store i32 %58, i32* %10
br label %37
59: ; preds = %37
%60 = bitcast [9 x [2 x i32]]* %11 to i8*
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %12
br label %62
62: ; preds = %102, %59
%63 = load i32, i32* %12
%64 = sext i32 %63 to i64
%65 = icmp ult i64 %64, 9
br i1 %65, label %66, label %105
66: ; preds = %62
%67 = load i32, i32* %12
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [9 x [2 x i32]], [9 x [2 x i32]]* %11, i64 0, i64 %68
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %69, i64 0, i64 0
%71 = load i32, i32* %70
store i32 %71, i32* %13
%72 = load i32, i32* %12
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [9 x [2 x i32]], [9 x [2 x i32]]* %11, i64 0, i64 %73
%75 = getelementptr inbounds [2 x i32], [2 x i32]* %74, i64 0, i64 1
%76 = load i32, i32* %75
store i32 %76, i32* %14
%77 = load i32, i32* %13
%78 = load i32, i32* %14
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 %77, i32 %78)
%80 = load i32, i32* @GL_PROXY_TEXTURE_2D
%81 = load i32, i32* %13
%82 = load i32, i32* %14
%83 = load i32, i32* @GL_RGBA
%84 = load i32, i32* @GL_UNSIGNED_BYTE
%85 = call i32 @glTexImage2D(i32 %80, i32 0, i32 4, i32 %81, i32 %82, i32 0, i32 %83, i32 %84, i32* null)
%86 = load i32, i32* @GL_PROXY_TEXTURE_2D
%87 = load i32, i32* @GL_TEXTURE_WIDTH
%88 = call i32 @glGetTexLevelParameteriv(i32 %86, i32 0, i32 %87, i32* %13)
%89 = load i32, i32* @GL_PROXY_TEXTURE_2D
%90 = load i32, i32* @GL_TEXTURE_HEIGHT
%91 = call i32 @glGetTexLevelParameteriv(i32 %89, i32 0, i32 %90, i32* %14)
%92 = load i32, i32* %13
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %97
94: ; preds = %66
%95 = load i32, i32* %14
%96 = icmp ne i32 %95, 0
br label %97
97: ; preds = %94, %66
%98 = phi i1 [ false, %66 ], [ %96, %94 ]
%99 = zext i1 %98 to i64
%100 = select i1 %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %100)
br label %102
102: ; preds = %97
%103 = load i32, i32* %12
%104 = add nsw i32 %103, 1
store i32 %104, i32* %12
br label %62
105: ; preds = %62
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0))
%107 = call i32 (...) @getchar()
%108 = load i32, i32* %3
ret i32 %108
}

LLVM IR (-O2):
@GLUT_SINGLE = global i32 0
@GLUT_RGB = global i32 0
@.str = [13 x i8] c"Hello World!\00"
@GL_MAX_TEXTURE_SIZE = global i32 0
@GL_DEPTH_BITS = global i32 0
@.str.1 = [27 x i8] c"\0AGL_MAX_TEXTURE_SIZE = %d\0A\00"
@.str.2 = [21 x i8] c"\0AGL_DEPTH_BITS = %d\0A\00"
@.str.3 = [25 x i8] c"GL_ARB_texture_rectangle\00"
@.str.4 = [32 x i8] c"GL_ARB_texture_non_power_of_two\00"
@.str.5 = [22 x i8] c"GL_ARB_does_not_exist\00"
@GL_EXTENSIONS = global i32 0
@.str.7 = [9 x i8] c"\09%s: %s\0A\00"
@.str.8 = [3 x i8] c"OK\00"
@.str.9 = [6 x i8] c"Error\00"
@__const.main.sizes = [9 x [2 x i32]] [[2 x i32] [i32 120, i32 40], [2 x i32] [i32 120, i32 120], [2 x i32] [i32 128, i32 32], [2 x i32] [i32 128, i32 64], [2 x i32] [i32 128, i32 128], [2 x i32] [i32 3400, i32 1600], [2 x i32] [i32 1024, i32 1024], [2 x i32] [i32 4096, i32 4096], [2 x i32] [i32 8192, i32 8192]]
@.str.11 = [9 x i8] c"\09%dx%d: \00"
@GL_PROXY_TEXTURE_2D = global i32 0
@GL_RGBA = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@GL_TEXTURE_WIDTH = global i32 0
@GL_TEXTURE_HEIGHT = global i32 0
@str = [29 x i8] c"\0AChecking some extensions...\00"
@str.14 = [22 x i8] c"\0ATrying some sizes...\00"
@str.15 = [25 x i8] c"\0APress any key to exit..\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
%8 = call i32 @glutInit(i32* %3, i8** %1)
%9 = load i32, i32* @GLUT_SINGLE
%10 = load i32, i32* @GLUT_RGB
%11 = or i32 %10, %9
%12 = call i32 @glutInitDisplayMode(i32 %11)
%13 = call i32 @glutInitWindowSize(i32 250, i32 250)
%14 = call i32 @glutInitWindowPosition(i32 100, i32 100)
%15 = call i32 @glutCreateWindow(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%16 = bitcast i32* %4 to i8*
%17 = bitcast i32* %5 to i8*
%18 = load i32, i32* @GL_MAX_TEXTURE_SIZE
%19 = call i32 @glGetIntegerv(i32 %18, i32* %4)
%20 = load i32, i32* @GL_DEPTH_BITS
%21 = call i32 @glGetIntegerv(i32 %20, i32* %5)
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %5
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%27 = load i32, i32* @GL_EXTENSIONS
%28 = call i64 @glGetString(i32 %27)
%29 = inttoptr i64 %28 to i8*
%30 = call i64 @strstr(i8* %29, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
%32 = select i1 %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %32)
%34 = call i64 @strstr(i8* %29, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
%36 = select i1 %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i8* %36)
%38 = call i64 @strstr(i8* %29, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
%40 = select i1 %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %40)
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.14, i64 0, i64 0))
%43 = bitcast i32* %6 to i8*
%44 = bitcast i32* %7 to i8*
br label %48
45: ; preds = %48
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0))
%47 = call i32 (...) @getchar()
ret i32 0
48: ; preds = %2, %48
%49 = phi i64 [ 0, %2 ], [ %74, %48 ]
%50 = getelementptr inbounds [9 x [2 x i32]], [9 x [2 x i32]]* @__const.main.sizes, i64 0, i64 %49, i64 0
%51 = load i32, i32* %50
store i32 %51, i32* %6
%52 = getelementptr inbounds [9 x [2 x i32]], [9 x [2 x i32]]* @__const.main.sizes, i64 0, i64 %49, i64 1
%53 = load i32, i32* %52
store i32 %53, i32* %7
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 %51, i32 %53)
%55 = load i32, i32* @GL_PROXY_TEXTURE_2D
%56 = load i32, i32* %6
%57 = load i32, i32* %7
%58 = load i32, i32* @GL_RGBA
%59 = load i32, i32* @GL_UNSIGNED_BYTE
%60 = call i32 @glTexImage2D(i32 %55, i32 0, i32 4, i32 %56, i32 %57, i32 0, i32 %58, i32 %59, i32* null)
%61 = load i32, i32* @GL_PROXY_TEXTURE_2D
%62 = load i32, i32* @GL_TEXTURE_WIDTH
%63 = call i32 @glGetTexLevelParameteriv(i32 %61, i32 0, i32 %62, i32* %6)
%64 = load i32, i32* @GL_PROXY_TEXTURE_2D
%65 = load i32, i32* @GL_TEXTURE_HEIGHT
%66 = call i32 @glGetTexLevelParameteriv(i32 %64, i32 0, i32 %65, i32* %7)
%67 = load i32, i32* %6
%68 = icmp ne i32 %67, 0
%69 = load i32, i32* %7
%70 = icmp ne i32 %69, 0
%71 = select i1 %68, i1 %70, i1 false
%72 = select i1 %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0)
%73 = call i32 @puts(i8* dereferenceable(1) %72)
%74 = add nuw nsw i64 %49, 1
%75 = icmp eq i64 %74, 9
br i1 %75, label %45, label %48
}