// File: /workspace/github_cpp_makefile_star2_O3/ticky[P]ps2iconsys/src/obj_loader.cpp
// Function: OBJ_FileLoader::WriteFile(char const*) const
void OBJ_FileLoader::WriteFile(char const* fname) const {
	std::ofstream fout(fname, std::ios_base::out);
	if( fout.fail() ) {
		throw( Ghulbus::gbException( Ghulbus::gbException::GB_FAILED,
			                         "Output OBJ file could not be opened" ) );
	}
	//again we need counters since obj doesn't reset indices between meshes:
	int vert_counter=0, normal_counter=0, texture_counter=0;
	int vert_base=0, normal_base=0, texture_base=0;
	int current_smooth_group = 0;
	
	fout.precision(6);
	fout << std::fixed;
	//file header:
	fout << "# OBJ File created by PS2IconSys Viewer" << std::endl
		 << "#  http://www.ghulbus-inc.de/" << std::endl
		 << "#" << std::endl;

	for(int i=0; i<GetNMeshes(); i++) {
		OBJ_Mesh const* mesh = GetMesh(i);
		//object header:
		fout << "# object " << mesh->GetName() << " to come" << std::endl
			 << "#" << std::endl;
		
		//vertex data:
		for(int j=0; j<mesh->GetNVertices(); j++) {
			vert_counter++;
			fout << "v  " << *(mesh->GetVertexX(j)) << " " << *(mesh->GetVertexY(j)) << " "
				<< *(mesh->GetVertexZ(j)) << std::endl;
		}
		fout << "# " << mesh->GetNVertices() << " vertices" << std::endl << std::endl;
		//texture vertex data:
		for(int j=0; j<mesh->GetNTexture(); j++) {
			texture_counter++;
			fout << "vt  " << *(mesh->GetTextureX(j)) << " " << *(mesh->GetTextureY(j)) << " "
				<< *(mesh->GetTextureZ(j)) << std::endl;
		}
		fout << "# " << mesh->GetNTexture() << " texture vertices" << std::endl << std::endl;
		//vertex normal data:
		for(int j=0; j<mesh->GetNNormals(); j++) {
			normal_counter++;
			fout << "vn  " << *(mesh->GetNormalX(j)) << " " << *(mesh->GetNormalY(j)) << " "
				<< *(mesh->GetNormalZ(j)) << std::endl;
		}
		fout << "# " << mesh->GetNNormals() << " vertex normals" << std::endl << std::endl;

		//face list:
		fout << "g " << mesh->GetName() << std::endl;
		current_smooth_group = mesh->GetFace(0)->smoothing_group;
		fout << "s " << current_smooth_group << std::endl;
		for(int j=0; j<mesh->GetNFaces(); j++) {
			OBJ_Mesh::Face const* current_face = mesh->GetFace(j);
			if(current_face->smoothing_group != current_smooth_group) {
				current_smooth_group = current_face->smoothing_group;
				fout << "s " << current_smooth_group << std::endl;
			}
			fout << "f " << (current_face->vert1 + vert_base + 1) << "/" 
				<< (current_face->texture1 + texture_base + 1) << "/" 
				<< (current_face->normal1 + normal_base + 1)   << " " 
				<< (current_face->vert2 + vert_base + 1)       << "/" 
				<< (current_face->texture2 + texture_base + 1) << "/" 
				<< (current_face->normal2 + normal_base + 1)   << " " 
				<< (current_face->vert3 + vert_base + 1)       << "/" 
				<< (current_face->texture3 + texture_base + 1) << "/" 
				<< (current_face->normal3 + normal_base + 1)   << std::endl;
		}
		fout << "# " << mesh->GetNFaces() << " faces" << std::endl << std::endl;

		//adjust base counters:
		vert_base = vert_counter;
		normal_base = normal_counter;
		texture_base = texture_counter;
		fout << "g" << std::endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, 0x18(%rsp)
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movl $0x10, %edx
callq 0x21e0
movq (%rbx), %rax
movq -0x18(%rax), %rcx
testb $0x5, 0x48(%rsp,%rcx)
jne 0x397f
movq $0x6, 0x30(%rsp,%rcx)
movq -0x18(%rax), %rax
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl 0x40(%rsp,%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x40(%rsp,%rax)
leaq 0x71c5(%rip), %rsi      # 0xa065
leaq 0x28(%rsp), %rbx
movl $0x27, %edx
movq %rbx, %rdi
callq 0x21f0
movq 0x28(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rax, %rbx
leaq 0x71a3(%rip), %rsi      # 0xa08d
movl $0x1d, %edx
movq %rax, %rdi
callq 0x21f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rax, %rbx
leaq 0x7d36(%rip), %rsi      # 0xac5e
movl $0x1, %edx
movq %rax, %rdi
callq 0x21f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
testl %ecx, %ecx
jle 0x393b
xorl %edx, %edx
movl $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movl $0x0, 0xc(%rsp)
movq %rdx, 0x20(%rsp)
movq (%rax,%rdx,8), %rbx
movl $0x9, %edx
movq %r15, %rdi
leaq 0x7102(%rip), %rsi      # 0xa0ab
callq 0x21f0
movq 0x60(%rbx), %r14
testq %r14, %r14
leaq 0x7e51(%rip), %rax      # 0xae0d
cmoveq %rax, %r14
movq %r14, %rdi
callq 0x20c0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x21f0
movl $0x8, %edx
movq %r15, %rdi
leaq 0x70d0(%rip), %rsi      # 0xa0b5
callq 0x21f0
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7c39(%rip), %rsi      # 0xac5e
callq 0x21f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
mulq %r12
shrq %rdx
movl 0xc(%rsp), %ebp
testl %edx, %edx
jle 0x314a
xorl %ebp, %ebp
leaq 0x703d(%rip), %r13      # 0xa0be
movl $0x3, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3a34
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7cb9(%rip), %rsi      # 0xad72
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3a92
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7c8c(%rip), %rsi      # 0xad72
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3af4
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
mulq %r12
incl %ebp
shrq %rdx
cmpl %edx, %ebp
jl 0x3081
addl 0xc(%rsp), %ebp
movl %ebp, 0x14(%rsp)
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6f65(%rip), %rsi      # 0xa0c2
callq 0x21f0
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq %rdx
movq %r15, %rdi
movl %edx, %esi
callq 0x2330
movq %rax, %r14
movl $0x9, %edx
movq %rax, %rdi
leaq 0x6f39(%rip), %rsi      # 0xa0d2
callq 0x21f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x38(%rbx), %rax
subq 0x30(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
mulq %r12
shrq %rdx
movl 0x8(%rsp), %ebp
testl %edx, %edx
jle 0x32ea
xorl %ebp, %ebp
leaq 0x6ea5(%rip), %r13      # 0xa0c5
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3b76
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7b1a(%rip), %rsi      # 0xad72
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3bd4
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7aed(%rip), %rsi      # 0xad72
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3c36
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x38(%rbx), %rax
subq 0x30(%rbx), %rax
sarq $0x3, %rax
mulq %r12
incl %ebp
shrq %rdx
cmpl %edx, %ebp
jl 0x3220
addl 0x8(%rsp), %ebp
movl %ebp, 0x10(%rsp)
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6dc5(%rip), %rsi      # 0xa0c2
callq 0x21f0
movq 0x38(%rbx), %rax
subq 0x30(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq %rdx
movq %r15, %rdi
movl %edx, %esi
callq 0x2330
movq %rax, %r14
movl $0x11, %edx
movq %rax, %rdi
leaq 0x6d90(%rip), %rsi      # 0xa0ca
callq 0x21f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x20(%rbx), %rax
subq 0x18(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq %rdx
movl 0x4(%rsp), %ebp
testl %edx, %edx
jle 0x3492
xorl %ebp, %ebp
movl $0x4, %edx
movq %r15, %rdi
leaq 0x6d13(%rip), %rsi      # 0xa0dc
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3cb8
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x797c(%rip), %rsi      # 0xad72
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3d16
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x794f(%rip), %rsi      # 0xad72
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3d78
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x20(%rbx), %rax
subq 0x18(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
incl %ebp
shrq %rdx
cmpl %edx, %ebp
jl 0x33ba
addl 0x4(%rsp), %ebp
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6c21(%rip), %rsi      # 0xa0c2
callq 0x21f0
movq 0x20(%rbx), %rax
subq 0x18(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq %rdx
movq %r15, %rdi
movl %edx, %esi
callq 0x2330
movq %rax, %r14
movl $0xf, %edx
movq %rax, %rdi
leaq 0x6c03(%rip), %rsi      # 0xa0e1
callq 0x21f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6bae(%rip), %rsi      # 0xa0f1
callq 0x21f0
movq 0x60(%rbx), %r14
testq %r14, %r14
leaq 0x78b7(%rip), %rax      # 0xae0d
cmoveq %rax, %r14
movq %r14, %rdi
callq 0x20c0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x21f0
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3dda
movl 0x24(%rax), %r12d
movl $0x2, %edx
movq %r15, %rdi
leaq 0x772d(%rip), %rsi      # 0xace3
callq 0x21f0
movq %r15, %rdi
movl %r12d, %esi
callq 0x2330
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x50(%rbx), %rax
subq 0x48(%rbx), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
testl %eax, %eax
jle 0x3828
incl 0xc(%rsp)
incl 0x8(%rsp)
incl 0x4(%rsp)
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3dda
movq %rax, %r13
movl 0x24(%rax), %r15d
cmpl %r12d, %r15d
je 0x3680
movl $0x2, %edx
leaq 0x28(%rsp), %rdi
leaq 0x76a2(%rip), %rsi      # 0xace3
callq 0x21f0
leaq 0x28(%rsp), %rdi
movl %r15d, %esi
callq 0x2330
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movl %r15d, %r12d
movl $0x2, %edx
leaq 0x28(%rsp), %rdi
leaq 0x6a63(%rip), %rsi      # 0xa0f4
callq 0x21f0
movl (%r13), %esi
addl 0xc(%rsp), %esi
leaq 0x28(%rsp), %rdi
callq 0x2330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x69ef(%rip), %rsi      # 0xa0a9
callq 0x21f0
movl 0x18(%r13), %esi
addl 0x8(%rsp), %esi
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x69c8(%rip), %rsi      # 0xa0a9
callq 0x21f0
movl 0xc(%r13), %esi
addl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x766a(%rip), %rsi      # 0xad72
callq 0x21f0
movl 0x4(%r13), %esi
addl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x697a(%rip), %rsi      # 0xa0a9
callq 0x21f0
movl 0x1c(%r13), %esi
addl 0x8(%rsp), %esi
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6953(%rip), %rsi      # 0xa0a9
callq 0x21f0
movl 0x10(%r13), %esi
addl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x75f5(%rip), %rsi      # 0xad72
callq 0x21f0
movl 0x8(%r13), %esi
addl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6905(%rip), %rsi      # 0xa0a9
callq 0x21f0
movl 0x20(%r13), %esi
addl 0x8(%rsp), %esi
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x68de(%rip), %rsi      # 0xa0a9
callq 0x21f0
movl 0x14(%r13), %esi
addl 0x4(%rsp), %esi
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x50(%rbx), %rax
subq 0x48(%rbx), %rax
incl %r14d
shrq $0x3, %rax
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
cmpl %eax, %r14d
jl 0x3619
movl $0x2, %edx
leaq 0x28(%rsp), %r15
movq %r15, %rdi
leaq 0x6886(%rip), %rsi      # 0xa0c2
callq 0x21f0
movq 0x50(%rbx), %rax
subq 0x48(%rbx), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %esi # imm = 0xCCCCCCCD
movq %r15, %rdi
callq 0x2330
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x688a(%rip), %rsi      # 0xa0f7
callq 0x21f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movl $0x1, %edx
movq %r15, %rdi
leaq 0x682c(%rip), %rsi      # 0xa0fe
callq 0x21f0
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x20(%rsp), %rdx
incq %rdx
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
movl 0x10(%rsp), %esi
movl %esi, 0x8(%rsp)
movl %ebp, 0x4(%rsp)
movl 0x14(%rsp), %esi
movl %esi, 0xc(%rsp)
cmpq %rcx, %rdx
jl 0x2f91
movq 0xb686(%rip), %rax      # 0xefc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x2150
leaq 0x120(%rsp), %rdi
callq 0x2080
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x18, %edi
callq 0x20e0
movq %rax, %rbx
leaq 0x66ae(%rip), %rdx      # 0xa041
movq %rax, %rdi
movl $0x1, %esi
callq 0x8330
leaq 0xb3e9(%rip), %rsi      # 0xed90
leaq 0x49ae(%rip), %rdx      # 0x835c
movq %rbx, %rdi
callq 0x2320
jmp 0x39c2
jmp 0x39c2
jmp 0x39c2
jmp 0x39c2
jmp 0x39c2
jmp 0x39c2
movq %rax, %rbx
movq 0xb5fc(%rip), %rax      # 0xefc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x2150
leaq 0x120(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2350
nop