// File: /workspace/github_cpp_makefile_star2_O1/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 0x5e23(%rip), %rdi      # 0xf278
callq 0x9366
testb %al, %al
je 0x9487
movl $0x20, %edi
callq 0x21c0
movq %rax, %rbx
movq 0x5e06(%rip), %r14      # 0xf278
callq 0x7f70
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x7684
jmp 0x94ae
movl $0x20, %edi
callq 0x21c0
movq %rax, %rbx
movq 0x5ddd(%rip), %r14      # 0xf278
callq 0x7cf0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x7684
movq %rbx, %rdi
callq 0x779a
cmpl $0x80, %eax
jne 0x94d9
movq %rbx, %rdi
callq 0x779e
cmpl $0x80, %eax
jne 0x94d9
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x5af8(%rip), %rdi      # 0xefd8
leaq 0x1794(%rip), %rsi      # 0xac7b
callq 0x21b0
movq 0x5d85(%rip), %rsi      # 0xf278
movq %rax, %rdi
callq 0x21b0
leaq 0x17a2(%rip), %rsi      # 0xaca4
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x779a
movq %r14, %rdi
movl %eax, %esi
callq 0x2330
leaq 0x1629(%rip), %rsi      # 0xab4f
movq %rax, %rdi
callq 0x21b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x779e
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 0x957b
movq %rdx, %r15
movq %rax, %r14
jmp 0x961b
movq %rdx, %r15
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x21d0
cmpl $0x1, %r15d
jne 0x969f
movq %r14, %rdi
callq 0x2230
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x860a
movq %r14, %rdi
callq 0x20b0
movq 0x5a2f(%rip), %rdi      # 0xefd8
leaq 0x16f2(%rip), %rsi      # 0xaca2
movl $0x1, %edx
callq 0x21f0
movq 0x5cb7(%rip), %rsi      # 0xf278
movq 0x5a10(%rip), %rdi      # 0xefd8
callq 0x21b0
movq %rax, %rbx
leaq 0x168c(%rip), %rsi      # 0xac63
movl $0x17, %edx
movq %rax, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x20d0
jmp 0x954b
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x8624
callq 0x2300
jmp 0x969f
movq %rdx, %r15
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x21d0
cmpl $0x1, %r15d
jne 0x969f
movq %r14, %rdi
callq 0x2230
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x860a
movq %r14, %rdi
callq 0x20b0
movq 0x5993(%rip), %rdi      # 0xefd8
leaq 0x1656(%rip), %rsi      # 0xaca2
movl $0x1, %edx
callq 0x21f0
movq 0x5c1b(%rip), %rsi      # 0xf278
movq 0x5974(%rip), %rdi      # 0xefd8
callq 0x21b0
movq %rax, %rbx
leaq 0x15d8(%rip), %rsi      # 0xac4b
movl $0x17, %edx
movq %rax, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x20d0
jmp 0x954b
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x8624
callq 0x2300
movq %r14, %rdi
callq 0x2350
movq %rax, %rdi
callq 0x7292