LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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:
movl (%rdi), %ecx
testl %ecx, %ecx
js 0x4c7d
movl $0xff, %eax
cmpl $0x100, %ecx            # imm = 0x100
jae 0x4c7f
jmp 0x4c81
xorl %eax, %eax
movl %eax, (%rdi)
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
js 0x4c97
movl $0xff, %eax
cmpl $0x100, %ecx            # imm = 0x100
jae 0x4c99
jmp 0x4c9c
xorl %eax, %eax
movl %eax, 0x4(%rdi)
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
js 0x4cb2
movl $0xff, %eax
cmpl $0x100, %ecx            # imm = 0x100
jae 0x4cb4
jmp 0x4cb7
xorl %eax, %eax
movl %eax, 0x8(%rdi)
movl 0xc(%rdi), %ecx
testl %ecx, %ecx
js 0x4ccc
movl $0xff, %eax
cmpl $0x100, %ecx            # imm = 0x100
jae 0x4cce
retq
xorl %eax, %eax
movl %eax, 0xc(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
movss (%rdi), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
ja 0x4e09
movss 0x440c(%rip), %xmm0     # 0x9210
ucomiss %xmm0, %xmm1
jbe 0x4e0d
movss %xmm0, (%rdi)
movss 0x4(%rdi), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
ja 0x4e27
movss 0x43ee(%rip), %xmm0     # 0x9210
ucomiss %xmm0, %xmm1
jbe 0x4e2c
movss %xmm0, 0x4(%rdi)
movss 0x8(%rdi), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
ja 0x4e46
movss 0x43cf(%rip), %xmm0     # 0x9210
ucomiss %xmm0, %xmm1
jbe 0x4e4b
movss %xmm0, 0x8(%rdi)
movss 0xc(%rdi), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
ja 0x4e65
movss 0x43b0(%rip), %xmm0     # 0x9210
ucomiss %xmm0, %xmm1
jbe 0x4e6a
movss %xmm0, 0xc(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x38(%rdi)
movups %xmm0, 0x58(%rdi)
leaq 0x10(%rsp), %r14
pushq $0xc
popq %rdx
movq %r14, %rdi
callq 0x2340
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x30(%rsp,%rax)
jne 0x50b7
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x5154
leaq 0x10(%rsp), %rdi
callq 0x2050
leaq 0x10(%rsp), %rdi
callq 0x2060
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
retq
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
leaq 0x414f(%rip), %rdx      # 0x9218
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x7628
leaq 0x9cbd(%rip), %rsi      # 0xed98
leaq 0x2572(%rip), %rdx      # 0x7654
movq %rbx, %rdi
callq 0x22f0
jmp 0x5123
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x5142
movq %rbx, %rdi
callq 0x2210
movq 0x9ecd(%rip), %rax      # 0xefd0
addq $0x10, %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x20a0
leaq 0x10(%rsp), %rdi
callq 0x2050
callq 0x2280
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2360
callq 0x22e0
jmp 0x5142
movq %rax, %rdi
callq 0x398a
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x38(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x58(%rdi)
movaps 0x3d8b(%rip), %xmm0     # 0x9300
movups %xmm0, (%rdi)
andl $0x0, 0x10(%rdi)
movaps 0x3d8d(%rip), %xmm0     # 0x9310
movups %xmm0, 0x40(%rdi)
andl $0x0, 0x50(%rdi)
addq $0x68, %rdi
movl $0x10000, %edx          # imm = 0x10000
xorl %esi, %esi
jmp 0x2100
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x55b7
callq 0x2230
andq $0x0, 0x18(%rbx)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x55ca
callq 0x2230
andq $0x0, 0x30(%rbx)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x55dd
callq 0x2230
andq $0x0, 0x20(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x55f0
callq 0x2230
andq $0x0, 0x38(%rbx)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x5603
callq 0x2230
andq $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
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, %r12
movq %rdi, %r14
imull $0x3, 0x10(%rdi), %edi
shlq $0x2, %rdi
callq 0x2030
movq %rax, %r15
xorl %r13d, %r13d
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x5c10
imull $0x3, 0x10(%r14), %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x66a2
movq %r15, %rdi
callq 0x2230
movq 0x38(%r14), %rsi
imull $0x3, 0x10(%r14), %edx
leaq 0x18(%r12), %rdi
callq 0x66a2
movq %r12, %rdi
callq 0x3806
movq %r12, %rbx
leaq 0x30(%r12), %r15
leaq 0xc(%rsp), %r12
pushq $0x1
popq %rbp
movl 0x10(%r14), %eax
cmpq %rax, %r13
jae 0x5b8e
movq 0x28(%r14), %rax
movswl (%rax,%r13,8), %eax
cvtsi2ss %eax, %xmm0
movss 0x37b9(%rip), %xmm1     # 0x92f0
mulss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x6701
movq 0x28(%r14), %rax
movswl 0x2(%rax,%r13,8), %eax
cvtsi2ss %eax, %xmm0
mulss 0x378c(%rip), %xmm0     # 0x92f0
movss %xmm0, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x6701
andl $0x0, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x6701
incq %r13
jmp 0x5b19
movq %rbx, %rdi
callq 0x3816
xorl %r12d, %r12d
pushq $0x2
popq %r13
pushq $0x3
popq %r15
pushq $0x1
popq %rbp
movl 0x10(%r14), %eax
xorl %edx, %edx
divl %r15d
cmpl %eax, %r12d
jae 0x5c01
leal -0x2(%r13), %eax
movl %eax, 0x28(%rsp)
movl %eax, 0x1c(%rsp)
movl %eax, 0x10(%rsp)
leal -0x1(%r13), %eax
movl %eax, 0x2c(%rsp)
movl %eax, 0x20(%rsp)
movl %eax, 0x14(%rsp)
movl %r13d, 0x30(%rsp)
movl %r13d, 0x24(%rsp)
movl %r13d, 0x18(%rsp)
movl $0x1, 0x34(%rsp)
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
movl %ebp, %edx
callq 0x365a
incl %r12d
addl $0x3, %r13d
jmp 0x5ba4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
movl 0x4(%rdi), %eax
cmpl %edx, %eax
jle 0x5d09
movl 0x10(%rdi), %ecx
testl %edx, %edx
js 0x5c87
movq 0x30(%rdi), %rdi
leaq (%rcx,%rcx,2), %rcx
leal (%rdx,%rdx,2), %edx
leal (%rax,%rax,2), %eax
xorl %r8d, %r8d
cmpq %r8, %rcx
je 0x5cff
movl %edx, %r9d
movss (%rdi,%r9,4), %xmm0
movl %r8d, %r9d
movss %xmm0, (%rsi,%r9,4)
leal 0x1(%rdx), %r9d
movss (%rdi,%r9,4), %xmm0
leal 0x1(%r8), %r9d
movss %xmm0, (%rsi,%r9,4)
leal 0x2(%rdx), %r9d
movss (%rdi,%r9,4), %xmm0
leal 0x2(%r8), %r9d
movss %xmm0, (%rsi,%r9,4)
addq $0x3, %r8
addl %eax, %edx
jmp 0x5c3c
leal (%rcx,%rcx,2), %edx
leal (%rax,%rax,2), %r8d
xorl %r9d, %r9d
pushq $0x2
popq %r10
movl %r10d, %r11d
cmpl %eax, %r9d
je 0x5cff
movq 0x30(%rdi), %rbx
movl %r10d, %r14d
movl %r11d, %r15d
movq %rcx, %r12
subq $0x1, %r12
jb 0x5cf3
leal -0x2(%r14), %r13d
movss (%rbx,%r13,4), %xmm0
leal -0x2(%r15), %r13d
movss %xmm0, (%rsi,%r13,4)
leal -0x1(%r14), %r13d
movss (%rbx,%r13,4), %xmm0
leal -0x1(%r15), %r13d
movss %xmm0, (%rsi,%r13,4)
movl %r14d, %r13d
movss (%rbx,%r13,4), %xmm0
movl %r15d, %r13d
movss %xmm0, (%rsi,%r13,4)
addl $0x3, %r15d
addl %r8d, %r14d
jmp 0x5caa
incl %r9d
addl %edx, %r11d
addl $0x3, %r10d
jmp 0x5c98
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x3
popq %rsi
movq %rax, %rdi
callq 0x7614
leaq 0x9072(%rip), %rsi      # 0xed98
leaq 0x1927(%rip), %rdx      # 0x7654
movq %rbx, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5d50
callq 0x2230
andq $0x0, 0x18(%rbx)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x5d63
callq 0x2230
andq $0x0, 0x30(%rbx)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x5d76
callq 0x2230
andq $0x0, 0x20(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x5d89
callq 0x2230
andq $0x0, 0x38(%rbx)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x5d9c
callq 0x2230
andq $0x0, 0x28(%rbx)
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x5daf
callq 0x2230
andq $0x0, 0x58(%rbx)
cmpq $0x0, 0x60(%rbx)
je 0x5df0
xorl %r14d, %r14d
movl 0x50(%rbx), %eax
movq 0x60(%rbx), %rdi
cmpq %rax, %r14
jae 0x5de1
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x5ddc
callq 0x2230
movq 0x60(%rbx), %rax
andq $0x0, (%rax,%r14,8)
incq %r14
jmp 0x5db9
testq %rdi, %rdi
je 0x5deb
callq 0x2230
andq $0x0, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5eb0
movq 0x58(%rdi), %rax
movslq %esi, %rcx
movl (%rax,%rcx,8), %eax
testl %eax, %eax
js 0x5ebf
popq %rbx
retq
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x3
jmp 0x5ecc
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x7614
leaq 0x8ebc(%rip), %rsi      # 0xed98
leaq 0x1771(%rip), %rdx      # 0x7654
movq %rbx, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5f03
movq 0x58(%rdi), %rax
movslq %esi, %rcx
movl 0x4(%rax,%rcx,8), %eax
testl %eax, %eax
js 0x5f12
popq %rbx
retq
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x3
jmp 0x5f1f
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x7614
leaq 0x8e69(%rip), %rsi      # 0xed98
leaq 0x171e(%rip), %rdx      # 0x7654
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5f61
movq 0x58(%rdi), %rcx
movslq %esi, %rax
cmpl %edx, 0x4(%rcx,%rax,8)
jbe 0x5f61
movq 0x60(%rdi), %rcx
movq (%rcx,%rax,8), %rax
movslq %edx, %rcx
movss (%rax,%rcx,8), %xmm0
retq
pushq %rbx
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x3
popq %rsi
movq %rax, %rdi
callq 0x7614
leaq 0x8e19(%rip), %rsi      # 0xed98
leaq 0x16ce(%rip), %rdx      # 0x7654
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x5fb2
movq 0x58(%rdi), %rcx
movslq %esi, %rax
cmpl %edx, 0x4(%rcx,%rax,8)
jbe 0x5fb2
movq 0x60(%rdi), %rcx
movq (%rcx,%rax,8), %rax
movslq %edx, %rcx
movss 0x4(%rax,%rcx,8), %xmm0
retq
pushq %rbx
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x3
popq %rsi
movq %rax, %rdi
callq 0x7614
leaq 0x8dc8(%rip), %rsi      # 0xed98
leaq 0x167d(%rip), %rdx      # 0x7654
movq %rbx, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x60f9
movl %edx, %ebx
movl %edx, %eax
andl $0x3, %eax
jne 0x60f9
movq %rsi, %r14
movq %rdi, %r15
addq $0x68, %r15
andl $-0x4, %ebx
xorl %r12d, %r12d
cmpq $0x10000, %r12          # imm = 0x10000
je 0x60ed
leaq (%r15,%r12), %rsi
movl $0x200, %edx            # imm = 0x200
movq %r14, %rdi
callq 0x2140
addq $0x200, %r12            # imm = 0x200
addq %rbx, %r14
jmp 0x60c7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x3
popq %rsi
movq %rax, %rdi
callq 0x7614
leaq 0x8c82(%rip), %rsi      # 0xed98
leaq 0x1537(%rip), %rdx      # 0x7654
movq %rbx, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0xc
popq %rdx
movq %r15, %rdi
callq 0x2340
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
jne 0x67df
movq (%r14), %rax
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq *0x8(%rax)
testb %al, %al
je 0x67e8
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 0x2bf7(%rip), %rbx      # 0x93dd
jmp 0x67ef
leaq 0x2c0d(%rip), %rbx      # 0x93fc
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %r14
pushq $0x1
popq %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x7628
leaq 0x8589(%rip), %rsi      # 0xed98
leaq 0xe3e(%rip), %rdx       # 0x7654
movq %r14, %rdi
callq 0x22f0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2320
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x68d6
cmpl $0x4, %eax
je 0x68b3
cmpl $0x1, %eax
jne 0x68ea
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
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
leaq 0x2b20(%rip), %rdx      # 0x941d
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x7628
leaq 0x8489(%rip), %rsi      # 0xed98
leaq 0xd3e(%rip), %rdx       # 0x7654
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movl 0x18(%rdi), %ecx
cmpq $0x20, %rcx
ja 0x6ccf
movabsq $0x101010100, %rax      # imm = 0x101010100
btq %rcx, %rax
jae 0x6c38
shrl $0x3, %ecx
imull 0x10(%rdi), %ecx
jmp 0x6c48
pushq $0x12
popq %rax
btq %rcx, %rax
jae 0x6ccf
movl 0x10(%rdi), %ecx
xorl %esi, %esi
testl %ecx, %ecx
movl $0x0, %r8d
cmovgl %ecx, %r8d
movslq %ecx, %r9
pushq $-0x1
popq %r10
pushq $0x2
popq %r11
xorl %ebx, %ebx
movl 0x14(%rdi), %eax
cltd
idivl %r11d
cltq
cmpq %rax, %rbx
jge 0x6cca
xorl %eax, %eax
cmpq %rax, %r8
je 0x6cbf
movq (%rdi), %rdx
movl 0x14(%rdi), %ebp
addl %r10d, %ebp
imull %ecx, %ebp
movslq %ebp, %r14
addq %rdx, %r14
addq %rsi, %rdx
movb (%rax,%rdx), %bpl
xorb (%rax,%r14), %bpl
movb %bpl, (%rax,%rdx)
movl 0x14(%rdi), %edx
addl %r10d, %edx
imull %ecx, %edx
movslq %edx, %rdx
addq (%rdi), %rdx
xorb (%rax,%rdx), %bpl
movb %bpl, (%rax,%rdx)
movq (%rdi), %rdx
addq %rsi, %rdx
xorb %bpl, (%rax,%rdx)
incq %rax
jmp 0x6c73
incq %rbx
decl %r10d
addq %r9, %rsi
jmp 0x6c63
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x18
popq %rdi
callq 0x20e0
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x7614
leaq 0x80ac(%rip), %rsi      # 0xed98
leaq 0x961(%rip), %rdx       # 0x7654
movq %rbx, %rdi
callq 0x22f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x76a8
movl 0x8(%rsi), %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rsi), %rcx
movq %rcx, 0x10(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ticky[P]ps2iconsys/src/obj_to_ps2icon.cpp
// Function: LoadOBJFile()
OBJ_FileLoader* LoadOBJFile()
{
	OBJ_FileLoader* ret = NULL;
	if(verbose_output)
		std::cout << " * Reading OBJ file \"" << obj_input_file << "\"...";
	try {
		ret = new OBJ_FileLoader(obj_input_file);
	} catch(Ghulbus::gbException e) {
		std::cout << "\nFile read error: \"" << obj_input_file << "\"" << std::endl;
		exit(1);
	}
	if(verbose_output)
		std::cout << "done." << std::endl;

	if(obj_mesh_index >= ret->GetNMeshes()) {
		std::cout << "Invalid mesh index. Index given: " << obj_mesh_index << "; Maximum allowed for \"" 
			<< obj_input_file << "\": " << (ret->GetNMeshes() - 1) << std::endl;
		exit(1);
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
cmpb $0x1, 0x75b1(%rip)      # 0xf260
jne 0x7ce2
movq 0x7320(%rip), %rdi      # 0xefd8
leaq 0x1ef1(%rip), %rsi      # 0x9bb0
callq 0x2190
movq 0x7575(%rip), %rsi      # 0xf240
movq %rax, %rdi
callq 0x2190
leaq 0x1eec(%rip), %rsi      # 0x9bc6
movq %rax, %rdi
callq 0x2190
pushq $0x18
popq %rdi
callq 0x21a0
movq %rax, %rbx
movq 0x754c(%rip), %rsi      # 0xf240
movq %rax, %rdi
callq 0x25b8
cmpb $0x0, 0x755d(%rip)      # 0xf260
je 0x7d20
movq 0x72cc(%rip), %rdi      # 0xefd8
leaq 0x1f6d(%rip), %rsi      # 0x9c80
callq 0x2190
movq %rax, %rdi
callq 0x20d0
movl 0x7522(%rip), %ebp      # 0xf248
movq %rbx, %rdi
callq 0x2ac0
cmpl %eax, %ebp
jge 0x7d40
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x7291(%rip), %rdi      # 0xefd8
leaq 0x1e91(%rip), %rsi      # 0x9bdf
callq 0x2190
movl 0x74ef(%rip), %esi      # 0xf248
movq %rax, %rdi
callq 0x2300
leaq 0x1e99(%rip), %rsi      # 0x9c01
movq %rax, %rdi
callq 0x2190
movq 0x74c9(%rip), %rsi      # 0xf240
movq %rax, %rdi
callq 0x2190
leaq 0x1e93(%rip), %rsi      # 0x9c19
movq %rax, %rdi
callq 0x2190
movq %rax, %r14
movq %rbx, %rdi
callq 0x2ac0
leal -0x1(%rax), %esi
movq %r14, %rdi
callq 0x2300
movq %rax, %rdi
callq 0x20d0
pushq $0x1
popq %rdi
callq 0x21f0
movq %rdx, %r15
movq %rax, %r14
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x21b0
jmp 0x7dcd
movq %rdx, %r15
movq %rax, %r14
cmpl $0x1, %r15d
jne 0x7e39
movq %r14, %rdi
callq 0x2210
movq %rsp, %rdi
movq %rax, %rsi
callq 0x763a
movq %r14, %rdi
callq 0x20a0
movq 0x71e3(%rip), %rdi      # 0xefd8
leaq 0x1dcf(%rip), %rsi      # 0x9bcb
callq 0x2190
movq 0x7438(%rip), %rsi      # 0xf240
movq %rax, %rdi
callq 0x2190
leaq 0x1ec6(%rip), %rsi      # 0x9cdd
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20d0
jmp 0x7dac
movq %rax, %r14
movq %rsp, %rdi
callq 0x7654
callq 0x22e0
movq %r14, %rdi
callq 0x2320
movq %rax, %rdi
callq 0x398a
// File: /workspace/github_cpp_makefile_star2_O2/ticky[P]ps2iconsys/src/obj_to_ps2icon.cpp
// Function: ListOBJFile(OBJ_FileLoader const*)
void ListOBJFile(OBJ_FileLoader const* obj_file)
{
	std::cout << " * Parsing OBJ file \"" << obj_input_file << "\" contents...\n";
	std::cout << " **  Found " << obj_file->GetNMeshes() << " meshes: " << std::endl;
	for(int i=0; i<obj_file->GetNMeshes(); ++i) {
		OBJ_Mesh const* tmp = obj_file->GetMesh(i);
		std::cout << " **   #" << i << ": " << tmp->GetName() << " - " 
			<< tmp->GetNFaces() << " Triangles, " << tmp->GetNVertices() << " Vertices\n";
	}
	std::cout << " *  done." << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x717a(%rip), %r14      # 0xefd8
leaq 0x1db8(%rip), %rsi      # 0x9c1d
movq %r14, %rdi
callq 0x2190
movq 0x73cc(%rip), %rsi      # 0xf240
movq %rax, %rdi
callq 0x2190
leaq 0x1db0(%rip), %rsi      # 0x9c33
movq %rax, %rdi
callq 0x2190
leaq 0x1db0(%rip), %rsi      # 0x9c42
movq %r14, %rdi
callq 0x2190
movq %rax, %r14
movq %rbx, %rdi
callq 0x2ac0
movq %r14, %rdi
movl %eax, %esi
callq 0x2300
leaq 0x1d98(%rip), %rsi      # 0x9c4e
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20d0
xorl %ebp, %ebp
leaq 0x1d95(%rip), %r14      # 0x9c64
leaq 0x1d9b(%rip), %r15      # 0x9c71
movq %rbx, %rdi
callq 0x2ac0
cmpl %eax, %ebp
jge 0x7f8b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2acc
movq %rax, %r12
movq 0x70de(%rip), %rdi      # 0xefd8
leaq 0x1d57(%rip), %rsi      # 0x9c58
callq 0x2190
movq %rax, %rdi
movl %ebp, %esi
callq 0x2300
movq %rax, %rdi
leaq 0x1d00(%rip), %rsi      # 0x9c1a
callq 0x2190
movq %rax, %r13
movq %r12, %rdi
callq 0x3264
movq %r13, %rdi
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
leaq 0x1d21(%rip), %rsi      # 0x9c60
callq 0x2190
movq %rax, %r13
movq %r12, %rdi
callq 0x3604
movq %r13, %rdi
movl %eax, %esi
callq 0x2300
movq %rax, %rdi
movq %r14, %rsi
callq 0x2190
movq %rax, %r13
movq %r12, %rdi
callq 0x3278
movq %r13, %rdi
movl %eax, %esi
callq 0x2300
movq %rax, %rdi
movq %r15, %rsi
callq 0x2190
incl %ebp
jmp 0x7ed6
movq 0x7046(%rip), %rdi      # 0xefd8
leaq 0x1ce3(%rip), %rsi      # 0x9c7c
callq 0x2190
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
// File: /workspace/github_cpp_makefile_star2_O2/ticky[P]ps2iconsys/src/obj_to_ps2icon.cpp
// Function: IsBMP(char const*)
bool IsBMP(char const* f)
{
	//check for .bmp ending:
	int len = static_cast<int>(strlen(f));
	if( (f[len-3] == 'B' || f[len-3] == 'b') && 
		(f[len-2] == 'M' || f[len-2] == 'm') && 
		(f[len-1] == 'P' || f[len-1] == 'p') ) {
			GhulbusUtil::gbImageType_BMP_T checker;
			std::ifstream tmp(f, std::ios_base::in | std::ios_base::binary);
			return checker.CheckFile(tmp);
	}
	return false;
}

// Assembly:
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
callq 0x20b0
shlq $0x20, %rax
movabsq $-0x300000000, %rcx     # imm = 0xFFFFFFFD00000000
addq %rax, %rcx
sarq $0x20, %rcx
movzbl (%rbx,%rcx), %ecx
orl $0x20, %ecx
cmpl $0x62, %ecx
jne 0x8060
movabsq $-0x200000000, %rcx     # imm = 0xFFFFFFFE00000000
addq %rax, %rcx
sarq $0x20, %rcx
movzbl (%rbx,%rcx), %ecx
orl $0x20, %ecx
cmpl $0x6d, %ecx
jne 0x8060
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %rcx, %rax
sarq $0x20, %rax
movzbl (%rbx,%rax), %eax
orl $0x20, %eax
cmpl $0x70, %eax
jne 0x8060
leaq 0x8(%rsp), %rdi
callq 0x6fe8
leaq 0x18(%rsp), %rdi
pushq $0xc
popq %rdx
movq %rbx, %rsi
callq 0x2340
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x701e
movl %eax, %ebx
leaq 0x18(%rsp), %rdi
callq 0x2060
leaq 0x8(%rsp), %rdi
callq 0x6ff8
jmp 0x8062
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbx
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2060
jmp 0x807f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6ff8
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/ticky[P]ps2iconsys/src/obj_to_ps2icon.cpp
// Function: main
int main(int argc, char* argv[])
{
	ParseCommandLine(argc, argv);

	if(!obj_input_file) {
		std::cout << "No input file specified." << std::endl << std::endl;
		PrintHelp(argv[0]);
		exit(1);
	}
	std::cout << "OBJ to PS2Icon Converter  V-1.0\n by Ghulbus Inc.  (http://www.ghulbus-inc.de/)\n" << std::endl;
	if((!list_obj_file) && (!ps2_output_file)) { ps2_output_file = "default.icn"; }

	OBJ_FileLoader* obj_file = LoadOBJFile();

	if(list_obj_file) {
		ListOBJFile(obj_file);
	}

	GhulbusUtil::gbImageLoader* img_loader = NULL;
	if(texture_input_file) {
		img_loader = LoadTexture();
	}
	
	if(ps2_output_file) {
		WriteOutputFile(obj_file, img_loader);
	}

	delete img_loader;
	delete obj_file;

	std::cout << "Success :)" << std::endl;

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x7a32
cmpq $0x0, 0x6c17(%rip)      # 0xf240
je 0x8700
movq 0x69a2(%rip), %rdi      # 0xefd8
leaq 0x1781(%rip), %rsi      # 0x9dbe
callq 0x2190
movq %rax, %rdi
callq 0x20d0
cmpb $0x0, 0x6c10(%rip)      # 0xf261
jne 0x866b
cmpq $0x0, 0x6bf5(%rip)      # 0xf250
jne 0x866b
leaq 0x138d(%rip), %rax      # 0x99f1
movq %rax, 0x6be5(%rip)      # 0xf250
callq 0x7c9e
movq %rax, %rbx
cmpb $0x1, 0x6be7(%rip)      # 0xf261
jne 0x8684
movq %rbx, %rdi
callq 0x7e49
cmpq $0x0, 0x6bcc(%rip)      # 0xf258
je 0x8698
callq 0x8091
movq %rax, %r14
jmp 0x869b
xorl %r14d, %r14d
cmpq $0x0, 0x6bad(%rip)      # 0xf250
je 0x86b0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x82cf
testq %r14, %r14
je 0x86bd
movq %r14, %rdi
callq 0x6834
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2a66
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x21b0
movq 0x68f6(%rip), %rdi      # 0xefd8
leaq 0x1725(%rip), %rsi      # 0x9e0e
callq 0x2190
movq %rax, %rdi
callq 0x20d0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x68d1(%rip), %rdi      # 0xefd8
leaq 0x1697(%rip), %rsi      # 0x9da5
callq 0x2190
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x20d0
movq (%rbx), %rdi
callq 0x7708
pushq $0x1
popq %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/jflemer[P]boost-chat-server/./stream_msg_client.hpp
// Function: void stream_msg_client<chat_message, boost::asio::ip::tcp>::async_receive<boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_client<boost::asio::ip::tcp>, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<chat_client<boost::asio::ip::tcp>*>, boost::arg<1> (*)()>>>(chat_message*, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_client<boost::asio::ip::tcp>, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<chat_client<boost::asio::ip::tcp>*>, boost::arg<1> (*)()>>)
void async_receive(Message * msg, ReadHandler handler)
  {
      boost::asio::async_read(socket_,
          boost::asio::buffer(msg->data(), message::header_length),
          std::bind(
            &stream_msg_client::handle_read_header<ReadHandler>,
            this, msg, handler, std::placeholders::_1, std::placeholders::_2));
  }

// Assembly:
subq $0x48, %rsp
leaq 0x8(%rdi), %rax
movq %rsp, %rcx
leaq 0x108(%rip), %r8        # 0xeafa
leaq 0x10(%rsp), %rdx
movq %r8, (%rdx)
andq $0x0, 0x8(%rdx)
movq %rsi, (%rcx)
movq $0x4, 0x8(%rcx)
movaps 0x50(%rsp), %xmm0
movups %xmm0, 0x10(%rdx)
movq 0x60(%rsp), %r8
movq %r8, 0x20(%rdx)
movq %rsi, 0x28(%rdx)
movq %rdi, 0x30(%rdx)
movq %rax, %rdi
movq %rcx, %rsi
xorl %ecx, %ecx
callq 0xead3
addq $0x48, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jflemer[P]boost-chat-server/chat_client.cpp
// Function: chat_client<boost::asio::ip::tcp>::handle_read(boost::system::error_code const&)
void handle_read(const boost::system::error_code& error)
  {
    if (!error)
    {
      std::cout << ">> ";
      std::cout.write(read_msg_.body(), read_msg_.body_length());
      std::cout << "\n";
      this->async_receive(&read_msg_,
          boost::bind(&chat_client::handle_read,
              this, boost::asio::placeholders::error));
    }
    else
    {
      do_close();
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x4(%rsi)
je 0xea5d
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xfccc
movq 0x10554(%rip), %r14     # 0x1efb8
leaq 0x3bf5(%rip), %rsi      # 0x12660
movq %r14, %rdi
callq 0x6300
leaq 0x58(%rbx), %r15
leaq 0x5c(%rbx), %rsi
movq 0x260(%rbx), %rdx
movq %r14, %rdi
callq 0x6410
leaq 0x360b(%rip), %rsi      # 0x1209c
movq %r14, %rdi
callq 0x6300
leaq -0x6a(%rip), %rax       # 0xea36
movq %rax, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %rbx, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe9e0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jflemer[P]boost-chat-server/./stream_msg_client.hpp
// Function: void stream_msg_client<chat_message, boost::asio::ip::tcp>::handle_read_header<boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_client<boost::asio::ip::tcp>, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<chat_client<boost::asio::ip::tcp>*>, boost::arg<1> (*)()>>>(chat_message*, boost::_bi::bind_t<void, boost::_mfi::mf1<void, chat_client<boost::asio::ip::tcp>, boost::system::error_code const&>, boost::_bi::list2<boost::_bi::value<chat_client<boost::asio::ip::tcp>*>, boost::arg<1> (*)()>>, boost::system::error_code const&, unsigned long)
void handle_read_header(Message * msg, ReadHandler handler, const boost::system::error_code& error, std::size_t bytes_transferred)
  {
    if (!error && msg->decode_header())
    {
      boost::asio::async_read(socket_,
          boost::asio::buffer(msg->body(), msg->body_length()),
          handler);
    }
    else
    {
      handler(error);
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
leaq 0x40(%rsp), %rbx
cmpb $0x0, 0x4(%rdx)
jne 0xeb4f
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0xf4f0
testb %al, %al
je 0xeb4f
addq $0x8, %r14
movq 0x208(%r15), %rax
addq $0x4, %r15
leaq 0x8(%rsp), %rsi
movq %r15, (%rsi)
movq %rax, 0x8(%rsi)
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0xf537
jmp 0xeb5a
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf55e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jflemer[P]boost-chat-server/./chat_message.hpp
// Function: chat_message::decode_header()
bool decode_header()
  {
    using namespace std; // For strncat and atoi.
    char header[header_length + 1] = "";
    strncat(header, data_, header_length);
    body_length_ = atoi(header);
    if (body_length_ > max_body_length)
    {
      body_length_ = 0;
      return false;
    }
    return true;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movb $0x0, 0x4(%r14)
andl $0x0, (%r14)
pushq $0x4
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6200
movq %r14, %rdi
callq 0x6500
xorl %edx, %edx
cmpl $0x201, %eax            # imm = 0x201
setb %cl
cmovbl %eax, %edx
movq %rdx, 0x208(%rbx)
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/jflemer[P]boost-chat-server/chat_client.cpp
// Function: chat_client<boost::asio::ip::tcp>::do_write(chat_message)
void do_write(chat_message msg)
  {
    bool write_in_progress = !write_msgs_.empty();
    write_msgs_.push_back(msg);
    if (!write_in_progress)
    {
      boost::asio::async_write(this->socket_,
          boost::asio::buffer(write_msgs_.front().data(),
            write_msgs_.front().length()),
          boost::bind(&chat_client::handle_write, this,
            boost::asio::placeholders::error));
    }
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
addq $0x268, %rdi            # imm = 0x268
movq 0x298(%rbx), %r14
movq 0x278(%rbx), %r15
leaq 0x50(%rsp), %rsi
callq 0x106a4
cmpq %r15, %r14
jne 0x104e9
leaq 0x8(%rbx), %rdi
movq 0x278(%rbx), %rax
movq 0x208(%rax), %rcx
addq $0x4, %rcx
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rsi)
leaq 0x22f(%rip), %rax       # 0x10700
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
andq $0x0, 0x8(%rdx)
movq %rbx, 0x10(%rdx)
xorl %ecx, %ecx
callq 0x106d9
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/jflemer[P]boost-chat-server/chat_client.cpp
// Function: chat_client<boost::asio::ip::tcp>::handle_write(boost::system::error_code const&)
void handle_write(const boost::system::error_code& error)
  {
    if (!error)
    {
      write_msgs_.pop_front();
      if (!write_msgs_.empty())
      {
        boost::asio::async_write(this->socket_,
            boost::asio::buffer(write_msgs_.front().data(),
              write_msgs_.front().length()),
            boost::bind(&chat_client::handle_write, this,
              boost::asio::placeholders::error));
      }
    }
    else
    {
      do_close();
    }
  }

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x4(%rsi)
je 0x1071f
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
jmp 0xfccc
leaq 0x268(%rbx), %rdi
callq 0x111f8
movq 0x278(%rbx), %rax
cmpq %rax, 0x298(%rbx)
je 0x10778
movq 0x208(%rax), %rcx
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq -0x51(%rip), %rax       # 0x10700
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
andq $0x0, 0x8(%rdx)
addq $0x4, %rcx
movq %rcx, 0x8(%rsi)
movq %rbx, 0x10(%rdx)
addq $0x8, %rbx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x106d9
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/ef-gy[P]libefgy/src/test-case/transformation.cpp
// Function: testIdentity(std::ostream&)
bool testIdentity(std::ostream &log) {
  identity<double, 3> id;

  linear<double, 3> phi;

  for (int i = 0; i < 3; i++) {
    for (int k = 0; k < 3; k++) {
      phi.matrix[i][k] = i * k;
    }
  }

  linear<double, 3> leftProduct = id * phi;
  linear<double, 3> rightProduct = phi * id;

  bool leftProductOK = true;
  bool rightProductOK = true;

  for (int i = 0; i < 3; i++) {
    for (int k = 0; k < 3; k++) {
      leftProductOK &= (leftProduct.matrix[i][k] == i * k);
      rightProductOK &= (rightProduct.matrix[i][k] == i * k);
    }
  }

  if (!leftProductOK) {
    log << "Incorrect product of identity transformation with non-trivial "
           "transformation (id * phi).\n";
    log << "\n Expected: \n";
    log << phi.matrix;
    log << "\n Actual: \n";
    log << leftProduct.matrix;

    return false;
  }
  if (!rightProductOK) {
    log << "Incorrect product of non-trivial transformation with identity "
           "transformation (phi * id).\n";
    log << "\n Expected: \n";
    log << phi.matrix;
    log << "\n Actual: \n";
    log << rightProduct.matrix;

    return false;
  }

  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rdi, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x4e7e
movq %rsp, %r14
movq %r14, %rdi
callq 0x4e7e
xorl %eax, %eax
cmpq $0x3, %rax
je 0x4973
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x3, %rdx
je 0x496a
cvtsi2sd %ecx, %xmm0
movsd %xmm0, (%r14,%rdx,8)
incq %rdx
addl %eax, %ecx
jmp 0x4953
incq %rax
addq $0x18, %r14
jmp 0x4949
leaq 0x90(%rsp), %r14
leaq 0xd8(%rsp), %r12
movq %rsp, %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x11741
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x11741
movb $0x1, %al
xorl %ecx, %ecx
xorl %esi, %esi
movb $0x1, %dl
cmpq $0x3, %rsi
je 0x4a02
xorl %edi, %edi
xorl %r8d, %r8d
cmpq $0x3, %r8
je 0x49f3
cvtsi2sd %edi, %xmm0
ucomisd (%r14,%r8,8), %xmm0
setnp %r9b
sete %r10b
andb %r9b, %r10b
andb %r10b, %al
ucomisd (%r15,%r8,8), %xmm0
setnp %r9b
sete %r10b
andb %r9b, %r10b
andb %r10b, %dl
incq %r8
addl %ecx, %edi
jmp 0x49ba
incq %rsi
addq $0x18, %r14
addq $0x18, %r15
incl %ecx
jmp 0x49af
testb $0x1, %al
je 0x4a1b
movb $0x1, %al
testb $0x1, %dl
jne 0x4a68
leaq 0x48(%rsp), %r14
leaq 0xd775(%rip), %rsi      # 0x1218e
jmp 0x4a2a
leaq 0x90(%rsp), %r14
leaq 0xd6f0(%rip), %rsi      # 0x1211a
movq %rbx, %rdi
callq 0x4260
leaq 0xd73b(%rip), %rsi      # 0x12174
movq %rbx, %rdi
callq 0x4260
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x4e8e
leaq 0xd72f(%rip), %rsi      # 0x12182
movq %rbx, %rdi
callq 0x4260
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4e8e
xorl %eax, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/ef-gy[P]libefgy/src/test-case/transformation.cpp
// Function: testAffineConstruction(std::ostream&)
bool testAffineConstruction(std::ostream &log) {
  linear<double, 3> phi;

  for (int i = 0; i < 3; i++) {
    for (int k = 0; k < 3; k++) {
      phi.matrix[i][k] = i * k;
    }
  }

  affine<double, 3> psi(phi);

  bool allCorrect = true;

  // check if matrix entries of linear map are in place
  for (int i = 0; i < 3; i++) {
    for (int k = 0; k < 3; k++) {
      allCorrect &= (psi.matrix[i][k] == i * k);
    }
  }

  // check for zeroes in the last row and column
  for (int i = 0; i < 3; i++) {
    allCorrect &= (psi.matrix[i][3] == 0);
    allCorrect &= (psi.matrix[3][i] == 0);
  }

  allCorrect &= (psi.matrix[3][3] == 1);

  if (!allCorrect) {
    log << "An error occurred in constructing an affine transformation";
    log << " from a linear map.\n";

    return false;
  } else {
    return true;
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x4e7e
xorl %eax, %eax
cmpq $0x3, %rax
je 0x4ac3
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x3, %rdx
je 0x4aba
cvtsi2sd %ecx, %xmm0
movsd %xmm0, (%r14,%rdx,8)
incq %rdx
addl %eax, %ecx
jmp 0x4aa3
incq %rax
addq $0x18, %r14
jmp 0x4a99
leaq 0x8(%rsp), %r14
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x4f02
movb $0x1, %bpl
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0x4b19
xorl %edx, %edx
xorl %esi, %esi
cmpq $0x3, %rsi
je 0x4b0e
cvtsi2sd %edx, %xmm0
ucomisd (%r14,%rsi,8), %xmm0
setnp %dil
sete %r8b
andb %dil, %r8b
andb %r8b, %bpl
incq %rsi
addl %eax, %edx
jmp 0x4ae9
incq %rcx
addq $0x20, %r14
incl %eax
jmp 0x4adf
pushq $-0x18
popq %rax
xorpd %xmm0, %xmm0
testq %rax, %rax
je 0x4b52
movsd 0x80(%rsp,%rax), %xmm1
cmpeqpd %xmm0, %xmm1
movsd 0x80(%rsp,%rax,4), %xmm2
cmpeqpd %xmm0, %xmm2
andpd %xmm1, %xmm2
movd %xmm2, %ecx
andb %cl, %bpl
addq $0x8, %rax
jmp 0x4b20
movsd 0x80(%rsp), %xmm0
ucomisd 0xd4a5(%rip), %xmm0     # 0x12008
setnp %al
sete %cl
andb %al, %cl
andb %cl, %bpl
jne 0x4b8e
leaq 0xd671(%rip), %rsi      # 0x121e8
movq %rbx, %rdi
callq 0x4260
leaq 0xd69d(%rip), %rsi      # 0x12223
movq %rbx, %rdi
callq 0x4260
movl %ebp, %eax
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ef-gy[P]libefgy/include/ef.gy/matrix.h
// Function: std::ostream& efgy::math::operator<<<double, 3ul, 3ul, char>(std::basic_ostream<char, std::char_traits<char>>&, efgy::math::matrix<double, 3ul, 3ul> const&)
std::ostream &operator<<(std::basic_ostream<C> &stream,
                         const matrix<Q, n, m> &matrix) {
  for (int i = 0; i < n; i++) {
    for (int k = 0; k < m; k++) {
      stream << matrix[i][k] << "\t";
    }
    stream << "\n";
  }
  return stream;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %r13d, %r13d
leaq 0xd2d7(%rip), %r15      # 0x12180
leaq 0xdd2e(%rip), %r12      # 0x12bde
cmpq $0x3, %r13
je 0x4ef0
xorl %ebp, %ebp
cmpq $0x3, %rbp
je 0x4edc
movsd (%r14,%rbp,8), %xmm0
movq %rbx, %rdi
callq 0x43a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x4260
incq %rbp
jmp 0x4eb8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4260
incq %r13
addq $0x18, %r14
jmp 0x4eb0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ef-gy[P]libefgy/include/ef.gy/transformation.h
// Function: efgy::geometry::transformation::affine<double, 3ul>::affine(efgy::geometry::transformation::linear<double, 3ul> const&)
affine(const linear<Q, d> &L) {
    for (std::size_t i = 0; i < d; i++) {
      for (std::size_t j = 0; j < d; j++) {
        matrix[i][j] = L.matrix[i][j];
      }
    }
    for (std::size_t i = 0; i < d; i++) {
      matrix[i][d] = Q(0);
      matrix[d][i] = Q(0);
    }
    matrix[d][d] = Q(1);
  }

// Assembly:
xorl %eax, %eax
movq %rdi, %rcx
cmpq $0x3, %rax
je 0x4f31
xorl %edx, %edx
cmpq $0x3, %rdx
je 0x4f24
movsd (%rsi,%rdx,8), %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
jmp 0x4f0f
incq %rax
addq $0x20, %rcx
addq $0x18, %rsi
jmp 0x4f07
pushq $-0x18
popq %rax
testq %rax, %rax
je 0x4f4b
andq $0x0, 0x78(%rdi,%rax,4)
andq $0x0, 0x78(%rdi,%rax)
addq $0x8, %rax
jmp 0x4f34
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x78(%rdi)
retq