LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Get_bitmap_vector_of_written_sectors(unsigned short, unsigned long)
page_status_type Cached_Mapping_Table::Get_bitmap_vector_of_written_sectors(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);
		auto it = addressMap.find(key);
		assert(it != addressMap.end());
		assert(it->second->Status == CMTEntryStatus::VALID);

		return it->second->WrittenStateBitmap;
	}

// Assembly:
pushq %rax
shlq $0x38, %rsi
orq %rdx, %rsi
movq %rsp, %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x30a0c
testq %rax, %rax
je 0x29479
movq 0x10(%rax), %rax
cmpl $0x2, 0x14(%rax)
jne 0x29498
movq 0x8(%rax), %rax
popq %rcx
retq
leaq 0x2f0c0(%rip), %rdi     # 0x58540
leaq 0x2f0d0(%rip), %rsi     # 0x58557
leaq 0x2f183(%rip), %rcx     # 0x58611
movl $0x3b, %edx
callq 0x7270
leaq 0x2f146(%rip), %rdi     # 0x585e5
leaq 0x2f0b1(%rip), %rsi     # 0x58557
leaq 0x2f164(%rip), %rcx     # 0x58611
movl $0x3c, %edx
callq 0x7270
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Update_mapping_info(unsigned short, unsigned long, unsigned long, unsigned long)
void Cached_Mapping_Table::Update_mapping_info(const stream_id_type streamID, const LPA_type lpa, const PPA_type ppa, const page_status_type pageWriteState)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpa);
		auto it = addressMap.find(key);
		assert(it != addressMap.end());
		assert(it->second->Status == CMTEntryStatus::VALID);
		it->second->PPA = ppa;
		it->second->WrittenStateBitmap = pageWriteState;
		it->second->Dirty = true;
		it->second->Stream_id = streamID;
		DEBUG("Address mapping table update entry - Stream ID:" << streamID << ", LPA:" << lpa << ", PPA:" << ppa)
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r15
movl %esi, %r14d
movq %r14, %rax
shlq $0x38, %rax
orq %rdx, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
callq 0x30a0c
testq %rax, %rax
je 0x2950a
movq 0x10(%rax), %rax
cmpl $0x2, 0x14(%rax)
jne 0x29529
movq %r15, (%rax)
movq %rbx, 0x8(%rax)
movb $0x1, 0x10(%rax)
movw %r14w, 0x20(%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2f02f(%rip), %rdi     # 0x58540
leaq 0x2f03f(%rip), %rsi     # 0x58557
leaq 0x2f174(%rip), %rcx     # 0x58693
movl $0x45, %edx
callq 0x7270
leaq 0x2f0b5(%rip), %rdi     # 0x585e5
leaq 0x2f020(%rip), %rsi     # 0x58557
leaq 0x2f155(%rip), %rcx     # 0x58693
movl $0x46, %edx
callq 0x7270
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Insert_new_mapping_info(unsigned short, unsigned long, unsigned long, unsigned long long)
void Cached_Mapping_Table::Insert_new_mapping_info(const stream_id_type streamID, const LPA_type lpa, const PPA_type ppa, const unsigned long long pageWriteState)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpa);
		auto it = addressMap.find(key);
		if (it == addressMap.end()) {
			throw std::logic_error("No slot is reserved!");
		}

		it->second->Status = CMTEntryStatus::VALID;
		it->second->PPA = ppa;
		it->second->WrittenStateBitmap = pageWriteState;
		it->second->Dirty = false;
		it->second->Stream_id = streamID;
		DEBUG("Address mapping table insert entry - Stream ID:" << streamID << ", LPA:" << lpa << ", PPA:" << ppa)
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r15
movl %esi, %r14d
movq %r14, %rax
shlq $0x38, %rax
orq %rdx, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
callq 0x30a0c
testq %rax, %rax
je 0x2959b
movq 0x10(%rax), %rax
movl $0x2, 0x14(%rax)
movq %r15, (%rax)
movq %rbx, 0x8(%rax)
movb $0x0, 0x10(%rax)
movw %r14w, 0x20(%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x2f171(%rip), %rsi     # 0x58720
movq %rax, %rdi
callq 0x7500
movq 0x45a02(%rip), %rsi     # 0x6efc0
movq 0x459bb(%rip), %rdx     # 0x6ef80
movq %rbx, %rdi
callq 0x75e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Is_slot_reserved_for_lpn_and_waiting(unsigned short, unsigned long)
bool Cached_Mapping_Table::Is_slot_reserved_for_lpn_and_waiting(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);
		auto it = addressMap.find(key);
		if (it != addressMap.end()) {
			if (it->second->Status == CMTEntryStatus::WAITING) {
				return true;
			}
		}

		return false;
	}

// Assembly:
pushq %rax
shlq $0x38, %rsi
orq %rdx, %rsi
movq %rsp, %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x30a0c
testq %rax, %rax
je 0x29607
movq 0x10(%rax), %rcx
movb $0x1, %al
cmpl $0x1, 0x14(%rcx)
je 0x29609
xorl %eax, %eax
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Reserve_slot_for_lpn(unsigned short, unsigned long)
void Cached_Mapping_Table::Reserve_slot_for_lpn(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);

		if (addressMap.find(key) != addressMap.end()) {
			throw std::logic_error("Duplicate lpa insertion into CMT!");
		}
		if (addressMap.size() >= capacity) {
			throw std::logic_error("CMT overfull!");
		}

		CMTSlotType* cmtEnt = new CMTSlotType();
		cmtEnt->Dirty = false;
		cmtEnt->Stream_id = streamID;
		lruList.push_front(std::pair<LPA_type, CMTSlotType*>(key, cmtEnt));
		cmtEnt->Status = CMTEntryStatus::WAITING;
		cmtEnt->listPtr = lruList.begin();
		addressMap[key] = cmtEnt;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq %r14, %rax
shlq $0x38, %rax
orq %rdx, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
callq 0x30a0c
testq %rax, %rax
jne 0x296c9
movl 0x50(%rbx), %eax
cmpq %rax, 0x18(%rbx)
jae 0x296e7
movl $0x28, %edi
callq 0x73a0
movq %rax, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movw %r14w, 0x20(%rax)
leaq 0x8(%rsp), %r14
movq (%r14), %r13
movq 0x38(%rbx), %r12
movl $0x20, %edi
callq 0x73a0
movq %r13, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x7060
incq 0x48(%rbx)
movl $0x1, 0x14(%r15)
movq 0x38(%rbx), %rax
movq %rax, 0x18(%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30aa2
movq %r15, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x2f058(%rip), %rsi     # 0x58735
movq %rax, %rdi
callq 0x7500
jmp 0x29703
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x2f05c(%rip), %rsi     # 0x58757
movq %rax, %rdi
callq 0x7500
movq 0x458b6(%rip), %rsi     # 0x6efc0
movq 0x4586f(%rip), %rdx     # 0x6ef80
movq %rbx, %rdi
callq 0x75e0
jmp 0x2971b
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Evict_one_slot(unsigned long&)
CMTSlotType Cached_Mapping_Table::Evict_one_slot(LPA_type& lpa)
	{
		assert(addressMap.size() > 0);
		addressMap.erase(lruList.back().first);
		lpa = UNIQUE_KEY_TO_LPN(lruList.back().second->Stream_id,lruList.back().first);
		CMTSlotType evictedItem = *lruList.back().second;
		delete lruList.back().second;
		lruList.pop_back();
	
		return evictedItem;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x18(%rsi)
je 0x297a8
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rsi), %rsi
addq $0x10, %rsi
movq %r14, %rdi
callq 0x30d28
movq 0x40(%r14), %rax
movq 0x18(%rax), %rdi
movl 0x20(%rdi), %ecx
shlq $0x38, %rcx
notq %rcx
andq 0x10(%rax), %rcx
movq %rcx, (%r15)
movq 0x20(%rdi), %rax
movq %rax, 0x20(%rbx)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
callq 0x7370
movq 0x40(%r14), %r15
decq 0x48(%r14)
movq %r15, %rdi
callq 0x7580
movq %r15, %rdi
callq 0x7370
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2efb6(%rip), %rdi     # 0x58765
leaq 0x2eda1(%rip), %rsi     # 0x58557
leaq 0x2efbe(%rip), %rcx     # 0x5877b
movl $0x85, %edx
callq 0x7270
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Is_dirty(unsigned short, unsigned long)
bool Cached_Mapping_Table::Is_dirty(const stream_id_type streamID, const LPA_type lpa)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpa);
		auto it = addressMap.find(key);
		if (it == addressMap.end())
		{
			throw std::logic_error("The requested slot does not exist!");
		}

		return it->second->Dirty;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
shlq $0x38, %rsi
orq %rdx, %rsi
movq %rsp, %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x30a0c
testq %rax, %rax
je 0x297f5
movq 0x10(%rax), %rax
movb 0x10(%rax), %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x2efbf(%rip), %rsi     # 0x587c8
movq %rax, %rdi
callq 0x7500
movq 0x457a8(%rip), %rsi     # 0x6efc0
movq 0x45761(%rip), %rdx     # 0x6ef80
movq %rbx, %rdi
callq 0x75e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Make_clean(unsigned short, unsigned long)
void Cached_Mapping_Table::Make_clean(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);
		auto it = addressMap.find(key);
		if (it == addressMap.end()) {
			throw std::logic_error("The requested slot does not exist!");
		}

		it->second->Dirty = false;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
shlq $0x38, %rsi
orq %rdx, %rsi
movq %rsp, %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x30a0c
testq %rax, %rax
je 0x29868
movq 0x10(%rax), %rax
movb $0x0, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x2ef4c(%rip), %rsi     # 0x587c8
movq %rax, %rdi
callq 0x7500
movq 0x45735(%rip), %rsi     # 0x6efc0
movq 0x456ee(%rip), %rdx     # 0x6ef80
movq %rbx, %rdi
callq 0x75e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
testq %r14, %r14
je 0x29d69
movq %r14, %rdi
callq 0x29356
movq %r14, %rdi
callq 0x7370
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x29d7f
callq 0x7480
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x29d8c
callq 0x7480
leaq 0x28(%rbx), %r14
movq 0x40(%rbx), %r15
leaq 0x30(%rbx), %r13
cmpq %r13, %r15
je 0x29dc1
movq 0x28(%r15), %rdi
callq 0x7370
movq %r15, %rdi
callq 0x72a0
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x30d8a
movq %r12, %r15
jmp 0x29d98
leaq 0x58(%rbx), %r15
movq 0x70(%rbx), %r12
leaq 0x60(%rbx), %rbp
cmpq %rbp, %r12
je 0x29df7
movq 0x28(%r12), %rdi
callq 0x7370
movq %r12, %rdi
callq 0x72a0
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x30d8a
movq %r13, %r12
jmp 0x29dcd
movq 0x210(%rbx), %rdi
testq %rdi, %rdi
je 0x29e08
callq 0x7480
movq 0x220(%rbx), %rdi
testq %rdi, %rdi
je 0x29e19
callq 0x7480
movq 0x230(%rbx), %rdi
testq %rdi, %rdi
je 0x29e2a
callq 0x7480
movq 0x240(%rbx), %rdi
testq %rdi, %rdi
je 0x29e3b
callq 0x7480
leaq 0x1d8(%rbx), %rdi
callq 0x304fe
leaq 0x1a8(%rbx), %rdi
callq 0x304fe
leaq 0x178(%rbx), %rdi
callq 0x30548
leaq 0x148(%rbx), %rdi
callq 0x30548
leaq 0x118(%rbx), %rdi
callq 0x304fe
leaq 0xe8(%rbx), %rdi
callq 0x16674
leaq 0xb8(%rbx), %rdi
callq 0x304fe
addq $0x88, %rbx
movq %rbx, %rdi
callq 0x30592
movq %r15, %rdi
callq 0x30548
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30548
jmp 0x29ebe
movq %rax, %rdi
callq 0xae63
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::Store_mapping_table_on_flash_at_start()
void Address_Mapping_Unit_Page_Level::Store_mapping_table_on_flash_at_start()
	{
		if (mapping_table_stored_on_flash) {
			return;
		}
		//Since address translation functions work on flash transactions
		NVM_Transaction_Flash_WR* dummy_tr = new NVM_Transaction_Flash_WR(Transaction_Source_Type::MAPPING, 0, 0,
			NO_LPA, 0, NULL, 0, NULL, 0, 0);

		for (unsigned int stream_id = 0; stream_id < no_of_input_streams; stream_id++) {
			dummy_tr->Stream_id = stream_id;
			for (MVPN_type translation_page_id = 0; translation_page_id < domains[stream_id]->Total_translation_pages_no; translation_page_id++) {
				dummy_tr->LPA = (LPA_type)translation_page_id;
				allocate_plane_for_translation_write(dummy_tr);
				allocate_page_in_plane_for_translation_write(dummy_tr, (MVPN_type)dummy_tr->LPA, false);
				flash_controller->Change_flash_page_status_for_preconditioning(dummy_tr->Address, dummy_tr->LPA);
			}
		}
		mapping_table_stored_on_flash = true;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpb $0x0, 0xa1(%rdi)
jne 0x2a82e
movq %rdi, %rbx
movl $0xb0, %edi
callq 0x73a0
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movups %xmm0, (%rsp)
movq $0x0, 0x20(%rsp)
movq %rax, %rdi
movl $0x3, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq $-0x1, %r8
xorl %r9d, %r9d
callq 0x481c8
movl 0x50(%rbx), %ecx
testl %ecx, %ecx
je 0x2a827
movq %r14, %r15
addq $0x38, %r15
movq 0xa8(%rbx), %rax
xorl %r12d, %r12d
movw %r12w, (%r14)
movq (%rax,%r12,8), %rdx
cmpl $0x0, 0x268(%rdx)
je 0x2a81d
xorl %r13d, %r13d
movq %r13, 0x58(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2b3c6
movl 0x58(%r14), %edx
movq %rbx, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x2a856
movq 0x38(%rbx), %rdi
movq 0x58(%r14), %rdx
movq (%rdi), %rax
movq %r15, %rsi
callq *0x60(%rax)
incq %r13
movq 0xa8(%rbx), %rax
movq (%rax,%r12,8), %rcx
movl 0x268(%rcx), %ecx
cmpq %rcx, %r13
jb 0x2a7d0
movl 0x50(%rbx), %ecx
incq %r12
movl %ecx, %edx
cmpq %rdx, %r12
jb 0x2a7bc
movb $0x1, 0xa1(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x7370
movq %rbx, %rdi
callq 0x7620
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::allocate_page_in_plane_for_translation_write(SSD_Components::NVM_Transaction_Flash*, unsigned int, bool)
void Address_Mapping_Unit_Page_Level::allocate_page_in_plane_for_translation_write(NVM_Transaction_Flash* transaction, MVPN_type mvpn, bool is_for_gc)
	{
		AddressMappingDomain* domain = domains[transaction->Stream_id];

		MPPN_type old_MPPN = domain->GlobalTranslationDirectory[mvpn].MPPN;
		/*this is the first access to the mvpn*/
		if (old_MPPN == NO_MPPN) {
			if (is_for_gc) {
				PRINT_ERROR("Unexpected mapping table status in allocate_page_in_plane_for_translation_write for a GC/WL write!")
			}
		} else {
			NVM::FlashMemory::Physical_Page_Address prevAddr;
			Convert_ppa_to_address(old_MPPN, prevAddr);
			block_manager->Invalidate_page_in_block(transaction->Stream_id, prevAddr);
		}

		block_manager->Allocate_block_and_page_in_plane_for_translation_write(transaction->Stream_id, transaction->Address, false);
		transaction->PPA = Convert_address_to_ppa(transaction->Address);
		domain->GlobalTranslationDirectory[mvpn].MPPN = (MPPN_type)transaction->PPA;
		domain->GlobalTranslationDirectory[mvpn].TimeStamp = CurrentTimeStamp;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0xa8(%rdi), %rsi
movzwl (%rbx), %eax
movq (%rsi,%rax,8), %r12
movq (%r12), %rsi
movl %edx, %r13d
shlq $0x4, %r13
movl (%rsi,%r13), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, %rsi
je 0x2a8c6
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rdx
callq *0x88(%rax)
movq 0x40(%r14), %rdi
movzwl (%rbx), %esi
movq (%rdi), %rax
movq %r15, %rdx
callq *0x30(%rax)
movzwl (%rbx), %eax
jmp 0x2a8ca
testb %cl, %cl
jne 0x2a920
movq 0x40(%r14), %rdi
leaq 0x38(%rbx), %r15
movq (%rdi), %r8
movzwl %ax, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq *0x20(%r8)
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x90(%rax)
movq %rax, 0x60(%rbx)
movq (%r12), %rcx
movl %eax, (%rcx,%r13)
callq 0x28018
movq %rax, %rdi
callq 0x2841a
movq (%r12), %rcx
movq %rax, 0x8(%rcx,%r13)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x446c9(%rip), %rbx     # 0x6eff0
leaq 0x2bc7a(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x2e21e(%rip), %rsi     # 0x58b5b
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x4467c(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::Bring_to_CMT_for_preconditioning(unsigned short, unsigned long)
int Address_Mapping_Unit_Page_Level::Bring_to_CMT_for_preconditioning(stream_id_type stream_id, LPA_type lpa)
	{
		if (domains[stream_id]->GlobalMappingTable[lpa].PPA == NO_PPA) {
			PRINT_ERROR("Touching an unallocated logical address in preconditioning!")
		}

		if (domains[stream_id]->CMT->Exists(stream_id, lpa)) {
			return domains[stream_id]->No_of_inserted_entries_in_preconditioning;
		}

		if (domains[stream_id]->CMT->Check_free_slot_availability()) {
			domains[stream_id]->CMT->Reserve_slot_for_lpn(stream_id, lpa);
			domains[stream_id]->CMT->Insert_new_mapping_info(stream_id, lpa,
				domains[stream_id]->GlobalMappingTable[lpa].PPA, domains[stream_id]->GlobalMappingTable[lpa].WrittenStateBitmap);
		} else {
			LPA_type evicted_lpa;
			domains[stream_id]->CMT->Evict_one_slot(evicted_lpa);
			domains[stream_id]->CMT->Reserve_slot_for_lpn(stream_id, lpa);
			domains[stream_id]->CMT->Insert_new_mapping_info(stream_id, lpa,
				domains[stream_id]->GlobalMappingTable[lpa].PPA, domains[stream_id]->GlobalMappingTable[lpa].WrittenStateBitmap);
		}
		domains[stream_id]->No_of_inserted_entries_in_preconditioning++;
		
		return domains[stream_id]->No_of_inserted_entries_in_preconditioning;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0xa8(%rdi), %rax
movl %esi, %r15d
movq (%rax,%r15,8), %rax
movq 0x20(%rax), %rcx
leaq (%rdx,%rdx,2), %r12
cmpq $-0x1, (%rcx,%r12,8)
je 0x2aa88
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq 0x10(%rax), %rdi
movq %r15, %rax
shlq $0x38, %rax
orq %rdx, %rax
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
callq 0x30a0c
testq %rax, %rax
je 0x2a9d8
movq 0x10(%rax), %rax
cmpl $0x2, 0x14(%rax)
jne 0x2a9d8
movq 0xa8(%rbx), %rax
movq (%rax,%r15,8), %rax
movl 0x18(%rax), %eax
jmp 0x2aa79
movq 0xa8(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x10(%rax), %rsi
movl 0x50(%rsi), %eax
cmpq %rax, 0x18(%rsi)
jae 0x2aa0d
movzwl %bp, %ebp
movq %rsi, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x2960c
movq 0xa8(%rbx), %rax
movq (%rax,%r15,8), %rax
jmp 0x2aa4b
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2972e
movq 0xa8(%rbx), %rax
leal (,%r15,8), %r13d
movq (%rax,%r13), %rax
movq 0x10(%rax), %rdi
movzwl %bp, %ebp
movl %ebp, %esi
movq %r14, %rdx
callq 0x2960c
movq 0xa8(%rbx), %rax
movq (%rax,%r13), %rax
movq 0x10(%rax), %rdi
movq 0x20(%rax), %rax
movq (%rax,%r12,8), %rcx
movq 0x8(%rax,%r12,8), %r8
movl %ebp, %esi
movq %r14, %rdx
callq 0x29548
movq 0xa8(%rbx), %rax
movq (%rax,%r15,8), %rcx
movl 0x18(%rcx), %eax
incl %eax
movl %eax, 0x18(%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x44561(%rip), %rbx     # 0x6eff0
leaq 0x2bb12(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x2dde9(%rip), %rsi     # 0x5888e
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x44514(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::Translate_lpa_to_ppa_and_dispatch(std::__cxx11::list<SSD_Components::NVM_Transaction*, std::allocator<SSD_Components::NVM_Transaction*>> const&)
void Address_Mapping_Unit_Page_Level::Translate_lpa_to_ppa_and_dispatch(const std::list<NVM_Transaction*>& transactionList)
	{
		for (std::list<NVM_Transaction*>::const_iterator it = transactionList.begin();
			it != transactionList.end(); ) {
			if (is_lpa_locked_for_gc((*it)->Stream_id, ((NVM_Transaction_Flash*)(*it))->LPA)) {
				//iterator should be post-incremented since the iterator may be deleted from list
				manage_user_transaction_facing_barrier((NVM_Transaction_Flash*)*(it++));
			} else {
				query_cmt((NVM_Transaction_Flash*)(*it++));
			}
		}

		if (transactionList.size() > 0) {
			ftl->TSU->Prepare_for_transaction_submit();
			for (std::list<NVM_Transaction*>::const_iterator it = transactionList.begin();
				it != transactionList.end(); it++) {
				if (((NVM_Transaction_Flash*)(*it))->Physical_address_determined) {
					ftl->TSU->Submit_transaction(static_cast<NVM_Transaction_Flash*>(*it));
					if (((NVM_Transaction_Flash*)(*it))->Type == Transaction_Type::WRITE) {
						if (((NVM_Transaction_Flash_WR*)(*it))->RelatedRead != NULL) {
							ftl->TSU->Submit_transaction(((NVM_Transaction_Flash_WR*)(*it))->RelatedRead);
						}
					}
				}
			}
			
			ftl->TSU->Schedule();
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %r15
cmpq %rsi, %r15
je 0x2ab3e
movq %r15, %r12
movq 0x10(%r15), %rax
movzwl (%rax), %esi
movq 0x58(%rax), %rdx
movq (%rbx), %rax
movq %rbx, %rdi
callq *0xe8(%rax)
movq (%r15), %r15
movq 0x10(%r12), %rsi
movq (%rbx), %rcx
movq %rbx, %rdi
testb %al, %al
je 0x2ab33
callq *0xd8(%rcx)
jmp 0x2ab39
callq *0xc8(%rcx)
cmpq %r14, %r15
jne 0x2aaff
cmpq $0x0, 0x10(%r14)
je 0x2ac02
movq 0x30(%rbx), %rax
movq 0x50(%rax), %rdi
callq 0x2f762
movq (%r14), %r12
cmpq %r14, %r12
je 0x2abe6
movq 0x10(%r12), %r13
cmpb $0x1, 0x69(%r13)
jne 0x2abdd
movq 0x30(%rbx), %rax
movq 0x50(%rax), %rbp
leaq 0x78(%rbp), %r15
movl $0x18, %edi
callq 0x73a0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x7060
incq 0x88(%rbp)
movq 0x10(%r12), %rax
cmpl $0x1, 0x8(%rax)
jne 0x2abdd
movq 0x88(%rax), %r13
testq %r13, %r13
je 0x2abdd
movq 0x30(%rbx), %rax
movq 0x50(%rax), %rbp
leaq 0x78(%rbp), %r15
movl $0x18, %edi
callq 0x73a0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x7060
incq 0x88(%rbp)
movq (%r12), %r12
jmp 0x2ab59
movq 0x30(%rbx), %rax
movq 0x50(%rax), %rdi
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x30(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::translate_lpa_to_ppa(unsigned short, SSD_Components::NVM_Transaction_Flash*)
bool Address_Mapping_Unit_Page_Level::translate_lpa_to_ppa(stream_id_type streamID, NVM_Transaction_Flash* transaction)
	{
		PPA_type ppa = domains[streamID]->Get_ppa(ideal_mapping_table, streamID, transaction->LPA);

		if (transaction->Type == Transaction_Type::READ) {
			if (ppa == NO_PPA) {
				ppa = online_create_entry_for_reads(transaction->LPA, streamID, transaction->Address, ((NVM_Transaction_Flash_RD*)transaction)->read_sectors_bitmap);
			}
			transaction->PPA = ppa;
			Convert_ppa_to_address(transaction->PPA, transaction->Address);
			block_manager->Read_transaction_issued(transaction->Address);
			transaction->Physical_address_determined = true;
			
			return true;
		} else {//This is a write transaction
			allocate_plane_for_user_write((NVM_Transaction_Flash_WR*)transaction);
			//there are too few free pages remaining only for GC
			if (ftl->GC_and_WL_Unit->Stop_servicing_writes(transaction->Address)){
				return false;
			}
			allocate_page_in_plane_for_user_write((NVM_Transaction_Flash_WR*)transaction, false);
			transaction->Physical_address_determined = true;
			
			return true;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0xa8(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rax
movq 0x58(%rdx), %rdx
cmpb $0x1, 0x4c(%rdi)
jne 0x2ae94
movq 0x20(%rax), %rax
leaq (%rdx,%rdx,2), %rcx
movq (%rax,%rcx,8), %rax
jmp 0x2aea0
movq 0x10(%rax), %rdi
movzwl %bp, %esi
callq 0x293bc
cmpl $0x0, 0x8(%rbx)
je 0x2aeca
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2b3c6
movq 0x30(%r14), %rax
movq 0x48(%rax), %rdi
leaq 0x38(%rbx), %rsi
callq 0x3f966
testb %al, %al
je 0x2af16
xorl %eax, %eax
jmp 0x2af29
cmpq $-0x1, %rax
jne 0x2aeee
leaq 0x38(%rbx), %rcx
movq 0x58(%rbx), %rsi
movq 0x90(%rbx), %r8
movq (%r14), %rax
movzwl %bp, %edx
movq %r14, %rdi
callq *0xd0(%rax)
movq %rax, 0x60(%rbx)
leaq 0x38(%rbx), %r15
movq (%r14), %rcx
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq *0x88(%rcx)
movq 0x40(%r14), %rdi
movq %r15, %rsi
callq 0x3d7d8
jmp 0x2af23
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2bf08
movb $0x1, 0x69(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::Start_servicing_writes_for_overfull_plane(NVM::FlashMemory::Physical_Page_Address)
void Address_Mapping_Unit_Page_Level::Start_servicing_writes_for_overfull_plane(const NVM::FlashMemory::Physical_Page_Address plane_address)
	{
		std::set<NVM_Transaction_Flash_WR*>& waiting_write_list = Write_transactions_for_overfull_planes[plane_address.ChannelID][plane_address.ChipID][plane_address.DieID][plane_address.PlaneID];

		ftl->TSU->Prepare_for_transaction_submit();
		auto program = waiting_write_list.begin();
		while (program != waiting_write_list.end()) {
			if (translate_lpa_to_ppa((*program)->Stream_id, *program)) {
				ftl->TSU->Submit_transaction(*program);
				if ((*program)->RelatedRead != NULL) {
					ftl->TSU->Submit_transaction((*program)->RelatedRead);
				}
				waiting_write_list.erase(program++);
			}
			else {
				break;
			}
		}
		ftl->TSU->Schedule();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0xb8(%rdi), %rcx
movl (%rsi), %edx
movl 0x4(%rsi), %edi
movq (%rcx,%rdx,8), %rcx
movq (%rcx,%rdi,8), %rcx
movl 0x8(%rsi), %edx
movq (%rcx,%rdx,8), %r14
movl 0xc(%rsi), %ecx
leaq (%rcx,%rcx,2), %r12
shlq $0x4, %r12
movq 0x50(%rax), %rdi
callq 0x2f762
movq %r14, (%rsp)
leaq (%r14,%r12), %r13
addq $0x8, %r13
movq 0x10(%r13), %r15
cmpq %r13, %r15
je 0x2f218
addq %r12, (%rsp)
movq 0x20(%r15), %rdx
movzwl (%rdx), %esi
movq %rbx, %rdi
callq 0x2ae60
testb %al, %al
je 0x2f218
movq 0x30(%rbx), %rax
movq 0x50(%rax), %rbp
movq 0x20(%r15), %r14
leaq 0x78(%rbp), %r12
movl $0x18, %edi
callq 0x73a0
movq %r14, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x7060
incq 0x88(%rbp)
movq 0x20(%r15), %rax
movq 0x88(%rax), %rbp
testq %rbp, %rbp
je 0x2f1f5
movq 0x30(%rbx), %rax
movq 0x50(%rax), %r14
leaq 0x78(%r14), %r12
movl $0x18, %edi
callq 0x73a0
movq %rbp, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x7060
incq 0x88(%r14)
movq %r15, %rdi
callq 0x7410
movq %rax, %r12
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x314ae
movq %r12, %r15
cmpq %r13, %r12
jne 0x2f172
movq 0x30(%rbx), %rax
movq 0x50(%rax), %rdi
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x30(%rax)
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/TSU_Base.h
// Function: SSD_Components::TSU_Base::Prepare_for_transaction_submit()
void Prepare_for_transaction_submit()
	{
		opened_scheduling_reqs++;
		if (opened_scheduling_reqs > 1)
		{
			return;
		}
		transaction_receive_slots.clear();
	}

// Assembly:
movl 0xa8(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa8(%rdi)
testl %eax, %eax
jle 0x2f776
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x78(%rdi), %r14
movq 0x78(%rdi), %rdi
cmpq %r14, %rdi
je 0x2f79b
movq (%rdi), %r15
callq 0x7370
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2f78b
movq %r14, 0x80(%rbx)
movq %r14, 0x78(%rbx)
movq $0x0, 0x88(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::Get_data_mapping_info_for_gc(unsigned short, unsigned long, unsigned long&, unsigned long&)
inline void Address_Mapping_Unit_Page_Level::Get_data_mapping_info_for_gc(const stream_id_type stream_id, const LPA_type lpa, PPA_type& ppa, page_status_type& page_state)
	{
		if (domains[stream_id]->Mapping_entry_accessible(ideal_mapping_table, stream_id, lpa)) {
			ppa = domains[stream_id]->Get_ppa(ideal_mapping_table, stream_id, lpa);
			page_state = domains[stream_id]->Get_page_status(ideal_mapping_table, stream_id, lpa);
		} else {
			ppa = domains[stream_id]->GlobalMappingTable[lpa].PPA;
			page_state = domains[stream_id]->GlobalMappingTable[lpa].WrittenStateBitmap;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r12
movl %esi, %r13d
movb 0x4c(%rdi), %cl
testb %cl, %cl
jne 0x2f83c
movq 0xa8(%r12), %rax
movq (%rax,%r13,8), %rax
movq 0x10(%rax), %rdi
movq %r13, %rax
shlq $0x38, %rax
orq %r14, %rax
movq %rsp, %rsi
movq %rax, (%rsi)
callq 0x30a0c
testq %rax, %rax
je 0x2f85e
movq 0x10(%rax), %rax
cmpl $0x2, 0x14(%rax)
jne 0x2f85e
movb 0x4c(%r12), %cl
movq 0xa8(%r12), %rax
movq (%rax,%r13,8), %rdx
movzwl %bp, %ebp
testb $0x1, %cl
je 0x2f87b
movq 0x20(%rdx), %rax
leaq (%r14,%r14,2), %rsi
movq (%rax,%rsi,8), %rax
jmp 0x2f89a
movq 0xa8(%r12), %rax
movq (%rax,%r13,8), %rax
movq 0x20(%rax), %rax
leaq (%r14,%r14,2), %rcx
movq (%rax,%rcx,8), %rdx
movq %rdx, (%r15)
jmp 0x2f8aa
movq 0x10(%rdx), %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x293bc
movq 0xa8(%r12), %rcx
movq (%rcx,%r13,8), %rdx
movb 0x4c(%r12), %cl
movq %rax, (%r15)
testb $0x1, %cl
je 0x2f8b1
movq 0x20(%rdx), %rax
leaq (%r14,%r14,2), %rcx
movq 0x8(%rax,%rcx,8), %rax
jmp 0x2f8bf
movq 0x10(%rdx), %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x2944e
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::Set_barrier_for_accessing_lpa(unsigned short, unsigned long)
inline void Address_Mapping_Unit_Page_Level::Set_barrier_for_accessing_lpa(stream_id_type stream_id, LPA_type lpa)
	{
		auto itr = domains[stream_id]->Locked_LPAs.find(lpa);
		if (itr != domains[stream_id]->Locked_LPAs.end()) {
			PRINT_ERROR("Illegal operation: Locking an LPA that has already been locked!");
		}
		domains[stream_id]->Locked_LPAs.insert(lpa);
	}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, 0x8(%rsp)
movq 0xa8(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rdi
movq 0xf8(%rdi), %rax
testq %rax, %rax
je 0x2fc1d
leaq 0xf0(%rdi), %rsi
movq %rsi, %rcx
xorl %r8d, %r8d
cmpq %rdx, 0x20(%rax)
setb %r8b
cmovaeq %rax, %rcx
movq 0x10(%rax,%r8,8), %rax
testq %rax, %rax
jne 0x2fbf9
cmpq %rsi, %rcx
je 0x2fc1d
cmpq %rdx, 0x20(%rcx)
jbe 0x2fc34
addq $0xe8, %rdi
leaq 0x8(%rsp), %rsi
callq 0x24406
addq $0x10, %rsp
popq %rbx
retq
movq 0x3f3b5(%rip), %rbx     # 0x6eff0
leaq 0x26966(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x29102(%rip), %rsi     # 0x58d53
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x3f368(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::Set_barrier_for_accessing_mvpn(unsigned short, unsigned int)
inline void Address_Mapping_Unit_Page_Level::Set_barrier_for_accessing_mvpn(stream_id_type stream_id, MVPN_type mvpn)
	{
		auto itr = domains[stream_id]->Locked_MVPNs.find(mvpn);
		if (itr != domains[stream_id]->Locked_MVPNs.end()) {
			PRINT_ERROR("Illegal operation: Locking an MVPN that has already been locked!");
		}
		domains[stream_id]->Locked_MVPNs.insert(mvpn);
	}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edx, 0xc(%rsp)
movq 0xa8(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x128(%rdi), %rax
testq %rax, %rax
je 0x2fcc6
leaq 0x120(%rdi), %rsi
movq %rsi, %rcx
xorl %r8d, %r8d
cmpl %edx, 0x20(%rax)
setb %r8b
cmovaeq %rax, %rcx
movq 0x10(%rax,%r8,8), %rax
testq %rax, %rax
jne 0x2fca4
cmpq %rsi, %rcx
je 0x2fcc6
cmpl %edx, 0x20(%rcx)
jbe 0x2fcdd
addq $0x118, %rdi            # imm = 0x118
leaq 0xc(%rsp), %rsi
callq 0x30732
addq $0x10, %rsp
popq %rbx
retq
movq 0x3f30c(%rip), %rbx     # 0x6eff0
leaq 0x268bd(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x29099(%rip), %rsi     # 0x58d93
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x3f2bf(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Flash.cpp
// Function: SSD_Components::Data_Cache_Flash::Get_slot(unsigned short, unsigned long)
Data_Cache_Slot_Type Data_Cache_Flash::Get_slot(const stream_id_type stream_id, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(stream_id, lpn);
		auto it = slots.find(key);
		assert(it != slots.end());
		if (lru_list.begin()->first != key) {
			lru_list.splice(lru_list.begin(), lru_list, it->second->lru_list_ptr);
		}

		return *(it->second);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
shlq $0x38, %rdx
orq %rcx, %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, (%rsi)
movq %r14, %rdi
callq 0x31bcc
testq %rax, %rax
je 0x31605
movq %rax, %r15
movq 0x38(%r14), %rsi
movq 0x10(%rsi), %rax
cmpq 0x8(%rsp), %rax
je 0x315de
addq $0x38, %r14
movq 0x10(%r15), %rax
movq 0x28(%rax), %rcx
movq %r14, %rdi
movq %r14, %rdx
callq 0x31c28
movq 0x10(%r15), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x27845(%rip), %rdi     # 0x58e51
leaq 0x27850(%rip), %rsi     # 0x58e63
leaq 0x27866(%rip), %rcx     # 0x58e80
movl $0x1e, %edx
callq 0x7270
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Flash.cpp
// Function: SSD_Components::Data_Cache_Flash::Evict_one_dirty_slot()
Data_Cache_Slot_Type Data_Cache_Flash::Evict_one_dirty_slot()
	{
		assert(slots.size() > 0);
		auto itr = lru_list.rbegin();
		while (itr != lru_list.rend()) {
			if ((*itr).second->Status == Cache_Slot_Status::DIRTY_NO_FLASH_WRITEBACK) {
				break;
			}
			itr++;
		}

		Data_Cache_Slot_Type evicted_item = *lru_list.back().second;
		if (itr == lru_list.rend()) {
			evicted_item.Status = Cache_Slot_Status::EMPTY;
			return evicted_item;
		}

		slots.erase(lru_list.back().first);
		delete lru_list.back().second;
		lru_list.pop_back();
		
		return evicted_item;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x18(%rsi)
je 0x3170e
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x38(%rsi), %rdx
movq 0x38(%rsi), %rax
cmpq %rax, %rdx
je 0x316e0
movq %rdx, %rcx
movq 0x8(%rdx), %rdx
movq 0x18(%rdx), %rsi
cmpl $0x2, 0x20(%rsi)
jne 0x31674
movq 0x40(%r14), %rsi
movq 0x18(%rsi), %rdx
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups 0x20(%rdx), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
cmpq %rax, %rcx
je 0x316fe
addq $0x10, %rsi
movq %r14, %rdi
callq 0x31c62
movq 0x40(%r14), %rax
movq 0x18(%rax), %rdi
callq 0x7370
movq 0x40(%r14), %r15
decq 0x48(%r14)
movq %r15, %rdi
callq 0x7580
movq %r15, %rdi
callq 0x7370
jmp 0x31705
movq 0x40(%r14), %rax
movq 0x18(%rax), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movl $0x0, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x277d1(%rip), %rdi     # 0x58ee6
leaq 0x27747(%rip), %rsi     # 0x58e63
leaq 0x277d4(%rip), %rcx     # 0x58ef7
movl $0x3c, %edx
callq 0x7270
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Flash.cpp
// Function: SSD_Components::Data_Cache_Flash::Evict_one_slot_lru()
Data_Cache_Slot_Type Data_Cache_Flash::Evict_one_slot_lru()
	{
		assert(slots.size() > 0);
		slots.erase(lru_list.back().first);
		Data_Cache_Slot_Type evicted_item = *lru_list.back().second;
		delete lru_list.back().second;
		lru_list.pop_back();

		return evicted_item;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x18(%rsi)
je 0x31794
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rsi), %rsi
addq $0x10, %rsi
movq %r14, %rdi
callq 0x31c62
movq 0x40(%r14), %rax
movq 0x18(%rax), %rdi
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups 0x20(%rdi), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
callq 0x7370
movq 0x40(%r14), %r15
decq 0x48(%r14)
movq %r15, %rdi
callq 0x7580
movq %r15, %rdi
callq 0x7370
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2774b(%rip), %rdi     # 0x58ee6
leaq 0x276c1(%rip), %rsi     # 0x58e63
leaq 0x2779c(%rip), %rcx     # 0x58f45
movl $0x54, %edx
callq 0x7270
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Flash.cpp
// Function: SSD_Components::Data_Cache_Flash::Change_slot_status_to_writeback(unsigned short, unsigned long)
void Data_Cache_Flash::Change_slot_status_to_writeback(const stream_id_type stream_id, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(stream_id, lpn);
		auto it = slots.find(key);
		assert(it != slots.end());
		it->second->Status = Cache_Slot_Status::DIRTY_FLASH_WRITEBACK;
	}

// Assembly:
pushq %rax
shlq $0x38, %rsi
orq %rdx, %rsi
movq %rsp, %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x31bcc
testq %rax, %rax
je 0x317dc
movq 0x10(%rax), %rax
movl $0x3, 0x20(%rax)
popq %rax
retq
leaq 0x2766e(%rip), %rdi     # 0x58e51
leaq 0x27679(%rip), %rsi     # 0x58e63
leaq 0x277a0(%rip), %rcx     # 0x58f91
movl $0x61, %edx
callq 0x7270
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Flash.cpp
// Function: SSD_Components::Data_Cache_Flash::Insert_read_data(unsigned short, unsigned long, unsigned long, unsigned long, unsigned long)
void Data_Cache_Flash::Insert_read_data(const stream_id_type stream_id, const LPA_type lpn, const data_cache_content_type content,
		const data_timestamp_type timestamp, const page_status_type state_bitmap_of_read_sectors)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(stream_id, lpn);
		
		if (slots.find(key) != slots.end()) {
			throw std::logic_error("Duplicate lpn insertion into data cache!");
		}
		if (slots.size() >= capacity_in_pages) {
			throw std::logic_error("Data cache overfull!");
		}

		Data_Cache_Slot_Type* cache_slot = new Data_Cache_Slot_Type();
		cache_slot->LPA = lpn;
		cache_slot->State_bitmap_of_existing_sectors = state_bitmap_of_read_sectors;
		cache_slot->Content = content;
		cache_slot->Timestamp = timestamp;
		cache_slot->Status = Cache_Slot_Status::CLEAN;
		lru_list.push_front(std::pair<LPA_type, Data_Cache_Slot_Type*>(key, cache_slot));
		cache_slot->lru_list_ptr = lru_list.begin();
		slots[key] = cache_slot;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
shlq $0x38, %rsi
orq %rdx, %rsi
movq %rsp, %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x31bcc
testq %rax, %rax
jne 0x318bb
movl 0x50(%rbx), %eax
cmpq %rax, 0x18(%rbx)
jae 0x318d9
movl $0x30, %edi
callq 0x73a0
movq %rax, %rbp
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rax)
movq %r13, 0x8(%rax)
movq %r15, (%rax)
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movl $0x1, 0x20(%rax)
movq %rsp, %r14
movq (%r14), %r12
movq 0x38(%rbx), %r15
movl $0x20, %edi
callq 0x73a0
movq %r12, 0x10(%rax)
movq %rbp, 0x18(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x7060
incq 0x48(%rbx)
movq 0x38(%rbx), %rax
movq %rax, 0x28(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31d4c
movq %rbp, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x2772f(%rip), %rsi     # 0x58ffe
movq %rax, %rdi
callq 0x7500
jmp 0x318f5
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x2773a(%rip), %rsi     # 0x59027
movq %rax, %rdi
callq 0x7500
movq 0x3d6c4(%rip), %rsi     # 0x6efc0
movq 0x3d67d(%rip), %rdx     # 0x6ef80
movq %rbx, %rdi
callq 0x75e0
jmp 0x3190d
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Flash.cpp
// Function: SSD_Components::Data_Cache_Flash::Insert_write_data(unsigned short, unsigned long, unsigned long, unsigned long, unsigned long)
void Data_Cache_Flash::Insert_write_data(const stream_id_type stream_id, const LPA_type lpn, const data_cache_content_type content,
		const data_timestamp_type timestamp, const page_status_type state_bitmap_of_write_sectors)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(stream_id, lpn);
		
		if (slots.find(key) != slots.end()) {
			throw std::logic_error("Duplicate lpn insertion into data cache!!");
		}
		
		if (slots.size() >= capacity_in_pages) {
			throw std::logic_error("Data cache overfull!");
		}

		Data_Cache_Slot_Type* cache_slot = new Data_Cache_Slot_Type();
		cache_slot->LPA = lpn;
		cache_slot->State_bitmap_of_existing_sectors = state_bitmap_of_write_sectors;
		cache_slot->Content = content;
		cache_slot->Timestamp = timestamp;
		cache_slot->Status = Cache_Slot_Status::DIRTY_NO_FLASH_WRITEBACK;
		lru_list.push_front(std::pair<LPA_type, Data_Cache_Slot_Type*>(key, cache_slot));
		cache_slot->lru_list_ptr = lru_list.begin();
		slots[key] = cache_slot;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
shlq $0x38, %rsi
orq %rdx, %rsi
movq %rsp, %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x31bcc
testq %rax, %rax
jne 0x319df
movl 0x50(%rbx), %eax
cmpq %rax, 0x18(%rbx)
jae 0x319fd
movl $0x30, %edi
callq 0x73a0
movq %rax, %rbp
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rax)
movq %r13, 0x8(%rax)
movq %r15, (%rax)
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movl $0x2, 0x20(%rax)
movq %rsp, %r14
movq (%r14), %r12
movq 0x38(%rbx), %r15
movl $0x20, %edi
callq 0x73a0
movq %r12, 0x10(%rax)
movq %rbp, 0x18(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x7060
incq 0x48(%rbx)
movq 0x38(%rbx), %rax
movq %rax, 0x28(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31d4c
movq %rbp, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x27649(%rip), %rsi     # 0x5903c
movq %rax, %rdi
callq 0x7500
jmp 0x31a19
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x27616(%rip), %rsi     # 0x59027
movq %rax, %rdi
callq 0x7500
movq 0x3d5a0(%rip), %rsi     # 0x6efc0
movq 0x3d559(%rip), %rdx     # 0x6ef80
movq %rbx, %rdi
callq 0x75e0
jmp 0x31a31
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Flash.cpp
// Function: SSD_Components::Data_Cache_Flash::Update_data(unsigned short, unsigned long, unsigned long, unsigned long, unsigned long)
void Data_Cache_Flash::Update_data(const stream_id_type stream_id, const LPA_type lpn, const data_cache_content_type content,
		const data_timestamp_type timestamp, const page_status_type state_bitmap_of_write_sectors)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(stream_id, lpn);
		auto it = slots.find(key);
		assert(it != slots.end());

		it->second->LPA = lpn;
		it->second->State_bitmap_of_existing_sectors = state_bitmap_of_write_sectors;
		it->second->Content = content;
		it->second->Timestamp = timestamp;
		it->second->Status = Cache_Slot_Status::DIRTY_NO_FLASH_WRITEBACK;
		if (lru_list.begin()->first != key) {
			lru_list.splice(lru_list.begin(), lru_list, it->second->lru_list_ptr);
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r9, %r15
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
shlq $0x38, %rsi
orq %rdx, %rsi
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x31bcc
testq %rax, %rax
je 0x31ac6
movq 0x10(%rax), %rax
movq %r13, 0x8(%rax)
movq %r15, (%rax)
movq %r12, 0x10(%rax)
movq %r14, 0x18(%rax)
movl $0x2, 0x20(%rax)
movq 0x38(%rbx), %rsi
movq 0x10(%rsi), %rcx
cmpq 0x8(%rsp), %rcx
je 0x31ab8
addq $0x38, %rbx
movq 0x28(%rax), %rcx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x31c28
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x27384(%rip), %rdi     # 0x58e51
leaq 0x2738f(%rip), %rsi     # 0x58e63
leaq 0x2758b(%rip), %rcx     # 0x59066
movl $0x99, %edx
callq 0x7270
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Flash.cpp
// Function: SSD_Components::Data_Cache_Flash::Remove_slot(unsigned short, unsigned long)
void Data_Cache_Flash::Remove_slot(const stream_id_type stream_id, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(stream_id, lpn);
		auto it = slots.find(key);
		assert(it != slots.end());
		lru_list.erase(it->second->lru_list_ptr);
		delete it->second;
		slots.erase(it);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
shlq $0x38, %rsi
orq %rdx, %rsi
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x31bcc
testq %rax, %rax
je 0x31b4b
movq %rax, %r14
movq 0x10(%rax), %rax
movq 0x28(%rax), %r15
decq 0x48(%rbx)
movq %r15, %rdi
callq 0x7580
movq %r15, %rdi
callq 0x7370
movq 0x10(%r14), %rdi
callq 0x7370
movq %rbx, %rdi
movq %r14, %rsi
callq 0x31fd2
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x272ff(%rip), %rdi     # 0x58e51
leaq 0x2730a(%rip), %rsi     # 0x58e63
leaq 0x275b1(%rip), %rcx     # 0x59111
movl $0xa9, %edx
callq 0x7270