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

/* Variables and functions */
int /*<<< orphan*/ GL_BLEND;
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_LINEAR;
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_MODULATE;
int /*<<< orphan*/ GL_NEAREST_MIPMAP_LINEAR;
int /*<<< orphan*/ GL_ONE_MINUS_SRC_ALPHA;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ GL_REPEAT;
int /*<<< orphan*/ GL_RGB;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ GL_SRC_ALPHA;
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ GL_TEXTURE_ENV;
int /*<<< orphan*/ GL_TEXTURE_ENV_MODE;
int /*<<< orphan*/ GL_TEXTURE_MAG_FILTER;
int /*<<< orphan*/ GL_TEXTURE_MIN_FILTER;
int /*<<< orphan*/ GL_TEXTURE_WRAP_S;
int /*<<< orphan*/ GL_TEXTURE_WRAP_T;
int /*<<< orphan*/ GL_UNPACK_ALIGNMENT;
int /*<<< orphan*/ GL_UNSIGNED_BYTE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ glBlendFunc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
int /*<<< orphan*/ glPixelStorei(int /*<<< orphan*/, int);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
int /*<<< orphan*/ glTexEnvf(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ glTexParameterf(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ gluBuild2DMipmaps(int /*<<< orphan*/, int, int, int,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     int /*<<< orphan*/ *);
char *gluErrorString(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void init_test04(void) {
  int x, y;
  GLubyte tex[128 * 128 * 3];
  GLenum gluerr;
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(-0.5, 639.5, -0.5, 479.5, 1.0, -1000.0 * 480.0);
  glMatrixMode(GL_MODELVIEW);
  glShadeModel(GL_SMOOTH);
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  for (y = 0; y < 128; y++)
    for (x = 0; x < 128; x++) {
      tex[(x + y * 128) * 3 + 0] = ((x % (128 / 4)) < (128 / 8)) ? 255 : 0;
      tex[(x + y * 128) * 3 + 1] = ((y % (128 / 4)) < (128 / 8)) ? 255 : 0;
      tex[(x + y * 128) * 3 + 2] = x;
    }
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  if ((gluerr = gluBuild2DMipmaps(GL_TEXTURE_2D, 3, 128, 128, GL_RGB,
                                  GL_UNSIGNED_BYTE, (GLvoid *)(&tex[0])))) {
    fprintf(stderr, "GLULib%s\n", gluErrorString(gluerr));
    exit(-1);
  }
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
                  GL_NEAREST_MIPMAP_LINEAR);
  glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
  glEnable(GL_TEXTURE_2D);
  glClearColor(0.0, 0.1, 1.0, 0.0);
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}


x86 assembly (clang, -O0):
<init_test04>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30020,%rsp
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    $0x0,%al
call   10c0 <glLoadIdentity@plt>
movsd  0xde8(%rip),%xmm2
movsd  0xde8(%rip),%xmm1
movsd  0xde8(%rip),%xmm3
movsd  0xde8(%rip),%xmm4
movsd  0xde8(%rip),%xmm5
movaps %xmm2,%xmm0
call   1070 <glOrtho@plt>
mov    0x2d59(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
call   10f0 <glShadeModel@plt>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d5f(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
mov    0x2d50(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1359 <init_test04+0x169>
movl   $0x0,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    1346 <init_test04+0x156>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
xor    %ecx,%ecx
mov    $0xff,%eax
cmp    $0x10,%edx
cmovl  %eax,%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x7,%edx
add    %edx,%eax
imul   $0x3,%eax,%eax
add    $0x0,%eax
cltq
mov    %ecx,-0x30010(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
xor    %ecx,%ecx
mov    $0xff,%eax
cmp    $0x10,%edx
cmovl  %eax,%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x7,%edx
add    %edx,%eax
imul   $0x3,%eax,%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x30010(%rbp,%rax,4)
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x7,%edx
add    %edx,%eax
imul   $0x3,%eax,%eax
add    $0x2,%eax
cltq
mov    %ecx,-0x30010(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    12aa <init_test04+0xba>
jmp    134b <init_test04+0x15b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1296 <init_test04+0xa6>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1080 <glPixelStorei@plt>
mov    0x2c0d(%rip),%rax
mov    (%rax),%edi
mov    0x2c74(%rip),%rax
mov    (%rax),%r8d
mov    0x2bca(%rip),%rax
mov    (%rax),%r9d
lea    -0x30010(%rbp),%rax
mov    $0x3,%esi
mov    $0x80,%ecx
mov    %ecx,%edx
mov    %rax,(%rsp)
call   1110 <gluBuild2DMipmaps@plt>
mov    %eax,-0x30014(%rbp)
cmp    $0x0,%eax
je     13ed <init_test04+0x1fd>
mov    0x2bbd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30018(%rbp)
mov    -0x30014(%rbp),%edi
call   10e0 <gluErrorString@plt>
mov    -0x30018(%rbp),%edi
mov    %rax,%rdx
lea    0xc52(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
mov    0x2b8c(%rip),%rax
mov    (%rax),%edi
mov    0x2b9b(%rip),%rax
mov    (%rax),%esi
mov    0x2b5a(%rip),%rax
mov    (%rax),%edx
call   10d0 <glTexParameterf@plt>
mov    0x2b6c(%rip),%rax
mov    (%rax),%edi
mov    0x2b03(%rip),%rax
mov    (%rax),%esi
mov    0x2b3a(%rip),%rax
mov    (%rax),%edx
call   10d0 <glTexParameterf@plt>
mov    0x2b4c(%rip),%rax
mov    (%rax),%edi
mov    0x2ba3(%rip),%rax
mov    (%rax),%esi
mov    0x2b2a(%rip),%rax
mov    (%rax),%edx
call   10d0 <glTexParameterf@plt>
mov    0x2b2c(%rip),%rax
mov    (%rax),%edi
mov    0x2ad3(%rip),%rax
mov    (%rax),%esi
mov    0x2b62(%rip),%rax
mov    (%rax),%edx
call   10d0 <glTexParameterf@plt>
mov    0x2b3c(%rip),%rax
mov    (%rax),%edi
mov    0x2b2b(%rip),%rax
mov    (%rax),%esi
mov    0x2b0a(%rip),%rax
mov    (%rax),%edx
call   1090 <glTexEnvf@plt>
mov    0x2aec(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
xorps  %xmm3,%xmm3
movsd  0xb82(%rip),%xmm1
movsd  0xb6a(%rip),%xmm2
movaps %xmm3,%xmm0
call   10a0 <glClearColor@plt>
mov    0x2a8b(%rip),%rax
mov    (%rax),%edi
mov    0x2af2(%rip),%rax
or     (%rax),%edi
call   1040 <glClear@plt>
add    $0x30020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_test04>:
push   %r14
push   %rbx
sub    $0x30018,%rsp
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   10c0 <glLoadIdentity@plt>
movsd  0xde6(%rip),%xmm1
movsd  0xde6(%rip),%xmm0
movsd  0xde6(%rip),%xmm3
movsd  0xde6(%rip),%xmm4
movsd  0xde6(%rip),%xmm5
movaps %xmm0,%xmm2
call   1070 <glOrtho@plt>
mov    0x2d57(%rip),%rax
mov    (%rax),%edi
call   1050 <glMatrixMode@plt>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
call   10f0 <glShadeModel@plt>
mov    0x2cd3(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
call   1060 <glEnable@plt>
mov    0x2cd7(%rip),%rax
mov    (%rax),%edi
mov    0x2d4e(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
lea    0x18(%rsp),%rax
mov    $0xff,%ecx
nopl   0x0(%rax,%rax,1)
test   $0x10,%r14b
mov    $0x0,%edx
cmove  %ecx,%edx
mov    %rax,%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x10,%dil
mov    $0x0,%ebx
cmove  %ecx,%ebx
mov    %ebx,-0x8(%rsi)
mov    %edx,-0x4(%rsi)
mov    %edi,(%rsi)
add    $0x1,%rdi
add    $0xc,%rsi
cmp    $0x80,%rdi
jne    12c0 <init_test04+0xd0>
add    $0x1,%r14
add    $0x600,%rax
cmp    $0x80,%r14
jne    12a0 <init_test04+0xb0>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1080 <glPixelStorei@plt>
mov    0x2c6e(%rip),%r14
mov    (%r14),%edi
mov    0x2cd4(%rip),%rax
mov    (%rax),%r8d
mov    0x2c2a(%rip),%rax
mov    (%rax),%r9d
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
mov    $0x3,%esi
mov    $0x80,%edx
mov    $0x80,%ecx
call   1110 <gluBuild2DMipmaps@plt>
test   %eax,%eax
jne    1414 <init_test04+0x224>
mov    (%r14),%edi
mov    0x2c40(%rip),%rax
mov    (%rax),%esi
mov    0x2bff(%rip),%rbx
mov    (%rbx),%edx
call   10d0 <glTexParameterf@plt>
mov    (%r14),%edi
mov    0x2bae(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
call   10d0 <glTexParameterf@plt>
mov    (%r14),%edi
mov    0x2c5b(%rip),%rax
mov    (%rax),%esi
mov    0x2be2(%rip),%rax
mov    (%rax),%edx
call   10d0 <glTexParameterf@plt>
mov    (%r14),%edi
mov    0x2b91(%rip),%rax
mov    (%rax),%esi
mov    0x2c20(%rip),%rax
mov    (%rax),%edx
call   10d0 <glTexParameterf@plt>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
mov    0x2be9(%rip),%rax
mov    (%rax),%esi
mov    0x2bc8(%rip),%rax
mov    (%rax),%edx
call   1090 <glTexEnvf@plt>
mov    (%r14),%edi
call   1060 <glEnable@plt>
movsd  0xc49(%rip),%xmm1
movsd  0xc31(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm3,%xmm3
call   10a0 <glClearColor@plt>
mov    0x2b4f(%rip),%rax
mov    0x2bb8(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1040 <glClear@plt>
add    $0x30018,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2b5d(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   10e0 <gluErrorString@plt>
lea    0xc05(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   10b0 <fprintf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_SMOOTH = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_BLEND = global i32 0
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
@GL_UNPACK_ALIGNMENT = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_RGB = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@stderr = global i32 0
@.str = [10 x i8] c"GLULib%s\0A\00"
@GL_TEXTURE_WRAP_S = global i32 0
@GL_REPEAT = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_NEAREST_MIPMAP_LINEAR = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_LINEAR = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_MODULATE = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @init_test04() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [49152 x i32]
%4 = alloca i32
%5 = load i32, i32* @GL_PROJECTION
%6 = call i32 @glMatrixMode(i32 %5)
%7 = call i32 (...) @glLoadIdentity()
%8 = call i32 @glOrtho(double -5.000000e-01, double 6.395000e+02, double -5.000000e-01, double 4.795000e+02, double 1.000000e+00, double -4.800000e+05)
%9 = load i32, i32* @GL_MODELVIEW
%10 = call i32 @glMatrixMode(i32 %9)
%11 = load i32, i32* @GL_SMOOTH
%12 = call i32 @glShadeModel(i32 %11)
%13 = load i32, i32* @GL_DEPTH_TEST
%14 = call i32 @glEnable(i32 %13)
%15 = load i32, i32* @GL_BLEND
%16 = call i32 @glEnable(i32 %15)
%17 = load i32, i32* @GL_SRC_ALPHA
%18 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%19 = call i32 @glBlendFunc(i32 %17, i32 %18)
store i32 0, i32* %2
br label %20
20: ; preds = %67, %0
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 128
br i1 %22, label %23, label %70
23: ; preds = %20
store i32 0, i32* %1
br label %24
24: ; preds = %63, %23
%25 = load i32, i32* %1
%26 = icmp slt i32 %25, 128
br i1 %26, label %27, label %66
27: ; preds = %24
%28 = load i32, i32* %1
%29 = srem i32 %28, 32
%30 = icmp slt i32 %29, 16
%31 = zext i1 %30 to i64
%32 = select i1 %30, i32 255, i32 0
%33 = load i32, i32* %1
%34 = load i32, i32* %2
%35 = mul nsw i32 %34, 128
%36 = add nsw i32 %33, %35
%37 = mul nsw i32 %36, 3
%38 = add nsw i32 %37, 0
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [49152 x i32], [49152 x i32]* %3, i64 0, i64 %39
store i32 %32, i32* %40
%41 = load i32, i32* %2
%42 = srem i32 %41, 32
%43 = icmp slt i32 %42, 16
%44 = zext i1 %43 to i64
%45 = select i1 %43, i32 255, i32 0
%46 = load i32, i32* %1
%47 = load i32, i32* %2
%48 = mul nsw i32 %47, 128
%49 = add nsw i32 %46, %48
%50 = mul nsw i32 %49, 3
%51 = add nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [49152 x i32], [49152 x i32]* %3, i64 0, i64 %52
store i32 %45, i32* %53
%54 = load i32, i32* %1
%55 = load i32, i32* %1
%56 = load i32, i32* %2
%57 = mul nsw i32 %56, 128
%58 = add nsw i32 %55, %57
%59 = mul nsw i32 %58, 3
%60 = add nsw i32 %59, 2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [49152 x i32], [49152 x i32]* %3, i64 0, i64 %61
store i32 %54, i32* %62
br label %63
63: ; preds = %27
%64 = load i32, i32* %1
%65 = add nsw i32 %64, 1
store i32 %65, i32* %1
br label %24
66: ; preds = %24
br label %67
67: ; preds = %66
%68 = load i32, i32* %2
%69 = add nsw i32 %68, 1
store i32 %69, i32* %2
br label %20
70: ; preds = %20
%71 = load i32, i32* @GL_UNPACK_ALIGNMENT
%72 = call i32 @glPixelStorei(i32 %71, i32 1)
%73 = load i32, i32* @GL_TEXTURE_2D
%74 = load i32, i32* @GL_RGB
%75 = load i32, i32* @GL_UNSIGNED_BYTE
%76 = getelementptr inbounds [49152 x i32], [49152 x i32]* %3, i64 0, i64 0
%77 = call i32 @gluBuild2DMipmaps(i32 %73, i32 3, i32 128, i32 128, i32 %74, i32 %75, i32* %76)
store i32 %77, i32* %4
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %85
79: ; preds = %70
%80 = load i32, i32* @stderr
%81 = load i32, i32* %4
%82 = call i8* @gluErrorString(i32 %81)
%83 = call i32 @fprintf(i32 %80, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %82)
%84 = call i32 @exit(i32 -1)
unreachable
85: ; preds = %70
%86 = load i32, i32* @GL_TEXTURE_2D
%87 = load i32, i32* @GL_TEXTURE_WRAP_S
%88 = load i32, i32* @GL_REPEAT
%89 = call i32 @glTexParameterf(i32 %86, i32 %87, i32 %88)
%90 = load i32, i32* @GL_TEXTURE_2D
%91 = load i32, i32* @GL_TEXTURE_WRAP_T
%92 = load i32, i32* @GL_REPEAT
%93 = call i32 @glTexParameterf(i32 %90, i32 %91, i32 %92)
%94 = load i32, i32* @GL_TEXTURE_2D
%95 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%96 = load i32, i32* @GL_NEAREST_MIPMAP_LINEAR
%97 = call i32 @glTexParameterf(i32 %94, i32 %95, i32 %96)
%98 = load i32, i32* @GL_TEXTURE_2D
%99 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%100 = load i32, i32* @GL_LINEAR
%101 = call i32 @glTexParameterf(i32 %98, i32 %99, i32 %100)
%102 = load i32, i32* @GL_TEXTURE_ENV
%103 = load i32, i32* @GL_TEXTURE_ENV_MODE
%104 = load i32, i32* @GL_MODULATE
%105 = call i32 @glTexEnvf(i32 %102, i32 %103, i32 %104)
%106 = load i32, i32* @GL_TEXTURE_2D
%107 = call i32 @glEnable(i32 %106)
%108 = call i32 @glClearColor(double 0.000000e+00, double 1.000000e-01, double 1.000000e+00, double 0.000000e+00)
%109 = load i32, i32* @GL_COLOR_BUFFER_BIT
%110 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%111 = or i32 %109, %110
%112 = call i32 @glClear(i32 %111)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_SMOOTH = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_BLEND = global i32 0
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
@GL_UNPACK_ALIGNMENT = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_RGB = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@stderr = global i32 0
@.str = [10 x i8] c"GLULib%s\0A\00"
@GL_TEXTURE_WRAP_S = global i32 0
@GL_REPEAT = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_NEAREST_MIPMAP_LINEAR = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_LINEAR = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_MODULATE = global i32 0
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @init_test04() {
%1 = alloca [49152 x i32]
%2 = bitcast [49152 x i32]* %1 to i8*
%3 = load i32, i32* @GL_PROJECTION
%4 = tail call i32 @glMatrixMode(i32 %3)
%5 = tail call i32 (...) @glLoadIdentity()
%6 = tail call i32 @glOrtho(double -5.000000e-01, double 6.395000e+02, double -5.000000e-01, double 4.795000e+02, double 1.000000e+00, double -4.800000e+05)
%7 = load i32, i32* @GL_MODELVIEW
%8 = tail call i32 @glMatrixMode(i32 %7)
%9 = load i32, i32* @GL_SMOOTH
%10 = tail call i32 @glShadeModel(i32 %9)
%11 = load i32, i32* @GL_DEPTH_TEST
%12 = tail call i32 @glEnable(i32 %11)
%13 = load i32, i32* @GL_BLEND
%14 = tail call i32 @glEnable(i32 %13)
%15 = load i32, i32* @GL_SRC_ALPHA
%16 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%17 = tail call i32 @glBlendFunc(i32 %15, i32 %16)
br label %18
18: ; preds = %0, %39
%19 = phi i64 [ 0, %0 ], [ %40, %39 ]
%20 = shl nsw i64 %19, 7
%21 = and i64 %19, 16
%22 = icmp eq i64 %21, 0
%23 = select i1 %22, i32 255, i32 0
br label %24
24: ; preds = %18, %24
%25 = phi i64 [ 0, %18 ], [ %37, %24 ]
%26 = trunc i64 %25 to i32
%27 = and i32 %26, 16
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 255, i32 0
%30 = add nuw nsw i64 %25, %20
%31 = mul nuw nsw i64 %30, 3
%32 = getelementptr inbounds [49152 x i32], [49152 x i32]* %1, i64 0, i64 %31
store i32 %29, i32* %32
%33 = add nuw nsw i64 %31, 1
%34 = getelementptr inbounds [49152 x i32], [49152 x i32]* %1, i64 0, i64 %33
store i32 %23, i32* %34
%35 = add nuw nsw i64 %31, 2
%36 = getelementptr inbounds [49152 x i32], [49152 x i32]* %1, i64 0, i64 %35
store i32 %26, i32* %36
%37 = add nuw nsw i64 %25, 1
%38 = icmp eq i64 %37, 128
br i1 %38, label %39, label %24
39: ; preds = %24
%40 = add nuw nsw i64 %19, 1
%41 = icmp eq i64 %40, 128
br i1 %41, label %42, label %18
42: ; preds = %39
%43 = load i32, i32* @GL_UNPACK_ALIGNMENT
%44 = tail call i32 @glPixelStorei(i32 %43, i32 1)
%45 = load i32, i32* @GL_TEXTURE_2D
%46 = load i32, i32* @GL_RGB
%47 = load i32, i32* @GL_UNSIGNED_BYTE
%48 = getelementptr inbounds [49152 x i32], [49152 x i32]* %1, i64 0, i64 0
%49 = call i32 @gluBuild2DMipmaps(i32 %45, i32 3, i32 128, i32 128, i32 %46, i32 %47, i32* %48)
%50 = icmp eq i32 %49, 0
br i1 %50, label %56, label %51
51: ; preds = %42
%52 = load i32, i32* @stderr
%53 = call i8* @gluErrorString(i32 %49)
%54 = call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %53)
%55 = call i32 @exit(i32 -1)
unreachable
56: ; preds = %42
%57 = load i32, i32* @GL_TEXTURE_2D
%58 = load i32, i32* @GL_TEXTURE_WRAP_S
%59 = load i32, i32* @GL_REPEAT
%60 = call i32 @glTexParameterf(i32 %57, i32 %58, i32 %59)
%61 = load i32, i32* @GL_TEXTURE_2D
%62 = load i32, i32* @GL_TEXTURE_WRAP_T
%63 = load i32, i32* @GL_REPEAT
%64 = call i32 @glTexParameterf(i32 %61, i32 %62, i32 %63)
%65 = load i32, i32* @GL_TEXTURE_2D
%66 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%67 = load i32, i32* @GL_NEAREST_MIPMAP_LINEAR
%68 = call i32 @glTexParameterf(i32 %65, i32 %66, i32 %67)
%69 = load i32, i32* @GL_TEXTURE_2D
%70 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%71 = load i32, i32* @GL_LINEAR
%72 = call i32 @glTexParameterf(i32 %69, i32 %70, i32 %71)
%73 = load i32, i32* @GL_TEXTURE_ENV
%74 = load i32, i32* @GL_TEXTURE_ENV_MODE
%75 = load i32, i32* @GL_MODULATE
%76 = call i32 @glTexEnvf(i32 %73, i32 %74, i32 %75)
%77 = load i32, i32* @GL_TEXTURE_2D
%78 = call i32 @glEnable(i32 %77)
%79 = call i32 @glClearColor(double 0.000000e+00, double 1.000000e-01, double 1.000000e+00, double 0.000000e+00)
%80 = load i32, i32* @GL_COLOR_BUFFER_BIT
%81 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%82 = or i32 %81, %80
%83 = call i32 @glClear(i32 %82)
ret void
}