#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 GLuint;
typedef size_t GLint;
typedef int GLenum;

/* Variables and functions */
#define GL_ALIASED_LINE_WIDTH_RANGE 148
#define GL_ALIASED_POINT_SIZE_RANGE 147
#define GL_MAX_3D_TEXTURE_SIZE 146
#define GL_MAX_ATTRIB_STACK_DEPTH 145
#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 144
#define GL_MAX_CLIP_PLANES 143
#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 142
#define GL_MAX_ELEMENTS_INDICES 141
#define GL_MAX_ELEMENTS_VERTICES 140
#define GL_MAX_EVAL_ORDER 139
#define GL_MAX_LIGHTS 138
#define GL_MAX_LIST_NESTING 137
#define GL_MAX_MODELVIEW_STACK_DEPTH 136
#define GL_MAX_NAME_STACK_DEPTH 135
#define GL_MAX_PIXEL_MAP_TABLE 134
#define GL_MAX_PROJECTION_STACK_DEPTH 133
#define GL_MAX_TEXTURE_SIZE 132
#define GL_MAX_TEXTURE_STACK_DEPTH 131
#define GL_MAX_VIEWPORT_DIMS 130
scalar_t__ GL_NONE;
#define GL_SMOOTH_LINE_WIDTH_RANGE 129
#define GL_SMOOTH_POINT_SIZE_RANGE 128
scalar_t__ glGetError();
int /*<<< orphan*/ glGetIntegerv(int, size_t *);
int /*<<< orphan*/ printf(char *, ...);
void print_limits(void) {
  struct token_name {
    GLuint count;
    GLenum token;
    const char *name;
  };
  static const struct token_name limits[] = {
      {1, GL_MAX_ATTRIB_STACK_DEPTH, "GL_MAX_ATTRIB_STACK_DEPTH"},
      {1, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH"},
      {1, GL_MAX_CLIP_PLANES, "GL_MAX_CLIP_PLANES"},
      {1, GL_MAX_COLOR_MATRIX_STACK_DEPTH, "GL_MAX_COLOR_MATRIX_STACK_DEPTH"},
      {1, GL_MAX_ELEMENTS_VERTICES, "GL_MAX_ELEMENTS_VERTICES"},
      {1, GL_MAX_ELEMENTS_INDICES, "GL_MAX_ELEMENTS_INDICES"},
      {1, GL_MAX_EVAL_ORDER, "GL_MAX_EVAL_ORDER"},
      {1, GL_MAX_LIGHTS, "GL_MAX_LIGHTS"},
      {1, GL_MAX_LIST_NESTING, "GL_MAX_LIST_NESTING"},
      {1, GL_MAX_MODELVIEW_STACK_DEPTH, "GL_MAX_MODELVIEW_STACK_DEPTH"},
      {1, GL_MAX_NAME_STACK_DEPTH, "GL_MAX_NAME_STACK_DEPTH"},
      {1, GL_MAX_PIXEL_MAP_TABLE, "GL_MAX_PIXEL_MAP_TABLE"},
      {1, GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH"},
      {1, GL_MAX_TEXTURE_STACK_DEPTH, "GL_MAX_TEXTURE_STACK_DEPTH"},
      {1, GL_MAX_TEXTURE_SIZE, "GL_MAX_TEXTURE_SIZE"},
      {1, GL_MAX_3D_TEXTURE_SIZE, "GL_MAX_3D_TEXTURE_SIZE"},
      {1, 0x851C, "GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB"},
      {1, 0x84F8, "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV"},
      {1, 0x86A2, "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB"},
      {1, 0x84E2, "GL_MAX_TEXTURE_UNITS_ARB"},
      {1, 0x84FD, "GL_MAX_TEXTURE_LOD_BIAS_EXT"},
      {1, 0x84FF, "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT"},
      {2, GL_MAX_VIEWPORT_DIMS, "GL_MAX_VIEWPORT_DIMS"},
      {2, GL_ALIASED_LINE_WIDTH_RANGE, "GL_ALIASED_LINE_WIDTH_RANGE"},
      {2, GL_SMOOTH_LINE_WIDTH_RANGE, "GL_SMOOTH_LINE_WIDTH_RANGE"},
      {2, GL_ALIASED_POINT_SIZE_RANGE, "GL_ALIASED_POINT_SIZE_RANGE"},
      {2, GL_SMOOTH_POINT_SIZE_RANGE, "GL_SMOOTH_POINT_SIZE_RANGE"},
      {0, (GLenum)0, NULL}};
  GLint i, max[2];
  printf("OpenGL limits:\n");
  for (i = 0; limits[i].count; i++) {
    glGetIntegerv(limits[i].token, max);
    if (glGetError() == GL_NONE) {
      if (limits[i].count == 1)
        printf("    %s = %d\n", limits[i].name, max[0]);
      else
        printf("    %s = %d, %d\n", limits[i].name, max[0], max[1]);
    }
  }
}


x86 assembly (clang, -O0):
<print_limits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0x1186(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0x2af7(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
cmpl   $0x0,(%rax)
je     122d <print_limits+0xfd>
mov    -0x8(%rbp),%rcx
lea    0x2adc(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x4(%rax),%edi
lea    -0x20(%rbp),%rsi
call   1050 <glGetIntegerv@plt>
mov    $0x0,%al
call   1040 <glGetError@plt>
mov    0x2e43(%rip),%rcx
cmp    (%rcx),%rax
jne    1217 <print_limits+0xe7>
mov    -0x8(%rbp),%rcx
lea    0x2aa7(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
cmpl   $0x1,(%rax)
jne    11e6 <print_limits+0xb6>
mov    -0x8(%rbp),%rcx
lea    0x2a8c(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rsi
mov    -0x20(%rbp),%rdx
lea    0x10fb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1212 <print_limits+0xe2>
mov    -0x8(%rbp),%rcx
lea    0x2a5f(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0x10d7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1217 <print_limits+0xe7>
jmp    121c <print_limits+0xec>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114e <print_limits+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_limits>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x118e(%rip),%rdi
call   1030 <puts@plt>
lea    0x2af7(%rip),%rbx
mov    %rsp,%r12
mov    0x2e6d(%rip),%r13
lea    0x1153(%rip),%r14
lea    0x1159(%rip),%r15
xor    %ebp,%ebp
jmp    119d <print_limits+0x5d>
nopl   (%rax)
mov    0x8(%rsp),%rcx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
add    $0x10,%rbx
cmp    $0x1b,%rbp
je     11ce <print_limits+0x8e>
mov    -0x4(%rbx),%edi
mov    %r12,%rsi
call   1060 <glGetIntegerv@plt>
xor    %eax,%eax
call   1050 <glGetError@plt>
cmp    0x0(%r13),%rax
jne    118f <print_limits+0x4f>
mov    (%rbx),%rsi
mov    (%rsp),%rdx
cmp    $0x15,%rbp
ja     1180 <print_limits+0x40>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118f <print_limits+0x4f>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.token_name = type { i32, i32, i8* }
@print_limits.limits = internal constant [28 x %struct.token_name] [%struct.token_name { i32 1, i32 145, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i32 0, i32 0) }, %struct.token_name { i32 1, i32 144, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i32 0, i32 0) }, %struct.token_name { i32 1, i32 143, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i32 0, i32 0) }, %struct.token_name { i32 1, i32 142, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i32 0, i32 0) }, %struct.token_name { i32 1, i32 140, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i32 0, i32 0) }, %struct.token_name { i32 1, i32 141, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i32 0, i32 0) }, %struct.token_name { i32 1, i32 139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i32 0, i32 0) }, %struct.token_name { i32 1, i32 138, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i32 0, i32 0) }, %struct.token_name { i32 1, i32 137, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i32 0, i32 0) }, %struct.token_name { i32 1, i32 136, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i32 0, i32 0) }, %struct.token_name { i32 1, i32 135, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i32 0, i32 0) }, %struct.token_name { i32 1, i32 134, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i32 0, i32 0) }, %struct.token_name { i32 1, i32 133, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i32 0, i32 0) }, %struct.token_name { i32 1, i32 131, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i32 0, i32 0) }, %struct.token_name { i32 1, i32 132, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i32 0, i32 0) }, %struct.token_name { i32 1, i32 146, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34076, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.16, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34040, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.17, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34466, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34018, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.19, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34045, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34047, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.21, i32 0, i32 0) }, %struct.token_name { i32 2, i32 130, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i32 0, i32 0) }, %struct.token_name { i32 2, i32 148, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.23, i32 0, i32 0) }, %struct.token_name { i32 2, i32 129, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.24, i32 0, i32 0) }, %struct.token_name { i32 2, i32 147, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.25, i32 0, i32 0) }, %struct.token_name { i32 2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.26, i32 0, i32 0) }, %struct.token_name zeroinitializer]
@.str = [26 x i8] c"GL_MAX_ATTRIB_STACK_DEPTH\00"
@.str.1 = [33 x i8] c"GL_MAX_CLIENT_ATTRIB_STACK_DEPTH\00"
@.str.2 = [19 x i8] c"GL_MAX_CLIP_PLANES\00"
@.str.3 = [32 x i8] c"GL_MAX_COLOR_MATRIX_STACK_DEPTH\00"
@.str.4 = [25 x i8] c"GL_MAX_ELEMENTS_VERTICES\00"
@.str.5 = [24 x i8] c"GL_MAX_ELEMENTS_INDICES\00"
@.str.6 = [18 x i8] c"GL_MAX_EVAL_ORDER\00"
@.str.7 = [14 x i8] c"GL_MAX_LIGHTS\00"
@.str.8 = [20 x i8] c"GL_MAX_LIST_NESTING\00"
@.str.9 = [29 x i8] c"GL_MAX_MODELVIEW_STACK_DEPTH\00"
@.str.10 = [24 x i8] c"GL_MAX_NAME_STACK_DEPTH\00"
@.str.11 = [23 x i8] c"GL_MAX_PIXEL_MAP_TABLE\00"
@.str.12 = [30 x i8] c"GL_MAX_PROJECTION_STACK_DEPTH\00"
@.str.13 = [27 x i8] c"GL_MAX_TEXTURE_STACK_DEPTH\00"
@.str.14 = [20 x i8] c"GL_MAX_TEXTURE_SIZE\00"
@.str.15 = [23 x i8] c"GL_MAX_3D_TEXTURE_SIZE\00"
@.str.16 = [33 x i8] c"GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB\00"
@.str.17 = [33 x i8] c"GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\00"
@.str.18 = [38 x i8] c"GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB\00"
@.str.19 = [25 x i8] c"GL_MAX_TEXTURE_UNITS_ARB\00"
@.str.20 = [28 x i8] c"GL_MAX_TEXTURE_LOD_BIAS_EXT\00"
@.str.21 = [34 x i8] c"GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT\00"
@.str.22 = [21 x i8] c"GL_MAX_VIEWPORT_DIMS\00"
@.str.23 = [28 x i8] c"GL_ALIASED_LINE_WIDTH_RANGE\00"
@.str.24 = [27 x i8] c"GL_SMOOTH_LINE_WIDTH_RANGE\00"
@.str.25 = [28 x i8] c"GL_ALIASED_POINT_SIZE_RANGE\00"
@.str.26 = [27 x i8] c"GL_SMOOTH_POINT_SIZE_RANGE\00"
@.str.27 = [16 x i8] c"OpenGL limits:\0A\00"
@GL_NONE = global i64 0
@.str.28 = [13 x i8] c" %s = %d\0A\00"
@.str.29 = [17 x i8] c" %s = %d, %d\0A\00"
define void @print_limits() {
%1 = alloca i64
%2 = alloca [2 x i64]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.27, i64 0, i64 0))
store i64 0, i64* %1
br label %4
4: ; preds = %46, %0
%5 = load i64, i64* %1
%6 = getelementptr inbounds [28 x %struct.token_name], [28 x %struct.token_name]* @print_limits.limits, i64 0, i64 %5
%7 = getelementptr inbounds %struct.token_name, %struct.token_name* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %49
10: ; preds = %4
%11 = load i64, i64* %1
%12 = getelementptr inbounds [28 x %struct.token_name], [28 x %struct.token_name]* @print_limits.limits, i64 0, i64 %11
%13 = getelementptr inbounds %struct.token_name, %struct.token_name* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%16 = call i32 @glGetIntegerv(i32 %14, i64* %15)
%17 = call i64 (...) @glGetError()
%18 = load i64, i64* @GL_NONE
%19 = icmp eq i64 %17, %18
br i1 %19, label %20, label %45
20: ; preds = %10
%21 = load i64, i64* %1
%22 = getelementptr inbounds [28 x %struct.token_name], [28 x %struct.token_name]* @print_limits.limits, i64 0, i64 %21
%23 = getelementptr inbounds %struct.token_name, %struct.token_name* %22, i32 0, i32 0
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %34
26: ; preds = %20
%27 = load i64, i64* %1
%28 = getelementptr inbounds [28 x %struct.token_name], [28 x %struct.token_name]* @print_limits.limits, i64 0, i64 %27
%29 = getelementptr inbounds %struct.token_name, %struct.token_name* %28, i32 0, i32 2
%30 = load i8*, i8** %29
%31 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%32 = load i64, i64* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.28, i64 0, i64 0), i8* %30, i64 %32)
br label %44
34: ; preds = %20
%35 = load i64, i64* %1
%36 = getelementptr inbounds [28 x %struct.token_name], [28 x %struct.token_name]* @print_limits.limits, i64 0, i64 %35
%37 = getelementptr inbounds %struct.token_name, %struct.token_name* %36, i32 0, i32 2
%38 = load i8*, i8** %37
%39 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%40 = load i64, i64* %39
%41 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 1
%42 = load i64, i64* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.29, i64 0, i64 0), i8* %38, i64 %40, i64 %42)
br label %44
44: ; preds = %34, %26
br label %45
45: ; preds = %44, %10
br label %46
46: ; preds = %45
%47 = load i64, i64* %1
%48 = add i64 %47, 1
store i64 %48, i64* %1
br label %4
49: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.token_name = type { i32, i32, i8* }
@print_limits.limits = internal unnamed_addr constant [28 x %struct.token_name] [%struct.token_name { i32 1, i32 145, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i32 0, i32 0) }, %struct.token_name { i32 1, i32 144, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i32 0, i32 0) }, %struct.token_name { i32 1, i32 143, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i32 0, i32 0) }, %struct.token_name { i32 1, i32 142, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i32 0, i32 0) }, %struct.token_name { i32 1, i32 140, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i32 0, i32 0) }, %struct.token_name { i32 1, i32 141, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i32 0, i32 0) }, %struct.token_name { i32 1, i32 139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i32 0, i32 0) }, %struct.token_name { i32 1, i32 138, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i32 0, i32 0) }, %struct.token_name { i32 1, i32 137, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i32 0, i32 0) }, %struct.token_name { i32 1, i32 136, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i32 0, i32 0) }, %struct.token_name { i32 1, i32 135, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i32 0, i32 0) }, %struct.token_name { i32 1, i32 134, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i32 0, i32 0) }, %struct.token_name { i32 1, i32 133, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i32 0, i32 0) }, %struct.token_name { i32 1, i32 131, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i32 0, i32 0) }, %struct.token_name { i32 1, i32 132, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i32 0, i32 0) }, %struct.token_name { i32 1, i32 146, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34076, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.16, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34040, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.17, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34466, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34018, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.19, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34045, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.20, i32 0, i32 0) }, %struct.token_name { i32 1, i32 34047, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.21, i32 0, i32 0) }, %struct.token_name { i32 2, i32 130, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i32 0, i32 0) }, %struct.token_name { i32 2, i32 148, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.23, i32 0, i32 0) }, %struct.token_name { i32 2, i32 129, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.24, i32 0, i32 0) }, %struct.token_name { i32 2, i32 147, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.25, i32 0, i32 0) }, %struct.token_name { i32 2, i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.26, i32 0, i32 0) }, %struct.token_name zeroinitializer]
@.str = [26 x i8] c"GL_MAX_ATTRIB_STACK_DEPTH\00"
@.str.1 = [33 x i8] c"GL_MAX_CLIENT_ATTRIB_STACK_DEPTH\00"
@.str.2 = [19 x i8] c"GL_MAX_CLIP_PLANES\00"
@.str.3 = [32 x i8] c"GL_MAX_COLOR_MATRIX_STACK_DEPTH\00"
@.str.4 = [25 x i8] c"GL_MAX_ELEMENTS_VERTICES\00"
@.str.5 = [24 x i8] c"GL_MAX_ELEMENTS_INDICES\00"
@.str.6 = [18 x i8] c"GL_MAX_EVAL_ORDER\00"
@.str.7 = [14 x i8] c"GL_MAX_LIGHTS\00"
@.str.8 = [20 x i8] c"GL_MAX_LIST_NESTING\00"
@.str.9 = [29 x i8] c"GL_MAX_MODELVIEW_STACK_DEPTH\00"
@.str.10 = [24 x i8] c"GL_MAX_NAME_STACK_DEPTH\00"
@.str.11 = [23 x i8] c"GL_MAX_PIXEL_MAP_TABLE\00"
@.str.12 = [30 x i8] c"GL_MAX_PROJECTION_STACK_DEPTH\00"
@.str.13 = [27 x i8] c"GL_MAX_TEXTURE_STACK_DEPTH\00"
@.str.14 = [20 x i8] c"GL_MAX_TEXTURE_SIZE\00"
@.str.15 = [23 x i8] c"GL_MAX_3D_TEXTURE_SIZE\00"
@.str.16 = [33 x i8] c"GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB\00"
@.str.17 = [33 x i8] c"GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\00"
@.str.18 = [38 x i8] c"GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB\00"
@.str.19 = [25 x i8] c"GL_MAX_TEXTURE_UNITS_ARB\00"
@.str.20 = [28 x i8] c"GL_MAX_TEXTURE_LOD_BIAS_EXT\00"
@.str.21 = [34 x i8] c"GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT\00"
@.str.22 = [21 x i8] c"GL_MAX_VIEWPORT_DIMS\00"
@.str.23 = [28 x i8] c"GL_ALIASED_LINE_WIDTH_RANGE\00"
@.str.24 = [27 x i8] c"GL_SMOOTH_LINE_WIDTH_RANGE\00"
@.str.25 = [28 x i8] c"GL_ALIASED_POINT_SIZE_RANGE\00"
@.str.26 = [27 x i8] c"GL_SMOOTH_POINT_SIZE_RANGE\00"
@GL_NONE = global i64 0
@.str.28 = [13 x i8] c" %s = %d\0A\00"
@.str.29 = [17 x i8] c" %s = %d, %d\0A\00"
@str = [15 x i8] c"OpenGL limits:\00"
define void @print_limits() {
%1 = alloca [2 x i64]
%2 = bitcast [2 x i64]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [2 x i64], [2 x i64]* %1, i64 0, i64 0
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %1, i64 0, i64 1
br label %6
6: ; preds = %0, %24
%7 = phi i64 [ 0, %0 ], [ %25, %24 ]
%8 = getelementptr inbounds [28 x %struct.token_name], [28 x %struct.token_name]* @print_limits.limits, i64 0, i64 %7, i32 1
%9 = load i32, i32* %8
%10 = call i32 @glGetIntegerv(i32 %9, i64* %4)
%11 = call i64 (...) @glGetError()
%12 = load i64, i64* @GL_NONE
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %6
%15 = icmp ult i64 %7, 22
%16 = getelementptr inbounds [28 x %struct.token_name], [28 x %struct.token_name]* @print_limits.limits, i64 0, i64 %7, i32 2
%17 = load i8*, i8** %16
%18 = load i64, i64* %4
br i1 %15, label %19, label %21
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.28, i64 0, i64 0), i8* %17, i64 %18)
br label %24
21: ; preds = %14
%22 = load i64, i64* %5
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.29, i64 0, i64 0), i8* %17, i64 %18, i64 %22)
br label %24
24: ; preds = %6, %21, %19
%25 = add nuw nsw i64 %7, 1
%26 = icmp eq i64 %25, 27
br i1 %26, label %27, label %6
27: ; preds = %24
ret void
}