// File: CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager_Base.cpp
// Function: SSD_Components::Flash_Block_Manager_Base::Flash_Block_Manager_Base(SSD_Components::GC_and_WL_Unit_Base*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
Flash_Block_Manager_Base::Flash_Block_Manager_Base(GC_and_WL_Unit_Base* gc_and_wl_unit, unsigned int max_allowed_block_erase_count, unsigned int total_concurrent_streams_no,
		unsigned int channel_count, unsigned int chip_no_per_channel, unsigned int die_no_per_chip, unsigned int plane_no_per_die,
		unsigned int block_no_per_plane, unsigned int page_no_per_block)
		: gc_and_wl_unit(gc_and_wl_unit), max_allowed_block_erase_count(max_allowed_block_erase_count), total_concurrent_streams_no(total_concurrent_streams_no),
		channel_count(channel_count), chip_no_per_channel(chip_no_per_channel), die_no_per_chip(die_no_per_chip), plane_no_per_die(plane_no_per_die),
		block_no_per_plane(block_no_per_plane), pages_no_per_block(page_no_per_block)
	{
		plane_manager = new PlaneBookKeepingType***[channel_count];
		for (unsigned int channelID = 0; channelID < channel_count; channelID++) {
			plane_manager[channelID] = new PlaneBookKeepingType**[chip_no_per_channel];
			for (unsigned int chipID = 0; chipID < chip_no_per_channel; chipID++) {
				plane_manager[channelID][chipID] = new PlaneBookKeepingType*[die_no_per_chip];
				for (unsigned int dieID = 0; dieID < die_no_per_chip; dieID++) {
					plane_manager[channelID][chipID][dieID] = new PlaneBookKeepingType[plane_no_per_die];

					//Initialize plane book keeping data structure
					for (unsigned int planeID = 0; planeID < plane_no_per_die; planeID++) {
						plane_manager[channelID][chipID][dieID][planeID].Total_pages_count = block_no_per_plane * pages_no_per_block;
						plane_manager[channelID][chipID][dieID][planeID].Free_pages_count = block_no_per_plane * pages_no_per_block;
						plane_manager[channelID][chipID][dieID][planeID].Valid_pages_count = 0;
						plane_manager[channelID][chipID][dieID][planeID].Invalid_pages_count = 0;
						plane_manager[channelID][chipID][dieID][planeID].Ongoing_erase_operations.clear();
						plane_manager[channelID][chipID][dieID][planeID].Blocks = new Block_Pool_Slot_Type[block_no_per_plane];
						
						//Initialize block pool for plane
						for (unsigned int blockID = 0; blockID < block_no_per_plane; blockID++) {
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].BlockID = blockID;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Current_page_write_index = 0;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Current_status = Block_Service_Status::IDLE;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Invalid_page_count = 0;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Erase_count = 0;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Holds_mapping_data = false;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Has_ongoing_gc_wl = false;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Erase_transaction = NULL;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Ongoing_user_program_count = 0;
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Ongoing_user_read_count = 0;
							Block_Pool_Slot_Type::Page_vector_size = pages_no_per_block / (sizeof(uint64_t) * 8) + (pages_no_per_block % (sizeof(uint64_t) * 8) == 0 ? 0 : 1);
							plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Invalid_page_bitmap = new uint64_t[Block_Pool_Slot_Type::Page_vector_size];
							for (unsigned int i = 0; i < Block_Pool_Slot_Type::Page_vector_size; i++) {
								plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID].Invalid_page_bitmap[i] = All_VALID_PAGE;
							}
							plane_manager[channelID][chipID][dieID][planeID].Add_to_free_block_pool(&plane_manager[channelID][chipID][dieID][planeID].Blocks[blockID], false);
						}
						plane_manager[channelID][chipID][dieID][planeID].Data_wf = new Block_Pool_Slot_Type*[total_concurrent_streams_no];
						plane_manager[channelID][chipID][dieID][planeID].Translation_wf = new Block_Pool_Slot_Type*[total_concurrent_streams_no];
						plane_manager[channelID][chipID][dieID][planeID].GC_wf = new Block_Pool_Slot_Type*[total_concurrent_streams_no];
						for (unsigned int stream_cntr = 0; stream_cntr < total_concurrent_streams_no; stream_cntr++) {
							plane_manager[channelID][chipID][dieID][planeID].Data_wf[stream_cntr] = plane_manager[channelID][chipID][dieID][planeID].Get_a_free_block(stream_cntr, false);
							plane_manager[channelID][chipID][dieID][planeID].Translation_wf[stream_cntr] = plane_manager[channelID][chipID][dieID][planeID].Get_a_free_block(stream_cntr, true);
							plane_manager[channelID][chipID][dieID][planeID].GC_wf[stream_cntr] = plane_manager[channelID][chipID][dieID][planeID].Get_a_free_block(stream_cntr, false);
						}
					}
				}
			}
		}
	}

// Assembly:
subq $0xc8, %rsp
movl 0xe8(%rsp), %eax
movl 0xe0(%rsp), %eax
movl 0xd8(%rsp), %eax
movl 0xd0(%rsp), %eax
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movl %edx, 0xb4(%rsp)
movl %ecx, 0xb0(%rsp)
movl %r8d, 0xac(%rsp)
movl %r9d, 0xa8(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x5df93(%rip), %rcx     # 0xd93f8
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0xb8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movl 0xb4(%rsp), %ecx
movl %ecx, 0x18(%rax)
movl 0xb0(%rsp), %ecx
movl %ecx, 0x1c(%rax)
movl 0xac(%rsp), %ecx
movl %ecx, 0x20(%rax)
movl 0xa8(%rsp), %ecx
movl %ecx, 0x24(%rax)
movl 0xd0(%rsp), %ecx
movl %ecx, 0x28(%rax)
movl 0xd8(%rsp), %ecx
movl %ecx, 0x2c(%rax)
movl 0xe0(%rsp), %ecx
movl %ecx, 0x30(%rax)
movl 0xe8(%rsp), %ecx
movl %ecx, 0x34(%rax)
movl 0xac(%rsp), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
cmpl 0xac(%rsp), %eax
jae 0x7c1ca
movl 0xa8(%rsp), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rdx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl $0x0, 0xa0(%rsp)
movl 0xa0(%rsp), %eax
cmpl 0xa8(%rsp), %eax
jae 0x7c1b2
movl 0xd0(%rsp), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rdx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl $0x0, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
cmpl 0xd0(%rsp), %eax
jae 0x7c19a
movl 0xd8(%rsp), %eax
movq %rax, 0x58(%rsp)
movl $0xe0, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x60(%rsp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0x68(%rsp)
cmpq $0x0, %rax
je 0x7b683
movq 0x68(%rsp), %rax
movq 0x58(%rsp), %rcx
imulq $0xe0, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x7cff0
jmp 0x7b669
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
addq $0xe0, %rax
cmpq %rcx, %rax
movq %rax, 0x50(%rsp)
jne 0x7b658
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl $0x0, 0x88(%rsp)
movl 0x88(%rsp), %eax
cmpl 0xd8(%rsp), %eax
jae 0x7c182
movq 0x70(%rsp), %rax
movl 0xe0(%rsp), %edx
imull 0x34(%rax), %edx
movq 0x8(%rax), %rcx
movl 0xa4(%rsp), %esi
movq (%rcx,%rsi,8), %rcx
movl 0xa0(%rsp), %esi
movq (%rcx,%rsi,8), %rcx
movl 0x9c(%rsp), %esi
movq (%rcx,%rsi,8), %rcx
movl 0x88(%rsp), %esi
imulq $0xe0, %rsi, %rsi
addq %rsi, %rcx
movl %edx, (%rcx)
movl 0xe0(%rsp), %edx
imull 0x34(%rax), %edx
movq 0x8(%rax), %rcx
movl 0xa4(%rsp), %esi
movq (%rcx,%rsi,8), %rcx
movl 0xa0(%rsp), %esi
movq (%rcx,%rsi,8), %rcx
movl 0x9c(%rsp), %esi
movq (%rcx,%rsi,8), %rcx
movl 0x88(%rsp), %esi
imulq $0xe0, %rsi, %rsi
addq %rsi, %rcx
movl %edx, 0x4(%rcx)
movq 0x8(%rax), %rcx
movl 0xa4(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0xa0(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x9c(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rcx
movl $0x0, 0x8(%rcx)
movq 0x8(%rax), %rcx
movl 0xa4(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0xa0(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x9c(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rcx
movl $0x0, 0xc(%rcx)
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movl 0x88(%rsp), %eax
imulq $0xe0, %rax, %rax
addq %rax, %rdi
addq $0xb0, %rdi
callq 0x7d0a0
movl 0xe0(%rsp), %eax
movq %rax, 0x30(%rsp)
movl $0x40, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x38(%rsp)
cmpq $0x0, %rax
je 0x7b89e
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rdx
shlq $0x6, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x7d0b0
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
addq $0x40, %rax
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x7b877
movq 0x38(%rsp), %rcx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl $0x0, 0x84(%rsp)
movl 0x84(%rsp), %eax
cmpl 0xe0(%rsp), %eax
jae 0x7be51
movq 0x70(%rsp), %rcx
movl 0x84(%rsp), %edx
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %esi
movq (%rax,%rsi,8), %rax
movl 0xa0(%rsp), %esi
movq (%rax,%rsi,8), %rax
movl 0x9c(%rsp), %esi
movq (%rax,%rsi,8), %rax
movl 0x88(%rsp), %esi
imulq $0xe0, %rsi, %rsi
addq %rsi, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %esi
shlq $0x6, %rsi
addq %rsi, %rax
movl %edx, (%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movl $0x0, 0x4(%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movl $0x0, 0x8(%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movl $0x0, 0xc(%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movl $0x0, 0x10(%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movb $0x0, 0x22(%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movb $0x0, 0x23(%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movq $0x0, 0x28(%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movl $0x0, 0x38(%rax)
movq 0x8(%rcx), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movl $0x0, 0x34(%rax)
movl 0x34(%rcx), %eax
shrq $0x6, %rax
movl 0x34(%rcx), %ecx
movl %ecx, %esi
andq $0x3f, %rsi
movl $0x1, %ecx
xorl %edx, %edx
cmpq $0x0, %rsi
cmovel %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl %eax, 0x5eab5(%rip)     # 0xda6f8
movl 0x5eaaf(%rip), %eax     # 0xda6f8
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movl $0x0, 0x80(%rsp)
movl 0x80(%rsp), %eax
cmpl 0x5ea22(%rip), %eax     # 0xda6f8
jae 0x7bdb1
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x88(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl 0x84(%rsp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movl 0x80(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
movl 0x80(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x80(%rsp)
jmp 0x7bcc9
movq 0x68(%rsp), %rcx
movq %rax, %rsi
movq 0x40(%rsp), %rax
movq %rsi, 0x90(%rsp)
movl %edx, 0x8c(%rsp)
cmpq %rax, %rcx
movq %rax, 0x10(%rsp)
je 0x7bda2
movq 0x10(%rsp), %rdi
addq $-0xe0, %rdi
movq %rdi, 0x8(%rsp)
callq 0x7d060
movq 0x68(%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x10(%rsp)
jne 0x7bd78
movq 0x60(%rsp), %rdi
callq 0x8570
jmp 0x7c1d2
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rcx
movl 0xa4(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0xa0(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x9c(%rsp), %edx
movq (%rcx,%rdx,8), %rdi
movl 0x88(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rdi
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x88(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movl 0x84(%rsp), %eax
shlq $0x6, %rax
addq %rax, %rsi
xorl %edx, %edx
callq 0x7c1e0
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x7b8ed
movl 0xb0(%rsp), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x48(%rax)
movl 0xb0(%rsp), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x58(%rax)
movl 0xb0(%rsp), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0xa0(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x9c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x50(%rax)
movl $0x0, 0x7c(%rsp)
movl 0x7c(%rsp), %eax
cmpl 0xb0(%rsp), %eax
jae 0x7c16a
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movl 0x88(%rsp), %eax
imulq $0xe0, %rax, %rax
addq %rax, %rdi
movl 0x7c(%rsp), %eax
xorl %edx, %edx
movzwl %ax, %esi
callq 0x7c270
movq %rax, %rsi
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rcx
movl 0xa4(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0xa0(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x9c(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rcx
movq 0x48(%rcx), %rcx
movl 0x7c(%rsp), %edx
movq %rsi, (%rcx,%rdx,8)
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movl 0x88(%rsp), %eax
imulq $0xe0, %rax, %rax
addq %rax, %rdi
movl 0x7c(%rsp), %eax
movl $0x1, %edx
movzwl %ax, %esi
callq 0x7c270
movq %rax, %rsi
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rcx
movl 0xa4(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0xa0(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x9c(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movl 0x88(%rsp), %edx
imulq $0xe0, %rdx, %rdx
addq %rdx, %rcx
movq 0x58(%rcx), %rcx
movl 0x7c(%rsp), %edx
movq %rsi, (%rcx,%rdx,8)
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movl 0x88(%rsp), %eax
imulq $0xe0, %rax, %rax
addq %rax, %rdi
movl 0x7c(%rsp), %eax
xorl %edx, %edx
movzwl %ax, %esi
callq 0x7c270
movq %rax, %rdx
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movl 0xa4(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0xa0(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x88(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rax
movl 0x7c(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0x7bf97
jmp 0x7c16c
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
jmp 0x7b6bd
jmp 0x7c184
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x7b5ce
jmp 0x7c19c
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0x7b565
jmp 0x7c1b4
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x7b507
addq $0xc8, %rsp
retq
movq 0x90(%rsp), %rdi
callq 0x8770
nop