LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Manager_Base.cpp
// Function: SSD_Components::Data_Cache_Manager_Base::Data_Cache_Manager_Base(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, SSD_Components::Host_Interface_Base*, SSD_Components::NVM_Firmware*, unsigned int, unsigned int, unsigned int, unsigned long, unsigned long, unsigned long, SSD_Components::Caching_Mode*, SSD_Components::Cache_Sharing_Mode, unsigned int)
Data_Cache_Manager_Base::Data_Cache_Manager_Base(const sim_object_id_type& id, Host_Interface_Base* host_interface, NVM_Firmware* nvm_firmware,
		unsigned int dram_row_size, unsigned int dram_data_rate, unsigned int dram_busrt_size, sim_time_type dram_tRCD, sim_time_type dram_tCL, sim_time_type dram_tRP,
		Caching_Mode* caching_mode_per_input_stream, Cache_Sharing_Mode sharing_mode, unsigned int stream_count)
		: MQSimEngine::Sim_Object(id), host_interface(host_interface), nvm_firmware(nvm_firmware),
		dram_row_size(dram_row_size), dram_data_rate(dram_data_rate), dram_busrt_size(dram_busrt_size), dram_tRCD(dram_tRCD), dram_tCL(dram_tCL), dram_tRP(dram_tRP),
		sharing_mode(sharing_mode), stream_count(stream_count)
	{
		_my_instance = this;
		dram_burst_transfer_time_ddr = (double) ONE_SECOND / (dram_data_rate * 1000 * 1000);
		this->caching_mode_per_input_stream = new Caching_Mode[stream_count];
		for (unsigned int i = 0; i < stream_count; i++) {
			this->caching_mode_per_input_stream[i] = caching_mode_per_input_stream[i];
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %ebp
movl %r8d, 0xc(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, %r13
movq %rdi, %rbx
movl 0xa0(%rsp), %r14d
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x98(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x88(%rsp), %r12
movups 0x78(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movl 0x70(%rsp), %r15d
callq 0x164ce
leaq 0x3c188(%rip), %rax     # 0x6e1e8
movq %rax, (%rbx)
movq %r13, 0x30(%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rbx)
movl 0xc(%rsp), %eax
movl %eax, 0x40(%rbx)
movl %ebp, 0x44(%rbx)
movl %r15d, 0x48(%rbx)
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x58(%rbx)
movq %r12, 0x68(%rbx)
movl 0x8(%rsp), %eax
movl %eax, 0x70(%rbx)
movl %r14d, 0x74(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movq %rbx, 0x3d56e(%rip)     # 0x6f620
imull $0xf4240, %ebp, %eax    # imm = 0xF4240
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x25860(%rip), %xmm1    # 0x57928
divsd %xmm0, %xmm1
movsd %xmm1, 0x50(%rbx)
movq %r14, %r15
shlq $0x2, %r15
movq %r15, %rdi
callq 0x7030
movq %rax, 0x3d541(%rip)     # 0x6f628
testl %r14d, %r14d
je 0x3210a
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7310
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x8(%rbx), %rdi
leaq 0x3b941(%rip), %rax     # 0x6da68
movq %rax, (%rbx)
addq $0x18, %rbx
cmpq %rbx, %rdi
je 0x32138
callq 0x7370
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Manager_Flash_Simple.cpp
// Function: SSD_Components::Data_Cache_Manager_Flash_Simple::~Data_Cache_Manager_Flash_Simple()
Data_Cache_Manager_Flash_Simple::~Data_Cache_Manager_Flash_Simple()
	{
		for (unsigned int i = 0; i < stream_count; i++) {
			while (dram_execution_queue[i].size()) {
				delete dram_execution_queue[i].front();
				dram_execution_queue[i].pop();
			}
			for (auto &req : waiting_user_requests_queue_for_dram_free_slot[i]) {
				delete req;
			}
		}

		delete data_cache;
		delete[] dram_execution_queue;
		delete[] waiting_user_requests_queue_for_dram_free_slot;
		delete[] bloom_filter;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x396ab(%rip), %rax     # 0x6e2b8
movq %rax, (%rdi)
cmpl $0x0, 0x74(%rdi)
je 0x34cfe
xorl %r15d, %r15d
leaq (%r15,%r15,4), %r14
shlq $0x4, %r14
movq 0xc8(%rbx), %rcx
movq 0x48(%rcx,%r14), %rax
movq %rax, %rdx
subq 0x28(%rcx,%r14), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rax
adcq $-0x1, %rdx
movq 0x30(%rcx,%r14), %rsi
subq 0x38(%rcx,%r14), %rsi
shlq $0x6, %rdx
sarq $0x3, %rsi
addq %rdx, %rsi
movq 0x10(%rcx,%r14), %rax
movq 0x20(%rcx,%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
addq %rsi, %rcx
je 0x34c89
movq (%rax), %rdi
callq 0x7370
movq 0xc8(%rbx), %rdi
addq %r14, %rdi
callq 0x3470a
jmp 0x34c25
movq 0xd0(%rbx), %rax
movq %r15, (%rsp)
leaq (%r15,%r15,2), %rcx
leaq (%rax,%rcx,8), %r12
movq (%r12), %r13
cmpq %r12, %r13
je 0x34ceb
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x34cdd
leaq 0x40(%r14), %rbp
movq 0x40(%r14), %rdi
cmpq %rbp, %rdi
je 0x34ccb
movq (%rdi), %r15
callq 0x7370
movq %r15, %rdi
cmpq %rbp, %r15
jne 0x34cbb
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x34cdd
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r13), %r13
jmp 0x34ca0
movq (%rsp), %r15
incq %r15
movl 0x74(%rbx), %eax
cmpq %rax, %r15
jb 0x34c1d
movq 0xc0(%rbx), %r14
testq %r14, %r14
je 0x34d12
movq %r14, %rdi
callq 0x31540
movq %r14, %rdi
callq 0x7370
movq 0xc8(%rbx), %r15
testq %r15, %r15
je 0x34d56
leaq -0x8(%r15), %r14
movq -0x8(%r15), %rax
testq %rax, %rax
je 0x34d4e
addq $-0x50, %r15
shlq $0x4, %rax
leaq (%rax,%rax,4), %r12
leaq (%r15,%r12), %rdi
callq 0x34558
addq $-0x50, %r12
jne 0x34d3f
movq %r14, %rdi
callq 0x7480
movq 0xd0(%rbx), %r15
testq %r15, %r15
je 0x34da2
leaq -0x8(%r15), %r14
movq -0x8(%r15), %rax
testq %rax, %rax
je 0x34d9a
leaq (%rax,%rax,2), %rax
leaq (%r15,%rax,8), %r12
movq -0x18(%r12), %rdi
addq $-0x18, %r12
cmpq %r12, %rdi
je 0x34d95
movq (%rdi), %r13
callq 0x7370
movq %r13, %rdi
cmpq %r12, %r13
jne 0x34d85
cmpq %r15, %r12
jne 0x34d77
movq %r14, %rdi
callq 0x7480
movq 0xe8(%rbx), %r15
testq %r15, %r15
je 0x34dde
leaq -0x8(%r15), %r14
movq -0x8(%r15), %rax
testq %rax, %rax
je 0x34dd6
addq $-0x30, %r15
shlq $0x4, %rax
leaq (%rax,%rax,2), %r12
leaq (%r15,%r12), %rdi
callq 0x16674
addq $-0x30, %r12
jne 0x34dc7
movq %r14, %rdi
callq 0x7480
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32140
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/FTL.cpp
// Function: SSD_Components::FTL::Validate_simulation_config()
void FTL::Validate_simulation_config()
	{
		NVM_Firmware::Validate_simulation_config();
		if (this->Data_cache_manager == NULL)
			throw std::logic_error("The cache manager is not set for FTL!");
		if (this->Address_Mapping_Unit == NULL)
			throw std::logic_error("The mapping module is not set for FTL!");
		if (this->BlockManager == NULL)
			throw std::logic_error("The block manager is not set for FTL!");
		if (this->GC_and_WL_Unit == NULL)
			throw std::logic_error("The garbage collector is not set for FTL!");
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x44d0a
cmpq $0x0, 0x30(%rbx)
je 0x3635c
cmpq $0x0, 0x38(%rbx)
je 0x3637a
cmpq $0x0, 0x40(%rbx)
je 0x36398
cmpq $0x0, 0x48(%rbx)
je 0x363b6
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x22fc0(%rip), %rsi     # 0x59330
movq %rax, %rdi
callq 0x7500
jmp 0x363d2
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x22fc8(%rip), %rsi     # 0x59356
movq %rax, %rdi
callq 0x7500
jmp 0x363d2
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x22fd1(%rip), %rsi     # 0x5937d
movq %rax, %rdi
callq 0x7500
jmp 0x363d2
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x22fd9(%rip), %rsi     # 0x593a3
movq %rax, %rdi
callq 0x7500
movq 0x38be7(%rip), %rsi     # 0x6efc0
movq 0x38ba0(%rip), %rdx     # 0x6ef80
movq %rbx, %rdi
callq 0x75e0
jmp 0x363ee
jmp 0x363ee
jmp 0x363ee
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/Flash_Block_Manager.cpp
// Function: SSD_Components::Flash_Block_Manager::Allocate_block_and_page_in_plane_for_user_write(unsigned short, NVM::FlashMemory::Physical_Page_Address&)
void Flash_Block_Manager::Allocate_block_and_page_in_plane_for_user_write(const stream_id_type stream_id, NVM::FlashMemory::Physical_Page_Address& page_address)
	{
		PlaneBookKeepingType *plane_record = &plane_manager[page_address.ChannelID][page_address.ChipID][page_address.DieID][page_address.PlaneID];
		plane_record->Valid_pages_count++;
		plane_record->Free_pages_count--;		
		page_address.BlockID = plane_record->Data_wf[stream_id]->BlockID;
		page_address.PageID = plane_record->Data_wf[stream_id]->Current_page_write_index++;
		program_transaction_issued(page_address);

		//The current write frontier block is written to the end
		if(plane_record->Data_wf[stream_id]->Current_page_write_index == pages_no_per_block) {
			//Assign a new write frontier block
			plane_record->Data_wf[stream_id] = plane_record->Get_a_free_block(stream_id, false);
			gc_and_wl_unit->Check_gc_required(plane_record->Get_free_block_pool_size(), page_address);
		}

		plane_record->Check_bookkeeping_correctness(page_address);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r15
movq 0x8(%rdi), %rax
movl (%rdx), %ecx
movl 0x4(%rdx), %edx
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rax
movl 0x8(%rbx), %ecx
movq (%rax,%rcx,8), %r13
movl 0xc(%rbx), %eax
imulq $0xe0, %rax, %rbp
movq %r13, %r14
addq %rbp, %r14
movq 0x4(%r13,%rbp), %xmm0
paddd 0x1d538(%rip), %xmm0    # 0x59960
movq %xmm0, 0x4(%r13,%rbp)
movq 0x48(%r13,%rbp), %rax
movq %rsi, (%rsp)
leal (,%rsi,8), %r12d
movq (%rax,%r12), %rax
movl (%rax), %ecx
movl %ecx, 0x10(%rbx)
movl 0x4(%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rax)
movl %ecx, 0x14(%rbx)
movq %rbx, %rsi
callq 0x3d7a4
movq 0x48(%r13,%rbp), %rax
movq (%rax,%r12), %rax
movl 0x4(%rax), %eax
cmpl 0x34(%r15), %eax
jne 0x3c4a5
movq (%rsp), %rax
movl %eax, %r12d
movzwl %ax, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3d1a2
movq 0x48(%r14), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x10(%r15), %r15
movq %r14, %rdi
callq 0x3d5f2
movq (%r15), %rcx
movq %r15, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq *0x28(%rcx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d4da
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager.cpp
// Function: SSD_Components::Flash_Block_Manager::Allocate_block_and_page_in_plane_for_gc_write(unsigned short, NVM::FlashMemory::Physical_Page_Address&)
void Flash_Block_Manager::Allocate_block_and_page_in_plane_for_gc_write(const stream_id_type stream_id, NVM::FlashMemory::Physical_Page_Address& page_address)
	{
		PlaneBookKeepingType *plane_record = &plane_manager[page_address.ChannelID][page_address.ChipID][page_address.DieID][page_address.PlaneID];
		plane_record->Valid_pages_count++;
		plane_record->Free_pages_count--;		
		page_address.BlockID = plane_record->GC_wf[stream_id]->BlockID;
		page_address.PageID = plane_record->GC_wf[stream_id]->Current_page_write_index++;

		
		//The current write frontier block is written to the end
		if (plane_record->GC_wf[stream_id]->Current_page_write_index == pages_no_per_block) {
			//Assign a new write frontier block
			plane_record->GC_wf[stream_id] = plane_record->Get_a_free_block(stream_id, false);
			gc_and_wl_unit->Check_gc_required(plane_record->Get_free_block_pool_size(), page_address);
		}
		plane_record->Check_bookkeeping_correctness(page_address);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x8(%rdi), %rax
movl (%rdx), %ecx
movl 0x4(%rdx), %edx
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rax
movl 0x8(%rbx), %ecx
movq (%rax,%rcx,8), %rax
movl 0xc(%rbx), %ecx
imulq $0xe0, %rcx, %rcx
leaq (%rax,%rcx), %r14
movq 0x4(%rax,%rcx), %xmm0
paddd 0x1d463(%rip), %xmm0    # 0x59960
movq %xmm0, 0x4(%rax,%rcx)
movq 0x50(%rax,%rcx), %rax
movl %esi, %r12d
movq (%rax,%r12,8), %rax
movl (%rax), %ecx
movl %ecx, 0x10(%rbx)
movl 0x4(%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rax)
movl %ecx, 0x14(%rbx)
cmpl 0x34(%rdi), %edx
jne 0x3c557
movq %rdi, %r15
movzwl %si, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3d1a2
movq 0x50(%r14), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x10(%r15), %r15
movq %r14, %rdi
callq 0x3d5f2
movq (%r15), %rcx
movq %r15, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq *0x28(%rcx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3d4da
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager.cpp
// Function: SSD_Components::Flash_Block_Manager::Allocate_block_and_page_in_plane_for_translation_write(unsigned short, NVM::FlashMemory::Physical_Page_Address&, bool)
void Flash_Block_Manager::Allocate_block_and_page_in_plane_for_translation_write(const stream_id_type streamID, NVM::FlashMemory::Physical_Page_Address& page_address, bool is_for_gc)
	{
		PlaneBookKeepingType *plane_record = &plane_manager[page_address.ChannelID][page_address.ChipID][page_address.DieID][page_address.PlaneID];
		plane_record->Valid_pages_count++;
		plane_record->Free_pages_count--;
		page_address.BlockID = plane_record->Translation_wf[streamID]->BlockID;
		page_address.PageID = plane_record->Translation_wf[streamID]->Current_page_write_index++;
		program_transaction_issued(page_address);

		//The current write frontier block for translation pages is written to the end
		if (plane_record->Translation_wf[streamID]->Current_page_write_index == pages_no_per_block) {
			//Assign a new write frontier block
			plane_record->Translation_wf[streamID] = plane_record->Get_a_free_block(streamID, true);
			if (!is_for_gc) {
				gc_and_wl_unit->Check_gc_required(plane_record->Get_free_block_pool_size(), page_address);
			}
		}
		plane_record->Check_bookkeeping_correctness(page_address);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0xc(%rsp)
movq %rdx, %rbx
movq %rdi, %r15
movq 0x8(%rdi), %rax
movl (%rdx), %ecx
movl 0x4(%rdx), %edx
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rax
movl 0x8(%rbx), %ecx
movq (%rax,%rcx,8), %r13
movl 0xc(%rbx), %eax
imulq $0xe0, %rax, %rbp
movq %r13, %r12
addq %rbp, %r12
movq 0x4(%r13,%rbp), %xmm0
paddd 0x1d1ad(%rip), %xmm0    # 0x59960
movq %xmm0, 0x4(%r13,%rbp)
movq 0x58(%r13,%rbp), %rax
movq %rsi, 0x10(%rsp)
leal (,%rsi,8), %r14d
movq (%rax,%r14), %rax
movl (%rax), %ecx
movl %ecx, 0x10(%rbx)
movl 0x4(%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rax)
movl %ecx, 0x14(%rbx)
movq %rbx, %rsi
callq 0x3d7a4
movq 0x58(%r13,%rbp), %rax
movq (%rax,%r14), %rax
movl 0x4(%rax), %eax
cmpl 0x34(%r15), %eax
jne 0x3c83d
movq 0x10(%rsp), %rax
movl %eax, %r14d
movzwl %ax, %esi
movq %r12, %rdi
movl $0x1, %edx
callq 0x3d1a2
movq 0x58(%r12), %rcx
movq %rax, (%rcx,%r14,8)
cmpb $0x0, 0xc(%rsp)
jne 0x3c83d
movq 0x10(%r15), %r15
movq %r12, %rdi
callq 0x3d5f2
movq (%r15), %rcx
movq %r15, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq *0x28(%rcx)
movq %r12, %rdi
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d4da
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager.cpp
// Function: SSD_Components::Flash_Block_Manager::Add_erased_block_to_pool(NVM::FlashMemory::Physical_Page_Address const&)
void Flash_Block_Manager::Add_erased_block_to_pool(const NVM::FlashMemory::Physical_Page_Address& block_address)
	{
		PlaneBookKeepingType *plane_record = &plane_manager[block_address.ChannelID][block_address.ChipID][block_address.DieID][block_address.PlaneID];
		Block_Pool_Slot_Type* block = &(plane_record->Blocks[block_address.BlockID]);
		plane_record->Free_pages_count += block->Invalid_page_count;
		plane_record->Invalid_pages_count -= block->Invalid_page_count;

		Stats::Block_erase_histogram[block_address.ChannelID][block_address.ChipID][block_address.DieID][block_address.PlaneID][block->Erase_count]--;
		block->Erase();
		Stats::Block_erase_histogram[block_address.ChannelID][block_address.ChipID][block_address.DieID][block_address.PlaneID][block->Erase_count]++;
		plane_record->Add_to_free_block_pool(block, gc_and_wl_unit->Use_dynamic_wearleveling());
		plane_record->Check_bookkeeping_correctness(block_address);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, (%rsp)
movq 0x8(%rdi), %rax
movl (%rsi), %ecx
movl 0x4(%rsi), %edx
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rax
movl 0x8(%rsi), %esi
movq (%rax,%rsi,8), %rax
movl 0xc(%rbx), %edi
imulq $0xe0, %rdi, %r8
movq 0x10(%rax,%r8), %r13
movl 0x10(%rbx), %ebp
shlq $0x6, %rbp
movl 0xc(%r13,%rbp), %r9d
addl %r9d, 0x4(%rax,%r8)
subl %r9d, 0xc(%rax,%r8)
leaq (%rax,%r8), %r15
movq %r13, %r12
addq %rbp, %r12
leaq 0x33e7a(%rip), %r14     # 0x70730
movq (%r14), %rax
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rax
movq (%rax,%rsi,8), %rax
movq (%rax,%rdi,8), %rax
movl 0x10(%r13,%rbp), %ecx
decl (%rax,%rcx,4)
movq %r12, %rdi
callq 0x3d49c
movq (%r14), %rax
movl (%rbx), %ecx
movl 0x4(%rbx), %edx
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rax
movl 0x8(%rbx), %ecx
movq (%rax,%rcx,8), %rax
movl 0xc(%rbx), %ecx
movq (%rax,%rcx,8), %rax
movl 0x10(%r13,%rbp), %ecx
incl (%rax,%rcx,4)
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x3f9a8
movzbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3d16e
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d4da
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager.cpp
// Function: SSD_Components::Flash_Block_Manager::Invalidate_page_in_block(unsigned short, NVM::FlashMemory::Physical_Page_Address const&)
inline void Flash_Block_Manager::Invalidate_page_in_block(const stream_id_type stream_id, const NVM::FlashMemory::Physical_Page_Address& page_address)
	{
		PlaneBookKeepingType* plane_record = &plane_manager[page_address.ChannelID][page_address.ChipID][page_address.DieID][page_address.PlaneID];
		plane_record->Invalid_pages_count++;
		plane_record->Valid_pages_count--;
		if (plane_record->Blocks[page_address.BlockID].Stream_id != stream_id) {
			PRINT_ERROR("Inconsistent status in the Invalidate_page_in_block function! The accessed block is not allocated to stream " << stream_id)
		}
		plane_record->Blocks[page_address.BlockID].Invalid_page_count++;
		plane_record->Blocks[page_address.BlockID].Invalid_page_bitmap[page_address.PageID / 64] |= ((uint64_t)0x1) << (page_address.PageID % 64);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0x8(%rdi), %rax
movl (%rdx), %ecx
movl 0x4(%rdx), %esi
movq (%rax,%rcx,8), %rax
movq (%rax,%rsi,8), %rax
movl 0x8(%rdx), %ecx
movq (%rax,%rcx,8), %rax
movl 0xc(%rdx), %ecx
imulq $0xe0, %rcx, %rcx
movq 0x8(%rax,%rcx), %xmm0
paddd 0x1cff6(%rip), %xmm0    # 0x59960
movq %xmm0, 0x8(%rax,%rcx)
movq 0x10(%rax,%rcx), %rax
movl 0x10(%rdx), %esi
shlq $0x6, %rsi
cmpw %bx, 0x20(%rax,%rsi)
jne 0x3c9a9
leaq (%rax,%rsi), %rcx
incl 0xc(%rcx)
movl 0x14(%rdx), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq 0x18(%rax,%rsi), %rax
shrl $0x6, %ecx
orq %rdx, (%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x32640(%rip), %r14     # 0x6eff0
leaq 0x19bf1(%rip), %rsi     # 0x565a8
movq %r14, %rdi
callq 0x7390
leaq 0x1d0a6(%rip), %rsi     # 0x59a6c
movq %r14, %rdi
callq 0x7390
movzwl %bx, %esi
movq %rax, %rdi
callq 0x75b0
movq %rax, %rdi
callq 0x71c0
movq 0x325e8(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager.cpp
// Function: SSD_Components::Flash_Block_Manager::Invalidate_page_in_block_for_preconditioning(unsigned short, NVM::FlashMemory::Physical_Page_Address const&)
inline void Flash_Block_Manager::Invalidate_page_in_block_for_preconditioning(const stream_id_type stream_id, const NVM::FlashMemory::Physical_Page_Address& page_address)
	{
		PlaneBookKeepingType* plane_record = &plane_manager[page_address.ChannelID][page_address.ChipID][page_address.DieID][page_address.PlaneID];
		plane_record->Invalid_pages_count++;
		if (plane_record->Blocks[page_address.BlockID].Stream_id != stream_id) {
			PRINT_ERROR("Inconsistent status in the Invalidate_page_in_block function! The accessed block is not allocated to stream " << stream_id)
		}
		plane_record->Blocks[page_address.BlockID].Invalid_page_count++;
		plane_record->Blocks[page_address.BlockID].Invalid_page_bitmap[page_address.PageID / 64] |= ((uint64_t)0x1) << (page_address.PageID % 64);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0x8(%rdi), %rax
movl (%rdx), %ecx
movl 0x4(%rdx), %esi
movq (%rax,%rcx,8), %rax
movq (%rax,%rsi,8), %rax
movl 0x8(%rdx), %ecx
movq (%rax,%rcx,8), %rax
movl 0xc(%rdx), %ecx
imulq $0xe0, %rcx, %rcx
incl 0xc(%rax,%rcx)
movq 0x10(%rax,%rcx), %rax
movl 0x10(%rdx), %esi
shlq $0x6, %rsi
cmpw %bx, 0x20(%rax,%rsi)
jne 0x3ca5d
leaq (%rax,%rsi), %rcx
incl 0xc(%rcx)
movl 0x14(%rdx), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq 0x18(%rax,%rsi), %rax
shrl $0x6, %ecx
orq %rdx, (%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x3258c(%rip), %r14     # 0x6eff0
leaq 0x19b3d(%rip), %rsi     # 0x565a8
movq %r14, %rdi
callq 0x7390
leaq 0x1cff2(%rip), %rsi     # 0x59a6c
movq %r14, %rdi
callq 0x7390
movzwl %bx, %esi
movq %rax, %rdi
callq 0x75b0
movq %rax, %rdi
callq 0x71c0
movq 0x32534(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager_Base.cpp
// Function: SSD_Components::PlaneBookKeepingType::Add_to_free_block_pool(SSD_Components::Block_Pool_Slot_Type*, bool)
void PlaneBookKeepingType::Add_to_free_block_pool(Block_Pool_Slot_Type* block, bool consider_dynamic_wl)
	{
		if (consider_dynamic_wl) {
			std::pair<unsigned int, Block_Pool_Slot_Type*> entry(block->Erase_count, block);
			Free_block_pool.insert(entry);
		} else {
			std::pair<unsigned int, Block_Pool_Slot_Type*> entry(0, block);
			Free_block_pool.insert(entry);
		}
	}

// Assembly:
subq $0x18, %rsp
testl %edx, %edx
je 0x3d182
movl 0x10(%rsi), %ecx
leaq 0x8(%rsp), %rax
movl %ecx, (%rax)
jmp 0x3d18d
leaq 0x8(%rsp), %rax
movl $0x0, (%rax)
movq %rsi, 0x8(%rax)
addq $0x18, %rdi
movq %rax, %rsi
callq 0x3dd22
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager_Base.cpp
// Function: SSD_Components::PlaneBookKeepingType::Get_a_free_block(unsigned short, bool)
Block_Pool_Slot_Type* PlaneBookKeepingType::Get_a_free_block(stream_id_type stream_id, bool for_mapping_data)
	{
		Block_Pool_Slot_Type* new_block = NULL;
		new_block = (*Free_block_pool.begin()).second;//Assign a new write frontier block
		if (Free_block_pool.size() == 0) {
			PRINT_ERROR("Requesting a free block from an empty pool!")
		}
		Free_block_pool.erase(Free_block_pool.begin());
		new_block->Stream_id = stream_id;
		new_block->Holds_mapping_data = for_mapping_data;
		Block_usage_history.push(new_block->BlockID);

		return new_block;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x40(%rdi)
je 0x3d218
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
movq 0x30(%rdi), %rsi
movq 0x28(%rsi), %r14
addq $0x18, %rdi
callq 0x3daf2
movw %r15w, 0x20(%r14)
movb %bpl, 0x22(%r14)
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3d1fb
movl (%r14), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x90(%rbx)
jmp 0x3d20a
addq $0x60, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3db2a
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x31dd1(%rip), %rbx     # 0x6eff0
leaq 0x19382(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x1c8cc(%rip), %rsi     # 0x59b01
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x31d84(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager_Base.cpp
// Function: SSD_Components::Block_Pool_Slot_Type::Erase()
void Block_Pool_Slot_Type::Erase()
	{
		Current_page_write_index = 0;
		Invalid_page_count = 0;
		Erase_count++;
		for (unsigned int i = 0; i < Block_Pool_Slot_Type::Page_vector_size; i++) {
			Invalid_page_bitmap[i] = All_VALID_PAGE;
		}
		Stream_id = NO_STREAM;
		Holds_mapping_data = false;
		Erase_transaction = NULL;
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movl %eax, 0x4(%rdi)
movl %eax, 0xc(%rdi)
incl 0x10(%rdi)
movl 0x32187(%rip), %edx     # 0x6f638
testq %rdx, %rdx
je 0x3d4c5
movq 0x18(%rbx), %rdi
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x7230
movw $0xff, 0x20(%rbx)
movb $0x0, 0x22(%rbx)
movq $0x0, 0x28(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager_Base.cpp
// Function: SSD_Components::PlaneBookKeepingType::Check_bookkeeping_correctness(NVM::FlashMemory::Physical_Page_Address const&)
void PlaneBookKeepingType::Check_bookkeeping_correctness(const NVM::FlashMemory::Physical_Page_Address& plane_address)
	{
		if (Total_pages_count != Free_pages_count + Valid_pages_count + Invalid_pages_count) {
			PRINT_ERROR("Inconsistent status in the plane bookkeeping record!")
		}
		if (Free_pages_count == 0) {
			PRINT_ERROR("Plane " << "@" << plane_address.ChannelID << "@" << plane_address.ChipID << "@" << plane_address.DieID << "@" << plane_address.PlaneID << " pool size: " << Get_free_block_pool_size() << " ran out of free pages! Bad resource management! It is not safe to continue simulation!");
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %ecx
addl %eax, %ecx
addl 0xc(%rdi), %ecx
cmpl %ecx, (%rdi)
jne 0x3d4f8
testl %eax, %eax
je 0x3d51d
popq %rbx
popq %r14
popq %r15
retq
movq 0x31af1(%rip), %rbx     # 0x6eff0
leaq 0x190a2(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x1c618(%rip), %rsi     # 0x59b2d
movq %rbx, %rdi
jmp 0x3d5ce
movq %rsi, %r14
movq %rdi, %rbx
movq 0x31ac6(%rip), %r15     # 0x6eff0
leaq 0x19077(%rip), %rsi     # 0x565a8
movq %r15, %rdi
callq 0x7390
leaq 0x1c622(%rip), %rsi     # 0x59b62
movq %r15, %rdi
callq 0x7390
leaq 0x1d108(%rip), %r15     # 0x5a657
movq %rax, %rdi
movq %r15, %rsi
callq 0x7390
movl (%r14), %esi
movq %rax, %rdi
callq 0x74c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x7390
movl 0x4(%r14), %esi
movq %rax, %rdi
callq 0x74c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x7390
movl 0x8(%r14), %esi
movq %rax, %rdi
callq 0x74c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x7390
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0x74c0
leaq 0x1c5b8(%rip), %rsi     # 0x59b69
movq %rax, %rdi
callq 0x7390
movl 0x40(%rbx), %esi
movq %rax, %rdi
callq 0x74c0
leaq 0x1c5ab(%rip), %rsi     # 0x59b76
movq %rax, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x319ee(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// 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::Get_min_max_erase_difference(NVM::FlashMemory::Physical_Page_Address const&)
unsigned int Flash_Block_Manager_Base::Get_min_max_erase_difference(const NVM::FlashMemory::Physical_Page_Address& plane_address)
	{
		unsigned int min_erased_block = 0;
		unsigned int max_erased_block = 0;
		PlaneBookKeepingType *plane_record = &plane_manager[plane_address.ChannelID][plane_address.ChipID][plane_address.DieID][plane_address.PlaneID];

		for (unsigned int i = 1; i < block_no_per_plane; i++) {
			if (plane_record->Blocks[i].Erase_count > plane_record->Blocks[max_erased_block].Erase_count) {
				max_erased_block = i;
			}
			if (plane_record->Blocks[i].Erase_count < plane_record->Blocks[min_erased_block].Erase_count) {
				min_erased_block = i;
			}
		}

		return max_erased_block - min_erased_block;
	}

// Assembly:
movl 0x30(%rdi), %ecx
xorl %eax, %eax
cmpq $0x2, %rcx
jb 0x3d677
movl 0xc(%rsi), %eax
movq 0x8(%rdi), %rdx
movl (%rsi), %edi
movl 0x4(%rsi), %r8d
movq (%rdx,%rdi,8), %rdx
movq (%rdx,%r8,8), %rdx
movl 0x8(%rsi), %esi
movq (%rdx,%rsi,8), %rdx
imulq $0xe0, %rax, %rax
movq 0x10(%rdx,%rax), %rdx
leaq 0x50(%rdx), %rsi
xorl %r8d, %r8d
movl $0x1, %edi
xorl %r9d, %r9d
movl (%rsi), %r10d
movl %r9d, %r11d
shlq $0x6, %r11
movl %edi, %eax
cmpl 0x10(%rdx,%r11), %r10d
ja 0x3d64e
movl %r9d, %eax
movl %r8d, %r9d
shlq $0x6, %r9
movl %edi, %r11d
cmpl 0x10(%rdx,%r9), %r10d
jb 0x3d662
movl %r8d, %r11d
incq %rdi
addq $0x40, %rsi
movl %r11d, %r8d
movl %eax, %r9d
cmpq %rdi, %rcx
jne 0x3d638
subl %r11d, %eax
retq
// 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::Get_coldest_block_id(NVM::FlashMemory::Physical_Page_Address const&)
flash_block_ID_type Flash_Block_Manager_Base::Get_coldest_block_id(const NVM::FlashMemory::Physical_Page_Address& plane_address)
	{
		unsigned int min_erased_block = 0;
		PlaneBookKeepingType *plane_record = &plane_manager[plane_address.ChannelID][plane_address.ChipID][plane_address.DieID][plane_address.PlaneID];

		for (unsigned int i = 1; i < block_no_per_plane; i++) {
			if (plane_record->Blocks[i].Erase_count < plane_record->Blocks[min_erased_block].Erase_count) {
				min_erased_block = i;
			}
		}
		
		return min_erased_block;
	}

// Assembly:
movl 0x30(%rdi), %ecx
xorl %eax, %eax
cmpq $0x2, %rcx
jb 0x3d6dc
movl 0xc(%rsi), %eax
movq 0x8(%rdi), %rdx
movl (%rsi), %edi
movl 0x4(%rsi), %r8d
movq (%rdx,%rdi,8), %rdx
movq (%rdx,%r8,8), %rdx
movl 0x8(%rsi), %esi
movq (%rdx,%rsi,8), %rdx
imulq $0xe0, %rax, %rax
movq 0x10(%rdx,%rax), %rdx
leaq 0x50(%rdx), %rsi
xorl %r8d, %r8d
movl $0x1, %edi
movl (%rsi), %r9d
movl %r8d, %r10d
shlq $0x6, %r10
movl %edi, %eax
cmpl 0x10(%rdx,%r10), %r9d
jb 0x3d6cd
movl %r8d, %eax
incq %rdi
addq $0x40, %rsi
movl %eax, %r8d
cmpq %rdi, %rcx
jne 0x3d6b7
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/GC_and_WL_Unit_Base.cpp
// Function: SSD_Components::GC_and_WL_Unit_Base::Get_GC_policy_specific_parameter()
unsigned int GC_and_WL_Unit_Base::Get_GC_policy_specific_parameter()
	{
		switch (block_selection_policy) {
			case GC_Block_Selection_Policy_Type::RGA:
				return rga_set_size;
			case GC_Block_Selection_Policy_Type::RANDOM_PP:
				return random_pp_threshold;
		}

		return 0;
	}

// Assembly:
movl 0x2c(%rdi), %ecx
cmpl $0x4, %ecx
je 0x3f99c
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x3f9a2
movl 0x80(%rdi), %eax
retq
movl 0xf0(%rdi), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/GC_and_WL_Unit_Base.cpp
// Function: SSD_Components::GC_and_WL_Unit_Base::is_safe_gc_wl_candidate(SSD_Components::PlaneBookKeepingType const*, unsigned int)
bool GC_and_WL_Unit_Base::is_safe_gc_wl_candidate(const PlaneBookKeepingType* plane_record, const flash_block_ID_type gc_wl_candidate_block_id)
	{
		//The block shouldn't be a current write frontier
		for (unsigned int stream_id = 0; stream_id < address_mapping_unit->Get_no_of_input_streams(); stream_id++) {
			if ((&plane_record->Blocks[gc_wl_candidate_block_id]) == plane_record->Data_wf[stream_id]
				|| (&plane_record->Blocks[gc_wl_candidate_block_id]) == plane_record->Translation_wf[stream_id]
				|| (&plane_record->Blocks[gc_wl_candidate_block_id]) == plane_record->GC_wf[stream_id]) {
				return false;
			}
		}

		//The block shouldn't have an ongoing program request (all pages must already be written)
		if (plane_record->Blocks[gc_wl_candidate_block_id].Ongoing_user_program_count > 0) {
			return false;
		}

		if (plane_record->Blocks[gc_wl_candidate_block_id].Has_ongoing_gc_wl) {
			return false;
		}

		return true;
	}

// Assembly:
movq 0x30(%rdi), %rax
movl 0x50(%rax), %edi
movq 0x10(%rsi), %rax
movl %edx, %ecx
testq %rdi, %rdi
je 0x3f9f1
movq %rcx, %rdx
shlq $0x6, %rdx
addq %rax, %rdx
movq 0x48(%rsi), %r8
xorl %r9d, %r9d
cmpq (%r8,%r9,8), %rdx
je 0x3f9fc
movq 0x58(%rsi), %r10
cmpq (%r10,%r9,8), %rdx
je 0x3f9fc
movq 0x50(%rsi), %r10
cmpq (%r10,%r9,8), %rdx
je 0x3f9fc
incq %r9
cmpq %r9, %rdi
jne 0x3f9cf
shlq $0x6, %rcx
cmpl $0x0, 0x38(%rax,%rcx)
jle 0x3f9ff
xorl %eax, %eax
retq
addq %rcx, %rax
movb 0x23(%rax), %al
xorb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/GC_and_WL_Unit_Page_Level.cpp
// Function: SSD_Components::GC_and_WL_Unit_Page_Level::GC_is_in_urgent_mode(NVM::FlashMemory::Flash_Chip const*)
bool GC_and_WL_Unit_Page_Level::GC_is_in_urgent_mode(const NVM::FlashMemory::Flash_Chip* chip)
	{
		if (!preemptible_gc_enabled) {
			return true;
		}

		NVM::FlashMemory::Physical_Page_Address addr;
		addr.ChannelID = chip->ChannelID; addr.ChipID = chip->ChipID;
		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++) {
				addr.DieID = die_id; addr.PlaneID = plane_id;
				if (block_manager->Get_pool_size(addr) < block_pool_gc_hard_threshold)
					return true;
			}
		}

		return false;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movb $0x1, %bl
cmpb $0x1, 0x6c(%rdi)
jne 0x3fd61
movq %rdi, %r14
movq $0x0, 0x10(%rsp)
movq 0x2c(%rsi), %rax
movq %rax, (%rsp)
movl 0xfc(%rdi), %eax
xorl %ebx, %ebx
testl %eax, %eax
je 0x3fd61
movl 0x100(%r14), %ecx
movq %rsp, %r15
testl %ecx, %ecx
je 0x3fd53
xorl %ebp, %ebp
movl %ebx, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
movq 0x38(%r14), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x48(%rax)
cmpl 0x78(%r14), %eax
jb 0x3fd5f
incl %ebp
movl 0x100(%r14), %ecx
cmpl %ecx, %ebp
jb 0x3fd22
movl 0xfc(%r14), %eax
jmp 0x3fd55
xorl %ecx, %ecx
incl %ebx
cmpl %eax, %ebx
jb 0x3fd1c
xorl %ebx, %ebx
jmp 0x3fd61
movb $0x1, %bl
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_Base.cpp
// Function: SSD_Components::Host_Interface_Base::Send_write_message_to_host(unsigned long, void*, unsigned int)
void Host_Interface_Base::Send_write_message_to_host(uint64_t addresss, void* message, unsigned int message_size)
	{
		Host_Components::PCIe_Message* pcie_message = new Host_Components::PCIe_Message;
		pcie_message->Type = Host_Components::PCIe_Message_Type::WRITE_REQ;
		pcie_message->Destination = Host_Components::PCIe_Destination_Type::HOST;
		pcie_message->Address = addresss;
		COPYDATA(pcie_message->Payload, message, pcie_message->Payload_size);
		pcie_message->Payload_size = message_size;
		pcie_switch->Send_to_host(pcie_message);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movl $0x20, %edi
callq 0x73a0
movq %rax, %r15
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, (%r15)
movq %r13, 0x18(%r15)
callq 0x28018
movq %rax, %rdi
callq 0x28484
testb %al, %al
je 0x40763
xorl %edi, %edi
callq 0x7030
movq %rax, %r12
movq %r12, 0x8(%r15)
movl %ebx, 0x10(%r15)
movq 0x80(%r14), %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x24f80
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe.cpp
// Function: SSD_Components::Input_Stream_NVMe::~Input_Stream_NVMe()
Input_Stream_NVMe::~Input_Stream_NVMe()
{
	for (auto &user_request : Waiting_user_requests)
		delete user_request;
	for (auto &user_request : Completed_user_requests)
		delete user_request;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2dca2(%rip), %rax     # 0x6e710
movq %rax, (%rdi)
leaq 0x88(%rdi), %r15
movq %rdi, (%rsp)
movq 0x88(%rdi), %r12
cmpq %r15, %r12
je 0x40acf
movq 0x10(%r12), %r14
testq %r14, %r14
je 0x40ac1
leaq 0x40(%r14), %r13
movq 0x40(%r14), %rdi
cmpq %r13, %rdi
je 0x40aaf
movq (%rdi), %rbp
callq 0x7370
movq %rbp, %rdi
cmpq %r13, %rbp
jne 0x40a9f
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x40ac1
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r12), %r12
jmp 0x40a83
movq (%rsp), %rax
leaq 0xa0(%rax), %r12
movq 0xa0(%rax), %r13
cmpq %r12, %r13
je 0x40b2c
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x40b1e
leaq 0x40(%r14), %rbp
movq 0x40(%r14), %rdi
cmpq %rbp, %rdi
je 0x40b0c
movq (%rdi), %rbx
callq 0x7370
movq %rbx, %rdi
cmpq %rbp, %rbx
jne 0x40afc
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x40b1e
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r13), %r13
jmp 0x40ae1
movq (%rsp), %rax
leaq 0xb8(%rax), %r14
movq 0xb8(%rax), %rdi
cmpq %r14, %rdi
je 0x40b53
movq (%rdi), %r13
callq 0x7370
movq %r13, %rdi
cmpq %r14, %r13
jne 0x40b43
movq (%r12), %rdi
cmpq %r12, %rdi
je 0x40b6c
movq (%rdi), %r14
callq 0x7370
movq %r14, %rdi
cmpq %r12, %r14
jne 0x40b5c
movq (%r15), %rdi
cmpq %r15, %rdi
je 0x40b84
movq (%rdi), %r14
callq 0x7370
movq %r14, %rdi
cmpq %r15, %r14
jne 0x40b74
movq (%rsp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4057a
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe.cpp
// Function: SSD_Components::Input_Stream_Manager_NVMe::Create_new_stream(IO_Flow_Priority_Class::Priority, unsigned long, unsigned long, unsigned long, unsigned short, unsigned long, unsigned short)
stream_id_type Input_Stream_Manager_NVMe::Create_new_stream(IO_Flow_Priority_Class::Priority priority_class,
															LHA_type start_logical_sector_address,
															LHA_type end_logical_sector_address,
															uint64_t submission_queue_base_address,
															uint16_t submission_queue_size,
															uint64_t completion_queue_base_address,
															uint16_t completion_queue_size)
{
	if (end_logical_sector_address < start_logical_sector_address)
	{
		PRINT_ERROR("Error in allocating address range to a stream in host interface: the start address should be smaller than the end address.")
	}
	Input_Stream_NVMe *input_stream = new Input_Stream_NVMe(priority_class, start_logical_sector_address, end_logical_sector_address,
															submission_queue_base_address, submission_queue_size, completion_queue_base_address, completion_queue_size);
	this->input_streams.push_back(input_stream);

	return (stream_id_type)(this->input_streams.size() - 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0xc(%rsp)
cmpq %rdx, %rcx
jb 0x40cff
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %rbx
movl $0xd8, %edi
callq 0x73a0
movq %rax, %r14
movq %rax, %rdi
callq 0x40508
movzwl 0x58(%rsp), %eax
movq 0x50(%rsp), %rcx
leaq 0x2daee(%rip), %rdx     # 0x6e710
movq %rdx, (%r14)
movl %ebp, 0x48(%r14)
movq %r13, 0x50(%r14)
movq %r12, 0x58(%r14)
movq %r15, 0x60(%r14)
movl 0xc(%rsp), %edx
movw %dx, 0x68(%r14)
movq %rcx, 0x70(%r14)
movw %ax, 0x78(%r14)
leaq 0x88(%r14), %rax
xorl %ecx, %ecx
movq %rcx, 0x7a(%r14)
movw %cx, 0x82(%r14)
movq %rax, 0x90(%r14)
movq %rax, 0x88(%r14)
movq %rcx, 0x98(%r14)
leaq 0xa0(%r14), %rax
movq %rax, 0xa8(%r14)
movq %rax, 0xa0(%r14)
movq %rcx, 0xb0(%r14)
movq %r14, %rax
addq $0xb8, %rax
movq %rax, 0xc0(%r14)
movq %rax, 0xb8(%r14)
movq %rcx, 0xc8(%r14)
movw %cx, 0xd0(%r14)
leaq 0x10(%rbx), %r15
movq %r14, 0x10(%rsp)
movq 0x18(%rbx), %rsi
cmpq 0x20(%rbx), %rsi
je 0x40cd7
movq %r14, (%rsi)
movq 0x18(%rbx), %rax
addq $0x8, %rax
movq %rax, 0x18(%rbx)
jmp 0x40ce8
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x430e8
movq 0x18(%rbx), %rax
subl (%r15), %eax
shrl $0x3, %eax
decl %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e2ea(%rip), %rbx     # 0x6eff0
leaq 0x1589b(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x191c6(%rip), %rsi     # 0x59ee2
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x2e29d(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
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/Host_Interface_NVMe.cpp
// Function: SSD_Components::Host_Interface_NVMe::Validate_simulation_config()
void Host_Interface_NVMe::Validate_simulation_config()
{
	Host_Interface_Base::Validate_simulation_config();
	if (this->input_stream_manager == NULL)
	{
		throw std::logic_error("Input stream manager is not set for Host Interface");
	}
	if (this->request_fetch_unit == NULL)
	{
		throw std::logic_error("Request fetch unit is not set for Host Interface");
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x406d0
cmpq $0x0, 0x50(%rbx)
je 0x41b46
cmpq $0x0, 0x58(%rbx)
je 0x41b64
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x1843f(%rip), %rsi     # 0x59f99
movq %rax, %rdi
callq 0x7500
jmp 0x41b80
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x18454(%rip), %rsi     # 0x59fcc
movq %rax, %rdi
callq 0x7500
movq 0x2d439(%rip), %rsi     # 0x6efc0
movq 0x2d3f2(%rip), %rdx     # 0x6ef80
movq %rbx, %rdi
callq 0x75e0
jmp 0x41b98
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/Host_Interface_SATA.cpp
// Function: SSD_Components::Input_Stream_SATA::~Input_Stream_SATA()
Input_Stream_SATA::~Input_Stream_SATA()
	{
		for (auto &user_request : Waiting_user_requests) {
			delete user_request;
		}
		for (auto &user_request : Completed_user_requests) {
			delete user_request;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2b646(%rip), %rax     # 0x6e878
movq %rax, (%rdi)
leaq 0x78(%rdi), %r15
movq %rdi, (%rsp)
movq 0x78(%rdi), %r12
cmpq %r15, %r12
je 0x4328d
movq 0x10(%r12), %r14
testq %r14, %r14
je 0x4327f
leaq 0x40(%r14), %r13
movq 0x40(%r14), %rdi
cmpq %r13, %rdi
je 0x4326d
movq (%rdi), %rbp
callq 0x7370
movq %rbp, %rdi
cmpq %r13, %rbp
jne 0x4325d
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x4327f
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r12), %r12
jmp 0x43241
movq (%rsp), %rax
leaq 0x90(%rax), %r12
movq 0x90(%rax), %r13
cmpq %r12, %r13
je 0x432ea
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x432dc
leaq 0x40(%r14), %rbp
movq 0x40(%r14), %rdi
cmpq %rbp, %rdi
je 0x432ca
movq (%rdi), %rbx
callq 0x7370
movq %rbx, %rdi
cmpq %rbp, %rbx
jne 0x432ba
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x432dc
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r13), %r13
jmp 0x4329f
movq (%rsp), %rax
leaq 0xa8(%rax), %r14
movq 0xa8(%rax), %rdi
cmpq %r14, %rdi
je 0x43311
movq (%rdi), %r13
callq 0x7370
movq %r13, %rdi
cmpq %r14, %r13
jne 0x43301
movq (%r12), %rdi
cmpq %r12, %rdi
je 0x4332a
movq (%rdi), %r14
callq 0x7370
movq %r14, %rdi
cmpq %r12, %r14
jne 0x4331a
movq (%r15), %rdi
cmpq %r15, %rdi
je 0x43342
movq (%rdi), %r14
callq 0x7370
movq %r14, %rdi
cmpq %r15, %r14
jne 0x43332
movq (%rsp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4057a
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Input_Stream_Manager_SATA::Input_Stream_Manager_SATA(SSD_Components::Host_Interface_Base*, unsigned short, unsigned long, unsigned long)
Input_Stream_Manager_SATA::Input_Stream_Manager_SATA(Host_Interface_Base* host_interface, uint16_t ncq_depth,
		LHA_type start_logical_sector_address, LHA_type end_logical_sector_address) :
		ncq_depth(ncq_depth), Input_Stream_Manager_Base(host_interface)
	{
		if (end_logical_sector_address < start_logical_sector_address) {
			PRINT_ERROR("Error in allocating address range to a stream in host interface: the start address should be smaller than the end address.")
		}
		Input_Stream_SATA* input_stream = new Input_Stream_SATA(start_logical_sector_address, end_logical_sector_address, 0, 0);
		this->input_streams.push_back(input_stream);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %r15
movq %rcx, %r12
movl %edx, %ebp
movq %rdi, %rbx
callq 0x40796
leaq 0x2b5f9(%rip), %rax     # 0x6e988
movq %rax, (%rbx)
movw %bp, 0x28(%rbx)
cmpq %r12, %r15
jb 0x43464
movl $0xc8, %edi
callq 0x73a0
movq %rax, %r14
movq %rax, %rdi
callq 0x40508
leaq 0x2b4bd(%rip), %rax     # 0x6e878
movq %rax, (%r14)
movq %r12, 0x48(%r14)
movq %r15, 0x50(%r14)
leaq 0x78(%r14), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%r14)
movups %xmm0, 0x62(%r14)
movq %rax, 0x80(%r14)
movq %rax, 0x78(%r14)
xorl %eax, %eax
movq %rax, 0x88(%r14)
leaq 0x90(%r14), %rcx
movq %rcx, 0x98(%r14)
movq %rcx, 0x90(%r14)
movq %rax, 0xa0(%r14)
movq %r14, %rcx
addq $0xa8, %rcx
movq %rcx, 0xb0(%r14)
movq %rcx, 0xa8(%r14)
movq %rax, 0xb8(%r14)
movw $0x0, 0xc0(%r14)
movq %r14, 0x8(%rsp)
movq 0x18(%rbx), %rsi
cmpq 0x20(%rbx), %rsi
je 0x43449
movq %r14, (%rsi)
addq $0x8, 0x18(%rbx)
jmp 0x43457
leaq 0x10(%rbx), %rdi
leaq 0x8(%rsp), %rdx
callq 0x430e8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x2bb85(%rip), %rdi     # 0x6eff0
leaq 0x13136(%rip), %rsi     # 0x565a8
movl $0x6, %edx
callq 0x7400
movq 0x2bb6d(%rip), %rdi     # 0x6eff0
leaq 0x16a58(%rip), %rsi     # 0x59ee2
movl $0x7a, %edx
callq 0x7400
movq 0x2bb55(%rip), %rdi     # 0x6eff0
callq 0x71c0
movq 0x2bb29(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
jmp 0x434c7
jmp 0x434c7
movq %rax, %r15
movq %r14, %rdi
callq 0x7370
jmp 0x434ca
movq %rax, %r15
movq %rbx, %rdi
callq 0x40526
movq %r15, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Request_Fetch_Unit_SATA::Process_pcie_write_message(unsigned long, void*, unsigned int)
void Request_Fetch_Unit_SATA::Process_pcie_write_message(uint64_t address, void * payload, unsigned int payload_size)
	{
		Host_Interface_SATA* hi = (Host_Interface_SATA*)host_interface;
		uint64_t val = (uint64_t)payload;
		switch (address)
		{
			case NCQ_SUBMISSION_REGISTER:
				((Input_Stream_Manager_SATA*)(hi->input_stream_manager))->Submission_queue_tail_pointer_update((uint16_t)val);
				break;
			case NCQ_COMPLETION_REGISTER:
				((Input_Stream_Manager_SATA*)(hi->input_stream_manager))->Completion_queue_head_pointer_update((uint16_t)val);
				break;
			default:
				throw std::invalid_argument("Unknown register is written in Request_Fetch_Unit_SATA!");
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x8(%rdi), %rax
cmpq $0x1003, %rsi           # imm = 0x1003
je 0x43754
cmpq $0x1000, %rsi           # imm = 0x1000
jne 0x437d1
movq 0x50(%rax), %r15
movq 0x10(%r15), %rax
movq (%rax), %rax
movw %dx, 0x6c(%rax)
movq 0x8(%r15), %rax
movq 0x58(%rax), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x10(%rax)
movq 0x10(%r15), %rax
movq (%rax), %rax
incw 0xc0(%rax)
addq $0x68, %rax
jmp 0x437ba
movq 0x50(%rax), %r15
movq 0x10(%r15), %rax
movq (%rax), %rax
movw %dx, 0x6e(%rax)
movq 0xa0(%rax), %rcx
testq %rcx, %rcx
je 0x437cb
movq 0x90(%rax), %rbx
movq 0x10(%rbx), %r14
decq %rcx
movq %rcx, 0xa0(%rax)
movq %rbx, %rdi
callq 0x7580
movq %rbx, %rdi
callq 0x7370
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
movq 0x58(%rax), %rdi
movq (%rcx), %rax
movzwl 0x6a(%rax), %edx
movq %r14, %rsi
callq 0x43a62
movq 0x10(%r15), %rax
movq (%rax), %rax
addq $0x70, %rax
movl (%rax), %ecx
incl %ecx
xorl %edx, %edx
cmpw 0x28(%r15), %cx
cmovnel %ecx, %edx
movw %dx, (%rax)
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x16a77(%rip), %rsi     # 0x5a25c
movq %rax, %rdi
callq 0x7680
movq 0x2b7d4(%rip), %rsi     # 0x6efc8
movq 0x2b7ad(%rip), %rdx     # 0x6efa8
movq %rbx, %rdi
callq 0x75e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620