#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 GLubyte;

/* Variables and functions */
int /*<<< orphan*/ GL_NEAREST;
int /*<<< orphan*/ GL_REPEAT;
int /*<<< orphan*/ GL_RGB;
int /*<<< orphan*/ GL_TEXTURE_2D;
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_UNSIGNED_BYTE;
int /*<<< orphan*/ glBindTexture(int /*<<< orphan*/, int);
int /*<<< orphan*/ glTexImage2D(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                int, int, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/, int **);
int /*<<< orphan*/ glTexParameteri(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
void bind_texture(int texobj, int image) {
  static int width = 8, height = 8;
  static int color[2][3] = {
      {255, 0, 0},
      {0, 255, 0},
  };
  GLubyte tex[64][3];
  static GLubyte texchar[2][8 * 8] = {
      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0,
       0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
       1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
      {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 2,
       0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2,
       0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
  int i, j;
  glBindTexture(GL_TEXTURE_2D, texobj);
  for (i = 0; i < height; i++) {
    for (j = 0; j < width; j++) {
      int p = i * width + j;
      if (texchar[image][(height - i - 1) * width + j]) {
        tex[p][0] = color[image][0];
        tex[p][1] = color[image][1];
        tex[p][2] = color[image][2];
      } else {
        tex[p][0] = 255;
        tex[p][1] = 255;
        tex[p][2] = 255;
      }
    }
  }
  glTexImage2D(GL_TEXTURE_2D, 0, 3, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE,
               tex);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
}


x86 assembly (clang, -O0):
<bind_texture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1050 <glBindTexture@plt>
movl   $0x0,-0x314(%rbp)
mov    -0x314(%rbp),%eax
cmp    0x2edc(%rip),%eax
jge    12ed <bind_texture+0x1bd>
movl   $0x0,-0x318(%rbp)
mov    -0x318(%rbp),%eax
cmp    0x2ebc(%rip),%eax
jge    12d4 <bind_texture+0x1a4>
mov    -0x314(%rbp),%eax
imul   0x2ea9(%rip),%eax
add    -0x318(%rbp),%eax
mov    %eax,-0x31c(%rbp)
movslq -0x8(%rbp),%rcx
lea    0x2ec2(%rip),%rax
shl    $0x8,%rcx
add    %rcx,%rax
mov    0x2e89(%rip),%ecx
sub    -0x314(%rbp),%ecx
sub    $0x1,%ecx
imul   0x2e75(%rip),%ecx
add    -0x318(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1268 <bind_texture+0x138>
movslq -0x8(%rbp),%rcx
lea    0x2e67(%rip),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%ecx
movslq -0x31c(%rbp),%rdx
lea    -0x310(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
movslq -0x8(%rbp),%rcx
lea    0x2e3c(%rip),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x4(%rax),%ecx
movslq -0x31c(%rbp),%rdx
lea    -0x310(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
movslq -0x8(%rbp),%rcx
lea    0x2e0f(%rip),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    0x8(%rax),%ecx
movslq -0x31c(%rbp),%rdx
lea    -0x310(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
jmp    12bb <bind_texture+0x18b>
movslq -0x31c(%rbp),%rcx
lea    -0x310(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movl   $0xff,(%rax)
movslq -0x31c(%rbp),%rcx
lea    -0x310(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movl   $0xff,0x4(%rax)
movslq -0x31c(%rbp),%rcx
lea    -0x310(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movl   $0xff,0x8(%rax)
jmp    12c0 <bind_texture+0x190>
mov    -0x318(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x318(%rbp)
jmp    1178 <bind_texture+0x48>
jmp    12d9 <bind_texture+0x1a9>
mov    -0x314(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x314(%rbp)
jmp    115c <bind_texture+0x2c>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
mov    0x2d44(%rip),%ecx
mov    0x2d41(%rip),%r8d
mov    0x2ce6(%rip),%rax
mov    (%rax),%r11d
mov    0x2c9c(%rip),%rax
mov    (%rax),%r10d
lea    -0x310(%rbp),%rax
xor    %r9d,%r9d
mov    $0x3,%edx
mov    %r9d,%esi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <glTexImage2D@plt>
mov    0x2c85(%rip),%rax
mov    (%rax),%edi
mov    0x2c94(%rip),%rax
mov    (%rax),%esi
mov    0x2c6b(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    0x2c65(%rip),%rax
mov    (%rax),%edi
mov    0x2c3c(%rip),%rax
mov    (%rax),%esi
mov    0x2c4b(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    0x2c45(%rip),%rax
mov    (%rax),%edi
mov    0x2c4c(%rip),%rax
mov    (%rax),%esi
mov    0x2c23(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    0x2c25(%rip),%rax
mov    (%rax),%edi
mov    0x2bec(%rip),%rax
mov    (%rax),%esi
mov    0x2c03(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_texture>:
push   %r14
push   %rbx
sub    $0x308,%rsp
mov    %esi,%ebx
mov    %edi,%esi
mov    0x2e83(%rip),%r14
mov    (%r14),%edi
call   1050 <glBindTexture@plt>
movslq %ebx,%rdx
lea    (%rdx,%rdx,2),%rax
lea    0xea5(%rip),%rcx
lea    (%rcx,%rax,4),%rax
lea    0x5c(%rsp),%rcx
shl    $0x8,%rdx
lea    0xeb1(%rip),%r8
add    %rdx,%r8
mov    $0x100,%esi
jmp    1197 <bind_texture+0x67>
nopl   0x0(%rax)
mov    %r9d,-0x8(%rcx)
mov    %edx,-0x4(%rcx)
mov    %edi,(%rcx)
add    $0x60,%rcx
add    $0xffffffffffffffe0,%rsi
je     12e2 <bind_texture+0x1b2>
cmpl   $0x0,-0x20(%r8,%rsi,1)
mov    $0xff,%r9d
mov    $0xff,%ebx
mov    $0xff,%edx
mov    $0xff,%edi
je     11bc <bind_texture+0x8c>
mov    (%rax),%ebx
mov    0x4(%rax),%edx
mov    0x8(%rax),%edi
mov    %ebx,-0x5c(%rcx)
mov    %edx,-0x58(%rcx)
mov    %edi,-0x54(%rcx)
cmpl   $0x0,-0x1c(%r8,%rsi,1)
mov    $0xff,%edx
mov    $0xff,%edi
je     11e0 <bind_texture+0xb0>
mov    (%rax),%r9d
mov    0x4(%rax),%edx
mov    0x8(%rax),%edi
mov    %r9d,-0x50(%rcx)
mov    %edx,-0x4c(%rcx)
mov    %edi,-0x48(%rcx)
cmpl   $0x0,-0x18(%r8,%rsi,1)
mov    $0xff,%r9d
mov    $0xff,%ebx
mov    $0xff,%edx
mov    $0xff,%edi
je     120f <bind_texture+0xdf>
mov    (%rax),%ebx
mov    0x4(%rax),%edx
mov    0x8(%rax),%edi
mov    %ebx,-0x44(%rcx)
mov    %edx,-0x40(%rcx)
mov    %edi,-0x3c(%rcx)
cmpl   $0x0,-0x14(%r8,%rsi,1)
mov    $0xff,%edx
mov    $0xff,%edi
je     1233 <bind_texture+0x103>
mov    (%rax),%r9d
mov    0x4(%rax),%edx
mov    0x8(%rax),%edi
mov    %r9d,-0x38(%rcx)
mov    %edx,-0x34(%rcx)
mov    %edi,-0x30(%rcx)
cmpl   $0x0,-0x10(%r8,%rsi,1)
mov    $0xff,%r9d
mov    $0xff,%ebx
mov    $0xff,%edx
mov    $0xff,%edi
je     1262 <bind_texture+0x132>
mov    (%rax),%ebx
mov    0x4(%rax),%edx
mov    0x8(%rax),%edi
mov    %ebx,-0x2c(%rcx)
mov    %edx,-0x28(%rcx)
mov    %edi,-0x24(%rcx)
cmpl   $0x0,-0xc(%r8,%rsi,1)
mov    $0xff,%edx
mov    $0xff,%edi
je     1286 <bind_texture+0x156>
mov    (%rax),%r9d
mov    0x4(%rax),%edx
mov    0x8(%rax),%edi
mov    %r9d,-0x20(%rcx)
mov    %edx,-0x1c(%rcx)
mov    %edi,-0x18(%rcx)
cmpl   $0x0,-0x8(%r8,%rsi,1)
mov    $0xff,%r9d
mov    $0xff,%ebx
mov    $0xff,%edx
mov    $0xff,%edi
je     12b5 <bind_texture+0x185>
mov    (%rax),%ebx
mov    0x4(%rax),%edx
mov    0x8(%rax),%edi
mov    %ebx,-0x14(%rcx)
mov    %edx,-0x10(%rcx)
mov    %edi,-0xc(%rcx)
cmpl   $0x0,-0x4(%r8,%rsi,1)
mov    $0xff,%edx
mov    $0xff,%edi
je     1180 <bind_texture+0x50>
mov    (%rax),%r9d
mov    0x4(%rax),%edx
mov    0x8(%rax),%edi
jmp    1180 <bind_texture+0x50>
mov    (%r14),%edi
mov    0x2d04(%rip),%rax
mov    (%rax),%eax
mov    0x2cbb(%rip),%rcx
mov    (%rcx),%ebx
sub    $0x8,%rsp
lea    0x8(%rsp),%r10
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x8,%ecx
mov    $0x8,%r8d
xor    %r9d,%r9d
push   %r10
push   %rbx
push   %rax
call   1040 <glTexImage2D@plt>
add    $0x20,%rsp
mov    (%r14),%edi
mov    0x2cb4(%rip),%rax
mov    (%rax),%esi
mov    0x2c8b(%rip),%rbx
mov    (%rbx),%edx
call   1030 <glTexParameteri@plt>
mov    (%r14),%edi
mov    0x2c62(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
call   1030 <glTexParameteri@plt>
mov    (%r14),%edi
mov    0x2c7f(%rip),%rax
mov    (%rax),%esi
mov    0x2c56(%rip),%rbx
mov    (%rbx),%edx
call   1030 <glTexParameteri@plt>
mov    (%r14),%edi
mov    0x2c25(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
call   1030 <glTexParameteri@plt>
add    $0x308,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@bind_texture.width = internal global i32 8
@bind_texture.height = internal global i32 8
@bind_texture.color = internal global [2 x [3 x i32]] [[3 x i32] [i32 255, i32 0, i32 0], [3 x i32] [i32 0, i32 255, i32 0]]
@bind_texture.texchar = internal global [2 x <{ [54 x i32], [10 x i32] }>] [<{ [54 x i32], [10 x i32] }> <{ [54 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1], [10 x i32] zeroinitializer }>, <{ [54 x i32], [10 x i32] }> <{ [54 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 2, i32 2, i32 2], [10 x i32] zeroinitializer }>]
@GL_TEXTURE_2D = global i32 0
@GL_RGB = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_NEAREST = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_TEXTURE_WRAP_S = global i32 0
@GL_REPEAT = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
define void @bind_texture(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [64 x [3 x i32]]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* @GL_TEXTURE_2D
%10 = load i32, i32* %3
%11 = call i32 @glBindTexture(i32 %9, i32 %10)
store i32 0, i32* %6
br label %12
12: ; preds = %88, %2
%13 = load i32, i32* %6
%14 = load i32, i32* @bind_texture.height
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %91
16: ; preds = %12
store i32 0, i32* %7
br label %17
17: ; preds = %84, %16
%18 = load i32, i32* %7
%19 = load i32, i32* @bind_texture.width
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %87
21: ; preds = %17
%22 = load i32, i32* %6
%23 = load i32, i32* @bind_texture.width
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %7
%26 = add nsw i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %28
%30 = load i32, i32* @bind_texture.height
%31 = load i32, i32* %6
%32 = sub nsw i32 %30, %31
%33 = sub nsw i32 %32, 1
%34 = load i32, i32* @bind_texture.width
%35 = mul nsw i32 %33, %34
%36 = load i32, i32* %7
%37 = add nsw i32 %35, %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [64 x i32], [64 x i32]* %29, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %70
42: ; preds = %21
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* @bind_texture.color, i64 0, i64 %44
%46 = getelementptr inbounds [3 x i32], [3 x i32]* %45, i64 0, i64 0
%47 = load i32, i32* %46
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %5, i64 0, i64 %49
%51 = getelementptr inbounds [3 x i32], [3 x i32]* %50, i64 0, i64 0
store i32 %47, i32* %51
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* @bind_texture.color, i64 0, i64 %53
%55 = getelementptr inbounds [3 x i32], [3 x i32]* %54, i64 0, i64 1
%56 = load i32, i32* %55
%57 = load i32, i32* %8
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %5, i64 0, i64 %58
%60 = getelementptr inbounds [3 x i32], [3 x i32]* %59, i64 0, i64 1
store i32 %56, i32* %60
%61 = load i32, i32* %4
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* @bind_texture.color, i64 0, i64 %62
%64 = getelementptr inbounds [3 x i32], [3 x i32]* %63, i64 0, i64 2
%65 = load i32, i32* %64
%66 = load i32, i32* %8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %5, i64 0, i64 %67
%69 = getelementptr inbounds [3 x i32], [3 x i32]* %68, i64 0, i64 2
store i32 %65, i32* %69
br label %83
70: ; preds = %21
%71 = load i32, i32* %8
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %5, i64 0, i64 %72
%74 = getelementptr inbounds [3 x i32], [3 x i32]* %73, i64 0, i64 0
store i32 255, i32* %74
%75 = load i32, i32* %8
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %5, i64 0, i64 %76
%78 = getelementptr inbounds [3 x i32], [3 x i32]* %77, i64 0, i64 1
store i32 255, i32* %78
%79 = load i32, i32* %8
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %5, i64 0, i64 %80
%82 = getelementptr inbounds [3 x i32], [3 x i32]* %81, i64 0, i64 2
store i32 255, i32* %82
br label %83
83: ; preds = %70, %42
br label %84
84: ; preds = %83
%85 = load i32, i32* %7
%86 = add nsw i32 %85, 1
store i32 %86, i32* %7
br label %17
87: ; preds = %17
br label %88
88: ; preds = %87
%89 = load i32, i32* %6
%90 = add nsw i32 %89, 1
store i32 %90, i32* %6
br label %12
91: ; preds = %12
%92 = load i32, i32* @GL_TEXTURE_2D
%93 = load i32, i32* @bind_texture.width
%94 = load i32, i32* @bind_texture.height
%95 = load i32, i32* @GL_RGB
%96 = load i32, i32* @GL_UNSIGNED_BYTE
%97 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %5, i64 0, i64 0
%98 = bitcast [3 x i32]* %97 to i32**
%99 = call i32 @glTexImage2D(i32 %92, i32 0, i32 3, i32 %93, i32 %94, i32 0, i32 %95, i32 %96, i32** %98)
%100 = load i32, i32* @GL_TEXTURE_2D
%101 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%102 = load i32, i32* @GL_NEAREST
%103 = call i32 @glTexParameteri(i32 %100, i32 %101, i32 %102)
%104 = load i32, i32* @GL_TEXTURE_2D
%105 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%106 = load i32, i32* @GL_NEAREST
%107 = call i32 @glTexParameteri(i32 %104, i32 %105, i32 %106)
%108 = load i32, i32* @GL_TEXTURE_2D
%109 = load i32, i32* @GL_TEXTURE_WRAP_S
%110 = load i32, i32* @GL_REPEAT
%111 = call i32 @glTexParameteri(i32 %108, i32 %109, i32 %110)
%112 = load i32, i32* @GL_TEXTURE_2D
%113 = load i32, i32* @GL_TEXTURE_WRAP_T
%114 = load i32, i32* @GL_REPEAT
%115 = call i32 @glTexParameteri(i32 %112, i32 %113, i32 %114)
ret void
}

LLVM IR (-O2):
@bind_texture.color = internal unnamed_addr constant [2 x [3 x i32]] [[3 x i32] [i32 255, i32 0, i32 0], [3 x i32] [i32 0, i32 255, i32 0]]
@bind_texture.texchar = internal unnamed_addr constant [2 x <{ [54 x i32], [10 x i32] }>] [<{ [54 x i32], [10 x i32] }> <{ [54 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1], [10 x i32] zeroinitializer }>, <{ [54 x i32], [10 x i32] }> <{ [54 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 2, i32 2, i32 2], [10 x i32] zeroinitializer }>]
@GL_TEXTURE_2D = global i32 0
@GL_RGB = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_NEAREST = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_TEXTURE_WRAP_S = global i32 0
@GL_REPEAT = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
define void @bind_texture(i32 %0, i32 %1) {
%3 = alloca [64 x [3 x i32]]
%4 = bitcast [64 x [3 x i32]]* %3 to i8*
%5 = load i32, i32* @GL_TEXTURE_2D
%6 = tail call i32 @glBindTexture(i32 %5, i32 %0)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* @bind_texture.color, i64 0, i64 %7, i64 0
%9 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* @bind_texture.color, i64 0, i64 %7, i64 1
%10 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* @bind_texture.color, i64 0, i64 %7, i64 2
br label %11
11: ; preds = %2, %135
%12 = phi i64 [ 0, %2 ], [ %142, %135 ]
%13 = shl nsw i64 %12, 3
%14 = mul nsw i64 %12, -8
%15 = add nsw i64 %14, 56
%16 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %7, i64 %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %11
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = load i32, i32* %10
br label %23
23: ; preds = %11, %19
%24 = phi i32 [ %20, %19 ], [ 255, %11 ]
%25 = phi i32 [ %21, %19 ], [ 255, %11 ]
%26 = phi i32 [ %22, %19 ], [ 255, %11 ]
%27 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %13, i64 0
store i32 %24, i32* %27
%28 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %13, i64 1
store i32 %25, i32* %28
%29 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %13, i64 2
store i32 %26, i32* %29
%30 = or i64 %13, 1
%31 = add nsw i64 %14, 57
%32 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %7, i64 %31
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %23
%36 = load i32, i32* %8
%37 = load i32, i32* %9
%38 = load i32, i32* %10
br label %39
39: ; preds = %35, %23
%40 = phi i32 [ %36, %35 ], [ 255, %23 ]
%41 = phi i32 [ %37, %35 ], [ 255, %23 ]
%42 = phi i32 [ %38, %35 ], [ 255, %23 ]
%43 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %30, i64 0
store i32 %40, i32* %43
%44 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %30, i64 1
store i32 %41, i32* %44
%45 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %30, i64 2
store i32 %42, i32* %45
%46 = or i64 %13, 2
%47 = add nsw i64 %14, 58
%48 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %7, i64 %47
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %55, label %51
51: ; preds = %39
%52 = load i32, i32* %8
%53 = load i32, i32* %9
%54 = load i32, i32* %10
br label %55
55: ; preds = %51, %39
%56 = phi i32 [ %52, %51 ], [ 255, %39 ]
%57 = phi i32 [ %53, %51 ], [ 255, %39 ]
%58 = phi i32 [ %54, %51 ], [ 255, %39 ]
%59 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %46, i64 0
store i32 %56, i32* %59
%60 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %46, i64 1
store i32 %57, i32* %60
%61 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %46, i64 2
store i32 %58, i32* %61
%62 = or i64 %13, 3
%63 = add nsw i64 %14, 59
%64 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %7, i64 %63
%65 = load i32, i32* %64
%66 = icmp eq i32 %65, 0
br i1 %66, label %71, label %67
67: ; preds = %55
%68 = load i32, i32* %8
%69 = load i32, i32* %9
%70 = load i32, i32* %10
br label %71
71: ; preds = %67, %55
%72 = phi i32 [ %68, %67 ], [ 255, %55 ]
%73 = phi i32 [ %69, %67 ], [ 255, %55 ]
%74 = phi i32 [ %70, %67 ], [ 255, %55 ]
%75 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %62, i64 0
store i32 %72, i32* %75
%76 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %62, i64 1
store i32 %73, i32* %76
%77 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %62, i64 2
store i32 %74, i32* %77
%78 = or i64 %13, 4
%79 = add nsw i64 %14, 60
%80 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %7, i64 %79
%81 = load i32, i32* %80
%82 = icmp eq i32 %81, 0
br i1 %82, label %87, label %83
83: ; preds = %71
%84 = load i32, i32* %8
%85 = load i32, i32* %9
%86 = load i32, i32* %10
br label %87
87: ; preds = %83, %71
%88 = phi i32 [ %84, %83 ], [ 255, %71 ]
%89 = phi i32 [ %85, %83 ], [ 255, %71 ]
%90 = phi i32 [ %86, %83 ], [ 255, %71 ]
%91 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %78, i64 0
store i32 %88, i32* %91
%92 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %78, i64 1
store i32 %89, i32* %92
%93 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %78, i64 2
store i32 %90, i32* %93
%94 = or i64 %13, 5
%95 = add nsw i64 %14, 61
%96 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %7, i64 %95
%97 = load i32, i32* %96
%98 = icmp eq i32 %97, 0
br i1 %98, label %103, label %99
99: ; preds = %87
%100 = load i32, i32* %8
%101 = load i32, i32* %9
%102 = load i32, i32* %10
br label %103
103: ; preds = %99, %87
%104 = phi i32 [ %100, %99 ], [ 255, %87 ]
%105 = phi i32 [ %101, %99 ], [ 255, %87 ]
%106 = phi i32 [ %102, %99 ], [ 255, %87 ]
%107 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %94, i64 0
store i32 %104, i32* %107
%108 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %94, i64 1
store i32 %105, i32* %108
%109 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %94, i64 2
store i32 %106, i32* %109
%110 = or i64 %13, 6
%111 = add nsw i64 %14, 62
%112 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %7, i64 %111
%113 = load i32, i32* %112
%114 = icmp eq i32 %113, 0
br i1 %114, label %119, label %115
115: ; preds = %103
%116 = load i32, i32* %8
%117 = load i32, i32* %9
%118 = load i32, i32* %10
br label %119
119: ; preds = %115, %103
%120 = phi i32 [ %116, %115 ], [ 255, %103 ]
%121 = phi i32 [ %117, %115 ], [ 255, %103 ]
%122 = phi i32 [ %118, %115 ], [ 255, %103 ]
%123 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %110, i64 0
store i32 %120, i32* %123
%124 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %110, i64 1
store i32 %121, i32* %124
%125 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %110, i64 2
store i32 %122, i32* %125
%126 = or i64 %13, 7
%127 = add nsw i64 %14, 63
%128 = getelementptr inbounds [2 x [64 x i32]], [2 x [64 x i32]]* bitcast ([2 x <{ [54 x i32], [10 x i32] }>]* @bind_texture.texchar to [2 x [64 x i32]]*), i64 0, i64 %7, i64 %127
%129 = load i32, i32* %128
%130 = icmp eq i32 %129, 0
br i1 %130, label %135, label %131
131: ; preds = %119
%132 = load i32, i32* %8
%133 = load i32, i32* %9
%134 = load i32, i32* %10
br label %135
135: ; preds = %131, %119
%136 = phi i32 [ %132, %131 ], [ 255, %119 ]
%137 = phi i32 [ %133, %131 ], [ 255, %119 ]
%138 = phi i32 [ %134, %131 ], [ 255, %119 ]
%139 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %126, i64 0
store i32 %136, i32* %139
%140 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %126, i64 1
store i32 %137, i32* %140
%141 = getelementptr inbounds [64 x [3 x i32]], [64 x [3 x i32]]* %3, i64 0, i64 %126, i64 2
store i32 %138, i32* %141
%142 = add nuw nsw i64 %12, 1
%143 = icmp eq i64 %142, 8
br i1 %143, label %144, label %11
144: ; preds = %135
%145 = load i32, i32* @GL_TEXTURE_2D
%146 = load i32, i32* @GL_RGB
%147 = load i32, i32* @GL_UNSIGNED_BYTE
%148 = bitcast [64 x [3 x i32]]* %3 to i32**
%149 = call i32 @glTexImage2D(i32 %145, i32 0, i32 3, i32 8, i32 8, i32 0, i32 %146, i32 %147, i32** %148)
%150 = load i32, i32* @GL_TEXTURE_2D
%151 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%152 = load i32, i32* @GL_NEAREST
%153 = call i32 @glTexParameteri(i32 %150, i32 %151, i32 %152)
%154 = load i32, i32* @GL_TEXTURE_2D
%155 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%156 = load i32, i32* @GL_NEAREST
%157 = call i32 @glTexParameteri(i32 %154, i32 %155, i32 %156)
%158 = load i32, i32* @GL_TEXTURE_2D
%159 = load i32, i32* @GL_TEXTURE_WRAP_S
%160 = load i32, i32* @GL_REPEAT
%161 = call i32 @glTexParameteri(i32 %158, i32 %159, i32 %160)
%162 = load i32, i32* @GL_TEXTURE_2D
%163 = load i32, i32* @GL_TEXTURE_WRAP_T
%164 = load i32, i32* @GL_REPEAT
%165 = call i32 @glTexParameteri(i32 %162, i32 %163, i32 %164)
ret void
}