// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x2fd72(%rip), %rax     # 0x613e0
movq %rax, (%rdi)
xorl %edx, %edx
movl 0x20(%rbx), %eax
cmpq %rax, %rdx
jae 0x3181c
xorl %r13d, %r13d
movq %rdx, 0x8(%rsp)
movl 0x24(%rbx), %eax
cmpq %rax, %r13
jae 0x317fd
xorl %ebp, %ebp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jae 0x317da
xorl %ecx, %ecx
movl 0x2c(%rbx), %eax
cmpq %rax, %rcx
jae 0x31783
movq %rcx, 0x10(%rsp)
imulq $0xe0, %rcx, %r12
pushq $0x18
popq %r14
xorl %r15d, %r15d
movl 0x30(%rbx), %ecx
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x10(%rax,%r12), %rdi
cmpq %rcx, %r15
jae 0x316fb
movq (%rdi,%r14), %rdi
testq %rdi, %rdi
je 0x316f2
callq 0x7430
movq 0x8(%rsp), %rdx
incq %r15
addq $0x40, %r14
jmp 0x316c2
testq %rdi, %rdi
je 0x3171a
callq 0x7430
movq 0x8(%rsp), %rdx
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x50(%rax,%r12), %rdi
testq %rdi, %rdi
je 0x3173e
callq 0x7430
movq 0x8(%rsp), %rdx
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x48(%rax,%r12), %rdi
testq %rdi, %rdi
je 0x31762
callq 0x7430
movq 0x8(%rsp), %rdx
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x58(%rax,%r12), %rdi
testq %rdi, %rdi
je 0x31776
callq 0x7430
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
incq %rcx
jmp 0x316a3
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %r14
testq %r14, %r14
je 0x317d2
movq -0x8(%r14), %rax
testq %rax, %rax
je 0x317c1
leaq -0xe0(%r14), %r15
imulq $0xe0, %rax, %r12
leaq (%r15,%r12), %rdi
callq 0x31d1e
addq $-0xe0, %r12
jne 0x317af
addq $-0x8, %r14
movq %r14, %rdi
callq 0x7430
movq 0x8(%rsp), %rdx
incq %rbp
jmp 0x31695
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%r13,8), %rdi
testq %rdi, %rdi
je 0x317f5
callq 0x7430
movq 0x8(%rsp), %rdx
incq %r13
jmp 0x31687
movq 0x8(%rbx), %rax
movq (%rax,%rdx,8), %rdi
testq %rdi, %rdi
je 0x31814
callq 0x7430
movq 0x8(%rsp), %rdx
incq %rdx
jmp 0x31673
movq 0x8(%rbx), %rdi
addq $0x18, %rsp
testq %rdi, %rdi
je 0x31838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7430
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop