// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rdi, %rbx
leaq 0x30745(%rip), %rax     # 0x6e408
movq %rax, (%rdi)
cmpl $0x0, 0x20(%rdi)
je 0x3dec5
movq $0x0, (%rsp)
cmpl $0x0, 0x24(%rbx)
je 0x3de98
xorl %r13d, %r13d
cmpl $0x0, 0x28(%rbx)
je 0x3de6f
xorl %ebp, %ebp
cmpl $0x0, 0x2c(%rbx)
je 0x3ddec
xorl %r14d, %r14d
cmpl $0x0, 0x30(%rbx)
je 0x3dd4a
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
imulq $0xe0, %r14, %rcx
movq 0x10(%rax,%rcx), %rax
movq (%rax,%r15), %rdi
testq %rdi, %rdi
je 0x3dd3b
callq 0x7480
incq %r12
movl 0x30(%rbx), %eax
addq $0x40, %r15
cmpq %rax, %r12
jb 0x3dd0d
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
imulq $0xe0, %r14, %r15
movq 0x10(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x3dd74
callq 0x7480
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x50(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x3dd97
callq 0x7480
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x48(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x3ddba
callq 0x7480
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x58(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x3dddd
callq 0x7480
incq %r14
movl 0x2c(%rbx), %eax
cmpq %rax, %r14
jb 0x3dcfe
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %r14
testq %r14, %r14
je 0x3de60
movq -0x8(%r14), %rax
testq %rax, %rax
je 0x3de54
imulq $0xe0, %rax, %rcx
leaq (%r14,%rcx), %r15
addq $-0xc8, %r15
imulq $-0xe0, %rax, %r12
leaq 0x98(%r15), %rdi
callq 0x30d22
leaq 0x48(%r15), %rdi
callq 0x3e500
movq %r15, %rdi
callq 0x3e4b6
addq $-0xe0, %r15
addq $0xe0, %r12
jne 0x3de27
addq $-0x8, %r14
movq %r14, %rdi
callq 0x7480
incq %rbp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jb 0x3dcf1
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r13,8), %rdi
testq %rdi, %rdi
je 0x3de89
callq 0x7480
incq %r13
movl 0x24(%rbx), %eax
cmpq %rax, %r13
jb 0x3dce5
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x3deae
callq 0x7480
movq (%rsp), %rdx
incq %rdx
movl 0x20(%rbx), %eax
movq %rdx, (%rsp)
cmpq %rax, %rdx
jb 0x3dcd8
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x3dee1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7480
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq