#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 double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ GL_EXP2;
int /*<<< orphan*/ GL_FOG;
int /*<<< orphan*/ GL_FOG_COLOR;
int /*<<< orphan*/ GL_FOG_DENSITY;
int /*<<< orphan*/ GL_FOG_MODE;
int /*<<< orphan*/ GL_LINEAR;
int /*<<< orphan*/ GL_LINE_SMOOTH;
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_MODULATE;
int /*<<< orphan*/ GL_NICEST;
int /*<<< orphan*/ GL_ONE_MINUS_SRC_ALPHA;
int /*<<< orphan*/ GL_POINT_SMOOTH;
int /*<<< orphan*/ GL_POINT_SMOOTH_HINT;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ GL_REPEAT;
int /*<<< orphan*/ GL_RGBA;
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 /*<<< orphan*/);
scalar_t__ exp(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ glBlendFunc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(double, double, double, float);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glFogf(int /*<<< orphan*/, double);
int /*<<< orphan*/ glFogfv(int /*<<< orphan*/, double *);
int /*<<< orphan*/ glFogi(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glHint(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glLineWidth(float);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glPixelStorei(int /*<<< orphan*/, int);
int /*<<< orphan*/ glPointSize(float);
int /*<<< orphan*/ glTexEnvf(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ glTexImage2D(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                int, int, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                unsigned int *);
int /*<<< orphan*/ glTexParameteri(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ glTranslatef(int, int, double);
int /*<<< orphan*/ gluPerspective(int, int, double, double);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
unsigned int *read_texture(char *, int *, int *, int *);
int /*<<< orphan*/ stderr;
void init(char *filename) {
  GLfloat fog_color[4], fog_density = 0.05, density, far_cull;
  unsigned *image;
  int width, height, components;
  if (filename) {
    image = read_texture(filename, &width, &height, &components);
    if (image == NULL) {
      fprintf(stderr, "Error: Can't load image file \"%s\".\n", filename);
      exit(EXIT_FAILURE);
    } else {
      printf("%d x %d image loaded\n", width, height);
    }
    if (components != 1 && components != 2) {
      printf("must be a l or la image\n");
      exit(EXIT_FAILURE);
    }
    if (components == 1) {
      int i;
      GLubyte *p = (GLubyte *)image;
      for (i = 0; i < width * height; i++) {
        p[i * 4 + 3] = p[i * 4 + 0];
      }
      components = 2;
    }
  } else {
    int i, j;
    unsigned char *img;
    components = 4;
    width = height = 512;
    image = (unsigned *)malloc(width * height * sizeof(unsigned));
    img = (unsigned char *)image;
    for (j = 0; j < height; j++)
      for (i = 0; i < width; i++) {
        int w2 = width / 2, h2 = height / 2;
        if (i & 32)
          img[4 * (i + j * width) + 0] = 0xff;
        else
          img[4 * (i + j * width) + 1] = 0xff;
        if (j & 32)
          img[4 * (i + j * width) + 2] = 0xff;
        if ((i - w2) * (i - w2) + (j - h2) * (j - h2) > 64 * 64 &&
            (i - w2) * (i - w2) + (j - h2) * (j - h2) < 300 * 300)
          img[4 * (i + j * width) + 3] = 0xff;
      }
  }
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
  glTexImage2D(GL_TEXTURE_2D, 0, components, width, height, 0, GL_RGBA,
               GL_UNSIGNED_BYTE, image);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(50., 1., .1, far_cull = 10.);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  glTranslatef(0., 0., -5.5);
  density =
      1. -
      ((float)exp((-5.5 * fog_density * fog_density * far_cull * far_cull)));
  density = ((((density) < (1.) ? (density) : (1.))) > (0.)
                 ? (((density) < (1.) ? (density) : (1.)))
                 : (0.));
  fog_color[0] = .23 * .2 + density * .57 * .2;
  fog_color[1] = .35 * .2 + density * .45 * .2;
  fog_color[2] = .78 * .5 + density * .22 * .2;
  glClearColor(fog_color[0], fog_color[1], fog_color[2], 1.f);
  glFogi(GL_FOG_MODE, GL_EXP2);
  glFogf(GL_FOG_DENSITY, fog_density);
  glFogfv(GL_FOG_COLOR, fog_color);
  if (fog_density > 0)
    glEnable(GL_FOG);
  glLineWidth(2.0f);
  glEnable(GL_LINE_SMOOTH);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  glPointSize(10.f);
  glEnable(GL_POINT_SMOOTH);
  glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xd79(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     2391 <init+0x121>
mov    -0x8(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
lea    -0x5c(%rbp),%rcx
call   2140 <read_texture@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    22e2 <init+0x72>
mov    0x2c96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xd9d(%rip),%rsi
call   2100 <fprintf@plt>
mov    0x2c5d(%rip),%rax
mov    (%rax),%edi
call   2190 <exit@plt>
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   2090 <printf@plt>
cmpl   $0x1,-0x5c(%rbp)
je     2326 <init+0xb6>
cmpl   $0x2,-0x5c(%rbp)
je     2326 <init+0xb6>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   2090 <printf@plt>
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
call   2190 <exit@plt>
cmpl   $0x1,-0x5c(%rbp)
jne    238c <init+0x11c>
mov    -0x50(%rbp),%rax
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
mov    -0x54(%rbp),%ecx
imul   -0x58(%rbp),%ecx
cmp    %ecx,%eax
jge    2385 <init+0x115>
mov    -0x68(%rbp),%rax
mov    -0x60(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x68(%rbp),%rax
mov    -0x60(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    233f <init+0xcf>
movl   $0x2,-0x5c(%rbp)
jmp    2520 <init+0x2b0>
movl   $0x4,-0x5c(%rbp)
movl   $0x200,-0x58(%rbp)
movl   $0x200,-0x54(%rbp)
mov    -0x54(%rbp),%eax
imul   -0x58(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   2120 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x58(%rbp),%eax
jge    251b <init+0x2ab>
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    2508 <init+0x298>
mov    -0x54(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x7c(%rbp)
mov    -0x58(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x80(%rbp)
mov    -0x6c(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     2439 <init+0x1c9>
mov    -0x78(%rbp),%rax
mov    -0x6c(%rbp),%ecx
mov    -0x70(%rbp),%edx
imul   -0x54(%rbp),%edx
add    %edx,%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movb   $0xff,(%rax,%rcx,1)
jmp    2456 <init+0x1e6>
mov    -0x78(%rbp),%rax
mov    -0x6c(%rbp),%ecx
mov    -0x70(%rbp),%edx
imul   -0x54(%rbp),%edx
add    %edx,%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0xff,(%rax,%rcx,1)
mov    -0x70(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     2482 <init+0x212>
mov    -0x78(%rbp),%rax
mov    -0x6c(%rbp),%ecx
mov    -0x70(%rbp),%edx
imul   -0x54(%rbp),%edx
add    %edx,%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movb   $0xff,(%rax,%rcx,1)
mov    -0x6c(%rbp),%eax
sub    -0x7c(%rbp),%eax
mov    -0x6c(%rbp),%ecx
sub    -0x7c(%rbp),%ecx
imul   %ecx,%eax
mov    -0x70(%rbp),%ecx
sub    -0x80(%rbp),%ecx
mov    -0x70(%rbp),%edx
sub    -0x80(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
cmp    $0x1000,%eax
jle    24f5 <init+0x285>
mov    -0x6c(%rbp),%eax
sub    -0x7c(%rbp),%eax
mov    -0x6c(%rbp),%ecx
sub    -0x7c(%rbp),%ecx
imul   %ecx,%eax
mov    -0x70(%rbp),%ecx
sub    -0x80(%rbp),%ecx
mov    -0x70(%rbp),%edx
sub    -0x80(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
cmp    $0x15f90,%eax
jge    24f5 <init+0x285>
mov    -0x78(%rbp),%rax
mov    -0x6c(%rbp),%ecx
mov    -0x70(%rbp),%edx
imul   -0x54(%rbp),%edx
add    %edx,%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movb   $0xff,(%rax,%rcx,1)
jmp    24fa <init+0x28a>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    23e0 <init+0x170>
jmp    250d <init+0x29d>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    23cd <init+0x15d>
jmp    2520 <init+0x2b0>
mov    0x2a99(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   20c0 <glPixelStorei@plt>
mov    0x2a6e(%rip),%rax
mov    (%rax),%edi
mov    0x2a55(%rip),%rax
mov    (%rax),%esi
mov    0x2a34(%rip),%rax
mov    (%rax),%edx
call   20e0 <glTexEnvf@plt>
mov    0x2a0e(%rip),%rax
mov    (%rax),%edi
mov    0x2a7d(%rip),%rax
mov    (%rax),%esi
mov    0x2a5c(%rip),%rax
mov    (%rax),%edx
call   2080 <glTexParameteri@plt>
mov    0x29ee(%rip),%rax
mov    (%rax),%edi
mov    0x298d(%rip),%rax
mov    (%rax),%esi
mov    0x2a3c(%rip),%rax
mov    (%rax),%edx
call   2080 <glTexParameteri@plt>
mov    0x29ce(%rip),%rax
mov    (%rax),%edi
mov    0x29e5(%rip),%rax
mov    (%rax),%esi
mov    0x2984(%rip),%rax
mov    (%rax),%edx
call   2080 <glTexParameteri@plt>
mov    0x29ae(%rip),%rax
mov    (%rax),%edi
mov    0x293d(%rip),%rax
mov    (%rax),%esi
mov    0x2964(%rip),%rax
mov    (%rax),%edx
call   2080 <glTexParameteri@plt>
mov    0x298e(%rip),%rax
mov    (%rax),%edi
mov    -0x5c(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    -0x58(%rbp),%r8d
mov    0x2a03(%rip),%rax
mov    (%rax),%r11d
mov    0x2921(%rip),%rax
mov    (%rax),%r10d
mov    -0x50(%rbp),%rax
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   20a0 <glTexImage2D@plt>
mov    0x2922(%rip),%rax
mov    (%rax),%edi
call   2070 <glMatrixMode@plt>
mov    $0x0,%al
call   2110 <glLoadIdentity@plt>
movsd  0x9ec(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x32,%edi
mov    $0x1,%esi
movsd  0x9cd(%rip),%xmm0
movsd  0x9cd(%rip),%xmm1
call   20d0 <gluPerspective@plt>
mov    0x2931(%rip),%rax
mov    (%rax),%edi
call   2070 <glMatrixMode@plt>
mov    $0x0,%al
call   2110 <glLoadIdentity@plt>
xor    %esi,%esi
movsd  0x999(%rip),%xmm0
mov    %esi,%edi
call   2180 <glTranslatef@plt>
movsd  0x98a(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   2130 <exp@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x958(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0x947(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    26de <init+0x46e>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    26f3 <init+0x483>
movsd  0x922(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    26f3 <init+0x483>
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    2757 <init+0x4e7>
movsd  0x8f8(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    272d <init+0x4bd>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    2742 <init+0x4d2>
movsd  0x8d3(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    2742 <init+0x4d2>
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
jmp    2767 <init+0x4f7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    2767 <init+0x4f7>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  0x8dc(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0x89f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x8bb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0x8a2(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0x875(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x881(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0x868(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0x84b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x847(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movss  0x857(%rip),%xmm3
call   20f0 <glClearColor@plt>
mov    0x274b(%rip),%rax
mov    (%rax),%edi
mov    0x2792(%rip),%rax
mov    (%rax),%esi
call   2160 <glFogi@plt>
mov    0x274c(%rip),%rax
mov    (%rax),%edi
movsd  -0x38(%rbp),%xmm0
call   2060 <glFogf@plt>
mov    0x2761(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
call   2030 <glFogfv@plt>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    286a <init+0x5fa>
mov    0x26ed(%rip),%rax
mov    (%rax),%edi
call   20b0 <glEnable@plt>
movss  0x7f6(%rip),%xmm0
call   2040 <glLineWidth@plt>
mov    0x26a2(%rip),%rax
mov    (%rax),%edi
call   20b0 <glEnable@plt>
mov    0x269c(%rip),%rax
mov    (%rax),%edi
mov    0x2743(%rip),%rax
mov    (%rax),%esi
call   2050 <glBlendFunc@plt>
movss  0x7c0(%rip),%xmm0
call   2170 <glPointSize@plt>
mov    0x2708(%rip),%rax
mov    (%rax),%edi
call   20b0 <glEnable@plt>
mov    0x2712(%rip),%rax
mov    (%rax),%edi
mov    0x2681(%rip),%rax
mov    (%rax),%esi
call   2150 <glHint@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
test   %rdi,%rdi
je     2597 <init+0x317>
mov    %rdi,%r14
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   2150 <read_texture@plt>
test   %rax,%rax
je     267f <init+0x3ff>
mov    %rax,%r15
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xdec(%rip),%rdi
xor    %eax,%eax
call   20a0 <printf@plt>
mov    0xc(%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0xfffffffd,%ecx
jbe    2699 <init+0x419>
cmp    $0x1,%eax
jne    2328 <init+0xa8>
mov    0x8(%rsp),%eax
imul   0x4(%rsp),%eax
test   %eax,%eax
jle    2320 <init+0xa0>
xor    %eax,%eax
mov    %r15,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rcx),%edx
mov    %edx,0xc(%rcx)
add    $0x1,%rax
movslq 0x4(%rsp),%rdx
movslq 0x8(%rsp),%rsi
imul   %rdx,%rsi
add    $0x10,%rcx
cmp    %rsi,%rax
jl     2300 <init+0x80>
movl   $0x2,0xc(%rsp)
mov    0x2c91(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   20d0 <glPixelStorei@plt>
mov    0x2c66(%rip),%rax
mov    (%rax),%edi
mov    0x2c4d(%rip),%rax
mov    (%rax),%esi
mov    0x2c2c(%rip),%rax
mov    (%rax),%edx
call   20f0 <glTexEnvf@plt>
mov    0x2c06(%rip),%rbx
mov    (%rbx),%edi
mov    0x2c75(%rip),%rax
mov    (%rax),%esi
mov    0x2c54(%rip),%r14
mov    (%r14),%edx
call   2090 <glTexParameteri@plt>
mov    (%rbx),%edi
mov    0x2b8b(%rip),%rax
mov    (%rax),%esi
mov    (%r14),%edx
call   2090 <glTexParameteri@plt>
mov    (%rbx),%edi
mov    0x2bf0(%rip),%rax
mov    (%rax),%esi
mov    0x2b8f(%rip),%r14
mov    (%r14),%edx
call   2090 <glTexParameteri@plt>
mov    (%rbx),%edi
mov    0x2b4e(%rip),%rax
mov    (%rax),%esi
mov    (%r14),%edx
call   2090 <glTexParameteri@plt>
mov    (%rbx),%edi
mov    0xc(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0x2c1e(%rip),%rax
mov    (%rax),%eax
mov    0x2b3d(%rip),%rsi
mov    (%rsi),%ebx
sub    $0x8,%rsp
xor    %esi,%esi
xor    %r9d,%r9d
push   %r15
push   %rbx
push   %rax
call   20b0 <glTexImage2D@plt>
add    $0x20,%rsp
mov    0x2b46(%rip),%rax
mov    (%rax),%edi
call   2080 <glMatrixMode@plt>
xor    %eax,%eax
call   2120 <glLoadIdentity@plt>
movsd  0xbf0(%rip),%xmm0
movsd  0xbf0(%rip),%xmm1
mov    $0x32,%edi
mov    $0x1,%esi
call   20e0 <gluPerspective@plt>
mov    0x2b62(%rip),%rax
mov    (%rax),%edi
call   2080 <glMatrixMode@plt>
xor    %eax,%eax
call   2120 <glLoadIdentity@plt>
movsd  0xbcc(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   2190 <glTranslatef@plt>
movsd  0xbc3(%rip),%xmm0
call   2140 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xbb2(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
minsd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
maxsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpcklpd %xmm2,%xmm0
mulpd  0xbbe(%rip),%xmm0
mulpd  0xbc6(%rip),%xmm0
addpd  0xbce(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
mulsd  0xb78(%rip),%xmm2
mulsd  0xb78(%rip),%xmm2
addsd  0xb78(%rip),%xmm2
movsd  %xmm2,0x20(%rsp)
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
movss  0xbaa(%rip),%xmm3
call   2100 <glClearColor@plt>
mov    0x2a7e(%rip),%rax
mov    (%rax),%edi
mov    0x2ac5(%rip),%rax
mov    (%rax),%esi
call   2170 <glFogi@plt>
mov    0x2a7f(%rip),%rax
mov    (%rax),%edi
movsd  0xb3d(%rip),%xmm0
call   2070 <glFogf@plt>
mov    0x2a91(%rip),%rax
mov    (%rax),%edi
lea    0x10(%rsp),%rsi
call   2030 <glFogfv@plt>
mov    0x2a2e(%rip),%rax
mov    (%rax),%edi
call   20c0 <glEnable@plt>
movss  0xb53(%rip),%xmm0
call   2040 <glLineWidth@plt>
mov    0x29e3(%rip),%rax
mov    (%rax),%edi
call   20c0 <glEnable@plt>
mov    0x29dd(%rip),%rax
mov    (%rax),%edi
mov    0x2a84(%rip),%rax
mov    (%rax),%esi
call   2050 <glBlendFunc@plt>
movss  0xb25(%rip),%xmm0
call   2180 <glPointSize@plt>
mov    0x2a49(%rip),%rax
mov    (%rax),%edi
call   20c0 <glEnable@plt>
mov    0x2a53(%rip),%rax
mov    (%rax),%edi
mov    0x29c2(%rip),%rax
mov    (%rax),%esi
call   2160 <glHint@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
movl   $0x4,0xc(%rsp)
movl   $0x200,0x8(%rsp)
movl   $0x200,0x4(%rsp)
mov    $0x100000,%edi
call   2130 <malloc@plt>
mov    %rax,%r15
xor    %eax,%eax
mov    $0x200,%edi
mov    $0x200,%edx
jmp    25db <init+0x35b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmp    %edi,%eax
jge    2328 <init+0xa8>
test   %edx,%edx
jle    25d0 <init+0x350>
xor    %ecx,%ecx
jmp    25ff <init+0x37f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ecx
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%edi
cmp    %edx,%ecx
jge    25d0 <init+0x350>
mov    %edx,%esi
shr    $0x1f,%esi
add    %edx,%esi
sar    %esi
neg    %esi
mov    %edi,%ebx
shr    $0x1f,%ebx
add    %edi,%ebx
sar    %ebx
neg    %ebx
imul   %eax,%edx
add    %ecx,%edx
mov    %ecx,%edi
shr    $0x5,%edi
and    $0x1,%edi
lea    (%rdi,%rdx,4),%edx
movslq %edx,%rdx
xor    $0x1,%rdx
movb   $0xff,(%r15,%rdx,1)
test   $0x20,%al
je     264a <init+0x3ca>
mov    0x4(%rsp),%edx
imul   %eax,%edx
add    %ecx,%edx
shl    $0x2,%edx
movslq %edx,%rdx
movb   $0xff,0x2(%r15,%rdx,1)
add    %ecx,%esi
imul   %esi,%esi
add    %eax,%ebx
imul   %ebx,%ebx
lea    (%rsi,%rbx,1),%edx
add    $0xffffefff,%edx
cmp    $0x14f8e,%edx
ja     25f0 <init+0x370>
mov    0x4(%rsp),%edx
imul   %eax,%edx
add    %ecx,%edx
shl    $0x2,%edx
movslq %edx,%rdx
movb   $0xff,0x3(%r15,%rdx,1)
jmp    25f0 <init+0x370>
mov    0x28d2(%rip),%rax
mov    (%rax),%edi
lea    0x9fd(%rip),%rsi
mov    %r14,%rdx
call   2110 <fprintf@plt>
jmp    26a5 <init+0x425>
lea    0xa26(%rip),%rdi
call   2060 <puts@plt>
mov    0x288c(%rip),%rax
mov    (%rax),%edi
call   21a0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Error: Can't load image file \22%s\22.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [22 x i8] c"%d x %d image loaded\0A\00"
@.str.2 = [25 x i8] c"must be a l or la image\0A\00"
@GL_UNPACK_ALIGNMENT = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_MODULATE = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_LINEAR = 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
@GL_RGBA = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_FOG_MODE = global i32 0
@GL_EXP2 = global i32 0
@GL_FOG_DENSITY = global i32 0
@GL_FOG_COLOR = global i32 0
@GL_FOG = global i32 0
@GL_LINE_SMOOTH = global i32 0
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
@GL_POINT_SMOOTH = global i32 0
@GL_POINT_SMOOTH_HINT = global i32 0
@GL_NICEST = global i32 0
define void @init(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x double]
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
store i8* %0, i8** %2
store double 5.000000e-02, double* %4
%18 = load i8*, i8** %2
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %75
20: ; preds = %1
%21 = load i8*, i8** %2
%22 = call i32* @read_texture(i8* %21, i32* %8, i32* %9, i32* %10)
store i32* %22, i32** %7
%23 = load i32*, i32** %7
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %31
25: ; preds = %20
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %2
%28 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = load i32, i32* @EXIT_FAILURE
%30 = call i32 @exit(i32 %29)
unreachable
31: ; preds = %20
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %32, i32 %33)
br label %35
35: ; preds = %31
%36 = load i32, i32* %10
%37 = icmp ne i32 %36, 1
br i1 %37, label %38, label %45
38: ; preds = %35
%39 = load i32, i32* %10
%40 = icmp ne i32 %39, 2
br i1 %40, label %41, label %45
41: ; preds = %38
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%43 = load i32, i32* @EXIT_FAILURE
%44 = call i32 @exit(i32 %43)
unreachable
45: ; preds = %38, %35
%46 = load i32, i32* %10
%47 = icmp eq i32 %46, 1
br i1 %47, label %48, label %74
48: ; preds = %45
%49 = load i32*, i32** %7
store i32* %49, i32** %12
store i32 0, i32* %11
br label %50
50: ; preds = %70, %48
%51 = load i32, i32* %11
%52 = load i32, i32* %8
%53 = load i32, i32* %9
%54 = mul nsw i32 %52, %53
%55 = icmp slt i32 %51, %54
br i1 %55, label %56, label %73
56: ; preds = %50
%57 = load i32*, i32** %12
%58 = load i32, i32* %11
%59 = mul nsw i32 %58, 4
%60 = add nsw i32 %59, 0
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i32, i32* %57, i64 %61
%63 = load i32, i32* %62
%64 = load i32*, i32** %12
%65 = load i32, i32* %11
%66 = mul nsw i32 %65, 4
%67 = add nsw i32 %66, 3
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %64, i64 %68
store i32 %63, i32* %69
br label %70
70: ; preds = %56
%71 = load i32, i32* %11
%72 = add nsw i32 %71, 1
store i32 %72, i32* %11
br label %50
73: ; preds = %50
store i32 2, i32* %10
br label %74
74: ; preds = %73, %45
br label %194
75: ; preds = %1
store i32 4, i32* %10
store i32 512, i32* %9
store i32 512, i32* %8
%76 = load i32, i32* %8
%77 = load i32, i32* %9
%78 = mul nsw i32 %76, %77
%79 = sext i32 %78 to i64
%80 = mul i64 %79, 4
%81 = trunc i64 %80 to i32
%82 = call i64 @malloc(i32 %81)
%83 = inttoptr i64 %82 to i32*
store i32* %83, i32** %7
%84 = load i32*, i32** %7
%85 = bitcast i32* %84 to i8*
store i8* %85, i8** %15
store i32 0, i32* %14
br label %86
86: ; preds = %190, %75
%87 = load i32, i32* %14
%88 = load i32, i32* %9
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %193
90: ; preds = %86
store i32 0, i32* %13
br label %91
91: ; preds = %186, %90
%92 = load i32, i32* %13
%93 = load i32, i32* %8
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %189
95: ; preds = %91
%96 = load i32, i32* %8
%97 = sdiv i32 %96, 2
store i32 %97, i32* %16
%98 = load i32, i32* %9
%99 = sdiv i32 %98, 2
store i32 %99, i32* %17
%100 = load i32, i32* %13
%101 = and i32 %100, 32
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %114
103: ; preds = %95
%104 = load i8*, i8** %15
%105 = load i32, i32* %13
%106 = load i32, i32* %14
%107 = load i32, i32* %8
%108 = mul nsw i32 %106, %107
%109 = add nsw i32 %105, %108
%110 = mul nsw i32 4, %109
%111 = add nsw i32 %110, 0
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8, i8* %104, i64 %112
store i8 -1, i8* %113
br label %125
114: ; preds = %95
%115 = load i8*, i8** %15
%116 = load i32, i32* %13
%117 = load i32, i32* %14
%118 = load i32, i32* %8
%119 = mul nsw i32 %117, %118
%120 = add nsw i32 %116, %119
%121 = mul nsw i32 4, %120
%122 = add nsw i32 %121, 1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %115, i64 %123
store i8 -1, i8* %124
br label %125
125: ; preds = %114, %103
%126 = load i32, i32* %14
%127 = and i32 %126, 32
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %140
129: ; preds = %125
%130 = load i8*, i8** %15
%131 = load i32, i32* %13
%132 = load i32, i32* %14
%133 = load i32, i32* %8
%134 = mul nsw i32 %132, %133
%135 = add nsw i32 %131, %134
%136 = mul nsw i32 4, %135
%137 = add nsw i32 %136, 2
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i8, i8* %130, i64 %138
store i8 -1, i8* %139
br label %140
140: ; preds = %129, %125
%141 = load i32, i32* %13
%142 = load i32, i32* %16
%143 = sub nsw i32 %141, %142
%144 = load i32, i32* %13
%145 = load i32, i32* %16
%146 = sub nsw i32 %144, %145
%147 = mul nsw i32 %143, %146
%148 = load i32, i32* %14
%149 = load i32, i32* %17
%150 = sub nsw i32 %148, %149
%151 = load i32, i32* %14
%152 = load i32, i32* %17
%153 = sub nsw i32 %151, %152
%154 = mul nsw i32 %150, %153
%155 = add nsw i32 %147, %154
%156 = icmp sgt i32 %155, 4096
br i1 %156, label %157, label %185
157: ; preds = %140
%158 = load i32, i32* %13
%159 = load i32, i32* %16
%160 = sub nsw i32 %158, %159
%161 = load i32, i32* %13
%162 = load i32, i32* %16
%163 = sub nsw i32 %161, %162
%164 = mul nsw i32 %160, %163
%165 = load i32, i32* %14
%166 = load i32, i32* %17
%167 = sub nsw i32 %165, %166
%168 = load i32, i32* %14
%169 = load i32, i32* %17
%170 = sub nsw i32 %168, %169
%171 = mul nsw i32 %167, %170
%172 = add nsw i32 %164, %171
%173 = icmp slt i32 %172, 90000
br i1 %173, label %174, label %185
174: ; preds = %157
%175 = load i8*, i8** %15
%176 = load i32, i32* %13
%177 = load i32, i32* %14
%178 = load i32, i32* %8
%179 = mul nsw i32 %177, %178
%180 = add nsw i32 %176, %179
%181 = mul nsw i32 4, %180
%182 = add nsw i32 %181, 3
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i8, i8* %175, i64 %183
store i8 -1, i8* %184
br label %185
185: ; preds = %174, %157, %140
br label %186
186: ; preds = %185
%187 = load i32, i32* %13
%188 = add nsw i32 %187, 1
store i32 %188, i32* %13
br label %91
189: ; preds = %91
br label %190
190: ; preds = %189
%191 = load i32, i32* %14
%192 = add nsw i32 %191, 1
store i32 %192, i32* %14
br label %86
193: ; preds = %86
br label %194
194: ; preds = %193, %74
%195 = load i32, i32* @GL_UNPACK_ALIGNMENT
%196 = call i32 @glPixelStorei(i32 %195, i32 1)
%197 = load i32, i32* @GL_TEXTURE_ENV
%198 = load i32, i32* @GL_TEXTURE_ENV_MODE
%199 = load i32, i32* @GL_MODULATE
%200 = call i32 @glTexEnvf(i32 %197, i32 %198, i32 %199)
%201 = load i32, i32* @GL_TEXTURE_2D
%202 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%203 = load i32, i32* @GL_LINEAR
%204 = call i32 @glTexParameteri(i32 %201, i32 %202, i32 %203)
%205 = load i32, i32* @GL_TEXTURE_2D
%206 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%207 = load i32, i32* @GL_LINEAR
%208 = call i32 @glTexParameteri(i32 %205, i32 %206, i32 %207)
%209 = load i32, i32* @GL_TEXTURE_2D
%210 = load i32, i32* @GL_TEXTURE_WRAP_S
%211 = load i32, i32* @GL_REPEAT
%212 = call i32 @glTexParameteri(i32 %209, i32 %210, i32 %211)
%213 = load i32, i32* @GL_TEXTURE_2D
%214 = load i32, i32* @GL_TEXTURE_WRAP_T
%215 = load i32, i32* @GL_REPEAT
%216 = call i32 @glTexParameteri(i32 %213, i32 %214, i32 %215)
%217 = load i32, i32* @GL_TEXTURE_2D
%218 = load i32, i32* %10
%219 = load i32, i32* %8
%220 = load i32, i32* %9
%221 = load i32, i32* @GL_RGBA
%222 = load i32, i32* @GL_UNSIGNED_BYTE
%223 = load i32*, i32** %7
%224 = call i32 @glTexImage2D(i32 %217, i32 0, i32 %218, i32 %219, i32 %220, i32 0, i32 %221, i32 %222, i32* %223)
%225 = load i32, i32* @GL_PROJECTION
%226 = call i32 @glMatrixMode(i32 %225)
%227 = call i32 (...) @glLoadIdentity()
store double 1.000000e+01, double* %6
%228 = call i32 @gluPerspective(i32 50, i32 1, double 1.000000e-01, double 1.000000e+01)
%229 = load i32, i32* @GL_MODELVIEW
%230 = call i32 @glMatrixMode(i32 %229)
%231 = call i32 (...) @glLoadIdentity()
%232 = call i32 @glTranslatef(i32 0, i32 0, double -5.500000e+00)
%233 = load double, double* %4
%234 = fmul double -5.500000e+00, %233
%235 = load double, double* %4
%236 = fmul double %234, %235
%237 = load double, double* %6
%238 = fmul double %236, %237
%239 = load double, double* %6
%240 = fmul double %238, %239
%241 = call i64 @exp(double %240)
%242 = sitofp i64 %241 to float
%243 = fpext float %242 to double
%244 = fsub double 1.000000e+00, %243
store double %244, double* %5
%245 = load double, double* %5
%246 = fcmp olt double %245, 1.000000e+00
br i1 %246, label %247, label %249
247: ; preds = %194
%248 = load double, double* %5
br label %250
249: ; preds = %194
br label %250
250: ; preds = %249, %247
%251 = phi double [ %248, %247 ], [ 1.000000e+00, %249 ]
%252 = fcmp ogt double %251, 0.000000e+00
br i1 %252, label %253, label %261
253: ; preds = %250
%254 = load double, double* %5
%255 = fcmp olt double %254, 1.000000e+00
br i1 %255, label %256, label %258
256: ; preds = %253
%257 = load double, double* %5
br label %259
258: ; preds = %253
br label %259
259: ; preds = %258, %256
%260 = phi double [ %257, %256 ], [ 1.000000e+00, %258 ]
br label %262
261: ; preds = %250
br label %262
262: ; preds = %261, %259
%263 = phi double [ %260, %259 ], [ 0.000000e+00, %261 ]
store double %263, double* %5
%264 = load double, double* %5
%265 = fmul double %264, 5.700000e-01
%266 = call double @llvm.fmuladd.f64(double %265, double 2.000000e-01, double 0x3FA78D4FDF3B645B)
%267 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
store double %266, double* %267
%268 = load double, double* %5
%269 = fmul double %268, 4.500000e-01
%270 = call double @llvm.fmuladd.f64(double %269, double 2.000000e-01, double 0x3FB1EB851EB851EB)
%271 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
store double %270, double* %271
%272 = load double, double* %5
%273 = fmul double %272, 2.200000e-01
%274 = call double @llvm.fmuladd.f64(double %273, double 2.000000e-01, double 3.900000e-01)
%275 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
store double %274, double* %275
%276 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%277 = load double, double* %276
%278 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
%279 = load double, double* %278
%280 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%281 = load double, double* %280
%282 = call i32 @glClearColor(double %277, double %279, double %281, float 1.000000e+00)
%283 = load i32, i32* @GL_FOG_MODE
%284 = load i32, i32* @GL_EXP2
%285 = call i32 @glFogi(i32 %283, i32 %284)
%286 = load i32, i32* @GL_FOG_DENSITY
%287 = load double, double* %4
%288 = call i32 @glFogf(i32 %286, double %287)
%289 = load i32, i32* @GL_FOG_COLOR
%290 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%291 = call i32 @glFogfv(i32 %289, double* %290)
%292 = load double, double* %4
%293 = fcmp ogt double %292, 0.000000e+00
br i1 %293, label %294, label %297
294: ; preds = %262
%295 = load i32, i32* @GL_FOG
%296 = call i32 @glEnable(i32 %295)
br label %297
297: ; preds = %294, %262
%298 = call i32 @glLineWidth(float 2.000000e+00)
%299 = load i32, i32* @GL_LINE_SMOOTH
%300 = call i32 @glEnable(i32 %299)
%301 = load i32, i32* @GL_SRC_ALPHA
%302 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%303 = call i32 @glBlendFunc(i32 %301, i32 %302)
%304 = call i32 @glPointSize(float 1.000000e+01)
%305 = load i32, i32* @GL_POINT_SMOOTH
%306 = call i32 @glEnable(i32 %305)
%307 = load i32, i32* @GL_POINT_SMOOTH_HINT
%308 = load i32, i32* @GL_NICEST
%309 = call i32 @glHint(i32 %307, i32 %308)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Error: Can't load image file \22%s\22.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [22 x i8] c"%d x %d image loaded\0A\00"
@GL_UNPACK_ALIGNMENT = global i32 0
@GL_TEXTURE_ENV = global i32 0
@GL_TEXTURE_ENV_MODE = global i32 0
@GL_MODULATE = global i32 0
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_MIN_FILTER = global i32 0
@GL_LINEAR = 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
@GL_RGBA = global i32 0
@GL_UNSIGNED_BYTE = global i32 0
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
@GL_FOG_MODE = global i32 0
@GL_EXP2 = global i32 0
@GL_FOG_DENSITY = global i32 0
@GL_FOG_COLOR = global i32 0
@GL_FOG = global i32 0
@GL_LINE_SMOOTH = global i32 0
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
@GL_POINT_SMOOTH = global i32 0
@GL_POINT_SMOOTH_HINT = global i32 0
@GL_NICEST = global i32 0
@str = [24 x i8] c"must be a l or la image\00"
define void @init(i8* %0) {
%2 = alloca [4 x double]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [4 x double]* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = icmp eq i8* %0, null
br i1 %10, label %51, label %11
11: ; preds = %1
%12 = call i32* @read_texture(i8* %0, i32* %3, i32* %4, i32* %5)
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %11
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %21)
%23 = load i32, i32* %5
%24 = add i32 %23, -3
%25 = icmp ult i32 %24, -2
br i1 %25, label %26, label %30
26: ; preds = %19
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%28 = load i32, i32* @EXIT_FAILURE
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %19
%31 = icmp eq i32 %23, 1
br i1 %31, label %32, label %112
32: ; preds = %30
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = mul nsw i32 %34, %33
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %50
37: ; preds = %32, %37
%38 = phi i64 [ %44, %37 ], [ 0, %32 ]
%39 = shl nsw i64 %38, 2
%40 = getelementptr inbounds i32, i32* %12, i64 %39
%41 = load i32, i32* %40
%42 = or i64 %39, 3
%43 = getelementptr inbounds i32, i32* %12, i64 %42
store i32 %41, i32* %43
%44 = add nuw nsw i64 %38, 1
%45 = load i32, i32* %3
%46 = load i32, i32* %4
%47 = mul nsw i32 %46, %45
%48 = sext i32 %47 to i64
%49 = icmp slt i64 %44, %48
br i1 %49, label %37, label %50
50: ; preds = %37, %32
store i32 2, i32* %5
br label %112
51: ; preds = %1
store i32 4, i32* %5
store i32 512, i32* %4
store i32 512, i32* %3
%52 = tail call i64 @malloc(i32 1048576)
%53 = inttoptr i64 %52 to i32*
%54 = inttoptr i64 %52 to i8*
br label %55
55: ; preds = %51, %107
%56 = phi i32 [ %108, %107 ], [ 512, %51 ]
%57 = phi i32 [ %109, %107 ], [ 512, %51 ]
%58 = phi i32 [ %110, %107 ], [ 0, %51 ]
%59 = icmp sgt i32 %57, 0
br i1 %59, label %60, label %107
60: ; preds = %55
%61 = and i32 %58, 32
%62 = icmp eq i32 %61, 0
br label %63
63: ; preds = %102, %60
%64 = phi i32 [ %56, %60 ], [ %106, %102 ]
%65 = phi i32 [ %57, %60 ], [ %104, %102 ]
%66 = phi i32 [ 0, %60 ], [ %103, %102 ]
%67 = sdiv i32 %65, -2
%68 = sdiv i32 %64, -2
%69 = mul nsw i32 %65, %58
%70 = add nsw i32 %69, %66
%71 = shl nsw i32 %70, 2
%72 = lshr i32 %66, 5
%73 = and i32 %72, 1
%74 = or i32 %73, %71
%75 = xor i32 %74, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8, i8* %54, i64 %76
store i8 -1, i8* %77
br i1 %62, label %86, label %78
78: ; preds = %63
%79 = load i32, i32* %3
%80 = mul nsw i32 %79, %58
%81 = add nsw i32 %80, %66
%82 = shl nsw i32 %81, 2
%83 = or i32 %82, 2
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %54, i64 %84
store i8 -1, i8* %85
br label %86
86: ; preds = %78, %63
%87 = add i32 %67, %66
%88 = mul nsw i32 %87, %87
%89 = add i32 %68, %58
%90 = mul nsw i32 %89, %89
%91 = add nsw i32 %88, -4097
%92 = add i32 %91, %90
%93 = icmp ult i32 %92, 85903
br i1 %93, label %94, label %102
94: ; preds = %86
%95 = load i32, i32* %3
%96 = mul nsw i32 %95, %58
%97 = add nsw i32 %96, %66
%98 = shl nsw i32 %97, 2
%99 = or i32 %98, 3
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %54, i64 %100
store i8 -1, i8* %101
br label %102
102: ; preds = %94, %86
%103 = add nuw nsw i32 %66, 1
%104 = load i32, i32* %3
%105 = icmp slt i32 %103, %104
%106 = load i32, i32* %4
br i1 %105, label %63, label %107
107: ; preds = %102, %55
%108 = phi i32 [ %56, %55 ], [ %106, %102 ]
%109 = phi i32 [ %57, %55 ], [ %104, %102 ]
%110 = add nuw nsw i32 %58, 1
%111 = icmp slt i32 %110, %108
br i1 %111, label %55, label %112
112: ; preds = %107, %30, %50
%113 = phi i32* [ %12, %50 ], [ %12, %30 ], [ %53, %107 ]
%114 = load i32, i32* @GL_UNPACK_ALIGNMENT
%115 = call i32 @glPixelStorei(i32 %114, i32 1)
%116 = load i32, i32* @GL_TEXTURE_ENV
%117 = load i32, i32* @GL_TEXTURE_ENV_MODE
%118 = load i32, i32* @GL_MODULATE
%119 = call i32 @glTexEnvf(i32 %116, i32 %117, i32 %118)
%120 = load i32, i32* @GL_TEXTURE_2D
%121 = load i32, i32* @GL_TEXTURE_MIN_FILTER
%122 = load i32, i32* @GL_LINEAR
%123 = call i32 @glTexParameteri(i32 %120, i32 %121, i32 %122)
%124 = load i32, i32* @GL_TEXTURE_2D
%125 = load i32, i32* @GL_TEXTURE_MAG_FILTER
%126 = load i32, i32* @GL_LINEAR
%127 = call i32 @glTexParameteri(i32 %124, i32 %125, i32 %126)
%128 = load i32, i32* @GL_TEXTURE_2D
%129 = load i32, i32* @GL_TEXTURE_WRAP_S
%130 = load i32, i32* @GL_REPEAT
%131 = call i32 @glTexParameteri(i32 %128, i32 %129, i32 %130)
%132 = load i32, i32* @GL_TEXTURE_2D
%133 = load i32, i32* @GL_TEXTURE_WRAP_T
%134 = load i32, i32* @GL_REPEAT
%135 = call i32 @glTexParameteri(i32 %132, i32 %133, i32 %134)
%136 = load i32, i32* @GL_TEXTURE_2D
%137 = load i32, i32* %5
%138 = load i32, i32* %3
%139 = load i32, i32* %4
%140 = load i32, i32* @GL_RGBA
%141 = load i32, i32* @GL_UNSIGNED_BYTE
%142 = call i32 @glTexImage2D(i32 %136, i32 0, i32 %137, i32 %138, i32 %139, i32 0, i32 %140, i32 %141, i32* %113)
%143 = load i32, i32* @GL_PROJECTION
%144 = call i32 @glMatrixMode(i32 %143)
%145 = call i32 (...) @glLoadIdentity()
%146 = call i32 @gluPerspective(i32 50, i32 1, double 1.000000e-01, double 1.000000e+01)
%147 = load i32, i32* @GL_MODELVIEW
%148 = call i32 @glMatrixMode(i32 %147)
%149 = call i32 (...) @glLoadIdentity()
%150 = call i32 @glTranslatef(i32 0, i32 0, double -5.500000e+00)
%151 = call i64 @exp(double -1.375000e+00)
%152 = sitofp i64 %151 to float
%153 = fpext float %152 to double
%154 = fsub double 1.000000e+00, %153
%155 = fcmp olt double %154, 1.000000e+00
%156 = select i1 %155, double %154, double 1.000000e+00
%157 = fcmp ogt double %156, 0.000000e+00
%158 = select i1 %157, double %156, double 0.000000e+00
%159 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%160 = insertelement <2 x double> poison, double %158, i64 0
%161 = shufflevector <2 x double> %160, <2 x double> poison, <2 x i32> zeroinitializer
%162 = fmul <2 x double> %161, <double 5.700000e-01, double 4.500000e-01>
%163 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %162, <2 x double> <double 2.000000e-01, double 2.000000e-01>, <2 x double> <double 0x3FA78D4FDF3B645B, double 0x3FB1EB851EB851EB>)
%164 = bitcast [4 x double]* %2 to <2 x double>*
store <2 x double> %163, <2 x double>* %164
%165 = fmul double %158, 2.200000e-01
%166 = call double @llvm.fmuladd.f64(double %165, double 2.000000e-01, double 3.900000e-01)
%167 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 2
store double %166, double* %167
%168 = extractelement <2 x double> %163, i64 0
%169 = extractelement <2 x double> %163, i64 1
%170 = call i32 @glClearColor(double %168, double %169, double %166, float 1.000000e+00)
%171 = load i32, i32* @GL_FOG_MODE
%172 = load i32, i32* @GL_EXP2
%173 = call i32 @glFogi(i32 %171, i32 %172)
%174 = load i32, i32* @GL_FOG_DENSITY
%175 = call i32 @glFogf(i32 %174, double 5.000000e-02)
%176 = load i32, i32* @GL_FOG_COLOR
%177 = call i32 @glFogfv(i32 %176, double* %159)
%178 = load i32, i32* @GL_FOG
%179 = call i32 @glEnable(i32 %178)
%180 = call i32 @glLineWidth(float 2.000000e+00)
%181 = load i32, i32* @GL_LINE_SMOOTH
%182 = call i32 @glEnable(i32 %181)
%183 = load i32, i32* @GL_SRC_ALPHA
%184 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%185 = call i32 @glBlendFunc(i32 %183, i32 %184)
%186 = call i32 @glPointSize(float 1.000000e+01)
%187 = load i32, i32* @GL_POINT_SMOOTH
%188 = call i32 @glEnable(i32 %187)
%189 = load i32, i32* @GL_POINT_SMOOTH_HINT
%190 = load i32, i32* @GL_NICEST
%191 = call i32 @glHint(i32 %189, i32 %190)
ret void
}