// File: /workspace/github_cpp_makefile_star2_O3/ticky[P]ps2iconsys/src/ps2icon_to_obj.cpp
// Function: WriteOBJFile(PS2Icon*)
void WriteOBJFile(PS2Icon* ps2_icon)
{
	OBJ_FileLoader obj_file;
	OBJ_Mesh obj_mesh(ps2_input_file);
	if(verbose_output)
		std::cout << " * Convert geometry data from \"" << ps2_input_file << "\"...";
	ps2_icon->BuildMesh(&obj_mesh);
	if(verbose_output)
		std::cout << "done." << std::endl;

	if(verbose_output)
		std::cout << " * Writing geometry output to file \"" << obj_output_file << "\"...";
	obj_file.AddMesh(obj_mesh);
	try {
		obj_file.WriteFile(obj_output_file);
	} catch( Ghulbus::gbException e ) {
		std::cout << "\nError while writing to \"" << obj_output_file << "\"" << std::endl;
		exit(1);
	}
	if(verbose_output)
		std::cout << "done." << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x27ac
movq 0x656d(%rip), %rsi      # 0xf258
leaq 0x38(%rsp), %rdi
callq 0x3f06
cmpb $0x1, 0x6574(%rip)      # 0xf270
jne 0x8d71
movq 0x62d3(%rip), %r14      # 0xefd8
leaq 0x1d97(%rip), %rsi      # 0xaaa3
movl $0x1f, %edx
movq %r14, %rdi
callq 0x21f0
movq 0x6538(%rip), %r15      # 0xf258
testq %r15, %r15
je 0x8d41
movq %r15, %rdi
callq 0x20c0
movq 0x62a4(%rip), %rdi      # 0xefd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x21f0
jmp 0x8d59
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22f0
movq 0x6278(%rip), %rdi      # 0xefd8
leaq 0x1d5c(%rip), %rsi      # 0xaac3
movl $0x4, %edx
callq 0x21f0
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x652c
movb 0x64ec(%rip), %al       # 0xf270
cmpb $0x1, %al
jne 0x8dd4
movq 0x6249(%rip), %rbx      # 0xefd8
leaq 0x1d07(%rip), %rsi      # 0xaa9d
movl $0x5, %edx
movq %rbx, %rdi
callq 0x21f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x6217(%rip), %rdi      # 0xefd8
callq 0x2040
movq %rax, %rdi
callq 0x2120
movb 0x649c(%rip), %al       # 0xf270
testb $0x1, %al
je 0x8e4a
movq 0x61f9(%rip), %rbx      # 0xefd8
leaq 0x1ce2(%rip), %rsi      # 0xaac8
movl $0x24, %edx
movq %rbx, %rdi
callq 0x21f0
movq 0x6466(%rip), %r14      # 0xf260
testq %r14, %r14
je 0x8e1b
movq %r14, %rdi
callq 0x20c0
movq 0x61ca(%rip), %rdi      # 0xefd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x21f0
jmp 0x8e32
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x22f0
movq 0x619f(%rip), %rdi      # 0xefd8
leaq 0x1c83(%rip), %rsi      # 0xaac3
movl $0x4, %edx
callq 0x21f0
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x2db2
movq 0x6400(%rip), %rsi      # 0xf260
leaq 0x8(%rsp), %rdi
callq 0x2e22
cmpb $0x1, 0x63ff(%rip)      # 0xf270
jne 0x8eb9
movq 0x615e(%rip), %rbx      # 0xefd8
leaq 0x1c1c(%rip), %rsi      # 0xaa9d
movl $0x5, %edx
movq %rbx, %rdi
callq 0x21f0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x612c(%rip), %rdi      # 0xefd8
callq 0x2040
movq %rax, %rdi
callq 0x2120
leaq 0x38(%rsp), %rdi
callq 0x3f7a
leaq 0x8(%rsp), %rdi
callq 0x2d34
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x8f7b
movq %rbx, %rdi
callq 0x2220
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x8322
movq %rbx, %rdi
callq 0x20b0
movq 0x60ce(%rip), %rdi      # 0xefd8
leaq 0x1bdc(%rip), %rsi      # 0xaaed
movl $0x19, %edx
callq 0x21f0
movq 0x633e(%rip), %rsi      # 0xf260
movq 0x60af(%rip), %rdi      # 0xefd8
callq 0x21b0
movq %rax, %rbx
leaq 0x1b12(%rip), %rsi      # 0xaa4a
movl $0x1, %edx
movq %rax, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x20d0
movl $0x1, %edi
callq 0x2210
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x833c
callq 0x22e0
jmp 0x8f7b
movq %rax, %rdi
callq 0x7068
movq %rax, %rbx
jmp 0x8f85
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3f7a
leaq 0x8(%rsp), %rdi
callq 0x2d34
movq %rbx, %rdi
callq 0x2330