#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 */

/* Variables and functions */
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ glBindTexture(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rd_ast(char *, int);
int /*<<< orphan*/ rd_neb(char *, int);
int /*<<< orphan*/ rd_torp(char *);
void init_textures(void) {
  printf("Reading asteroid textures\n");
  rd_ast("ast_tex0.ppm", 0);
  rd_ast("ast_tex1.ppm", 1);
  rd_ast("ast_tex2.ppm", 2);
  rd_ast("ast_tex3.ppm", 3);
  rd_ast("ast_tex4.ppm", 4);
  rd_ast("ast_tex5.ppm", 5);
  printf("Reading nebula textures\n");
  rd_neb("nebula_tex0.ppm", 0);
  rd_neb("nebula_tex1.ppm", 1);
  rd_neb("nebula_tex2.ppm", 2);
  rd_neb("nebula_tex3.ppm", 3);
  printf("Reading torpedo texture\n");
  rd_torp("torp_tex0.ppm");
  glBindTexture(GL_TEXTURE_2D, 0);
  return;
}


x86 assembly (clang, -O0):
<init_textures>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
xor    %esi,%esi
call   1060 <rd_ast@plt>
lea    0xeb3(%rip),%rdi
mov    $0x1,%esi
call   1060 <rd_ast@plt>
lea    0xeaf(%rip),%rdi
mov    $0x2,%esi
call   1060 <rd_ast@plt>
lea    0xeab(%rip),%rdi
mov    $0x3,%esi
call   1060 <rd_ast@plt>
lea    0xea7(%rip),%rdi
mov    $0x4,%esi
call   1060 <rd_ast@plt>
lea    0xea3(%rip),%rdi
mov    $0x5,%esi
call   1060 <rd_ast@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
xor    %esi,%esi
call   1040 <rd_neb@plt>
lea    0xeae(%rip),%rdi
mov    $0x1,%esi
call   1040 <rd_neb@plt>
lea    0xead(%rip),%rdi
mov    $0x2,%esi
call   1040 <rd_neb@plt>
lea    0xeac(%rip),%rdi
mov    $0x3,%esi
call   1040 <rd_neb@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1070 <rd_torp@plt>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <glBindTexture@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_textures>:
push   %rax
lea    0xf44(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
xor    %esi,%esi
call   1060 <rd_ast@plt>
lea    0xe9b(%rip),%rdi
mov    $0x1,%esi
call   1060 <rd_ast@plt>
lea    0xe97(%rip),%rdi
mov    $0x2,%esi
call   1060 <rd_ast@plt>
lea    0xe93(%rip),%rdi
mov    $0x3,%esi
call   1060 <rd_ast@plt>
lea    0xe8f(%rip),%rdi
mov    $0x4,%esi
call   1060 <rd_ast@plt>
lea    0xe8b(%rip),%rdi
mov    $0x5,%esi
call   1060 <rd_ast@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7b(%rip),%rdi
xor    %esi,%esi
call   1040 <rd_neb@plt>
lea    0xe7d(%rip),%rdi
mov    $0x1,%esi
call   1040 <rd_neb@plt>
lea    0xe7c(%rip),%rdi
mov    $0x2,%esi
call   1040 <rd_neb@plt>
lea    0xe7b(%rip),%rdi
mov    $0x3,%esi
call   1040 <rd_neb@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6e(%rip),%rdi
call   1070 <rd_torp@plt>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
pop    %rax
jmp    1050 <glBindTexture@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Reading asteroid textures\0A\00"
@.str.1 = [13 x i8] c"ast_tex0.ppm\00"
@.str.2 = [13 x i8] c"ast_tex1.ppm\00"
@.str.3 = [13 x i8] c"ast_tex2.ppm\00"
@.str.4 = [13 x i8] c"ast_tex3.ppm\00"
@.str.5 = [13 x i8] c"ast_tex4.ppm\00"
@.str.6 = [13 x i8] c"ast_tex5.ppm\00"
@.str.7 = [25 x i8] c"Reading nebula textures\0A\00"
@.str.8 = [16 x i8] c"nebula_tex0.ppm\00"
@.str.9 = [16 x i8] c"nebula_tex1.ppm\00"
@.str.10 = [16 x i8] c"nebula_tex2.ppm\00"
@.str.11 = [16 x i8] c"nebula_tex3.ppm\00"
@.str.12 = [25 x i8] c"Reading torpedo texture\0A\00"
@.str.13 = [14 x i8] c"torp_tex0.ppm\00"
@GL_TEXTURE_2D = global i32 0
define void @init_textures() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 2)
%5 = call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 3)
%6 = call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 4)
%7 = call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 5)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @rd_neb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 0)
%10 = call i32 @rd_neb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 1)
%11 = call i32 @rd_neb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 2)
%12 = call i32 @rd_neb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 3)
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0))
%14 = call i32 @rd_torp(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%15 = load i32, i32* @GL_TEXTURE_2D
%16 = call i32 @glBindTexture(i32 %15, i32 0)
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"ast_tex0.ppm\00"
@.str.2 = [13 x i8] c"ast_tex1.ppm\00"
@.str.3 = [13 x i8] c"ast_tex2.ppm\00"
@.str.4 = [13 x i8] c"ast_tex3.ppm\00"
@.str.5 = [13 x i8] c"ast_tex4.ppm\00"
@.str.6 = [13 x i8] c"ast_tex5.ppm\00"
@.str.8 = [16 x i8] c"nebula_tex0.ppm\00"
@.str.9 = [16 x i8] c"nebula_tex1.ppm\00"
@.str.10 = [16 x i8] c"nebula_tex2.ppm\00"
@.str.11 = [16 x i8] c"nebula_tex3.ppm\00"
@.str.13 = [14 x i8] c"torp_tex0.ppm\00"
@GL_TEXTURE_2D = global i32 0
@str = [26 x i8] c"Reading asteroid textures\00"
@str.14 = [24 x i8] c"Reading nebula textures\00"
@str.15 = [24 x i8] c"Reading torpedo texture\00"
define void @init_textures() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 2)
%5 = tail call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 3)
%6 = tail call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 4)
%7 = tail call i32 @rd_ast(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 5)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @rd_neb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 0)
%10 = tail call i32 @rd_neb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i32 1)
%11 = tail call i32 @rd_neb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 2)
%12 = tail call i32 @rd_neb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i32 3)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.15, i64 0, i64 0))
%14 = tail call i32 @rd_torp(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%15 = load i32, i32* @GL_TEXTURE_2D
%16 = tail call i32 @glBindTexture(i32 %15, i32 0)
ret void
}