LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x165ce
leaq 0x3b754(%rip), %rax     # 0x6e1f0
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)
leaq 0x78(%rbx), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movq %rbx, 0x3cb2e(%rip)     # 0x6f620
imull $0xf4240, %ebp, %eax    # imm = 0xF4240
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x24e20(%rip), %xmm1    # 0x57928
divsd %xmm0, %xmm1
movsd %xmm1, 0x50(%rbx)
movq %r14, %rdi
shlq $0x2, %rdi
callq 0x7030
movq %rax, 0x3cb04(%rip)     # 0x6f628
testl %r14d, %r14d
je 0x32b4b
movl %r14d, %edx
shlq $0x2, %rdx
movq %rax, %rdi
movq 0x10(%rsp), %rsi
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 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x32b6e
callq 0x7370
movq %r15, %rdi
movq %rbx, %rsi
callq 0x788b
movq %r14, %rdi
callq 0x7620
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x38c57(%rip), %rax     # 0x6e2c0
movq %rax, (%rdi)
cmpl $0x0, 0x74(%rdi)
je 0x3575f
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 0x356ea
movq (%rax), %rdi
testq %rdi, %rdi
je 0x356d9
callq 0x7370
movq 0xc8(%rbx), %rdi
addq %r14, %rdi
callq 0x35168
jmp 0x35681
movq 0xd0(%rbx), %rax
movq %r15, (%rsp)
leaq (%r15,%r15,2), %rcx
leaq (%rax,%rcx,8), %r12
movq (%r12), %r13
cmpq %r12, %r13
je 0x3574c
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x35746
leaq 0x40(%r14), %rbp
movq 0x40(%r14), %rdi
cmpq %rbp, %rdi
je 0x3572c
movq (%rdi), %r15
callq 0x7370
movq %r15, %rdi
cmpq %rbp, %r15
jne 0x3571c
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x3573e
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r13), %r13
jmp 0x35701
movq (%rsp), %r15
incq %r15
movl 0x74(%rbx), %eax
cmpq %rax, %r15
jb 0x35679
movq 0xc0(%rbx), %r14
testq %r14, %r14
je 0x3577b
movq %r14, %rdi
callq 0x31dae
movq %r14, %rdi
callq 0x7370
movq 0xc8(%rbx), %r15
testq %r15, %r15
je 0x357b7
leaq -0x8(%r15), %r14
movq -0x8(%r15), %rax
testq %rax, %rax
je 0x357af
addq $-0x50, %r15
shlq $0x4, %rax
leaq (%rax,%rax,4), %r12
leaq (%r15,%r12), %rdi
callq 0x34fbc
addq $-0x50, %r12
jne 0x357a0
movq %r14, %rdi
callq 0x7480
movq 0xd0(%rbx), %r15
testq %r15, %r15
je 0x35803
leaq -0x8(%r15), %r14
movq -0x8(%r15), %rax
testq %rax, %rax
je 0x357fb
leaq (%rax,%rax,2), %rax
leaq (%r15,%rax,8), %r12
movq -0x18(%r12), %rdi
addq $-0x18, %r12
cmpq %r12, %rdi
je 0x357f6
movq (%rdi), %r13
callq 0x7370
movq %r13, %rdi
cmpq %r12, %r13
jne 0x357e6
cmpq %r15, %r12
jne 0x357d8
movq %r14, %rdi
callq 0x7480
movq 0xe8(%rbx), %r15
testq %r15, %r15
je 0x3583f
leaq -0x8(%r15), %r14
movq -0x8(%r15), %rax
testq %rax, %rax
je 0x35837
addq $-0x30, %r15
shlq $0x4, %rax
leaq (%rax,%rax,2), %r12
leaq (%r15,%r12), %rdi
callq 0x1676e
addq $-0x30, %r12
jne 0x35828
movq %r14, %rdi
callq 0x7480
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32b82
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4578e
cmpq $0x0, 0x30(%rbx)
je 0x36df4
cmpq $0x0, 0x38(%rbx)
je 0x36e12
cmpq $0x0, 0x40(%rbx)
je 0x36e30
cmpq $0x0, 0x48(%rbx)
je 0x36e4e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x22528(%rip), %rsi     # 0x59330
movq %rax, %rdi
callq 0x7500
jmp 0x36e6a
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x22530(%rip), %rsi     # 0x59356
movq %rax, %rdi
callq 0x7500
jmp 0x36e6a
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x22539(%rip), %rsi     # 0x5937d
movq %rax, %rdi
callq 0x7500
jmp 0x36e6a
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x22541(%rip), %rsi     # 0x593a3
movq %rax, %rdi
callq 0x7500
movq 0x3814f(%rip), %rsi     # 0x6efc0
movq 0x38110(%rip), %rdx     # 0x6ef88
movq %rbx, %rdi
callq 0x75e0
jmp 0x36e86
jmp 0x36e86
jmp 0x36e86
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1ca98(%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 0x3e1fc
movq 0x48(%r13,%rbp), %rax
movq (%rax,%r12), %rax
movl 0x4(%rax), %eax
cmpl 0x34(%r15), %eax
jne 0x3cf45
movq (%rsp), %rax
movl %eax, %r12d
movzwl %ax, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3dbf4
movq 0x48(%r14), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x10(%r15), %r15
movq %r14, %rdi
callq 0x3e04a
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 0x3df32
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1c9c3(%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 0x3cff7
movq %rdi, %r15
movzwl %si, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3dbf4
movq 0x50(%r14), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x10(%r15), %r15
movq %r14, %rdi
callq 0x3e04a
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 0x3df32
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1c72b(%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 0x3e1fc
movq 0x58(%r13,%rbp), %rax
movq (%rax,%r14), %rax
movl 0x4(%rax), %eax
cmpl 0x34(%r15), %eax
jne 0x3d2bf
movq 0x10(%rsp), %rax
movl %eax, %r14d
movzwl %ax, %esi
movq %r12, %rdi
movl $0x1, %edx
callq 0x3dbf4
movq 0x58(%r12), %rcx
movq %rax, (%rcx,%r14,8)
cmpb $0x0, 0xc(%rsp)
jne 0x3d2bf
movq 0x10(%r15), %r15
movq %r12, %rdi
callq 0x3e04a
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 0x3df32
// File: /workspace/github_cpp_makefile_star2_O1/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 0x333f8(%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 0x3def4
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 0x403a8
movzbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3dbc0
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3df32
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1c574(%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 0x3d42b
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 0x31bbe(%rip), %r14     # 0x6eff0
leaq 0x1916f(%rip), %rsi     # 0x565a8
movq %r14, %rdi
callq 0x7390
leaq 0x1c624(%rip), %rsi     # 0x59a6c
movq %r14, %rdi
callq 0x7390
movzwl %bx, %esi
movq %rax, %rdi
callq 0x75b0
movq %rax, %rdi
callq 0x71c0
movq 0x31b66(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3d4df
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 0x31b0a(%rip), %r14     # 0x6eff0
leaq 0x190bb(%rip), %rsi     # 0x565a8
movq %r14, %rdi
callq 0x7390
leaq 0x1c570(%rip), %rsi     # 0x59a6c
movq %r14, %rdi
callq 0x7390
movzwl %bx, %esi
movq %rax, %rdi
callq 0x75b0
movq %rax, %rdi
callq 0x71c0
movq 0x31ab2(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dbd4
movl 0x10(%rsi), %ecx
leaq 0x8(%rsp), %rax
movl %ecx, (%rax)
jmp 0x3dbdf
leaq 0x8(%rsp), %rax
movl $0x0, (%rax)
movq %rsi, 0x8(%rax)
addq $0x18, %rdi
movq %rax, %rsi
callq 0x3e774
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3dc6a
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
movq 0x30(%rdi), %rsi
movq 0x28(%rsi), %r14
addq $0x18, %rdi
callq 0x3e544
movw %r15w, 0x20(%r14)
movb %bpl, 0x22(%r14)
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3dc4d
movl (%r14), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x90(%rbx)
jmp 0x3dc5c
addq $0x60, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e57c
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x3137f(%rip), %rbx     # 0x6eff0
leaq 0x18930(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x1be7a(%rip), %rsi     # 0x59b01
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x31332(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3172f(%rip), %edx     # 0x6f638
testq %rdx, %rdx
je 0x3df1d
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_O1/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 0x3df50
testl %eax, %eax
je 0x3df75
popq %rbx
popq %r14
popq %r15
retq
movq 0x31099(%rip), %rbx     # 0x6eff0
leaq 0x1864a(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x1bbc0(%rip), %rsi     # 0x59b2d
movq %rbx, %rdi
jmp 0x3e026
movq %rsi, %r14
movq %rdi, %rbx
movq 0x3106e(%rip), %r15     # 0x6eff0
leaq 0x1861f(%rip), %rsi     # 0x565a8
movq %r15, %rdi
callq 0x7390
leaq 0x1bbca(%rip), %rsi     # 0x59b62
movq %r15, %rdi
callq 0x7390
leaq 0x1c6b0(%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 0x1bb60(%rip), %rsi     # 0x59b69
movq %rax, %rdi
callq 0x7390
movl 0x40(%rbx), %esi
movq %rax, %rdi
callq 0x74c0
leaq 0x1bb53(%rip), %rsi     # 0x59b76
movq %rax, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x30f96(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager_Base.cpp
// Function: SSD_Components::Flash_Block_Manager_Base::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 0x3e0cf
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 0x3e0a6
movl %r9d, %eax
movl %r8d, %r9d
shlq $0x6, %r9
movl %edi, %r11d
cmpl 0x10(%rdx,%r9), %r10d
jb 0x3e0ba
movl %r8d, %r11d
incq %rdi
addq $0x40, %rsi
movl %r11d, %r8d
movl %eax, %r9d
cmpq %rdi, %rcx
jne 0x3e090
subl %r11d, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Flash_Block_Manager_Base.cpp
// Function: SSD_Components::Flash_Block_Manager_Base::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 0x3e134
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 0x3e125
movl %r8d, %eax
incq %rdi
addq $0x40, %rsi
movl %eax, %r8d
cmpq %rdi, %rcx
jne 0x3e10f
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4039c
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x403a2
movl 0x80(%rdi), %eax
retq
movl 0xf0(%rdi), %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq 0x30(%rdi), %rax
movl 0x50(%rax), %ecx
movl %edx, %eax
testl %ecx, %ecx
setne %dl
je 0x40408
movq %rax, %rdi
shlq $0x6, %rdi
addq 0x10(%rsi), %rdi
movq 0x48(%rsi), %r8
cmpq (%r8), %rdi
je 0x40403
movq 0x58(%rsi), %r9
leal -0x1(%rcx), %r10d
xorl %r11d, %r11d
cmpq (%r9,%r11,8), %rdi
je 0x40403
movq 0x50(%rsi), %rbx
cmpq (%rbx,%r11,8), %rdi
je 0x40403
cmpl %r11d, %r10d
je 0x40408
incq %r11
cmpl %ecx, %r11d
setb %dl
movl %r11d, %ebx
cmpq (%r8,%rbx,8), %rdi
jne 0x403dc
testb $0x1, %dl
jne 0x40417
movq 0x10(%rsi), %rcx
shlq $0x6, %rax
cmpl $0x0, 0x38(%rcx,%rax)
jle 0x4041b
xorl %eax, %eax
jmp 0x40423
addq %rax, %rcx
movb 0x23(%rcx), %al
xorb $0x1, %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x20, %rsp
movb $0x1, %bl
cmpb $0x1, 0x6c(%rdi)
jne 0x40783
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x2c(%rsi), %rax
movq %rax, (%rsp)
cmpl $0x0, 0xfc(%rdi)
setne %bl
je 0x40783
xorl %ebp, %ebp
movq %rsp, %r15
cmpl $0x0, 0x100(%r14)
je 0x40775
xorl %r12d, %r12d
movl %ebp, 0x8(%rsp)
movl %r12d, 0xc(%rsp)
movq 0x38(%r14), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x48(%rax)
cmpl 0x78(%r14), %eax
jb 0x40783
incl %r12d
cmpl 0x100(%r14), %r12d
jb 0x4074d
incl %ebp
cmpl 0xfc(%r14), %ebp
setb %bl
jb 0x40740
andb $0x1, %bl
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_Base.cpp
// Function: SSD_Components::Host_Interface_Base::Send_read_message_to_host(unsigned long, unsigned int)
void Host_Interface_Base::Send_read_message_to_host(uint64_t addresss, unsigned int request_read_data_size)
	{
		Host_Components::PCIe_Message* pcie_message = new Host_Components::PCIe_Message;
		pcie_message->Type = Host_Components::PCIe_Message_Type::READ_REQ;
		pcie_message->Destination = Host_Components::PCIe_Destination_Type::HOST;
		pcie_message->Address = addresss;
		pcie_message->Payload = (void*)(intptr_t)request_read_data_size;
		pcie_message->Payload_size = sizeof(request_read_data_size);
		pcie_switch->Send_to_host(pcie_message);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl $0x20, %edi
callq 0x73a0
movq $0x0, (%rax)
movq %r14, 0x18(%rax)
movl %ebx, %ecx
movq %rcx, 0x8(%rax)
movl $0x4, 0x10(%rax)
movq 0x80(%r15), %rdi
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x250e6
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x281b4
movq %rax, %rdi
callq 0x28610
testb %al, %al
je 0x411b3
movl 0x10(%r15), %r13d
movq %r13, %rdi
callq 0x7030
movq %rax, 0x8(%r15)
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x7310
jmp 0x411b7
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 0x250e6
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2d25a(%rip), %rax     # 0x6e718
movq %rax, (%rdi)
leaq 0x88(%rdi), %r15
movq %rdi, (%rsp)
movq 0x88(%rdi), %r12
cmpq %r15, %r12
je 0x4151f
movq 0x10(%r12), %r14
testq %r14, %r14
je 0x41519
leaq 0x40(%r14), %r13
movq 0x40(%r14), %rdi
cmpq %r13, %rdi
je 0x414ff
movq (%rdi), %rbp
callq 0x7370
movq %rbp, %rdi
cmpq %r13, %rbp
jne 0x414ef
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x41511
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r12), %r12
jmp 0x414d3
movq (%rsp), %rax
leaq 0xa0(%rax), %r12
movq 0xa0(%rax), %r13
cmpq %r12, %r13
je 0x4157c
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x41576
leaq 0x40(%r14), %rbp
movq 0x40(%r14), %rdi
cmpq %rbp, %rdi
je 0x4155c
movq (%rdi), %rbx
callq 0x7370
movq %rbx, %rdi
cmpq %rbp, %rbx
jne 0x4154c
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x4156e
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r13), %r13
jmp 0x41531
movq (%rsp), %rax
leaq 0xb8(%rax), %r14
movq 0xb8(%rax), %rdi
cmpq %r14, %rdi
je 0x415a3
movq (%rdi), %r13
callq 0x7370
movq %r13, %rdi
cmpq %r14, %r13
jne 0x41593
movq (%r12), %rdi
cmpq %r12, %rdi
je 0x415bc
movq (%rdi), %r14
callq 0x7370
movq %r14, %rdi
cmpq %r12, %r14
jne 0x415ac
movq (%r15), %rdi
cmpq %r15, %rdi
je 0x415d4
movq (%rdi), %r14
callq 0x7370
movq %r14, %rdi
cmpq %r15, %r14
jne 0x415c4
movq (%rsp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x40fb4
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x41744
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 0x40f48
movzwl 0x58(%rsp), %eax
movq 0x50(%rsp), %rcx
leaq 0x2d0a6(%rip), %rdx     # 0x6e718
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)
movq %r14, 0x10(%rsp)
movq 0x18(%rbx), %rsi
cmpq 0x20(%rbx), %rsi
je 0x4171c
movq %r14, (%rsi)
addq $0x8, 0x18(%rbx)
jmp 0x4172a
leaq 0x10(%rbx), %rdi
leaq 0x10(%rsp), %rdx
callq 0x43b48
movl 0x18(%rbx), %eax
subl 0x10(%rbx), %eax
shrl $0x3, %eax
decl %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d8a5(%rip), %rbx     # 0x6eff0
leaq 0x14e56(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x18781(%rip), %rsi     # 0x59ee2
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x2d858(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
movq %rax, %rbx
movq %r14, %rdi
callq 0x7370
movq %rbx, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe.cpp
// Function: SSD_Components::Request_Fetch_Unit_NVMe::Fetch_next_request(unsigned short)
void Request_Fetch_Unit_NVMe::Fetch_next_request(stream_id_type stream_id)
{
	DMA_Req_Item *dma_req_item = new DMA_Req_Item;
	dma_req_item->Type = DMA_Req_Type::REQUEST_INFO;
	dma_req_item->object = (void *)(intptr_t)stream_id;
	dma_list.push_back(dma_req_item);

	Host_Interface_NVMe *hi = (Host_Interface_NVMe *)host_interface;
	Input_Stream_NVMe *im = ((Input_Stream_NVMe *)hi->input_stream_manager->input_streams[stream_id]);
	host_interface->Send_read_message_to_host(im->Submission_queue_base_address + im->Submission_head * sizeof(Submission_Queue_Entry), sizeof(Submission_Queue_Entry));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x10, %edi
callq 0x73a0
movq %rax, %r15
movl $0x0, (%rax)
movl %ebx, %r12d
movq %r12, 0x8(%rax)
leaq 0x10(%r14), %rbx
movl $0x18, %edi
callq 0x73a0
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x7060
incq 0x20(%r14)
movq 0x8(%r14), %rdi
movq 0x50(%rdi), %rax
movq 0x10(%rax), %rax
movq (%rax,%r12,8), %rax
movzwl 0x7a(%rax), %ecx
leaq (%rcx,%rcx,8), %rsi
shll $0x3, %esi
addq 0x60(%rax), %rsi
movl $0x48, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4110c
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe.cpp
// Function: SSD_Components::Request_Fetch_Unit_NVMe::Fetch_write_data(SSD_Components::User_Request*)
void Request_Fetch_Unit_NVMe::Fetch_write_data(User_Request *request)
{
	DMA_Req_Item *dma_req_item = new DMA_Req_Item;
	dma_req_item->Type = DMA_Req_Type::WRITE_DATA;
	dma_req_item->object = (void *)request;
	dma_list.push_back(dma_req_item);

	Submission_Queue_Entry *sqe = (Submission_Queue_Entry *)request->IO_command_info;
	host_interface->Send_read_message_to_host((sqe->PRP_entry_2 << 31) | sqe->PRP_entry_1, request->Size_in_byte);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x10, %edi
callq 0x73a0
movq %rax, %r15
movl $0x1, (%rax)
movq %rbx, 0x8(%rax)
leaq 0x10(%r14), %r12
movl $0x18, %edi
callq 0x73a0
movq %r15, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x7060
incq 0x20(%r14)
movq 0x70(%rbx), %rax
movq 0x8(%r14), %rdi
movq 0x28(%rax), %rsi
shlq $0x1f, %rsi
orq 0x20(%rax), %rsi
movl 0x5c(%rbx), %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4110c
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe.cpp
// Function: SSD_Components::Request_Fetch_Unit_NVMe::Send_completion_queue_element(SSD_Components::User_Request*, unsigned short)
void Request_Fetch_Unit_NVMe::Send_completion_queue_element(User_Request *request, uint16_t sq_head_value)
{
	Host_Interface_NVMe *hi = (Host_Interface_NVMe *)host_interface;
	Completion_Queue_Entry *cqe = new Completion_Queue_Entry;
	cqe->SQ_Head = sq_head_value;
	cqe->SQ_ID = FLOW_ID_TO_Q_ID(request->Stream_id);
	cqe->SF_P = 0x0001 & current_phase;
	cqe->Command_Identifier = ((Submission_Queue_Entry *)request->IO_command_info)->Command_Identifier;
	Input_Stream_NVMe *im = ((Input_Stream_NVMe *)hi->input_stream_manager->input_streams[request->Stream_id]);
	host_interface->Send_write_message_to_host(im->Completion_queue_base_address + im->Completion_tail * sizeof(Completion_Queue_Entry), cqe, sizeof(Completion_Queue_Entry));
	number_of_sent_cqe++;
	if (number_of_sent_cqe % im->Completion_queue_size == 0)
	{
		//According to protocol specification, the value of the Phase Tag is inverted each pass through the Completion Queue
		if (current_phase == 0xffff)
		{
			current_phase = 0xfffe;
		}
		else
		{
			current_phase = 0xffff;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movl $0x10, %edi
callq 0x73a0
movw %bp, 0x8(%rax)
movzwl 0x68(%r15), %ecx
leal 0x1(%rcx), %edx
movw %dx, 0xa(%rax)
movzwl 0x28(%rbx), %edx
andl $0x1, %edx
movw %dx, 0xe(%rax)
movq 0x70(%r15), %rdx
movzwl 0x2(%rdx), %edx
movw %dx, 0xc(%rax)
movq 0x50(%r14), %rdx
movq 0x10(%rdx), %rdx
movq (%rdx,%rcx,8), %r15
movzwl 0x82(%r15), %esi
shll $0x4, %esi
addq 0x70(%r15), %rsi
movq %r14, %rdi
movq %rax, %rdx
movl $0x10, %ecx
callq 0x41150
movl 0x2c(%rbx), %eax
incl %eax
movl %eax, 0x2c(%rbx)
movzwl 0x78(%r15), %ecx
xorl %edx, %edx
divl %ecx
testl %edx, %edx
jne 0x42452
xorl %eax, %eax
cmpw $-0x1, 0x28(%rbx)
sete %al
notl %eax
movw %ax, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4110a
cmpq $0x0, 0x50(%rbx)
je 0x425b0
cmpq $0x0, 0x58(%rbx)
je 0x425ce
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x179d5(%rip), %rsi     # 0x59f99
movq %rax, %rdi
callq 0x7500
jmp 0x425ea
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x179ea(%rip), %rsi     # 0x59fcc
movq %rax, %rdi
callq 0x7500
movq 0x2c9cf(%rip), %rsi     # 0x6efc0
movq 0x2c990(%rip), %rdx     # 0x6ef88
movq %rbx, %rdi
callq 0x75e0
jmp 0x42602
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
nop