// File: /workspace/github_cpp_makefile_star2_O1/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 0x62c0(%rip), %rsi      # 0xf258
leaq 0x38(%rsp), %rdi
callq 0x3e88
cmpb $0x1, 0x62c7(%rip)      # 0xf270
jne 0x901e
movq 0x6026(%rip), %r14      # 0xefd8
leaq 0x1ab6(%rip), %rsi      # 0xaa6f
movl $0x1f, %edx
movq %r14, %rdi
callq 0x21f0
movq 0x628b(%rip), %r15      # 0xf258
testq %r15, %r15
je 0x8fee
movq %r15, %rdi
callq 0x20c0
movq 0x5ff7(%rip), %rdi      # 0xefd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x21f0
jmp 0x9006
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x22f0
movq 0x5fcb(%rip), %rdi      # 0xefd8
leaq 0x1a7b(%rip), %rsi      # 0xaa8f
movl $0x4, %edx
callq 0x21f0
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x6722
cmpb $0x1, 0x623e(%rip)      # 0xf270
jne 0x907a
movq 0x5f9d(%rip), %rbx      # 0xefd8
leaq 0x1a27(%rip), %rsi      # 0xaa69
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 0x5f6b(%rip), %rdi      # 0xefd8
callq 0x2040
movq %rax, %rdi
callq 0x2120
cmpb $0x1, 0x61ef(%rip)      # 0xf270
jne 0x90f5
movq 0x5f4e(%rip), %rbx      # 0xefd8
leaq 0x1a03(%rip), %rsi      # 0xaa94
movl $0x24, %edx
movq %rbx, %rdi
callq 0x21f0
movq 0x61bb(%rip), %r14      # 0xf260
testq %r14, %r14
je 0x90c6
movq %r14, %rdi
callq 0x20c0
movq 0x5f1f(%rip), %rdi      # 0xefd8
movq %r14, %rsi
movq %rax, %rdx
callq 0x21f0
jmp 0x90dd
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x22f0
movq 0x5ef4(%rip), %rdi      # 0xefd8
leaq 0x19a4(%rip), %rsi      # 0xaa8f
movl $0x4, %edx
callq 0x21f0
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x2d34
movq 0x6155(%rip), %rsi      # 0xf260
leaq 0x8(%rsp), %rdi
callq 0x2da4
cmpb $0x1, 0x6154(%rip)      # 0xf270
jne 0x9164
movq 0x5eb3(%rip), %rbx      # 0xefd8
leaq 0x193d(%rip), %rsi      # 0xaa69
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 0x5e81(%rip), %rdi      # 0xefd8
callq 0x2040
movq %rax, %rdi
callq 0x2120
leaq 0x38(%rsp), %rdi
callq 0x3efc
leaq 0x8(%rsp), %rdi
callq 0x2cb8
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x9226
movq %rbx, %rdi
callq 0x2220
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x85ea
movq %rbx, %rdi
callq 0x20b0
movq 0x5e23(%rip), %rdi      # 0xefd8
leaq 0x18fd(%rip), %rsi      # 0xaab9
movl $0x19, %edx
callq 0x21f0
movq 0x6093(%rip), %rsi      # 0xf260
movq 0x5e04(%rip), %rdi      # 0xefd8
callq 0x21b0
movq %rax, %rbx
leaq 0x1833(%rip), %rsi      # 0xaa16
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 0x8604
callq 0x22e0
jmp 0x9226
movq %rax, %rdi
callq 0x7272
movq %rax, %rbx
jmp 0x9230
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3efc
leaq 0x8(%rsp), %rdi
callq 0x2cb8
movq %rbx, %rdi
callq 0x2330