// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::AddressMappingDomain::~AddressMappingDomain()
AddressMappingDomain::~AddressMappingDomain()
	{
		delete CMT;
		delete[] GlobalMappingTable;
		delete[] GlobalTranslationDirectory;

		auto read_entry = Waiting_unmapped_read_transactions.begin();
		while (read_entry != Waiting_unmapped_read_transactions.end()) {
			delete read_entry->second;
			Waiting_unmapped_read_transactions.erase(read_entry++);
		}

		auto entry_write = Waiting_unmapped_program_transactions.begin();
		while (entry_write != Waiting_unmapped_program_transactions.end()) {
			delete entry_write->second;
			Waiting_unmapped_program_transactions.erase(entry_write++);
		}

		delete[] Channel_ids;
		delete[] Chip_ids;
		delete[] Die_ids;
		delete[] Plane_ids;
	}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, %rax
je 0x4b59f
movq 0x68(%rsp), %rdi
callq 0x4a2f0
movq 0x68(%rsp), %rdi
callq 0x8410
movq 0x60(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
je 0x4b5bd
movq 0x58(%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
je 0x4b5da
movq 0x50(%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rdi
addq $0x28, %rdi
callq 0x58e10
movq %rax, 0xa8(%rsp)
movq 0x60(%rsp), %rdi
addq $0x28, %rdi
callq 0x58e60
movq %rax, 0xa0(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x58e40
testb $0x1, %al
jne 0x4b621
jmp 0x4b697
leaq 0xa8(%rsp), %rdi
callq 0x58e90
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
je 0x4b647
movq 0x48(%rsp), %rdi
callq 0x8410
movq 0x60(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x38(%rsp)
leaq 0xa8(%rsp), %rdi
xorl %esi, %esi
callq 0x58ef0
movq 0x38(%rsp), %rdi
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rsi
callq 0x58eb0
movq %rax, 0x40(%rsp)
jmp 0x4b685
movq 0x40(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x4b5f0
movq 0x60(%rsp), %rdi
addq $0x58, %rdi
callq 0x58e10
movq %rax, 0x88(%rsp)
movq 0x60(%rsp), %rdi
addq $0x58, %rdi
callq 0x58e60
movq %rax, 0x80(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x58e40
testb $0x1, %al
jne 0x4b6de
jmp 0x4b74b
leaq 0x88(%rsp), %rdi
callq 0x58e90
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0x4b704
movq 0x30(%rsp), %rdi
callq 0x8410
movq 0x60(%rsp), %rax
addq $0x58, %rax
movq %rax, 0x20(%rsp)
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
callq 0x58ef0
movq 0x20(%rsp), %rdi
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rsi
callq 0x58eb0
movq %rax, 0x28(%rsp)
jmp 0x4b73c
movq 0x28(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x4b6ad
movq 0x60(%rsp), %rax
movq 0x210(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x4b76c
movq 0x18(%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rax
movq 0x220(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x4b78d
movq 0x10(%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rax
movq 0x230(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x4b7ae
movq 0x8(%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rax
movq 0x240(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x4b7cd
movq (%rsp), %rdi
callq 0x8570
movq 0x60(%rsp), %rdi
addq $0x1d8, %rdi            # imm = 0x1D8
callq 0x58de0
movq 0x60(%rsp), %rdi
addq $0x1a8, %rdi            # imm = 0x1A8
callq 0x58de0
movq 0x60(%rsp), %rdi
addq $0x178, %rdi            # imm = 0x178
callq 0x58df0
movq 0x60(%rsp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0x58df0
movq 0x60(%rsp), %rdi
addq $0x118, %rdi            # imm = 0x118
callq 0x58de0
movq 0x60(%rsp), %rdi
addq $0xe8, %rdi
callq 0x20b60
movq 0x60(%rsp), %rdi
addq $0xb8, %rdi
callq 0x58de0
movq 0x60(%rsp), %rdi
addq $0x88, %rdi
callq 0x58e00
movq 0x60(%rsp), %rdi
addq $0x58, %rdi
callq 0x58df0
movq 0x60(%rsp), %rdi
addq $0x28, %rdi
callq 0x58df0
addq $0xb8, %rsp
retq
movq %rax, %rdi
callq 0xd460
nopw %cs:(%rax,%rax)