// File: /workspace/github_cpp_makefile_star2_O3/ticky[P]ps2iconsys/src/obj_to_ps2icon.cpp
// Function: LoadTexture()
GhulbusUtil::gbImageLoader* LoadTexture()
{
	GhulbusUtil::gbImageLoader* ret = NULL;
	if(IsBMP(texture_input_file)) {
		try {
			ret = new GhulbusUtil::gbImageLoader( texture_input_file, GhulbusUtil::gbImageType_BMP() );
		} catch( Ghulbus::gbException e ) {
			std::cout << "\"" << texture_input_file << "\" is no valid BMP file." << std::endl;
			exit(1);
		}
	} else {
		try {
			ret = new GhulbusUtil::gbImageLoader( texture_input_file, GhulbusUtil::gbImageType_TGA() );
		} catch( Ghulbus::gbException e ) {
			std::cout << "\"" << texture_input_file << "\" is no valid TGA file." << std::endl;
			exit(1);
		}
	}
	if( (ret->GetWidth() != 128) || (ret->GetHeight() != 128) ) {
		std::cout << "Only Textures of size 128x128 allowed! \"" << texture_input_file << "\" has "
			<< ret->GetWidth() << "x" << ret->GetHeight() << std::endl;
		exit(1);
	}
	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq 0x6034(%rip), %rdi      # 0xf278
callq 0x9155
testb %al, %al
je 0x9276
movl $0x20, %edi
callq 0x21c0
movq %rax, %rbx
movq 0x6017(%rip), %r14      # 0xf278
callq 0x7c80
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x7388
jmp 0x929d
movl $0x20, %edi
callq 0x21c0
movq %rax, %rbx
movq 0x5fee(%rip), %r14      # 0xf278
callq 0x79e4
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x7388
movq %rbx, %rdi
callq 0x749e
cmpl $0x80, %eax
jne 0x92c8
movq %rbx, %rdi
callq 0x74a2
cmpl $0x80, %eax
jne 0x92c8
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x5d09(%rip), %rdi      # 0xefd8
leaq 0x19e0(%rip), %rsi      # 0xacb6
callq 0x21b0
movq 0x5f96(%rip), %rsi      # 0xf278
movq %rax, %rdi
callq 0x21b0
leaq 0x19ee(%rip), %rsi      # 0xacdf
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x749e
movq %r14, %rdi
movl %eax, %esi
callq 0x2330
leaq 0x1878(%rip), %rsi      # 0xab8d
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x74a2
movq %r14, %rdi
movl %eax, %esi
callq 0x2330
movq %rax, %rdi
callq 0x20d0
movl $0x1, %edi
callq 0x2210
movq %rdx, %r15
movq %rax, %r14
jmp 0x936a
movq %rdx, %r15
movq %rax, %r14
jmp 0x940a
movq %rdx, %r15
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x21d0
cmpl $0x1, %r15d
jne 0x948e
movq %r14, %rdi
callq 0x2230
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x8342
movq %r14, %rdi
callq 0x20b0
movq 0x5c40(%rip), %rdi      # 0xefd8
leaq 0x193e(%rip), %rsi      # 0xacdd
movl $0x1, %edx
callq 0x21f0
movq 0x5ec8(%rip), %rsi      # 0xf278
movq 0x5c21(%rip), %rdi      # 0xefd8
callq 0x21b0
movq %rax, %rbx
leaq 0x18d8(%rip), %rsi      # 0xac9e
movl $0x17, %edx
movq %rax, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x20d0
jmp 0x933a
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x835c
callq 0x2300
jmp 0x948e
movq %rdx, %r15
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x21d0
cmpl $0x1, %r15d
jne 0x948e
movq %r14, %rdi
callq 0x2230
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x8342
movq %r14, %rdi
callq 0x20b0
movq 0x5ba4(%rip), %rdi      # 0xefd8
leaq 0x18a2(%rip), %rsi      # 0xacdd
movl $0x1, %edx
callq 0x21f0
movq 0x5e2c(%rip), %rsi      # 0xf278
movq 0x5b85(%rip), %rdi      # 0xefd8
callq 0x21b0
movq %rax, %rbx
leaq 0x1824(%rip), %rsi      # 0xac86
movl $0x17, %edx
movq %rax, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x20d0
jmp 0x933a
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x835c
callq 0x2300
movq %r14, %rdi
callq 0x2350
movq %rax, %rdi
callq 0x7088