// File: /workspace/github_cpp_makefile_star2_O1/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 0x3901
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 0x7227(%rip), %rsi      # 0xa049
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 0x7205(%rip), %rsi      # 0xa071
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 0x7d79(%rip), %rsi      # 0xac23
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 0x38bd
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 0x7164(%rip), %rsi      # 0xa08f
callq 0x21f0
movq 0x60(%rbx), %r14
testq %r14, %r14
leaq 0x7e94(%rip), %rax      # 0xadd2
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 0x7132(%rip), %rsi      # 0xa099
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 0x7c7c(%rip), %rsi      # 0xac23
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 0x30cc
xorl %ebp, %ebp
leaq 0x709f(%rip), %r13      # 0xa0a2
movl $0x3, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x39b6
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7cfc(%rip), %rsi      # 0xad37
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3a14
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7ccf(%rip), %rsi      # 0xad37
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3a76
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 0x3003
addl 0xc(%rsp), %ebp
movl %ebp, 0x14(%rsp)
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6fc7(%rip), %rsi      # 0xa0a6
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 0x6f9b(%rip), %rsi      # 0xa0b6
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 0x326c
xorl %ebp, %ebp
leaq 0x6f07(%rip), %r13      # 0xa0a9
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3af8
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7b5d(%rip), %rsi      # 0xad37
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3b56
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7b30(%rip), %rsi      # 0xad37
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3bb8
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 0x31a2
addl 0x8(%rsp), %ebp
movl %ebp, 0x10(%rsp)
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6e27(%rip), %rsi      # 0xa0a6
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 0x6df2(%rip), %rsi      # 0xa0ae
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 0x3414
xorl %ebp, %ebp
movl $0x4, %edx
movq %r15, %rdi
leaq 0x6d75(%rip), %rsi      # 0xa0c0
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3c3a
movsd (%rax), %xmm0
movq %r15, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x79bf(%rip), %rsi      # 0xad37
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3c98
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7992(%rip), %rsi      # 0xad37
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3cfa
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 0x333c
addl 0x4(%rsp), %ebp
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6c83(%rip), %rsi      # 0xa0a6
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 0x6c65(%rip), %rsi      # 0xa0c5
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 0x6c10(%rip), %rsi      # 0xa0d5
callq 0x21f0
movq 0x60(%rbx), %r14
testq %r14, %r14
leaq 0x78fa(%rip), %rax      # 0xadd2
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 0x3d5c
movl 0x24(%rax), %r12d
movl $0x2, %edx
movq %r15, %rdi
leaq 0x7770(%rip), %rsi      # 0xaca8
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 0x37aa
incl 0xc(%rsp)
incl 0x8(%rsp)
incl 0x4(%rsp)
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3d5c
movq %rax, %r13
movl 0x24(%rax), %r15d
cmpl %r12d, %r15d
je 0x3602
movl $0x2, %edx
leaq 0x28(%rsp), %rdi
leaq 0x76e5(%rip), %rsi      # 0xaca8
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 0x6ac5(%rip), %rsi      # 0xa0d8
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 0x6a51(%rip), %rsi      # 0xa08d
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 0x6a2a(%rip), %rsi      # 0xa08d
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 0x76ad(%rip), %rsi      # 0xad37
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 0x69dc(%rip), %rsi      # 0xa08d
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 0x69b5(%rip), %rsi      # 0xa08d
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 0x7638(%rip), %rsi      # 0xad37
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 0x6967(%rip), %rsi      # 0xa08d
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 0x6940(%rip), %rsi      # 0xa08d
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 0x359b
movl $0x2, %edx
leaq 0x28(%rsp), %r15
movq %r15, %rdi
leaq 0x68e8(%rip), %rsi      # 0xa0a6
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 0x68ec(%rip), %rsi      # 0xa0db
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 0x688e(%rip), %rsi      # 0xa0e2
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 0x2f13
movq 0xb704(%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 0x6710(%rip), %rdx      # 0xa025
movq %rax, %rdi
movl $0x1, %esi
callq 0x85f8
leaq 0xb467(%rip), %rsi      # 0xed90
leaq 0x4cf4(%rip), %rdx      # 0x8624
movq %rbx, %rdi
callq 0x2320
jmp 0x3944
jmp 0x3944
jmp 0x3944
jmp 0x3944
jmp 0x3944
jmp 0x3944
movq %rax, %rbx
movq 0xb67a(%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