// File: CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager_Base.cpp
// Function: SSD_Components::Flash_Block_Manager_Base::~Flash_Block_Manager_Base()
Flash_Block_Manager_Base::~Flash_Block_Manager_Base() 
	{
		for (unsigned int channel_id = 0; channel_id < channel_count; channel_id++) {
			for (unsigned int chip_id = 0; chip_id < chip_no_per_channel; chip_id++) {
				for (unsigned int die_id = 0; die_id < die_no_per_chip; die_id++) {
					for (unsigned int plane_id = 0; plane_id < plane_no_per_die; plane_id++) {
						for (unsigned int blockID = 0; blockID < block_no_per_plane; blockID++) {
							delete[] plane_manager[channel_id][chip_id][die_id][plane_id].Blocks[blockID].Invalid_page_bitmap;
						}
						delete[] plane_manager[channel_id][chip_id][die_id][plane_id].Blocks;
						delete[] plane_manager[channel_id][chip_id][die_id][plane_id].GC_wf;
						delete[] plane_manager[channel_id][chip_id][die_id][plane_id].Data_wf;
						delete[] plane_manager[channel_id][chip_id][die_id][plane_id].Translation_wf;
					}
					delete[] plane_manager[channel_id][chip_id][die_id];
				}
				delete[] plane_manager[channel_id][chip_id];
			}
			delete[] plane_manager[channel_id];
		}
		delete[] plane_manager;
	}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x5d045(%rip), %rcx     # 0xd93f8
addq $0x10, %rcx
movq %rcx, (%rax)
movl $0x0, 0x7c(%rsp)
movq 0x60(%rsp), %rcx
movl 0x7c(%rsp), %eax
cmpl 0x20(%rcx), %eax
jae 0x7c6e3
movl $0x0, 0x78(%rsp)
movq 0x60(%rsp), %rcx
movl 0x78(%rsp), %eax
cmpl 0x24(%rcx), %eax
jae 0x7c6ab
movl $0x0, 0x74(%rsp)
movq 0x60(%rsp), %rcx
movl 0x74(%rsp), %eax
cmpl 0x28(%rcx), %eax
jae 0x7c66b
movl $0x0, 0x70(%rsp)
movq 0x60(%rsp), %rcx
movl 0x70(%rsp), %eax
cmpl 0x2c(%rcx), %eax
jae 0x7c5d0
movl $0x0, 0x6c(%rsp)
movq 0x60(%rsp), %rcx
movl 0x6c(%rsp), %eax
cmpl 0x30(%rcx), %eax
jae 0x7c49e
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x7c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x78(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x74(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x70(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl 0x6c(%rsp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
je 0x7c48f
movq 0x58(%rsp), %rdi
callq 0x8570
jmp 0x7c491
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x7c42a
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x7c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x78(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x74(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x70(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
je 0x7c4e6
movq 0x50(%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x7c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x78(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x74(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x70(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
je 0x7c52e
movq 0x48(%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x7c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x78(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x74(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x70(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0x7c576
movq 0x40(%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x7c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x78(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x74(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x70(%rsp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq 0x58(%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0x7c5be
movq 0x38(%rsp), %rdi
callq 0x8570
jmp 0x7c5c0
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x7c410
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x7c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x78(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x74(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0x7c659
movq 0x30(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x20(%rsp)
imulq $0xe0, -0x8(%rcx), %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0x28(%rsp)
je 0x7c64f
movq 0x28(%rsp), %rdi
addq $-0xe0, %rdi
movq %rdi, 0x18(%rsp)
callq 0x7d060
movq 0x30(%rsp), %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x7c625
movq 0x20(%rsp), %rdi
callq 0x8570
jmp 0x7c65b
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x7c3f6
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x7c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x78(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x7c699
movq 0x10(%rsp), %rdi
callq 0x8570
jmp 0x7c69b
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x7c3dc
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x7c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x7c6d1
movq 0x8(%rsp), %rdi
callq 0x8570
jmp 0x7c6d3
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0x7c3c2
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x7c6ff
movq (%rsp), %rdi
callq 0x8570
addq $0x88, %rsp
retq
nopw (%rax,%rax)