#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*/ GLubyte;
typedef int GLfloat;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ GL_BACK;
int /*<<< orphan*/ GL_BLEND;
int /*<<< orphan*/ GL_COLOR_MATERIAL;
int /*<<< orphan*/ GL_CULL_FACE;
int /*<<< orphan*/ GL_CW;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_DIFFUSE;
int /*<<< orphan*/ GL_FRONT;
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ GL_LIGHT_MODEL_LOCAL_VIEWER;
int /*<<< orphan*/ GL_LINEAR;
int /*<<< orphan*/ GL_MODULATE;
int /*<<< orphan*/ GL_NORMALIZE;
int /*<<< orphan*/ GL_ONE;
int /*<<< orphan*/ GL_POSITION;
int /*<<< orphan*/ GL_REPEAT;
int /*<<< orphan*/ GL_RGBA;
int /*<<< orphan*/ GL_S;
int /*<<< orphan*/ GL_SHININESS;
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ GL_SPHERE_MAP;
int /*<<< orphan*/ GL_SRC_ALPHA;
int /*<<< orphan*/ GL_T;
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ GL_TEXTURE_ENV;
int /*<<< orphan*/ GL_TEXTURE_ENV_MODE;
int /*<<< orphan*/ GL_TEXTURE_GEN_MODE;
int /*<<< orphan*/ GL_TEXTURE_GEN_S;
int /*<<< orphan*/ GL_TEXTURE_GEN_T;
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 /*<<< orphan*/);
int /*<<< orphan*/ glBlendFunc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glColorMaterial(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glCullFace(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glFrontFace(int /*<<< orphan*/);
int glGetError();
int /*<<< orphan*/ glLightModeli(int /*<<< orphan*/, int);
int /*<<< orphan*/ glLightfv(int /*<<< orphan*/, int /*<<< orphan*/, int *);
int /*<<< orphan*/ glMaterialf(int /*<<< orphan*/, int /*<<< orphan*/, double);
int /*<<< orphan*/ glPixelStorei(int /*<<< orphan*/, int);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
int /*<<< orphan*/ glTexEnvf(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ glTexGeni(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ glTexImage2D(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                int, int, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
int /*<<< orphan*/ glTexParameteri(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ read_texture(char *, int *, int *, int *);
void init(char *fname) {
  int width, height, components;
  GLubyte *image;
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glEnable(GL_DEPTH_TEST);
  glShadeModel(GL_SMOOTH);
  if (!(image = (GLubyte *)read_texture(fname, &width, &height, &components))) {
    perror(fname);
    exit(EXIT_FAILURE);
  }
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  glTexImage2D(GL_TEXTURE_2D, 0, 4, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE,
               image);
  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
  glEnable(GL_TEXTURE_GEN_S);
  glEnable(GL_TEXTURE_GEN_T);
  glEnable(GL_TEXTURE_2D);
  glEnable(GL_CULL_FACE);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glEnable(GL_NORMALIZE);
  glFrontFace(GL_CW);
  glCullFace(GL_BACK);
  glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
  glEnable(GL_COLOR_MATERIAL);
  glMaterialf(GL_FRONT, GL_SHININESS, 64.0);
  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
  {
    GLfloat pos[4] = {0, 0, 1, 1};
    glLightfv(GL_LIGHT0, GL_POSITION, pos);
  }
  {
    int e;
    if (e = glGetError())
      printf("error %x\n", e);
  }
  glBlendFunc(GL_SRC_ALPHA, GL_ONE);
  glEnable(GL_BLEND);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   20d0 <glClearColor@plt>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2c66(%rip),%rax
mov    (%rax),%edi
call   2140 <glShadeModel@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   20f0 <read_texture@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    22b3 <init+0x73>
mov    -0x8(%rbp),%rdi
call   2120 <perror@plt>
mov    0x2c5c(%rip),%rax
mov    (%rax),%edi
call   2150 <exit@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   20b0 <glPixelStorei@plt>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edi
mov    0x2c92(%rip),%rax
mov    (%rax),%esi
mov    0x2c21(%rip),%rax
mov    (%rax),%edx
call   2070 <glTexParameteri@plt>
mov    0x2c5b(%rip),%rax
mov    (%rax),%edi
mov    0x2bba(%rip),%rax
mov    (%rax),%esi
mov    0x2c01(%rip),%rax
mov    (%rax),%edx
call   2070 <glTexParameteri@plt>
mov    0x2c3b(%rip),%rax
mov    (%rax),%edi
mov    0x2bb2(%rip),%rax
mov    (%rax),%esi
mov    0x2c79(%rip),%rax
mov    (%rax),%edx
call   2070 <glTexParameteri@plt>
mov    0x2c1b(%rip),%rax
mov    (%rax),%edi
mov    0x2c8a(%rip),%rax
mov    (%rax),%esi
mov    0x2c59(%rip),%rax
mov    (%rax),%edx
call   2070 <glTexParameteri@plt>
mov    0x2bfb(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    0x2c8b(%rip),%rax
mov    (%rax),%r11d
mov    0x2b81(%rip),%rax
mov    (%rax),%r10d
mov    -0x20(%rbp),%rax
xor    %r9d,%r9d
mov    $0x4,%edx
mov    %r9d,%esi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   2090 <glTexImage2D@plt>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
mov    0x2bd4(%rip),%rax
mov    (%rax),%esi
mov    0x2bbb(%rip),%rax
mov    (%rax),%edx
call   20c0 <glTexEnvf@plt>
mov    0x2c1d(%rip),%rax
mov    (%rax),%edi
mov    0x2c3c(%rip),%rax
mov    (%rax),%esi
mov    0x2be3(%rip),%rax
mov    (%rax),%edx
call   2100 <glTexGeni@plt>
mov    0x2b6d(%rip),%rax
mov    (%rax),%edi
mov    0x2c1c(%rip),%rax
mov    (%rax),%esi
mov    0x2bc3(%rip),%rax
mov    (%rax),%edx
call   2100 <glTexGeni@plt>
mov    0x2b45(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2bc7(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2b39(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2ad3(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2ae5(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2b47(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2ae1(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2a63(%rip),%rax
mov    (%rax),%edi
call   2110 <glFrontFace@plt>
mov    0x2ab5(%rip),%rax
mov    (%rax),%edi
call   2160 <glCullFace@plt>
mov    0x2b2f(%rip),%rax
mov    (%rax),%edi
mov    0x2a66(%rip),%rax
mov    (%rax),%esi
call   2050 <glColorMaterial@plt>
mov    0x2af0(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2b22(%rip),%rax
mov    (%rax),%edi
mov    0x2b41(%rip),%rax
mov    (%rax),%esi
movsd  0xb57(%rip),%xmm0
call   2060 <glMaterialf@plt>
mov    0x2a6b(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   2130 <glLightModeli@plt>
mov    0xb48(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xb45(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2aa2(%rip),%rax
mov    (%rax),%edi
mov    0x2a49(%rip),%rax
mov    (%rax),%esi
lea    -0x30(%rbp),%rdx
call   2030 <glLightfv@plt>
mov    $0x0,%al
call   20e0 <glGetError@plt>
mov    %eax,-0x34(%rbp)
cmp    $0x0,%eax
je     2514 <init+0x2d4>
mov    -0x34(%rbp),%esi
lea    0xb11(%rip),%rdi
call   2080 <printf@plt>
mov    0x29dd(%rip),%rax
mov    (%rax),%edi
mov    0x2a2c(%rip),%rax
mov    (%rax),%esi
call   2040 <glBlendFunc@plt>
mov    0x2a7e(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   20d0 <glClearColor@plt>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2c66(%rip),%rax
mov    (%rax),%edi
call   2140 <glShadeModel@plt>
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
call   20f0 <read_texture@plt>
test   %rax,%rax
je     24d5 <init+0x295>
mov    %rax,%r14
mov    0x2ced(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   20b0 <glPixelStorei@plt>
mov    0x2c92(%rip),%r15
mov    (%r15),%edi
mov    0x2ca8(%rip),%rax
mov    (%rax),%esi
mov    0x2c37(%rip),%rbx
mov    (%rbx),%edx
call   2070 <glTexParameteri@plt>
mov    (%r15),%edi
mov    0x2bd6(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
call   2070 <glTexParameteri@plt>
mov    (%r15),%edi
mov    0x2bdb(%rip),%rax
mov    (%rax),%esi
mov    0x2ca2(%rip),%rbx
mov    (%rbx),%edx
call   2070 <glTexParameteri@plt>
mov    (%r15),%edi
mov    0x2cb9(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
call   2070 <glTexParameteri@plt>
mov    (%r15),%edi
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
mov    0x2cc5(%rip),%rax
mov    (%rax),%eax
mov    0x2bbc(%rip),%rdx
mov    (%rdx),%ebx
sub    $0x8,%rsp
xor    %esi,%esi
mov    $0x4,%edx
xor    %r9d,%r9d
push   %r14
push   %rbx
push   %rax
call   2090 <glTexImage2D@plt>
add    $0x20,%rsp
mov    0x2c38(%rip),%rax
mov    (%rax),%edi
mov    0x2c17(%rip),%rax
mov    (%rax),%esi
mov    0x2bfe(%rip),%rax
mov    (%rax),%edx
call   20c0 <glTexEnvf@plt>
mov    0x2c60(%rip),%rax
mov    (%rax),%edi
mov    0x2c7f(%rip),%r14
mov    (%r14),%esi
mov    0x2c25(%rip),%rbx
mov    (%rbx),%edx
call   2100 <glTexGeni@plt>
mov    0x2baf(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%esi
mov    (%rbx),%edx
call   2100 <glTexGeni@plt>
mov    0x2b94(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    (%r15),%edi
call   20a0 <glEnable@plt>
mov    0x2b28(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2b3a(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2b9c(%rip),%rbx
mov    (%rbx),%edi
call   20a0 <glEnable@plt>
mov    0x2b36(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2ab8(%rip),%rax
mov    (%rax),%edi
call   2110 <glFrontFace@plt>
mov    0x2b0a(%rip),%rax
mov    (%rax),%edi
call   2160 <glCullFace@plt>
mov    0x2b84(%rip),%rax
mov    (%rax),%edi
mov    0x2abb(%rip),%rax
mov    (%rax),%esi
call   2050 <glColorMaterial@plt>
mov    0x2b45(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
mov    0x2b77(%rip),%rax
mov    (%rax),%edi
mov    0x2b96(%rip),%rax
mov    (%rax),%esi
movsd  0xbac(%rip),%xmm0
call   2060 <glMaterialf@plt>
mov    0x2ac0(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   2130 <glLightModeli@plt>
movaps 0xb9d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    (%rbx),%edi
mov    0x2aaf(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdx
call   2030 <glLightfv@plt>
xor    %eax,%eax
call   20e0 <glGetError@plt>
test   %eax,%eax
je     24a6 <init+0x266>
lea    0xb81(%rip),%rdi
mov    %eax,%esi
call   2080 <printf@plt>
mov    0x2a4b(%rip),%rax
mov    (%rax),%edi
mov    0x2a9a(%rip),%rax
mov    (%rax),%esi
call   2040 <glBlendFunc@plt>
mov    0x2aec(%rip),%rax
mov    (%rax),%edi
call   20a0 <glEnable@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
call   2120 <perror@plt>
mov    0x2a24(%rip),%rax
mov    (%rax),%edi
call   2150 <exit@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_SMOOTH = global i32 0
@EXIT_FAILURE = global i32 0
@GL_UNPACK_ALIGNMENT = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_WRAP_S = global i32 0
@GL_REPEAT = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_LINEAR = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_RGBA = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_MODULATE = global i32 0
@GL_S = global i32 0
@GL_TEXTURE_GEN_MODE = global i32 0
@GL_SPHERE_MAP = global i32 0
@GL_T = global i32 0
@GL_TEXTURE_GEN_S = global i32 0
@GL_TEXTURE_GEN_T = global i32 0
@GL_CULL_FACE = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_NORMALIZE = global i32 0
@GL_CW = global i32 0
@GL_BACK = global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_DIFFUSE = global i32 0
@GL_COLOR_MATERIAL = global i32 0
@GL_FRONT = global i32 0
@GL_SHININESS = global i32 0
@GL_LIGHT_MODEL_LOCAL_VIEWER = global i32 0
@__const.init.pos = [4 x i32] [i32 0, i32 0, i32 1, i32 1]
@GL_POSITION = global i32 0
@.str = [10 x i8] c"error %x\0A\00"
@GL_SRC_ALPHA = global i32 0
@GL_ONE = global i32 0
@GL_BLEND = global i32 0
define void @init(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [4 x i32]
%8 = alloca i32
store i8* %0, i8** %2
%9 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%10 = load i32, i32* @GL_DEPTH_TEST
%11 = call i32 @glEnable(i32 %10)
%12 = load i32, i32* @GL_SMOOTH
%13 = call i32 @glShadeModel(i32 %12)
%14 = load i8*, i8** %2
%15 = call i64 @read_texture(i8* %14, i32* %3, i32* %4, i32* %5)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %6
%17 = icmp ne i32* %16, null
br i1 %17, label %23, label %18
18: ; preds = %1
%19 = load i8*, i8** %2
%20 = call i32 @perror(i8* %19)
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %1
%24 = load i32, i32* @GL_UNPACK_ALIGNMENT
%25 = call i32 @glPixelStorei(i32 %24, i32 1)
%26 = load i32, i32* @GL_TEXTURE_2D
%27 = load i32, i32* @GL_TEXTURE_WRAP_S
%28 = load i32, i32* @GL_REPEAT
%29 = call i32 @glTexParameteri(i32 %26, i32 %27, i32 %28)
%30 = load i32, i32* @GL_TEXTURE_2D
%31 = load i32, i32* @GL_TEXTURE_WRAP_T
%32 = load i32, i32* @GL_REPEAT
%33 = call i32 @glTexParameteri(i32 %30, i32 %31, i32 %32)
%34 = load i32, i32* @GL_TEXTURE_2D
%35 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%36 = load i32, i32* @GL_LINEAR
%37 = call i32 @glTexParameteri(i32 %34, i32 %35, i32 %36)
%38 = load i32, i32* @GL_TEXTURE_2D
%39 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%40 = load i32, i32* @GL_LINEAR
%41 = call i32 @glTexParameteri(i32 %38, i32 %39, i32 %40)
%42 = load i32, i32* @GL_TEXTURE_2D
%43 = load i32, i32* %3
%44 = load i32, i32* %4
%45 = load i32, i32* @GL_RGBA
%46 = load i32, i32* @GL_UNSIGNED_BYTE
%47 = load i32*, i32** %6
%48 = call i32 @glTexImage2D(i32 %42, i32 0, i32 4, i32 %43, i32 %44, i32 0, i32 %45, i32 %46, i32* %47)
%49 = load i32, i32* @GL_TEXTURE_ENV
%50 = load i32, i32* @GL_TEXTURE_ENV_MODE
%51 = load i32, i32* @GL_MODULATE
%52 = call i32 @glTexEnvf(i32 %49, i32 %50, i32 %51)
%53 = load i32, i32* @GL_S
%54 = load i32, i32* @GL_TEXTURE_GEN_MODE
%55 = load i32, i32* @GL_SPHERE_MAP
%56 = call i32 @glTexGeni(i32 %53, i32 %54, i32 %55)
%57 = load i32, i32* @GL_T
%58 = load i32, i32* @GL_TEXTURE_GEN_MODE
%59 = load i32, i32* @GL_SPHERE_MAP
%60 = call i32 @glTexGeni(i32 %57, i32 %58, i32 %59)
%61 = load i32, i32* @GL_TEXTURE_GEN_S
%62 = call i32 @glEnable(i32 %61)
%63 = load i32, i32* @GL_TEXTURE_GEN_T
%64 = call i32 @glEnable(i32 %63)
%65 = load i32, i32* @GL_TEXTURE_2D
%66 = call i32 @glEnable(i32 %65)
%67 = load i32, i32* @GL_CULL_FACE
%68 = call i32 @glEnable(i32 %67)
%69 = load i32, i32* @GL_LIGHTING
%70 = call i32 @glEnable(i32 %69)
%71 = load i32, i32* @GL_LIGHT0
%72 = call i32 @glEnable(i32 %71)
%73 = load i32, i32* @GL_NORMALIZE
%74 = call i32 @glEnable(i32 %73)
%75 = load i32, i32* @GL_CW
%76 = call i32 @glFrontFace(i32 %75)
%77 = load i32, i32* @GL_BACK
%78 = call i32 @glCullFace(i32 %77)
%79 = load i32, i32* @GL_FRONT_AND_BACK
%80 = load i32, i32* @GL_DIFFUSE
%81 = call i32 @glColorMaterial(i32 %79, i32 %80)
%82 = load i32, i32* @GL_COLOR_MATERIAL
%83 = call i32 @glEnable(i32 %82)
%84 = load i32, i32* @GL_FRONT
%85 = load i32, i32* @GL_SHININESS
%86 = call i32 @glMaterialf(i32 %84, i32 %85, double 6.400000e+01)
%87 = load i32, i32* @GL_LIGHT_MODEL_LOCAL_VIEWER
%88 = call i32 @glLightModeli(i32 %87, i32 1)
%89 = bitcast [4 x i32]* %7 to i8*
%90 = load i32, i32* @GL_LIGHT0
%91 = load i32, i32* @GL_POSITION
%92 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%93 = call i32 @glLightfv(i32 %90, i32 %91, i32* %92)
%94 = call i32 (...) @glGetError()
store i32 %94, i32* %8
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %99
96: ; preds = %23
%97 = load i32, i32* %8
%98 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %97)
br label %99
99: ; preds = %96, %23
%100 = load i32, i32* @GL_SRC_ALPHA
%101 = load i32, i32* @GL_ONE
%102 = call i32 @glBlendFunc(i32 %100, i32 %101)
%103 = load i32, i32* @GL_BLEND
%104 = call i32 @glEnable(i32 %103)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_SMOOTH = global i32 0
@EXIT_FAILURE = global i32 0
@GL_UNPACK_ALIGNMENT = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_WRAP_S = global i32 0
@GL_REPEAT = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
@GL_TEXTURE_MAG_FILTER = global i32 0
@GL_LINEAR = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_RGBA = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_MODULATE = global i32 0
@GL_S = global i32 0
@GL_TEXTURE_GEN_MODE = global i32 0
@GL_SPHERE_MAP = global i32 0
@GL_T = global i32 0
@GL_TEXTURE_GEN_S = global i32 0
@GL_TEXTURE_GEN_T = global i32 0
@GL_CULL_FACE = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
@GL_NORMALIZE = global i32 0
@GL_CW = global i32 0
@GL_BACK = global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_DIFFUSE = global i32 0
@GL_COLOR_MATERIAL = global i32 0
@GL_FRONT = global i32 0
@GL_SHININESS = global i32 0
@GL_LIGHT_MODEL_LOCAL_VIEWER = global i32 0
@__const.init.pos = [4 x i32] [i32 0, i32 0, i32 1, i32 1]
@GL_POSITION = global i32 0
@.str = [10 x i8] c"error %x\0A\00"
@GL_SRC_ALPHA = global i32 0
@GL_ONE = global i32 0
@GL_BLEND = global i32 0
define void @init(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i32]
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%10 = load i32, i32* @GL_DEPTH_TEST
%11 = tail call i32 @glEnable(i32 %10)
%12 = load i32, i32* @GL_SMOOTH
%13 = tail call i32 @glShadeModel(i32 %12)
%14 = call i64 @read_texture(i8* %0, i32* %2, i32* %3, i32* %4)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %1
%17 = call i32 @perror(i8* %0)
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %1
%21 = inttoptr i64 %14 to i32*
%22 = load i32, i32* @GL_UNPACK_ALIGNMENT
%23 = call i32 @glPixelStorei(i32 %22, i32 1)
%24 = load i32, i32* @GL_TEXTURE_2D
%25 = load i32, i32* @GL_TEXTURE_WRAP_S
%26 = load i32, i32* @GL_REPEAT
%27 = call i32 @glTexParameteri(i32 %24, i32 %25, i32 %26)
%28 = load i32, i32* @GL_TEXTURE_2D
%29 = load i32, i32* @GL_TEXTURE_WRAP_T
%30 = load i32, i32* @GL_REPEAT
%31 = call i32 @glTexParameteri(i32 %28, i32 %29, i32 %30)
%32 = load i32, i32* @GL_TEXTURE_2D
%33 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%34 = load i32, i32* @GL_LINEAR
%35 = call i32 @glTexParameteri(i32 %32, i32 %33, i32 %34)
%36 = load i32, i32* @GL_TEXTURE_2D
%37 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%38 = load i32, i32* @GL_LINEAR
%39 = call i32 @glTexParameteri(i32 %36, i32 %37, i32 %38)
%40 = load i32, i32* @GL_TEXTURE_2D
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = load i32, i32* @GL_RGBA
%44 = load i32, i32* @GL_UNSIGNED_BYTE
%45 = call i32 @glTexImage2D(i32 %40, i32 0, i32 4, i32 %41, i32 %42, i32 0, i32 %43, i32 %44, i32* %21)
%46 = load i32, i32* @GL_TEXTURE_ENV
%47 = load i32, i32* @GL_TEXTURE_ENV_MODE
%48 = load i32, i32* @GL_MODULATE
%49 = call i32 @glTexEnvf(i32 %46, i32 %47, i32 %48)
%50 = load i32, i32* @GL_S
%51 = load i32, i32* @GL_TEXTURE_GEN_MODE
%52 = load i32, i32* @GL_SPHERE_MAP
%53 = call i32 @glTexGeni(i32 %50, i32 %51, i32 %52)
%54 = load i32, i32* @GL_T
%55 = load i32, i32* @GL_TEXTURE_GEN_MODE
%56 = load i32, i32* @GL_SPHERE_MAP
%57 = call i32 @glTexGeni(i32 %54, i32 %55, i32 %56)
%58 = load i32, i32* @GL_TEXTURE_GEN_S
%59 = call i32 @glEnable(i32 %58)
%60 = load i32, i32* @GL_TEXTURE_GEN_T
%61 = call i32 @glEnable(i32 %60)
%62 = load i32, i32* @GL_TEXTURE_2D
%63 = call i32 @glEnable(i32 %62)
%64 = load i32, i32* @GL_CULL_FACE
%65 = call i32 @glEnable(i32 %64)
%66 = load i32, i32* @GL_LIGHTING
%67 = call i32 @glEnable(i32 %66)
%68 = load i32, i32* @GL_LIGHT0
%69 = call i32 @glEnable(i32 %68)
%70 = load i32, i32* @GL_NORMALIZE
%71 = call i32 @glEnable(i32 %70)
%72 = load i32, i32* @GL_CW
%73 = call i32 @glFrontFace(i32 %72)
%74 = load i32, i32* @GL_BACK
%75 = call i32 @glCullFace(i32 %74)
%76 = load i32, i32* @GL_FRONT_AND_BACK
%77 = load i32, i32* @GL_DIFFUSE
%78 = call i32 @glColorMaterial(i32 %76, i32 %77)
%79 = load i32, i32* @GL_COLOR_MATERIAL
%80 = call i32 @glEnable(i32 %79)
%81 = load i32, i32* @GL_FRONT
%82 = load i32, i32* @GL_SHININESS
%83 = call i32 @glMaterialf(i32 %81, i32 %82, double 6.400000e+01)
%84 = load i32, i32* @GL_LIGHT_MODEL_LOCAL_VIEWER
%85 = call i32 @glLightModeli(i32 %84, i32 1)
%86 = bitcast [4 x i32]* %5 to i8*
%87 = load i32, i32* @GL_LIGHT0
%88 = load i32, i32* @GL_POSITION
%89 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%90 = call i32 @glLightfv(i32 %87, i32 %88, i32* %89)
%91 = call i32 (...) @glGetError()
%92 = icmp eq i32 %91, 0
br i1 %92, label %95, label %93
93: ; preds = %20
%94 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %91)
br label %95
95: ; preds = %93, %20
%96 = load i32, i32* @GL_SRC_ALPHA
%97 = load i32, i32* @GL_ONE
%98 = call i32 @glBlendFunc(i32 %96, i32 %97)
%99 = load i32, i32* @GL_BLEND
%100 = call i32 @glEnable(i32 %99)
ret void
}