LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/obj_loader.cpp
// Function: OBJ_FileLoader::OBJ_FileLoader(char const*)
OBJ_FileLoader::OBJ_FileLoader(const char* fname)
{
	std::ifstream fin(fname, std::ios_base::in);
	if(fin.fail()) { throw( Ghulbus::gbException(Ghulbus::gbException::GB_FAILED,
	                                             "Could not open obj file for read") ); }
	ReadFile(fin);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rsp, %rdi
movl $0x8, %edx
callq 0x2370
movq (%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rsp,%rax)
jne 0x2831
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x2894
movq %rsp, %rdi
callq 0x2060
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
leaq 0x77bf(%rip), %rdx      # 0xa004
movq %rax, %rdi
movl $0x1, %esi
callq 0x85f8
leaq 0xc537(%rip), %rsi      # 0xed90
leaq 0x5dc4(%rip), %rdx      # 0x8624
movq %r14, %rdi
callq 0x2320
movq %rax, %r14
jmp 0x2878
movq %rax, %r14
movq %rsp, %rdi
callq 0x2060
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x288c
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/obj_loader.cpp
// Function: OBJ_Mesh::SetName(char const*)
void OBJ_Mesh::SetName(char const* name) {
	if(m_name) { delete[] m_name;  m_name = NULL; }
	size_t size = strlen(name) + 1;
	m_name = new char[size];
	strcpy(m_name, name);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x60(%rdi), %rdi
testq %rdi, %rdi
je 0x3de6
callq 0x2250
movq $0x0, 0x60(%r14)
movq %rbx, %rdi
callq 0x20c0
leaq 0x1(%rax), %rdi
callq 0x2030
movq %rax, 0x60(%r14)
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2180
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/obj_loader.cpp
// Function: OBJ_Mesh::OBJ_Mesh(OBJ_Mesh const&)
OBJ_Mesh::OBJ_Mesh(OBJ_Mesh const& rhs)
	:m_name(NULL)
{
	//copy construct:
	this->SetName(rhs.m_name);
	this->SetGeometry(rhs.m_geometry);
	this->SetNormals(rhs.m_normals);
	this->SetTextureData(rhs.m_texcoords);
	this->SetFaceData(rhs.m_faces);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
leaq 0x30(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x60(%rdi)
movq 0x60(%rsi), %rsi
callq 0x3dc6
movq %rbx, %rdi
movq %r12, %rsi
callq 0x403c
leaq 0x18(%r12), %rsi
movq %rbx, %rdi
callq 0x4092
leaq 0x30(%r12), %rsi
movq %rbx, %rdi
callq 0x40fa
addq $0x48, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4162
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r12
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x4025
movq 0x58(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2415
movq %r12, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::CheckValidity(IconSys::File_t const&)
bool IconSys::CheckValidity(IconSys::File_t const& f)
{
	if( (f.ps2d_string[0] != 'P') ||
		(f.ps2d_string[1] != 'S') ||
		(f.ps2d_string[2] != '2') ||
		(f.ps2d_string[3] != 'D') ||
		/* (f.reserve1 != 0) || */ //this is not necessary, see e.g. system configuration file
		(f.reserve2 != 0) ) { return false; }
	for(int i=0; i<512; i++) {
		if(f.reserve3[i] != 0) { return false; }
	}
	return true;
}

// Assembly:
xorl %eax, %eax
cmpb $0x50, (%rdi)
jne 0x4a06
cmpb $0x53, 0x1(%rdi)
jne 0x4a06
cmpb $0x32, 0x2(%rdi)
jne 0x4a06
cmpb $0x44, 0x3(%rdi)
jne 0x4a06
cmpl $0x0, 0x8(%rdi)
jne 0x4a06
cmpb $0x0, 0x1c4(%rdi)
je 0x4a07
xorl %eax, %eax
retq
xorl %ecx, %ecx
movq %rcx, %rax
cmpq $0x1ff, %rcx            # imm = 0x1FF
je 0x4a23
leaq 0x1(%rax), %rcx
cmpb $0x0, 0x1c5(%rdi,%rax)
je 0x4a09
cmpq $0x1ff, %rax            # imm = 0x1FF
setae %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::DecodeTitle(unsigned char const*, char*)
void IconSys::DecodeTitle(unsigned char const * str_in, char* str_out)
{
	unsigned char t1, t2;

	for(int i=0; i<68; i+=2) {
		t1 = str_in[i];		//each S-JIS character consists of two bytes
		t2 = str_in[i+1];

		switch(t1) {
			case 0x00:
				if(t2 == 0x00) {
					str_out[i>>1] = '\0';
					return;
				} else {
					str_out[i>>1] = '?';
				}
				break;
			case 0x81:
				if(t2 == 0x40) {
					str_out[i>>1] = ' ';
				} else if(t2 == 0x46) {
					str_out[i>>1] = ':';
				} else if(t2 == 0x5E) {
					str_out[i>>1] = '/';
				} else if(t2 == 0x69) {
					str_out[i>>1] = '(';
				} else if(t2 == 0x6A) {
					str_out[i>>1] = ')';
				} else if(t2 == 0x6D) {
					str_out[i>>1] = '[';
				} else if(t2 == 0x6E) {
					str_out[i>>1] = ']';
				} else if(t2 == 0x6F) {
					str_out[i>>1] = '{';
				} else if(t2 == 0x70) {
					str_out[i>>1] = '}';
				} else {
					str_out[i>>1] = '?';
				}
				break;
			case 0x82:
				if((t2 >= 0x4f) && (t2 <= 0x7A)) {
					//digits (0-9), capital letters (A-Z)
					str_out[i>>1] = t2-31;
				} else if( (t2 >= 0x81) && (t2 <= 0x9B) ) {
					//lowercase letters (a-z)
					str_out[i>>1] = t2-32;
				} else if(t2 == 0x3F) {
					str_out[i>>1] = ' ';
				}  else {
					str_out[i>>1] = '?';
				}
				break;			
			default:
				str_out[i>>1] = '?';
				break;
		}
	}
}

// Assembly:
movq $-0x2, %rax
leaq 0x5730(%rip), %rcx      # 0xa16c
movzbl 0x2(%rdi,%rax), %r8d
movzbl 0x3(%rdi,%rax), %edx
cmpl $0x82, %r8d
je 0x4a86
cmpl $0x81, %r8d
je 0x4a6b
testl %r8d, %r8d
jne 0x4a66
testl %edx, %edx
je 0x4af2
movb $0x3f, (%rsi)
jmp 0x4ae0
cmpl $0x68, %edx
jle 0x4aa6
addl $-0x69, %edx
cmpl $0x7, %edx
ja 0x4a66
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movb $0x28, (%rsi)
jmp 0x4ae0
leal -0x4f(%rdx), %r8d
cmpb $0x2b, %r8b
ja 0x4a95
addb $-0x1f, %dl
jmp 0x4aa2
leal 0x7f(%rdx), %r8d
cmpb $0x1a, %r8b
ja 0x4aba
addb $-0x20, %dl
movb %dl, (%rsi)
jmp 0x4ae0
cmpl $0x40, %edx
je 0x4abf
cmpl $0x46, %edx
je 0x4add
cmpl $0x5e, %edx
jne 0x4a66
movb $0x2f, (%rsi)
jmp 0x4ae0
cmpl $0x3f, %edx
jne 0x4a66
movb $0x20, (%rsi)
jmp 0x4ae0
movb $0x7b, (%rsi)
jmp 0x4ae0
movb $0x5b, (%rsi)
jmp 0x4ae0
movb $0x5d, (%rsi)
jmp 0x4ae0
movb $0x29, (%rsi)
jmp 0x4ae0
movb $0x7d, (%rsi)
jmp 0x4ae0
movb $0x3a, (%rsi)
incq %rsi
addq $0x2, %rax
cmpq $0x42, %rax
jb 0x4a3c
retq
movb $0x0, (%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::GetTitleString(char const*, unsigned int, char*)
void IconSys::GetTitleString(char const * str_in, unsigned int pos_linebreak, char * str_out)
{
	unsigned int i, j;
	pos_linebreak = pos_linebreak >> 1;				//remember S-JIS uses two bytes per character!
	if( (pos_linebreak>0) && (pos_linebreak < 33) ) {
		for(i=0, j=0; i<pos_linebreak; i++, j++) {
			str_out[i] = str_in[j];
		}
		str_out[i++] = '\n';
	} else {
		i = 0;
		j = 0;
	}
	for(; (i<35) || (str_in[i] == '\0'); i++, j++) {
		str_out[i] = str_in[j];
	}
}

// Assembly:
leal -0x2(%rsi), %r8d
xorl %ecx, %ecx
movl $0x0, %eax
cmpl $0x3f, %r8d
ja 0x4cc3
xorl %eax, %eax
cmpl $0x2, %esi
jb 0x4ca8
shrl %esi
movl %esi, %ecx
xorl %eax, %eax
movb (%rdi,%rax), %sil
movb %sil, (%rdx,%rax)
incq %rax
cmpq %rax, %rcx
jne 0x4c98
movl %eax, %esi
movl %eax, %ecx
incl %ecx
movb $0xa, (%rdx,%rsi)
jmp 0x4cc3
movl %eax, %r8d
movb (%rdi,%r8), %r8b
movb %r8b, (%rdx,%rsi)
incl %ecx
incl %eax
movl %ecx, %esi
cmpl $0x23, %ecx
jb 0x4cb4
cmpb $0x0, (%rdi,%rsi)
je 0x4cb4
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetToDefault()
void IconSys::SetToDefault() {
	File.ps2d_string[0] = 'P';  File.ps2d_string[1] = 'S';  
	File.ps2d_string[2] = '2';  File.ps2d_string[3] = 'D';
	File.reserve1 = 0;
	File.offset_2nd_line = 32;
	File.reserve2 = 0;
	File.bg_opacity = 0;
	File.bg_color_upperleft[0]  = 0x80;  File.bg_color_upperleft[1]  = 0x80;
	File.bg_color_upperleft[2]  = 0x80;  File.bg_color_upperleft[3]  = 0x00;
	File.bg_color_upperright[0] = 0x80;  File.bg_color_upperright[1] = 0x80;
	File.bg_color_upperright[2] = 0x80;  File.bg_color_upperright[3] = 0x00;
	File.bg_color_lowerleft[0]  = 0x80;  File.bg_color_lowerleft[1]  = 0x80;
	File.bg_color_lowerleft[2]  = 0x80;  File.bg_color_lowerleft[3]  = 0x00;
	File.bg_color_lowerright[0] = 0x80;  File.bg_color_lowerright[1] = 0x80;
	File.bg_color_lowerright[2] = 0x80;  File.bg_color_lowerright[3] = 0x00;
	File.light1_direction[0] =  0.5f;  File.light1_direction[1] =  0.5f;
	File.light1_direction[2] =  0.5f;  File.light1_direction[3] =  0.0f;
	File.light2_direction[0] =  0.0f;  File.light2_direction[1] = -0.4f;
	File.light2_direction[2] = -0.1f;  File.light2_direction[3] =  0.0f;
	File.light3_direction[0] = -0.5f;  File.light3_direction[1] = -0.5f;
	File.light3_direction[2] =  0.5f;  File.light3_direction[3] =  0.0f;
	File.light1_color[0] = 1.0f;  File.light1_color[1] = 1.0f;
	File.light1_color[2] = 1.0f;  File.light1_color[3] = 0.0f;
	File.light2_color[0] = 1.0f;  File.light2_color[1] = 1.0f;
	File.light2_color[2] = 1.0f;  File.light2_color[3] = 0.0f;
	File.light3_color[0] = 1.0f;  File.light3_color[1] = 1.0f;
	File.light3_color[2] = 1.0f;  File.light3_color[3] = 0.0f;
	File.light_ambient_color[0] = 1.0f;  File.light_ambient_color[1] = 1.0f;
	File.light_ambient_color[2] = 1.0f;  File.light_ambient_color[3] = 0.0f;
	SetTitle("DEFAULT");
	SetIconFilename("ICON.ICN");
	SetIconCopyFilename("ICON.ICN");
	SetIconDeleteFilename("ICON.ICN");
	memset(File.reserve3, 0, 512); 
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movabsq $0x20000044325350, %rax # imm = 0x20000044325350
movq %rax, (%rdi)
movaps 0x549d(%rip), %xmm0     # 0xa190
movups %xmm0, 0x8(%rdi)
movaps 0x54a2(%rip), %xmm0     # 0xa1a0
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
movq $0x80, 0x48(%rdi)
movaps 0x5497(%rip), %xmm0     # 0xa1b0
movups %xmm0, 0x50(%rdi)
movaps 0x549c(%rip), %xmm0     # 0xa1c0
movups %xmm0, 0x60(%rdi)
movaps 0x54a1(%rip), %xmm0     # 0xa1d0
movups %xmm0, 0x70(%rdi)
movaps 0x54a6(%rip), %xmm0     # 0xa1e0
movups %xmm0, 0x80(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0xa0(%rdi)
movups %xmm0, 0xb0(%rdi)
leaq 0x54cd(%rip), %rsi      # 0xa22a
callq 0x4ed6
leaq 0x54c9(%rip), %r14      # 0xa232
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4f60
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4fd8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5050
addq $0x1c4, %rbx            # imm = 0x1C4
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2100
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::IconSys(char const*)
IconSys::IconSys(const char* fname)
{
	std::ifstream fin(fname, std::ios_base::in | std::ios_base::binary);
	if(fin.fail()) { throw( Ghulbus::gbException(Ghulbus::gbException::GB_FAILED,
	                                             "Could not open icon file for read") ); }

	fin.read( reinterpret_cast<char*>(&File), sizeof(File) );
	if(fin.fail()) {
		fin.close();
		throw( Ghulbus::gbException(Ghulbus::gbException::GB_FAILED,
			                        "File read error") ); 
	}
	fin.close();

	/*if(!CheckValidity(File)) { 
		throw( Ghulbus::gbException(Ghulbus::gbException::GB_FAILED,
			                        "File seems to be corrupted") ); 
	}*/

	DecodeTitle(File.title, decoded_title);
	GetTitleString(decoded_title, File.offset_2nd_line, title_str);
	strcpy(title_str_single_line, title_str);
	char* tmp = strchr(title_str_single_line, '\n');
	if(tmp) { *tmp = ' '; }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0xc, %edx
callq 0x2370
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
jne 0x4e71
leaq 0x8(%rsp), %rdi
movl $0x3c4, %edx            # imm = 0x3C4
movq %rbx, %rsi
callq 0x2240
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
jne 0x4e7a
leaq 0x8(%rsp), %rdi
callq 0x2050
leaq 0xc0(%rbx), %rdi
leaq 0x3c4(%rbx), %r14
movq %r14, %rsi
callq 0x4a2e
movzwl 0x6(%rbx), %esi
leaq 0x3e6(%rbx), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x4c7a
addq $0x409, %rbx            # imm = 0x409
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2180
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20a0
testq %rax, %rax
je 0x4e5a
movb $0x20, (%rax)
leaq 0x8(%rsp), %rdi
callq 0x2060
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5380(%rip), %rbx      # 0xa1f8
jmp 0x4e8b
leaq 0x8(%rsp), %rdi
callq 0x2050
leaq 0x538f(%rip), %rbx      # 0xa21a
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
movq %rax, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x85f8
leaq 0x9ee1(%rip), %rsi      # 0xed90
leaq 0x376e(%rip), %rdx      # 0x8624
movq %r14, %rdi
callq 0x2320
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetTitle(char const*)
void IconSys::SetTitle(char const* str) {
	size_t len = strlen(str);
	if(len > 32) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER,
			                         "Title string exceeds character limit" ) );
	}
	//write ASCII string:
	memcpy(decoded_title, str, len+1);
	//write S-JIS string:
	EncodeTitle(decoded_title, File.title);
	//update linebreaks (remember the / 2 since File is referring to SJIS):
	SetLinebreak(File.offset_2nd_line / 2);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20c0
cmpq $0x21, %rax
jae 0x4f29
leaq 0x3c4(%rbx), %r15
incq %rax
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2140
leaq 0xc0(%rbx), %rsi
movq %r15, %rdi
callq 0x4af6
movzwl 0x6(%rbx), %esi
shrl %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x50d0
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
leaq 0x52fe(%rip), %rdx      # 0xa23b
movq %rax, %rdi
movl $0x3, %esi
callq 0x85f8
leaq 0x9e3f(%rip), %rsi      # 0xed90
leaq 0x36cc(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetIconFilename(char const*)
void IconSys::SetIconFilename(char const* fname) {
	if(strlen(fname) > 32) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) );
	}
	for(size_t i=0; i<64; i++) {
		if(i < strlen(fname)) {
			File.icon_file[i] = fname[i];
		} else {
			File.icon_file[i] = 0;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x20c0
cmpq $0x20, %rax
ja 0x4fa8
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x20c0
cmpq %rax, %r15
jae 0x4f8f
movb (%rbx,%r15), %al
jmp 0x4f91
xorl %eax, %eax
movb %al, 0x104(%r14,%r15)
incq %r15
cmpq $0x40, %r15
jne 0x4f7c
popq %rbx
popq %r14
popq %r15
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
callq 0x85e2
leaq 0x9dc7(%rip), %rsi      # 0xed90
leaq 0x3654(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetIconCopyFilename(char const*)
void IconSys::SetIconCopyFilename(char const* fname) {
	if(strlen(fname) > 32) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) );
	}
	for(size_t i=0; i<64; i++) {
		if(i < strlen(fname)) {
			File.icon_copy_file[i] = fname[i];
		} else {
			File.icon_copy_file[i] = 0;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x20c0
cmpq $0x20, %rax
ja 0x5020
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x20c0
cmpq %rax, %r15
jae 0x5007
movb (%rbx,%r15), %al
jmp 0x5009
xorl %eax, %eax
movb %al, 0x144(%r14,%r15)
incq %r15
cmpq $0x40, %r15
jne 0x4ff4
popq %rbx
popq %r14
popq %r15
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
callq 0x85e2
leaq 0x9d4f(%rip), %rsi      # 0xed90
leaq 0x35dc(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetIconDeleteFilename(char const*)
void IconSys::SetIconDeleteFilename(char const* fname) {
	if(strlen(fname) > 32) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) );
	}
	for(size_t i=0; i<64; i++) {
		if(i < strlen(fname)) {
			File.icon_delete_file[i] = fname[i];
		} else {
			File.icon_delete_file[i] = 0;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x20c0
cmpq $0x20, %rax
ja 0x5098
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x20c0
cmpq %rax, %r15
jae 0x507f
movb (%rbx,%r15), %al
jmp 0x5081
xorl %eax, %eax
movb %al, 0x184(%r14,%r15)
incq %r15
cmpq $0x40, %r15
jne 0x506c
popq %rbx
popq %r14
popq %r15
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
callq 0x85e2
leaq 0x9cd7(%rip), %rsi      # 0xed90
leaq 0x3564(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetLinebreak(int)
void IconSys::SetLinebreak(int lb) {
	if(lb > 32) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER,
									 "Linebreak exceeds character limit" ) );
	}
	File.offset_2nd_line = static_cast<unsigned short>(lb * 2);
	GetTitleString(decoded_title, File.offset_2nd_line, title_str);
	strcpy(title_str_single_line, title_str);
	char* tmp = strchr(title_str_single_line, '\n');
	if(tmp) { *tmp = ' '; }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x21, %esi
jge 0x512a
movq %rdi, %rbx
addl %esi, %esi
movw %si, 0x6(%rdi)
addq $0x3c4, %rdi            # imm = 0x3C4
movzwl %si, %esi
leaq 0x3e6(%rbx), %r14
movq %r14, %rdx
callq 0x4c7a
addq $0x409, %rbx            # imm = 0x409
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2180
movq %rbx, %rdi
movl $0xa, %esi
callq 0x20a0
testq %rax, %rax
je 0x5122
movb $0x20, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
leaq 0x5122(%rip), %rdx      # 0xa260
movq %rax, %rdi
movl $0x3, %esi
callq 0x85f8
leaq 0x9c3e(%rip), %rsi      # 0xed90
leaq 0x34cb(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetBackgroundColor_UL(IconSys::IconSys_Color const&)
void IconSys::IconSys_Color::Get(unsigned int* p) const
{
	p[0] = static_cast<unsigned int>(R);
	p[1] = static_cast<unsigned int>(G);
	p[2] = static_cast<unsigned int>(B);
	p[3] = static_cast<unsigned int>(X);
}

// Assembly:
movl (%rsi), %eax
movl %eax, 0x10(%rdi)
movl 0x4(%rsi), %eax
movl %eax, 0x14(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x18(%rdi)
movl 0xc(%rsi), %eax
movl %eax, 0x1c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetLight1Color(IconSys::IconSys_LightColor const&)
void IconSys::IconSys_LightColor::Get(float* p) const {
	p[0] = R;
	p[1] = G;
	p[2] = B;
	p[3] = X;
}

// Assembly:
movss (%rsi), %xmm0
movss %xmm0, 0x80(%rdi)
movss 0x4(%rsi), %xmm0
movss %xmm0, 0x84(%rdi)
movss 0x8(%rsi), %xmm0
movss %xmm0, 0x88(%rdi)
movss 0xc(%rsi), %xmm0
movss %xmm0, 0x8c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::SetLight1Dir(IconSys::IconSys_LightVec const&)
void IconSys::IconSys_LightVec::Get(float* p) const {
	p[0] = X;
	p[1] = Y;
	p[2] = Z;
	p[3] = W;
}

// Assembly:
movss (%rsi), %xmm0
movss %xmm0, 0x50(%rdi)
movss 0x4(%rsi), %xmm0
movss %xmm0, 0x54(%rdi)
movss 0x8(%rsi), %xmm0
movss %xmm0, 0x58(%rdi)
movss 0xc(%rsi), %xmm0
movss %xmm0, 0x5c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::WriteFile(char const*)
void IconSys::WriteFile(const char * fname) {
	std::ofstream fout(fname, std::ios_base::out | std::ios_base::binary);
	if(fout.fail()) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED,
			                         "Error opening output file for icon.sys") );
	}
	fout.seekp(std::ios::beg);

	//write data:
	fout.write( reinterpret_cast<char*>(&File), sizeof(File) );
	if(fout.fail()) {
		fout.close();
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED,
			                         "Error writing output file for icon.sys") );
	}
	fout.close();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x14, %edx
callq 0x21e0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
jne 0x56d2
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2200
leaq 0x8(%rsp), %rdi
movl $0x3c4, %edx            # imm = 0x3C4
movq %rbx, %rsi
callq 0x2260
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
jne 0x56db
leaq 0x8(%rsp), %rdi
callq 0x2290
movq 0x992c(%rip), %rax      # 0xefc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x8(%rsp,%rcx)
callq 0x2150
leaq 0x100(%rsp), %rdi
callq 0x2080
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
leaq 0x4ba9(%rip), %rbx      # 0xa282
jmp 0x56ec
leaq 0x8(%rsp), %rdi
callq 0x2290
leaq 0x4bbd(%rip), %rbx      # 0xa2a9
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
movq %rax, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x85f8
leaq 0x9680(%rip), %rsi      # 0xed90
leaq 0x2f0d(%rip), %rdx      # 0x8624
movq %r14, %rdi
callq 0x2320
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22b0
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::IconSys_Color::CheckRanges()
void IconSys::IconSys_Color::CheckRanges() {
	if(R < 0)   { R = 0; }
	if(R > 255) { R = 255; }
	if(G < 0)   { G = 0; }
	if(G > 255) { G = 255; }
	if(B < 0)   { B = 0; }
	if(B > 255) { B = 255; }
	if(X < 0)   { X = 0; }
	if(X > 255) { X = 255; }
}

// Assembly:
cmpl $0x0, (%rdi)
jns 0x575b
movl $0x0, (%rdi)
cmpl $0x100, (%rdi)          # imm = 0x100
jl 0x5769
movl $0xff, (%rdi)
cmpl $0x0, 0x4(%rdi)
jns 0x5776
movl $0x0, 0x4(%rdi)
cmpl $0x100, 0x4(%rdi)       # imm = 0x100
jl 0x5786
movl $0xff, 0x4(%rdi)
cmpl $0x0, 0x8(%rdi)
jns 0x5793
movl $0x0, 0x8(%rdi)
cmpl $0x100, 0x8(%rdi)       # imm = 0x100
jl 0x57a3
movl $0xff, 0x8(%rdi)
cmpl $0x0, 0xc(%rdi)
jns 0x57b0
movl $0x0, 0xc(%rdi)
cmpl $0x100, 0xc(%rdi)       # imm = 0x100
jl 0x57c0
movl $0xff, 0xc(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::IconSys_Color::operator=(IconSys::IconSys_Color const&)
IconSys::IconSys_Color& IconSys::IconSys_Color::operator =(IconSys::IconSys_Color const& in) {
	if(this != &in) {
		R = in.R;
		G = in.G;
		B = in.B;
		X = in.X;
	}
	return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x582c
movl (%rsi), %ecx
movl %ecx, (%rax)
movl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rax)
movl 0x8(%rsi), %ecx
movl %ecx, 0x8(%rax)
movl 0xc(%rsi), %ecx
movl %ecx, 0xc(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::IconSys_LightColor::CheckRanges()
void IconSys::IconSys_LightColor::CheckRanges() {
	if(R < 0.0f) { R = 0.0f; }
	if(R > 1.0f) { R = 1.0f; }
	if(G < 0.0f) { G = 0.0f; }
	if(G > 1.0f) { G = 1.0f; }
	if(B < 0.0f) { B = 0.0f; }
	if(B > 1.0f) { B = 1.0f; }
	if(X < 0.0f) { X = 0.0f; }
	if(X > 1.0f) { X = 1.0f; }
}

// Assembly:
xorps %xmm0, %xmm0
ucomiss (%rdi), %xmm0
jbe 0x590e
movl $0x0, (%rdi)
movss (%rdi), %xmm0
ucomiss 0x48d7(%rip), %xmm0     # 0xa1f0
jbe 0x5921
movl $0x3f800000, (%rdi)     # imm = 0x3F800000
xorps %xmm0, %xmm0
ucomiss 0x4(%rdi), %xmm0
jbe 0x5931
movl $0x0, 0x4(%rdi)
movss 0x4(%rdi), %xmm0
ucomiss 0x48b3(%rip), %xmm0     # 0xa1f0
jbe 0x5946
movl $0x3f800000, 0x4(%rdi)  # imm = 0x3F800000
xorps %xmm0, %xmm0
ucomiss 0x8(%rdi), %xmm0
jbe 0x5956
movl $0x0, 0x8(%rdi)
movss 0x8(%rdi), %xmm0
ucomiss 0x488e(%rip), %xmm0     # 0xa1f0
jbe 0x596b
movl $0x3f800000, 0x8(%rdi)  # imm = 0x3F800000
xorps %xmm0, %xmm0
ucomiss 0xc(%rdi), %xmm0
jbe 0x597b
movl $0x0, 0xc(%rdi)
movss 0xc(%rdi), %xmm0
ucomiss 0x4869(%rip), %xmm0     # 0xa1f0
jbe 0x5990
movl $0x3f800000, 0xc(%rdi)  # imm = 0x3F800000
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_iconsys.cpp
// Function: IconSys::IconSys_LightVec::operator=(IconSys::IconSys_LightVec const&)
IconSys::IconSys_LightVec& IconSys::IconSys_LightVec::operator=(IconSys::IconSys_LightVec const& in)
{
	if(this != &in) {
		X = in.X;
		Y = in.Y;
		Z = in.Z;
		W = in.W;
	}
	return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x5ba6
movss (%rsi), %xmm0
movss %xmm0, (%rax)
movss 0x4(%rsi), %xmm0
movss %xmm0, 0x4(%rax)
movss 0x8(%rsi), %xmm0
movss %xmm0, 0x8(%rax)
movss 0xc(%rsi), %xmm0
movss %xmm0, 0xc(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::PS2Icon(char const*)
PS2Icon::PS2Icon(const char *fname): vertices(NULL), normals(NULL), vert_texture(NULL),
fvertices(NULL), fnormals(NULL), animation(NULL), anim_keys(NULL)
{
	std::ifstream fin(fname, std::ios_base::in | std::ios_base::binary);
	if(fin.fail()) { throw( Ghulbus::gbException(Ghulbus::gbException::GB_FAILED,
	                                             "Could not open icon file for read") ); }
	//read icon data from file:
	try {
		ReadFile(fin);
	} catch(std::exception) {
		fin.close();
		throw;
	}
	fin.close();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movq $0x0, 0x38(%rdi)
movups %xmm0, 0x58(%rdi)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0xc, %edx
callq 0x2370
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x30(%rsp,%rax)
jne 0x5c60
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x5d02
leaq 0x10(%rsp), %rdi
callq 0x2050
leaq 0x10(%rsp), %rdi
callq 0x2060
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
leaq 0x4584(%rip), %rdx      # 0xa1f8
movq %rax, %rdi
movl $0x1, %esi
callq 0x85f8
leaq 0x9108(%rip), %rsi      # 0xed90
leaq 0x2995(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
jmp 0x5cd0
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x5cef
movq %rbx, %rdi
callq 0x2230
movq 0x9320(%rip), %rax      # 0xefd0
addq $0x10, %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x20b0
leaq 0x10(%rsp), %rdi
callq 0x2050
callq 0x22a0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x23a0
callq 0x2300
jmp 0x5cef
movq %rax, %rdi
callq 0x7292
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::PS2Icon()
PS2Icon::PS2Icon(): vertices(NULL), normals(NULL), vert_texture(NULL), 
fvertices(NULL), fnormals(NULL), animation(NULL), anim_keys(NULL)
{
	header.file_id          = 0x010000;
	header.animation_shapes = 1;
	header.texture_type     = 0x07;
	header.reserved         = 0x3F800000;
	header.n_vertices       = 0;
	
	anim_header.id_tag       = 1;
	anim_header.frame_length = 31;
	anim_header.anim_speed   = 1.0f;
	anim_header.play_offset  = 0;
	anim_header.n_frames     = 0;
	
	memset(texture, 0, sizeof(unsigned int)*16384);
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movq $0x0, 0x38(%rdi)
movups %xmm0, 0x58(%rdi)
movaps 0x4174(%rip), %xmm0     # 0xa2e0
movups %xmm0, (%rdi)
xorl %eax, %eax
movl %eax, 0x10(%rdi)
movaps 0x4175(%rip), %xmm0     # 0xa2f0
movups %xmm0, 0x40(%rdi)
movl %eax, 0x50(%rdi)
addq $0x68, %rdi
movl $0x10000, %edx          # imm = 0x10000
xorl %esi, %esi
jmp 0x2100
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::AllocateVertexMemory()
void PS2Icon::AllocateVertexMemory() 
{
	//helper function that reallocates all per-vertex storage fields based 
	//on the information stored in the header struct
	if(vertices)     { delete[] vertices;          vertices = NULL; }
	if(fvertices)    { delete[] fvertices;        fvertices = NULL; }
	if(normals)      { delete[] normals;            normals = NULL; }
	if(fnormals)     { delete[] fnormals;          fnormals = NULL; }
	if(vert_texture) { delete[] vert_texture;  vert_texture = NULL; }
	vertices     = new Vertex_Coord[header.n_vertices * header.animation_shapes];
	fvertices    = new        float[header.n_vertices * header.animation_shapes * 3];
	normals      = new Vertex_Coord[header.n_vertices];
	fnormals     = new        float[header.n_vertices * 3];
	vert_texture = new Texture_Data[header.n_vertices];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x61b0
callq 0x2250
movq $0x0, 0x18(%rbx)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x61c6
callq 0x2250
movq $0x0, 0x30(%rbx)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x61dc
callq 0x2250
movq $0x0, 0x20(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x61f2
callq 0x2250
movq $0x0, 0x38(%rbx)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x6208
callq 0x2250
movq $0x0, 0x28(%rbx)
movl 0x10(%rbx), %r15d
movl 0x4(%rbx), %r14d
imull %r15d, %r14d
leaq (,%r14,8), %rdi
callq 0x2030
movq %rax, 0x18(%rbx)
leal (%r14,%r14,2), %edi
shlq $0x2, %rdi
callq 0x2030
movq %rax, 0x30(%rbx)
movq %r15, %r14
shlq $0x3, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
leal (%r15,%r15,2), %edi
shlq $0x2, %rdi
callq 0x2030
movq %rax, 0x38(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x28(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::BuildMesh(OBJ_Mesh*)
void PS2Icon::BuildMesh(OBJ_Mesh* mesh) {
	float* tf = new float[header.n_vertices*3];
	this->GetVertexData(tf, 0);
	mesh->SetGeometry(tf, header.n_vertices*3);
	delete[] tf;
	mesh->SetNormals(fnormals, header.n_vertices*3);
	
	mesh->ClearTextureData();
	float tmp;
	for(unsigned int i=0; i<header.n_vertices; i++) {
		//texture data has to be converted by hand (2D -> 3D)
		tmp = convert_f16_to_f32(vert_texture[i].f16_u);
		mesh->AddTextureData(&tmp, 1);
		tmp = convert_f16_to_f32(vert_texture[i].f16_v);
		mesh->AddTextureData(&tmp, 1);
		tmp = 0.0f;
		mesh->AddTextureData(&tmp, 1);
	}

	mesh->ClearFaceData();
	OBJ_Mesh::Face face;
	for(unsigned int i=0; i<header.n_vertices/3; i++) {
		//face indices are calculated straightforward
		///@todo: vertex recycling?
		face.vert1 = face.normal1 = face.texture1 = i*3;
		face.vert2 = face.normal2 = face.texture2 = i*3 + 1;
		face.vert3 = face.normal3 = face.texture3 = i*3 + 2;

		face.smoothing_group = 1;
		mesh->AddFaceData(&face, 1);
	}		
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %eax
leal (%rax,%rax,2), %edi
shlq $0x2, %rdi
callq 0x2030
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x68d6
movl 0x10(%r14), %eax
leal (%rax,%rax,2), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x752c
movq %r15, %rdi
callq 0x2250
movq 0x38(%r14), %rsi
movl 0x10(%r14), %eax
leal (%rax,%rax,2), %edx
movq %rbx, %rdi
callq 0x75a4
movq %rbx, %rdi
callq 0x4298
cmpl $0x0, 0x10(%r14)
je 0x6846
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
movq 0x28(%r14), %rax
movswl (%rax,%r12,8), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss 0x3afb(%rip), %xmm1     # 0xa2d0
mulss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x761a
movq 0x28(%r14), %rax
movswl 0x2(%rax,%r12,8), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x3ac8(%rip), %xmm0     # 0xa2d0
movss %xmm0, 0xc(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x761a
movl $0x0, 0xc(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x761a
incq %r12
movl 0x10(%r14), %eax
cmpq %rax, %r12
jb 0x67bd
movq %rbx, %rdi
callq 0x42a8
cmpl $0x3, 0x10(%r14)
jb 0x68c7
xorl %ebp, %ebp
movl $0x2, %r12d
leaq 0x10(%rsp), %r15
movl $0xaaaaaaab, %r13d      # imm = 0xAAAAAAAB
leal -0x2(%r12), %eax
movl %eax, 0x28(%rsp)
movl %eax, 0x1c(%rsp)
movl %eax, 0x10(%rsp)
leal -0x1(%r12), %eax
movl %eax, 0x2c(%rsp)
movl %eax, 0x20(%rsp)
movl %eax, 0x14(%rsp)
movl %r12d, 0x30(%rsp)
movl %r12d, 0x24(%rsp)
movl %r12d, 0x18(%rsp)
movl $0x1, 0x34(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x3e0e
incl %ebp
movl 0x10(%r14), %eax
imulq %r13, %rax
shrq $0x21, %rax
addl $0x3, %r12d
cmpl %eax, %ebp
jb 0x6868
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::GetVertexData(float*, int) const
void PS2Icon::GetVertexData(float* data, int shape) const {
	if(shape >= static_cast<int>(header.animation_shapes)) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) ); 
	}
	if(shape >= 0) {	//copy specified shape
		for(unsigned int i=0; i<header.n_vertices; i++) {
			data[i*3]     = fvertices[(i*header.animation_shapes + shape) * 3];
			data[i*3 + 1] = fvertices[(i*header.animation_shapes + shape) * 3 + 1];
			data[i*3 + 2] = fvertices[(i*header.animation_shapes + shape) * 3 + 2];
		}
	} else {			//copy *all* shapes one after the other
		for(unsigned int j=0; j<header.animation_shapes; j++) {
			for(unsigned int i=0; i<header.n_vertices; i++) {
				data[j*header.n_vertices*3 + i*3]     = fvertices[(i*header.animation_shapes + j) * 3];
				data[j*header.n_vertices*3 + i*3 + 1] = fvertices[(i*header.animation_shapes + j) * 3 + 1];
				data[j*header.n_vertices*3 + i*3 + 2] = fvertices[(i*header.animation_shapes + j) * 3 + 2];
			}
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x4(%rdi), %eax
cmpl %edx, %eax
jle 0x69e9
testl %edx, %edx
js 0x6955
movl 0x10(%rdi), %r8d
testq %r8, %r8
je 0x69dd
movq 0x30(%rdi), %rcx
leal (%rdx,%rdx,2), %edx
leal (%rax,%rax,2), %eax
leaq (%r8,%r8,2), %rdi
xorl %r8d, %r8d
movl %edx, %r9d
movss (%rcx,%r9,4), %xmm0
movl %r8d, %r9d
movss %xmm0, (%rsi,%r9,4)
leal 0x1(%rdx), %r9d
movss (%rcx,%r9,4), %xmm0
leal 0x1(%r8), %r9d
movss %xmm0, (%rsi,%r9,4)
leal 0x2(%rdx), %r9d
movss (%rcx,%r9,4), %xmm0
leal 0x2(%r8), %r9d
movss %xmm0, (%rsi,%r9,4)
addq $0x3, %r8
addl %eax, %edx
cmpq %r8, %rdi
jne 0x690b
jmp 0x69dd
testl %eax, %eax
je 0x69dd
movl 0x10(%rdi), %ecx
movq 0x30(%rdi), %rdx
leal (%rax,%rax,2), %edi
leal (%rcx,%rcx,2), %r8d
xorl %r9d, %r9d
movl $0x2, %r10d
movl $0x2, %r11d
movq %rcx, %rbx
movl %r10d, %r14d
movl %r11d, %r15d
testq %rcx, %rcx
je 0x69ce
leal -0x2(%r15), %r12d
movss (%rdx,%r12,4), %xmm0
leal -0x2(%r14), %r12d
movss %xmm0, (%rsi,%r12,4)
leal -0x1(%r15), %r12d
movss (%rdx,%r12,4), %xmm0
leal -0x1(%r14), %r12d
movss %xmm0, (%rsi,%r12,4)
movl %r15d, %r12d
movss (%rdx,%r12,4), %xmm0
movl %r14d, %r12d
movss %xmm0, (%rsi,%r12,4)
addl %edi, %r15d
addl $0x3, %r14d
decq %rbx
jne 0x6988
incl %r9d
addl $0x3, %r11d
addl %r8d, %r10d
cmpl %eax, %r9d
jne 0x697a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
callq 0x85e2
leaq 0x8386(%rip), %rsi      # 0xed90
leaq 0x1c13(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::~PS2Icon()
PS2Icon::~PS2Icon() 
{
	if(vertices)     { delete[] vertices;          vertices = NULL; }
	if(fvertices)    { delete[] fvertices;        fvertices = NULL; }
	if(normals)      { delete[] normals;            normals = NULL; }
	if(fnormals)     { delete[] fnormals;          fnormals = NULL; }
	if(vert_texture) { delete[] vert_texture;  vert_texture = NULL; }
	if(animation)    { delete[] animation;        animation = NULL; }
	if(anim_keys)    {
		for(unsigned int i=0; i<anim_header.n_frames; i++) {
			if(anim_keys[i]) {
				delete[] anim_keys[i];
				anim_keys[i] = NULL;
			}
		}
		delete[] anim_keys;
		anim_keys = NULL;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x6a37
callq 0x2250
movq $0x0, 0x18(%rbx)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x6a4d
callq 0x2250
movq $0x0, 0x30(%rbx)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x6a63
callq 0x2250
movq $0x0, 0x20(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x6a79
callq 0x2250
movq $0x0, 0x38(%rbx)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x6a8f
callq 0x2250
movq $0x0, 0x28(%rbx)
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x6aa5
callq 0x2250
movq $0x0, 0x58(%rbx)
cmpq $0x0, 0x60(%rbx)
je 0x6af4
cmpl $0x0, 0x50(%rbx)
je 0x6ade
xorl %r14d, %r14d
movq 0x60(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x6ad3
callq 0x2250
movq 0x60(%rbx), %rax
movq $0x0, (%rax,%r14,8)
incq %r14
movl 0x50(%rbx), %eax
cmpq %rax, %r14
jb 0x6ab5
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x6aec
callq 0x2250
movq $0x0, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::GetFrameShape(int) const
int PS2Icon::GetFrameShape(int frame) const {
	if(static_cast<unsigned int>(frame) >= anim_header.n_frames) { 
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) ); 
	}
	if(animation[frame].shape_id > INT_MAX) { throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED ) ); }
	return static_cast<int>(animation[frame].shape_id);
}

// Assembly:
pushq %rbx
cmpl %esi, 0x50(%rdi)
jbe 0x6bc0
movq 0x58(%rdi), %rax
movslq %esi, %rcx
movl (%rax,%rcx,8), %eax
testl %eax, %eax
js 0x6bd7
popq %rbx
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
jmp 0x6bec
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x85e2
leaq 0x8198(%rip), %rsi      # 0xed90
leaq 0x1a25(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::GetNFrameKeys(int) const
int PS2Icon::GetNFrameKeys(int frame) const {
	if(static_cast<unsigned int>(frame) >= anim_header.n_frames) { 
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) ); 
	}
	if(animation[frame].n_keys > INT_MAX) { throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED ) ); }
	return static_cast<int>(animation[frame].n_keys);
}

// Assembly:
pushq %rbx
cmpl %esi, 0x50(%rdi)
jbe 0x6c1f
movq 0x58(%rdi), %rax
movslq %esi, %rcx
movl 0x4(%rax,%rcx,8), %eax
testl %eax, %eax
js 0x6c36
popq %rbx
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
jmp 0x6c4b
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x85e2
leaq 0x8139(%rip), %rsi      # 0xed90
leaq 0x19c6(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::GetFrameKeyTime(int, int) const
float PS2Icon::GetFrameKeyTime(int frame, int key) const {
	if((static_cast<unsigned int>(frame) >= anim_header.n_frames) ||
	   (static_cast<unsigned int>(key) >= animation[frame].n_keys) ) {
		   throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) );;
	}
	return anim_keys[frame][key].time;
}

// Assembly:
cmpl %esi, 0x50(%rdi)
jbe 0x6c89
movq 0x58(%rdi), %rcx
movslq %esi, %rax
cmpl %edx, 0x4(%rcx,%rax,8)
jbe 0x6c89
movq 0x60(%rdi), %rcx
movq (%rcx,%rax,8), %rax
movslq %edx, %rcx
movss (%rax,%rcx,8), %xmm0
retq
pushq %rbx
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
callq 0x85e2
leaq 0x80e5(%rip), %rsi      # 0xed90
leaq 0x1972(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::GetFrameKeyValue(int, int) const
float PS2Icon::GetFrameKeyValue(int frame, int key) const {
	if((static_cast<unsigned int>(frame) >= anim_header.n_frames) ||
	   (static_cast<unsigned int>(key) >= animation[frame].n_keys) ) {
		   throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) );
	}
	return anim_keys[frame][key].value;
}

// Assembly:
cmpl %esi, 0x50(%rdi)
jbe 0x6cde
movq 0x58(%rdi), %rcx
movslq %esi, %rax
cmpl %edx, 0x4(%rcx,%rax,8)
jbe 0x6cde
movq 0x60(%rdi), %rcx
movq (%rcx,%rax,8), %rax
movslq %edx, %rcx
movss 0x4(%rax,%rcx,8), %xmm0
retq
pushq %rbx
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
callq 0x85e2
leaq 0x8090(%rip), %rsi      # 0xed90
leaq 0x191d(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/src/ps2_ps2icon.cpp
// Function: PS2Icon::GetTextureData(unsigned int*, int) const
void PS2Icon::GetTextureData(unsigned int* data, int pitch) const {
	if((pitch < 512) || (pitch % 4 != 0)) { 
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_ILLEGALPARAMETER ) );
	}
	for(int i=0; i<128; i++) {
		memcpy(&(data[i*(pitch>>2)]), &(texture[i*128]), sizeof(unsigned int)*128);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x200, %edx            # imm = 0x200
jl 0x6e41
movl %edx, %eax
andl $0x3, %eax
jne 0x6e41
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %r14
movl %edx, %r15d
xorl %r12d, %r12d
leaq (%r14,%r12), %rsi
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
callq 0x2140
addq %r15, %rbx
addq $0x200, %r12            # imm = 0x200
cmpq $0x10000, %r12          # imm = 0x10000
jne 0x6e11
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x3, %esi
callq 0x85e2
leaq 0x7f2e(%rip), %rsi      # 0xed90
leaq 0x17bb(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/gbLib/src/gbImageLoader.cpp
// Function: GhulbusUtil::gbImageLoader::gbImageLoader(char const*, GhulbusUtil::gbImageLoader::gbImageType*)
gbImageLoader::gbImageLoader(char const* fname, gbImageType* img_type)
		:m_data(NULL), m_palette(NULL), m_width(0), m_height(0), m_bpp(0)
	{
		std::ifstream file( fname, std::ios_base::binary| std::ios_base::in );
		if( file.fail() ) {
			throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED,
				                         "Image file could not be opened" ) );
		}		
		if( !img_type->CheckFile(file) ) {
			throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED,
				                         "Image file seems to be corrupted" ) );
		}

		img_type->ReadFile(file, &m_width, &m_height, &m_bpp, &m_data, &m_palette);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rdi)
movups %xmm0, (%rdi)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0xc, %edx
callq 0x2370
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
jne 0x7711
movq (%r14), %rax
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq *0x8(%rax)
testb %al, %al
je 0x771a
leaq 0x8(%rbx), %rax
leaq 0x10(%rbx), %rdx
leaq 0x14(%rbx), %rcx
leaq 0x18(%rbx), %r8
movq (%r14), %rsi
movq (%rsi), %r10
movq %rax, (%rsp)
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %r9
callq *%r10
leaq 0x8(%rsp), %rdi
callq 0x2060
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2c75(%rip), %rbx      # 0xa38d
jmp 0x7721
leaq 0x2c8b(%rip), %rbx      # 0xa3ac
movl $0x18, %edi
callq 0x20e0
movq %rax, %r14
movq %rax, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x85f8
leaq 0x764b(%rip), %rsi      # 0xed90
leaq 0xed8(%rip), %rdx       # 0x8624
movq %r14, %rdi
callq 0x2320
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2350
nop
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/gbLib/src/gbImageLoader.cpp
// Function: GhulbusUtil::gbImageLoader::GetPaletteData(unsigned int*) const
void gbImageLoader::GetPaletteData(unsigned int* pPal) const {
		switch(m_bpp) {
			case 1:
				memcpy(pPal, m_palette, 2 * 4);
				break;
			case 4:
				memcpy(pPal, m_palette, 16 * 4);
				break;
			case 8:
				memcpy(pPal, m_palette, 256 * 4);
				break;
			default:
				throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED,
					                         "Unable to acquire palette data" ) );
				break;
		}
	}

// Assembly:
movl 0x18(%rdi), %eax
cmpl $0x8, %eax
je 0x7812
cmpl $0x4, %eax
je 0x77ef
cmpl $0x1, %eax
jne 0x7826
movq 0x8(%rdi), %rax
movq (%rax), %rax
movq %rax, (%rsi)
retq
movq 0x8(%rdi), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movups %xmm3, 0x30(%rsi)
movups %xmm2, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
retq
movq 0x8(%rdi), %rax
movl $0x400, %edx            # imm = 0x400
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x2140
pushq %rbx
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
leaq 0x2b92(%rip), %rdx      # 0xa3cd
movq %rax, %rdi
movl $0x1, %esi
callq 0x85f8
leaq 0x7541(%rip), %rsi      # 0xed90
leaq 0xdce(%rip), %rdx       # 0x8624
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/gbLib/src/gbImageLoader.cpp
// Function: GhulbusUtil::gbImageLoader::FlipV()
void gbImageLoader::FlipV() {
		int pitch;		//fields per row
		switch(m_bpp) {
			case 32: case 24: case 16: case 8: 
				pitch = (m_bpp / 8) * m_width;
				break;
			case 4: case 1:
				pitch = m_width;
				break;
			default:
				throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED ) );
				break;
		}
		for(int row=0; row<(m_height/2); row++) {
			for(int i=0; i<pitch; i++) {
				m_data[row * pitch + i] ^= m_data[((m_height-1) - row) * pitch + i]
					^= m_data[row * pitch + i] ^= m_data[((m_height-1) - row) * pitch + i];
			}
		}
	}

// Assembly:
pushq %rbx
movl 0x18(%rdi), %ecx
cmpq $0x20, %rcx
ja 0x7cbd
movabsq $0x101010100, %rax      # imm = 0x101010100
btq %rcx, %rax
jae 0x7c1d
leal 0x7(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x3, %eax
imull 0x10(%rdi), %eax
jmp 0x7c2f
movl $0x12, %eax
btq %rcx, %rax
jae 0x7cbd
movl 0x10(%rdi), %eax
cmpl $0x2, 0x14(%rdi)
jl 0x7cbb
movl %eax, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
xorl %r8d, %r8d
testl %eax, %eax
jle 0x7c9a
xorl %r9d, %r9d
movq (%rdi), %r10
movl 0x14(%rdi), %r11d
addl %edx, %r11d
imull %eax, %r11d
movslq %r11d, %r11
addq %r10, %r11
addq %rsi, %r10
movb (%r9,%r10), %bl
xorb (%r9,%r11), %bl
movb %bl, (%r9,%r10)
movl 0x14(%rdi), %r10d
addl %edx, %r10d
imull %eax, %r10d
movslq %r10d, %r10
addq (%rdi), %r10
xorb (%r9,%r10), %bl
movb %bl, (%r9,%r10)
movq (%rdi), %r10
addq %rsi, %r10
xorb %bl, (%r9,%r10)
incq %r9
cmpq %r9, %rcx
jne 0x7c4c
incq %r8
movl 0x14(%rdi), %r9d
movl %r9d, %r10d
shrl $0x1f, %r10d
addl %r9d, %r10d
sarl %r10d
movslq %r10d, %r9
decl %edx
addq %rcx, %rsi
cmpq %r9, %r8
jl 0x7c45
popq %rbx
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x85e2
leaq 0x70b2(%rip), %rsi      # 0xed90
leaq 0x93f(%rip), %rdx       # 0x8624
movq %rbx, %rdi
callq 0x2320
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/ticky[P]ps2iconsys/gbLib/src/gbException.cpp
// Function: Ghulbus::gbException::operator=(Ghulbus::gbException const&)
gbException& gbException::operator=(gbException const& e) throw() {
		if(this != &e) {
			this->m_errorcode = e.m_errorcode;
			this->m_errorstring = e.m_errorstring;
		}
		return (*this);
	}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x8684
movl 0x8(%rsi), %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rsi), %rcx
movq %rcx, 0x10(%rax)
retq
nop