// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/utils/Logical_Address_Partitioning_Unit.cpp
// Function: Utils::Logical_Address_Partitioning_Unit::Allocate_logical_address_for_flows(HostInterface_Types, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, std::vector<std::vector<unsigned int, std::allocator<unsigned int>>, std::allocator<std::vector<unsigned int, std::allocator<unsigned int>>>>, std::vector<std::vector<unsigned int, std::allocator<unsigned int>>, std::allocator<std::vector<unsigned int, std::allocator<unsigned int>>>>, std::vector<std::vector<unsigned int, std::allocator<unsigned int>>, std::allocator<std::vector<unsigned int, std::allocator<unsigned int>>>>, std::vector<std::vector<unsigned int, std::allocator<unsigned int>>, std::allocator<std::vector<unsigned int, std::allocator<unsigned int>>>>, unsigned int, unsigned int, unsigned int, double)
void Logical_Address_Partitioning_Unit::Allocate_logical_address_for_flows(HostInterface_Types hostinterface_type, unsigned int concurrent_stream_no,
		unsigned int channel_count, unsigned int chip_no_per_channel, unsigned int die_no_per_chip, unsigned int plane_no_per_die,
		std::vector<std::vector<flash_channel_ID_type>> stream_channel_ids, std::vector<std::vector<flash_chip_ID_type>> stream_chip_ids,
		std::vector<std::vector<flash_die_ID_type>> stream_die_ids, std::vector<std::vector<flash_plane_ID_type>> stream_plane_ids,
		unsigned int block_no_per_plane, unsigned int page_no_per_block, unsigned int sector_no_per_page, double overprovisioning_ratio) 
	{
		if (initialized) {
			return;
		}
		
		Logical_Address_Partitioning_Unit::hostinterface_type = hostinterface_type;

		Logical_Address_Partitioning_Unit::channel_count = channel_count;;
		Logical_Address_Partitioning_Unit::chip_no_per_channel = chip_no_per_channel;
		Logical_Address_Partitioning_Unit::die_no_per_chip = die_no_per_chip;
		Logical_Address_Partitioning_Unit::plane_no_per_die = plane_no_per_die;

		resource_list = new int***[channel_count];
		bool resource_sharing = false;
		for (flash_channel_ID_type channel_id = 0; channel_id < channel_count; channel_id++) {
			resource_list[channel_id] = new int**[chip_no_per_channel];
			for (flash_chip_ID_type chip_id = 0; chip_id < chip_no_per_channel; chip_id++) {
				resource_list[channel_id][chip_id] = new int*[die_no_per_chip];
				for (flash_die_ID_type die_id = 0; die_id < die_no_per_chip; die_id++) {
					resource_list[channel_id][chip_id][die_id] = new int[plane_no_per_die];
					for (flash_plane_ID_type plane_id = 0; plane_id < plane_no_per_die; plane_id++) {
						resource_list[channel_id][chip_id][die_id][plane_id] = 0;
					}
				}
			}
		}

		for (unsigned int stream_id = 0; stream_id < concurrent_stream_no; stream_id++)
		{
			for (flash_channel_ID_type channel_id = 0; channel_id < stream_channel_ids[stream_id].size(); channel_id++) {
				for (flash_chip_ID_type chip_id = 0; chip_id < stream_chip_ids[stream_id].size(); chip_id++) {
					for (flash_die_ID_type die_id = 0; die_id < stream_die_ids[stream_id].size(); die_id++) {
						for (flash_plane_ID_type plane_id = 0; plane_id < stream_plane_ids[stream_id].size(); plane_id++) {
							if (!(stream_channel_ids[stream_id][channel_id] < channel_count)) {
								PRINT_ERROR("Invalid channel ID specified for I/O flow " << stream_id);
							}

							if (!(stream_chip_ids[stream_id][chip_id] < chip_no_per_channel)) {
								PRINT_ERROR("Invalid chip ID specified for I/O flow " << stream_id);
							}

							if (!(stream_die_ids[stream_id][die_id] < die_no_per_chip)) {
								PRINT_ERROR("Invalid die ID specified for I/O flow " << stream_id);
							}

							if (!(stream_plane_ids[stream_id][plane_id] < plane_no_per_die)) {
								PRINT_ERROR("Invalid plane ID specified for I/O flow " << stream_id);
							}
							resource_list[stream_channel_ids[stream_id][channel_id]][stream_chip_ids[stream_id][chip_id]][stream_die_ids[stream_id][die_id]][stream_plane_ids[stream_id][plane_id]]++;
						}
					}
				}
			}
		}

		for (unsigned int stream_id = 0; stream_id < concurrent_stream_no; stream_id++)
		{
			std::vector<flash_channel_ID_type> channel_ids;
			Logical_Address_Partitioning_Unit::stream_channel_ids.push_back(channel_ids);
			for (flash_channel_ID_type channel_id = 0; channel_id < stream_channel_ids[stream_id].size(); channel_id++) {
				Logical_Address_Partitioning_Unit::stream_channel_ids[stream_id].push_back(stream_channel_ids[stream_id][channel_id]);
			}

			std::vector<flash_chip_ID_type> chip_ids;
			Logical_Address_Partitioning_Unit::stream_chip_ids.push_back(chip_ids);
			for (flash_chip_ID_type chip_id = 0; chip_id < stream_chip_ids[stream_id].size(); chip_id++) {
				Logical_Address_Partitioning_Unit::stream_chip_ids[stream_id].push_back(stream_chip_ids[stream_id][chip_id]);
			}

			std::vector<flash_die_ID_type> die_ids;
			Logical_Address_Partitioning_Unit::stream_die_ids.push_back(die_ids);
			for (flash_die_ID_type die_id = 0; die_id < stream_die_ids[stream_id].size(); die_id++) {
				Logical_Address_Partitioning_Unit::stream_die_ids[stream_id].push_back(stream_die_ids[stream_id][die_id]);
			}

			std::vector<flash_plane_ID_type> plane_ids;
			Logical_Address_Partitioning_Unit::stream_plane_ids.push_back(plane_ids);
			for (flash_plane_ID_type plane_id = 0; plane_id < stream_plane_ids[stream_id].size(); plane_id++) {
				Logical_Address_Partitioning_Unit::stream_plane_ids[stream_id].push_back(stream_plane_ids[stream_id][plane_id]);
			}
		}

		std::vector<LHA_type> lsa_count_per_stream;
		for (unsigned int stream_id = 0; stream_id < concurrent_stream_no; stream_id++) {
			LHA_type lsa_count = 0;
			for (flash_channel_ID_type channel_id = 0; channel_id < stream_channel_ids[stream_id].size(); channel_id++) {
				for (flash_chip_ID_type chip_id = 0; chip_id < stream_chip_ids[stream_id].size(); chip_id++) {
					for (flash_die_ID_type die_id = 0; die_id < stream_die_ids[stream_id].size(); die_id++) {
						for (flash_plane_ID_type plane_id = 0; plane_id < stream_plane_ids[stream_id].size(); plane_id++) {
							lsa_count += (LHA_type)((block_no_per_plane * page_no_per_block * sector_no_per_page * (1.0 - overprovisioning_ratio) *
								1.0 / double(resource_list[stream_channel_ids[stream_id][channel_id]][stream_chip_ids[stream_id][chip_id]][stream_die_ids[stream_id][die_id]][stream_plane_ids[stream_id][plane_id]])));
						}
					}
				}
			}
			pdas_per_flow.push_back(LHA_type(double(lsa_count) / (1.0 - overprovisioning_ratio)));
			total_pda_no += pdas_per_flow[stream_id];
			lsa_count_per_stream.push_back(lsa_count);
		}

		total_lha_no = 0;
		for (unsigned int stream_id = 0; stream_id < concurrent_stream_no; stream_id++) {
			start_lhas_per_flow.push_back(total_lha_no);
			end_lhas_per_flow.push_back(total_lha_no + lsa_count_per_stream[stream_id] - 1);
			total_lha_no += lsa_count_per_stream[stream_id];
		}

		initialized = true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
cmpb $0x0, 0x2189a(%rip)     # 0x73cc4
jne 0x52df8
movl %r8d, %ebx
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, 0xc(%rsp)
movsd %xmm0, 0xd0(%rsp)
movl %edi, 0x21874(%rip)     # 0x73cc0
movl %edx, 0x218be(%rip)     # 0x73d10
movl %ecx, 0x218bc(%rip)     # 0x73d14
movl %r8d, 0x218b9(%rip)     # 0x73d18
movl %r9d, 0x20(%rsp)
movl %r9d, 0x218b1(%rip)     # 0x73d1c
movl %edx, %eax
movq %rax, 0x30(%rsp)
leaq (,%rax,8), %rdi
callq 0x7030
movq %rax, 0x217d2(%rip)     # 0x73c58
testl %r15d, %r15d
movl %ebx, 0x80(%rsp)
je 0x52585
movl %r12d, %eax
movq %rax, 0x40(%rsp)
leaq (,%rax,8), %rax
movq %rax, 0x10(%rsp)
movl %ebx, %eax
movq %rax, 0x48(%rsp)
leaq (,%rax,8), %rax
movq %rax, 0x38(%rsp)
movl 0x20(%rsp), %eax
shlq $0x2, %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movq 0x10(%rsp), %rdi
callq 0x7030
movq 0x21779(%rip), %rcx     # 0x73c58
movq %rax, (%rcx,%rbp,8)
testl %r12d, %r12d
je 0x52577
xorl %r13d, %r13d
movq 0x38(%rsp), %rdi
callq 0x7030
movq 0x21758(%rip), %rcx     # 0x73c58
movq %rbp, %r14
movq (%rcx,%rbp,8), %rcx
movq %rax, (%rcx,%r13,8)
testl %ebx, %ebx
movq 0x18(%rsp), %rbp
je 0x5255f
xorl %ebx, %ebx
movq %rbp, %rdi
callq 0x7030
movq 0x21733(%rip), %rcx     # 0x73c58
movq (%rcx,%r14,8), %rcx
movq (%rcx,%r13,8), %rcx
movq %rax, (%rcx,%rbx,8)
cmpl $0x0, 0x20(%rsp)
je 0x52555
movq 0x21719(%rip), %rax     # 0x73c58
movq (%rax,%r14,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbx,8), %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x7230
incq %rbx
cmpq %rbx, 0x48(%rsp)
jne 0x52516
incq %r13
cmpq 0x40(%rsp), %r13
movl 0x80(%rsp), %ebx
movq %r14, %rbp
jne 0x524ef
incq %rbp
cmpq 0x30(%rsp), %rbp
jne 0x524ce
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
je 0x52dc4
movq 0x130(%rsp), %rax
movq (%rax), %rax
movq %rax, 0xd8(%rsp)
movl %ecx, %eax
movq %rax, 0x70(%rsp)
xorl %eax, %eax
movq %rax, 0x28(%rsp)
leaq (%rax,%rax,2), %rcx
movq 0xd8(%rsp), %rax
movq (%rax,%rcx,8), %rdx
movq %rcx, 0x10(%rsp)
movq 0x8(%rax,%rcx,8), %rax
movq %rdx, 0x48(%rsp)
subq %rdx, %rax
movq %rax, 0x78(%rsp)
je 0x52729
sarq $0x2, 0x78(%rsp)
movq 0x138(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x88(%rsp)
subq %rdi, %rax
sarq $0x2, %rax
movq %rax, 0x30(%rsp)
xorl %r10d, %r10d
cmpq %rdi, 0x88(%rsp)
je 0x5271b
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %r11
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
subq %r11, %rax
sarq $0x2, %rax
movq %rax, 0x38(%rsp)
xorl %r8d, %r8d
cmpq %r11, 0x18(%rsp)
je 0x5270d
movq 0x148(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rbx
movq 0x8(%rax,%rcx,8), %rsi
movq %rsi, 0x40(%rsp)
subq %rbx, %rsi
sarq $0x2, %rsi
xorl %ecx, %ecx
cmpq %rbx, 0x40(%rsp)
je 0x52700
movl $0x1, %r13d
movq 0x215c2(%rip), %rax     # 0x73c58
xorl %r9d, %r9d
movq 0x48(%rsp), %rdx
movl (%rdx,%r10,4), %r14d
cmpl %r15d, %r14d
jae 0x52e67
movl %r15d, %edx
movl (%rdi,%r8,4), %r15d
cmpl %r12d, %r15d
jae 0x52e29
movl %r12d, %ebp
movl (%r11,%rcx,4), %r12d
cmpl 0x80(%rsp), %r12d
jae 0x52e48
movl (%rbx,%r9,4), %r9d
cmpl 0x20(%rsp), %r9d
jae 0x52e0a
movq (%rax,%r14,8), %r14
movq (%r14,%r15,8), %r14
movq (%r14,%r12,8), %r14
incl (%r14,%r9,4)
movl %r13d, %r9d
incl %r13d
cmpq %r9, %rsi
movl %ebp, %r12d
movl %edx, %r15d
ja 0x52699
incl %ecx
cmpq %rcx, 0x38(%rsp)
ja 0x52682
incl %r8d
cmpq %r8, 0x30(%rsp)
ja 0x52650
incl %r10d
cmpq %r10, 0x78(%rsp)
ja 0x52615
movq 0x28(%rsp), %rax
incq %rax
cmpq 0x70(%rsp), %rax
jne 0x525ad
cmpl $0x0, 0xc(%rsp)
je 0x52dc4
xorl %r13d, %r13d
leaq 0xb0(%rsp), %r14
leaq 0x2154f(%rip), %r15     # 0x73ca8
leaq 0xe0(%rsp), %r12
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x214e5(%rip), %rdi     # 0x73c60
leaq 0x50(%rsp), %rsi
callq 0x1dc00
movq 0x130(%rsp), %rax
movq (%rax), %rax
leaq (,%r13,2), %rbp
addq %r13, %rbp
movq (%rax,%rbp,8), %rcx
cmpq %rcx, 0x8(%rax,%rbp,8)
je 0x527fd
movl $0x1, %ebx
xorl %edx, %edx
movq 0x214ac(%rip), %rsi     # 0x73c60
leaq (%rsi,%rbp,8), %rdi
leaq (%rcx,%rdx,4), %rdx
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x527d4
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x527e4
callq 0x1e0f4
movq 0x130(%rsp), %rax
movq (%rax), %rax
movl %ebx, %edx
movq (%rax,%rbp,8), %rcx
movq 0x8(%rax,%rbp,8), %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
incl %ebx
cmpq %rdx, %rsi
ja 0x527ad
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0x2145b(%rip), %rdi     # 0x73c78
leaq 0x90(%rsp), %rsi
callq 0x1dc00
movq 0x138(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbp,8), %rcx
cmpq %rcx, 0x8(%rax,%rbp,8)
je 0x52897
movl $0x1, %ebx
xorl %edx, %edx
movq 0x2142a(%rip), %rsi     # 0x73c78
leaq (%rsi,%rbp,8), %rdi
leaq (%rcx,%rdx,4), %rdx
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x5286e
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x5287e
callq 0x1e0f4
movq 0x138(%rsp), %rax
movq (%rax), %rax
movl %ebx, %edx
movq (%rax,%rbp,8), %rcx
movq 0x8(%rax,%rbp,8), %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
incl %ebx
cmpq %rdx, %rsi
ja 0x52847
xorpd %xmm0, %xmm0
movapd %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
leaq 0x213d9(%rip), %rdi     # 0x73c90
movq %r14, %rsi
callq 0x1dc00
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbp,8), %rcx
cmpq %rcx, 0x8(%rax,%rbp,8)
je 0x5292c
movl $0x1, %ebx
xorl %edx, %edx
movq 0x213ad(%rip), %rsi     # 0x73c90
leaq (%rsi,%rbp,8), %rdi
leaq (%rcx,%rdx,4), %rdx
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x52903
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x52913
callq 0x1e0f4
movq 0x140(%rsp), %rax
movq (%rax), %rax
movl %ebx, %edx
movq (%rax,%rbp,8), %rcx
movq 0x8(%rax,%rbp,8), %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
incl %ebx
cmpq %rdx, %rsi
ja 0x528dc
xorpd %xmm0, %xmm0
movapd %xmm0, 0xe0(%rsp)
movq $0x0, 0xf0(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1dc00
movq 0x148(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbp,8), %rcx
cmpq %rcx, 0x8(%rax,%rbp,8)
je 0x529bd
movl $0x1, %ebx
xorl %edx, %edx
movq 0x21334(%rip), %rsi     # 0x73ca8
leaq (%rsi,%rbp,8), %rdi
leaq (%rcx,%rdx,4), %rdx
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x52994
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x529a4
callq 0x1e0f4
movq 0x148(%rsp), %rax
movq (%rax), %rax
movl %ebx, %edx
movq (%rax,%rbp,8), %rcx
movq 0x8(%rax,%rbp,8), %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
incl %ebx
cmpq %rdx, %rsi
ja 0x5296d
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x529cf
callq 0x7370
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x529e1
callq 0x7370
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x529f3
callq 0x7370
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x52a02
callq 0x7370
incq %r13
cmpq 0x70(%rsp), %r13
jne 0x52761
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movl 0xc(%rsp), %ebx
testl %ebx, %ebx
je 0x52dd7
movl 0x158(%rsp), %eax
imull 0x160(%rsp), %eax
imull 0x150(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x51ba(%rip), %xmm1     # 0x57c10
subsd 0xd0(%rsp), %xmm1
movsd %xmm1, 0x88(%rsp)
mulsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
xorl %r14d, %r14d
movq $0x0, 0x90(%rsp)
movq 0x130(%rsp), %rax
movq (%rax), %rax
leaq (%r14,%r14,2), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x8(%rax,%rcx,8), %rsi
movq %rdx, 0x80(%rsp)
subq %rdx, %rsi
je 0x52c32
movq %r14, 0x78(%rsp)
sarq $0x2, %rsi
movq 0x138(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rcx,8), %rdx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
subq %rdx, %rax
sarq $0x2, %rax
movq %rax, 0x38(%rsp)
movq 0x2116f(%rip), %r9      # 0x73c58
xorl %r11d, %r11d
xorl %r10d, %r10d
movq %rsi, 0x30(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x52bf5
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %r14
movq 0x8(%rax,%rcx,8), %r15
movq %r15, 0x40(%rsp)
subq %r14, %r15
sarq $0x2, %r15
xorl %r13d, %r13d
cmpq %r14, 0x40(%rsp)
je 0x52be7
movq 0x148(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rbp
movq 0x8(%rax,%rcx,8), %rdx
movq %rdx, %rdi
subq %rbp, %rdi
sarq $0x2, %rdi
xorl %ebx, %ebx
cmpq %rbp, %rdx
je 0x52bdc
movq 0x80(%rsp), %rax
movl (%rax,%r11,4), %eax
movq (%r9,%rax,8), %rax
movq 0x20(%rsp), %rcx
movl (%rcx,%r13,4), %r8d
movq (%rax,%r8,8), %rax
movl (%r14,%rbx,4), %r8d
movq (%rax,%r8,8), %r8
xorl %eax, %eax
movsd 0x48(%rsp), %xmm2
movsd 0x24ba(%rip), %xmm3     # 0x55050
movl (%rbp,%rax,4), %r12d
xorps %xmm0, %xmm0
cvtsi2sdl (%r8,%r12,4), %xmm0
movapd %xmm2, %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %r12
subsd %xmm3, %xmm1
sarq $0x3f, %r12
cvttsd2si %xmm1, %rsi
andq %r12, %rsi
orq %rcx, %rsi
addq %rsi, %r10
incq %rax
movl %eax, %ecx
cmpq %rcx, %rdi
ja 0x52b96
movq %r10, 0x90(%rsp)
incl %ebx
cmpq %rbx, %r15
ja 0x52b5c
incl %r13d
cmpq %r13, 0x38(%rsp)
ja 0x52b2c
incl %r11d
movq 0x30(%rsp), %rsi
cmpq %r11, %rsi
ja 0x52af4
movq %r10, %xmm1
punpckldq 0x4cad(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4cb5(%rip), %xmm1     # 0x578d0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movl 0xc(%rsp), %ebx
movq 0x78(%rsp), %r14
jmp 0x52c36
xorpd %xmm0, %xmm0
divsd 0x88(%rsp), %xmm0
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subsd 0x23fd(%rip), %xmm0     # 0x55050
cvttsd2si %xmm0, %rax
andq %rdx, %rax
orq %rcx, %rax
movq %rax, 0xb0(%rsp)
movq 0x21063(%rip), %rsi     # 0x73cd0
cmpq 0x21064(%rip), %rsi     # 0x73cd8
je 0x52c86
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x2104c(%rip)     # 0x73cd0
jmp 0x52c9a
leaq 0x2103b(%rip), %rdi     # 0x73cc8
leaq 0xb0(%rsp), %rdx
callq 0x23ff2
movq 0x21027(%rip), %rax     # 0x73cc8
movq (%rax,%r14,8), %rax
addq %rax, 0x21074(%rip)     # 0x73d20
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x52cce
movq 0x90(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x52ce0
leaq 0x50(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x30e4e
incq %r14
cmpq 0x70(%rsp), %r14
jne 0x52a75
movq $0x0, 0x2102f(%rip) # 0x73d28
testl %ebx, %ebx
je 0x52de2
xorl %eax, %eax
leaq 0x20fd6(%rip), %r13     # 0x73ce0
leaq 0x21017(%rip), %r14     # 0x73d28
leaq 0x20fe0(%rip), %r15     # 0x73cf8
leaq 0x90(%rsp), %r12
xorl %ebx, %ebx
movq 0x20fbf(%rip), %rsi     # 0x73ce8
cmpq 0x20fc0(%rip), %rsi     # 0x73cf0
je 0x52d42
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x20fa8(%rip)     # 0x73ce8
jmp 0x52d4d
movq %r13, %rdi
movq %r14, %rdx
callq 0x30e4e
movq 0x20fd4(%rip), %rax     # 0x73d28
movq 0x50(%rsp), %rdi
movq (%rdi,%rbx,8), %rcx
addq %rcx, %rax
decq %rax
movq %rax, 0x90(%rsp)
movq 0x20f8e(%rip), %rsi     # 0x73d00
cmpq 0x20f8f(%rip), %rsi     # 0x73d08
je 0x52d8b
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x20f77(%rip)     # 0x73d00
jmp 0x52d9b
movq %r15, %rdi
movq %r12, %rdx
callq 0x23ff2
movq 0x50(%rsp), %rdi
movq 0x20f86(%rip), %rax     # 0x73d28
addq (%rdi,%rbx,8), %rax
movq %rax, 0x20f7b(%rip)     # 0x73d28
incq %rbx
cmpq %rbx, 0x70(%rsp)
jne 0x52d22
movb $0x1, 0x20f02(%rip)     # 0x73cc4
jmp 0x52df3
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x20f46(%rip) # 0x73d28
movq 0x50(%rsp), %rdi
movb $0x1, 0x20ed6(%rip)     # 0x73cc4
testq %rdi, %rdi
je 0x52df8
callq 0x7370
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1c1df(%rip), %rbx     # 0x6eff0
leaq 0x3790(%rip), %rsi      # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x5a3e(%rip), %rsi      # 0x58865
jmp 0x52e84
movq 0x1c1c0(%rip), %rbx     # 0x6eff0
leaq 0x3771(%rip), %rsi      # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x59d0(%rip), %rsi      # 0x58816
jmp 0x52e84
movq 0x1c1a1(%rip), %rbx     # 0x6eff0
leaq 0x3752(%rip), %rsi      # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x59d9(%rip), %rsi      # 0x5883e
jmp 0x52e84
movq 0x1c182(%rip), %rbx     # 0x6eff0
leaq 0x3733(%rip), %rsi      # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x5967(%rip), %rsi      # 0x587eb
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x74c0
movq %rax, %rdi
callq 0x71c0
movq 0x1c128(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
jmp 0x52f0c
jmp 0x52f0c
jmp 0x52f0c
jmp 0x52f0c
jmp 0x52ec7
jmp 0x52ede
jmp 0x52ef5
jmp 0x52f0c
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x52ee1
callq 0x7370
jmp 0x52ee1
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x52ef8
callq 0x7370
jmp 0x52ef8
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x52f0f
callq 0x7370
jmp 0x52f0f
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x52f1e
callq 0x7370
movq %rbx, %rdi
callq 0x7620