// File: /workspace/github_cpp_makefile_star2_O2/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 0x71b7(%rip), %rdi      # 0xf258
callq 0x7fb4
testb %al, %al
je 0x80d1
pushq $0x20
popq %rdi
callq 0x21a0
movq %rax, %rbx
movq 0x719c(%rip), %r14      # 0xf258
callq 0x6f84
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x6754
jmp 0x80f6
pushq $0x20
popq %rdi
callq 0x21a0
movq %rax, %rbx
movq 0x7175(%rip), %r14      # 0xf258
callq 0x6cfc
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x6754
movq %rbx, %rdi
callq 0x685e
cmpl $0x80, %eax
jne 0x8121
movq %rbx, %rdi
callq 0x6862
cmpl $0x80, %eax
jne 0x8121
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x6eb0(%rip), %rdi      # 0xefd8
leaq 0x1b87(%rip), %rsi      # 0x9cb6
callq 0x2190
movq 0x711d(%rip), %rsi      # 0xf258
movq %rax, %rdi
callq 0x2190
leaq 0x1b95(%rip), %rsi      # 0x9cdf
movq %rax, %rdi
callq 0x2190
movq %rax, %r14
movq %rbx, %rdi
callq 0x685e
movq %r14, %rdi
movl %eax, %esi
callq 0x2300
leaq 0x1a1f(%rip), %rsi      # 0x9b8d
movq %rax, %rdi
callq 0x2190
movq %rax, %r14
movq %rbx, %rdi
callq 0x6862
movq %r14, %rdi
movl %eax, %esi
callq 0x2300
movq %rax, %rdi
callq 0x20d0
pushq $0x1
popq %rdi
callq 0x21f0
movq %rdx, %r15
movq %rax, %r14
jmp 0x81bf
movq %rdx, %r15
movq %rax, %r14
jmp 0x824c
movq %rdx, %r15
movq %rax, %r14
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x21b0
cmpl $0x1, %r15d
jne 0x82bf
movq %r14, %rdi
callq 0x2210
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x763a
movq %r14, %rdi
callq 0x20a0
movq 0x6deb(%rip), %rdi      # 0xefd8
leaq 0x1ae9(%rip), %rsi      # 0x9cdd
callq 0x2190
movq 0x7058(%rip), %rsi      # 0xf258
movq %rax, %rdi
callq 0x2190
leaq 0x1a8f(%rip), %rsi      # 0x9c9e
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20d0
jmp 0x8193
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x7654
callq 0x22e0
jmp 0x82bf
movq %rdx, %r15
movq %rax, %r14
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x21b0
cmpl $0x1, %r15d
jne 0x82bf
movq %r14, %rdi
callq 0x2210
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x763a
movq %r14, %rdi
callq 0x20a0
movq 0x6d62(%rip), %rdi      # 0xefd8
leaq 0x1a60(%rip), %rsi      # 0x9cdd
callq 0x2190
movq 0x6fcf(%rip), %rsi      # 0xf258
movq %rax, %rdi
callq 0x2190
leaq 0x19ee(%rip), %rsi      # 0x9c86
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20d0
jmp 0x8193
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x7654
callq 0x22e0
movq %r14, %rdi
callq 0x2320
movq %rax, %rdi
callq 0x398a