// File: /workspace/github_cpp_makefile_star2_O3/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 0x3118f(%rip), %rax     # 0x6e400
movq %rax, (%rdi)
cmpl $0x0, 0x20(%rdi)
je 0x3d46c
xorl %esi, %esi
cmpl $0x0, 0x24(%rbx)
movq %rsi, (%rsp)
je 0x3d447
xorl %r13d, %r13d
cmpl $0x0, 0x28(%rbx)
je 0x3d41e
xorl %ebp, %ebp
cmpl $0x0, 0x2c(%rbx)
je 0x3d39b
xorl %r14d, %r14d
movl 0x30(%rbx), %eax
testl %eax, %eax
je 0x3d2f9
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0x8(%rbx), %rcx
movq (%rcx,%rsi,8), %rcx
movq (%rcx,%r13,8), %rcx
movq (%rcx,%rbp,8), %rcx
imulq $0xe0, %r14, %rdx
movq 0x10(%rcx,%rdx), %rcx
movq (%rcx,%r15), %rdi
testq %rdi, %rdi
je 0x3d2eb
callq 0x7480
movq (%rsp), %rsi
movl 0x30(%rbx), %eax
incq %r12
movl %eax, %ecx
addq $0x40, %r15
cmpq %rcx, %r12
jb 0x3d2ba
movq 0x8(%rbx), %rax
movq (%rax,%rsi,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 0x3d333
callq 0x7480
movq (%rsp), %rsi
movq 0x8(%rbx), %rax
movq (%rax,%rsi,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x50(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x3d356
callq 0x7480
movq (%rsp), %rsi
movq 0x8(%rbx), %rax
movq (%rax,%rsi,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x48(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x3d379
callq 0x7480
movq (%rsp), %rsi
movq 0x8(%rbx), %rax
movq (%rax,%rsi,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq 0x58(%rax,%r15), %rdi
testq %rdi, %rdi
je 0x3d38c
callq 0x7480
movq (%rsp), %rsi
incq %r14
movl 0x2c(%rbx), %eax
cmpq %rax, %r14
jb 0x3d2aa
movq 0x8(%rbx), %rax
movq (%rax,%rsi,8), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %r14
testq %r14, %r14
je 0x3d40f
movq -0x8(%r14), %rax
testq %rax, %rax
je 0x3d3ff
imulq $0xe0, %rax, %rcx
leaq (%r14,%rcx), %r15
addq $-0xc8, %r15
imulq $-0xe0, %rax, %r12
leaq 0x98(%r15), %rdi
callq 0x304fe
leaq 0x48(%r15), %rdi
callq 0x3daa8
movq %r15, %rdi
callq 0x3da5e
addq $-0xe0, %r15
addq $0xe0, %r12
jne 0x3d3d2
addq $-0x8, %r14
movq %r14, %rdi
callq 0x7480
movq (%rsp), %rsi
incq %rbp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jb 0x3d29d
movq 0x8(%rbx), %rax
movq (%rax,%rsi,8), %rax
movq (%rax,%r13,8), %rdi
testq %rdi, %rdi
je 0x3d438
callq 0x7480
movq (%rsp), %rsi
incq %r13
movl 0x24(%rbx), %eax
cmpq %rax, %r13
jb 0x3d291
movq 0x8(%rbx), %rax
movq (%rax,%rsi,8), %rdi
testq %rdi, %rdi
je 0x3d45d
callq 0x7480
movq (%rsp), %rsi
incq %rsi
movl 0x20(%rbx), %eax
cmpq %rax, %rsi
jb 0x3d280
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0x3d488
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
nop