LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
movq %rcx, %r15
movl %edx, %ebp
movq %rdi, %rbx
callq 0x345b0
leaq 0x2b779(%rip), %rax     # 0x61968
movq %rax, (%rbx)
movw %bp, 0x28(%rbx)
cmpq %r15, %r14
jb 0x36239
movl $0xc8, %edi
callq 0x7370
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3701c
leaq 0x10(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %r12, (%rsi)
callq 0x35eea
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x2bdb0(%rip), %rdi     # 0x61ff0
leaq 0xe341(%rip), %rsi      # 0x44588
callq 0x7360
movq 0x2bd9d(%rip), %rdi     # 0x61ff0
leaq 0x11b58(%rip), %rsi     # 0x47db2
callq 0x7360
movq %rax, %rdi
callq 0x71a0
movq 0x2bd62(%rip), %rdi     # 0x61fd0
callq 0x73d0
pushq $0x1
popq %rdi
callq 0x73e0
jmp 0x3628c
jmp 0x3628c
movq %rax, %r14
movq %r12, %rdi
callq 0x7340
jmp 0x3628f
movq %rax, %r14
movq %rbx, %rdi
callq 0x3438e
movq %r14, %rdi
callq 0x75d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
cmpq $0x1003, %rsi           # imm = 0x1003
je 0x364c3
cmpq $0x1000, %rsi           # imm = 0x1000
jne 0x364d6
movq 0x50(%rax), %rdi
movzwl %dx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37140
movq 0x50(%rax), %rdi
movzwl %dx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37188
pushq $0x10
popq %rdi
callq 0x71b0
movq %rax, %rbx
leaq 0x11c44(%rip), %rsi     # 0x4812c
movq %rax, %rdi
callq 0x7620
movq 0x2bad1(%rip), %rsi     # 0x61fc8
movq 0x2baaa(%rip), %rdx     # 0x61fa8
movq %rbx, %rdi
callq 0x7590
movq %rax, %r14
movq %rbx, %rdi
callq 0x72a0
movq %r14, %rdi
callq 0x75d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Request_Fetch_Unit_SATA::Fetch_next_request(unsigned short)
void Request_Fetch_Unit_SATA::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 *)SATA_STREAM_ID;
		dma_list.push_back(dma_req_item);

		Host_Interface_SATA* hi = (Host_Interface_SATA*)host_interface;
		Input_Stream_SATA* im = ((Input_Stream_SATA*)hi->input_stream_manager->input_streams[SATA_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 %rbx
subq $0x10, %rsp
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x7370
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
leaq 0x10(%rbx), %rdi
callq 0x35ca0
movq 0x8(%rbx), %rdi
movq 0x50(%rdi), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movzwl 0x68(%rax), %ecx
imulq $0x48, %rcx, %rsi
addq 0x58(%rax), %rsi
pushq $0x48
popq %rdx
callq 0x344f4
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Request_Fetch_Unit_SATA::Send_completion_queue_element(SSD_Components::User_Request*, unsigned short)
void Request_Fetch_Unit_SATA::Send_completion_queue_element(User_Request* request, uint16_t sq_head_value)
	{
		Host_Interface_SATA* hi = (Host_Interface_SATA*)host_interface;
		Completion_Queue_Entry* cqe = new Completion_Queue_Entry;
		cqe->SQ_Head = sq_head_value;
		cqe->SQ_ID = FLOW_ID_TO_Q_ID(SATA_STREAM_ID);
		cqe->SF_P = 0x0001 & current_phase;
		cqe->Command_Identifier = ((Submission_Queue_Entry*)request->IO_command_info)->Command_Identifier;
		Input_Stream_SATA* im = ((Input_Stream_SATA*)hi->input_stream_manager->input_streams[SATA_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 % ncq_depth == 0) {
			if (current_phase == 0xffff) {//According to protocol specification, the value of the Phase Tag is inverted each pass through the Completion Queue
				current_phase = 0xfffe;
			} else {
				current_phase = 0xffff;
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %r15
pushq $0x10
popq %rdi
callq 0x7370
movw %bp, 0x8(%rax)
movw $0x1, 0xa(%rax)
movzwl 0x28(%rbx), %ecx
andl $0x1, %ecx
movw %cx, 0xe(%rax)
movq 0x70(%r14), %rcx
movzwl 0x2(%rcx), %ecx
movw %cx, 0xc(%rax)
movq 0x50(%r15), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx), %rcx
movzwl 0x70(%rcx), %esi
shll $0x4, %esi
addq 0x60(%rcx), %rsi
pushq $0x10
popq %rcx
movq %r15, %rdi
movq %rax, %rdx
callq 0x34532
movl 0x2c(%rbx), %eax
incl %eax
movl %eax, 0x2c(%rbx)
movzwl 0x30(%rbx), %ecx
xorl %edx, %edx
divl %ecx
testl %edx, %edx
jne 0x36798
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_O2/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Host_Interface_SATA::Validate_simulation_config()
void Host_Interface_SATA::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 0x344f2
cmpq $0x0, 0x50(%rbx)
je 0x36896
cmpq $0x0, 0x58(%rbx)
je 0x368b2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x71b0
movq %rax, %rbx
leaq 0x115c1(%rip), %rsi     # 0x47e69
movq %rax, %rdi
callq 0x74b0
jmp 0x368cc
pushq $0x10
popq %rdi
callq 0x71b0
movq %rax, %rbx
leaq 0x115d8(%rip), %rsi     # 0x47e9c
movq %rax, %rdi
callq 0x74b0
movq 0x2b6ed(%rip), %rsi     # 0x61fc0
movq 0x2b696(%rip), %rdx     # 0x61f70
movq %rbx, %rdi
callq 0x7590
jmp 0x368e4
movq %rax, %r14
movq %rbx, %rdi
callq 0x72a0
movq %r14, %rdi
callq 0x75d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Input_Stream_Manager_SATA::Handle_new_arrived_request(SSD_Components::User_Request*)
inline void Input_Stream_Manager_SATA::Handle_new_arrived_request(User_Request* request)
	{
		((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Submission_head_informed_to_host++;
		if (((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Submission_head_informed_to_host == ncq_depth) {
			((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Submission_head_informed_to_host = 0;
		}
		if (request->Type == UserRequestType::READ) {
			((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Waiting_user_requests.push_back(request);
			((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->STAT_number_of_read_requests++;
			segment_user_request(request);

			((Host_Interface_SATA*)host_interface)->broadcast_user_request_arrival_signal(request);
		} else {//This is a write request
			((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Waiting_user_requests.push_back(request);
			((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->STAT_number_of_write_requests++;
			((Host_Interface_SATA*)host_interface)->request_fetch_unit->Fetch_write_data(request);
		}
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rax
movq %rsi, (%rax)
movq 0x10(%rdi), %rcx
movq (%rcx), %rdi
movzwl 0x6a(%rdi), %ecx
incl %ecx
xorl %edx, %edx
cmpw 0x28(%rbx), %cx
cmovnel %ecx, %edx
movw %dx, 0x6a(%rdi)
movl 0x64(%rsi), %ebp
addq $0x78, %rdi
movq %rax, %rsi
callq 0x2ab34
movq 0x10(%rbx), %rax
movq (%rax), %rax
testl %ebp, %ebp
je 0x3711b
incl 0xc(%rax)
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
movq (%rsp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x37138
incl 0x8(%rax)
movq (%rsp), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
movq 0x8(%rbx), %rdi
movq (%rsp), %rsi
callq 0x35bc0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Input_Stream_Manager_SATA::Submission_queue_tail_pointer_update(unsigned short)
inline void Input_Stream_Manager_SATA::Submission_queue_tail_pointer_update(uint16_t tail_pointer_value)
	{
		((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Submission_tail = tail_pointer_value;
		((Host_Interface_SATA*)host_interface)->request_fetch_unit->Fetch_next_request(SATA_STREAM_ID);
		((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->On_the_fly_requests++;
		((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Submission_head++;
		if (((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Submission_head == ncq_depth) {
			((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Submission_head = 0;
		}
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq (%rax), %rax
movw %si, 0x6c(%rax)
movq 0x8(%rdi), %rax
movq 0x58(%rax), %rdi
movq (%rdi), %rax
xorl %ebp, %ebp
xorl %esi, %esi
callq *0x10(%rax)
movq 0x10(%rbx), %rax
movq (%rax), %rax
incw 0xc0(%rax)
movl 0x68(%rax), %ecx
incl %ecx
cmpw 0x28(%rbx), %cx
cmovel %ebp, %ecx
movw %cx, 0x68(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Input_Stream_Manager_SATA::Completion_queue_head_pointer_update(unsigned short)
inline void Input_Stream_Manager_SATA::Completion_queue_head_pointer_update(uint16_t head_pointer_value)
	{
		((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Completion_head = head_pointer_value;

		if (((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Completed_user_requests.size() > 0) {
			User_Request* request = ((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Completed_user_requests.front();
			((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Completed_user_requests.pop_front();
			inform_host_request_completed(request);
		}
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq (%rax), %rdi
movw %si, 0x6e(%rdi)
cmpq $0x0, 0xa0(%rdi)
je 0x371cd
movq 0x90(%rdi), %rax
addq $0x90, %rdi
movq 0x10(%rax), %r14
callq 0x35e8e
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37398
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Input_Stream_Manager_SATA::inform_host_request_completed(SSD_Components::User_Request*)
inline void Input_Stream_Manager_SATA::inform_host_request_completed(User_Request* request)
	{
		((Request_Fetch_Unit_SATA*)((Host_Interface_SATA*)host_interface)->request_fetch_unit)->Send_completion_queue_element(request, ((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Submission_head_informed_to_host);
		((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Completion_tail++;//Next free slot in the completion queue
		
		//Circular queue implementation
		if (((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Completion_tail == ncq_depth) {
			((Input_Stream_SATA*)input_streams[SATA_STREAM_ID])->Completion_tail = 0;
		}
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
movq 0x58(%rax), %rdi
movq (%rcx), %rax
movzwl 0x6a(%rax), %edx
callq 0x36714
movq 0x10(%rbx), %rax
movq (%rax), %rax
movl 0x70(%rax), %ecx
incl %ecx
xorl %edx, %edx
cmpw 0x28(%rbx), %cx
cmovnel %ecx, %edx
movw %dx, 0x70(%rax)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/NVM_PHY_ONFI.cpp
// Function: SSD_Components::NVM_PHY_ONFI::broadcastTransactionServicedSignal(SSD_Components::NVM_Transaction_Flash*)
void NVM_PHY_ONFI::broadcastTransactionServicedSignal(NVM_Transaction_Flash* transaction)
	{
		for (std::vector<TransactionServicedHandlerType>::iterator it = connectedTransactionServicedHandlers.begin();
			it != connectedTransactionServicedHandlers.end(); it++) {
			(*it)(transaction);
		}
		delete transaction;//This transaction has been consumed and no more needed
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x40(%rdi), %r15
cmpq 0x48(%r14), %r15
je 0x3744b
movq %rbx, %rdi
callq *(%r15)
addq $0x8, %r15
jmp 0x37439
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x7340
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/NVM_PHY_ONFI_NVDDR2.cpp
// Function: SSD_Components::NVM_PHY_ONFI_NVDDR2::Setup_triggers()
void NVM_PHY_ONFI_NVDDR2::Setup_triggers()
	{
		Sim_Object::Setup_triggers();
		for (unsigned int i = 0; i < channel_count; i++) {
			for (unsigned int j = 0; j < chip_no_per_channel; j++) {
				channels[i]->Chips[j]->Connect_to_chip_ready_signal(handle_ready_signal_from_chip);
			}
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x1, 0x28(%rdi)
xorl %r15d, %r15d
leaq 0xfa9(%rip), %r14       # 0x38d2c
movl 0x2c(%rbx), %eax
cmpq %rax, %r15
jae 0x37dbb
xorl %r12d, %r12d
movl 0x30(%rbx), %eax
cmpq %rax, %r12
jae 0x37db6
movq 0x88(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x8(%rax), %rax
movq (%rax,%r12,8), %rdi
movq %r14, %rsi
callq 0x1e434
incq %r12
jmp 0x37d8e
incq %r15
jmp 0x37d83
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/NVM_PHY_ONFI_NVDDR2.cpp
// Function: SSD_Components::NVM_PHY_ONFI_NVDDR2::Is_chip_busy_with_stream(SSD_Components::NVM_Transaction_Flash*)
NVM_Transaction_Flash* NVM_PHY_ONFI_NVDDR2::Is_chip_busy_with_stream(NVM_Transaction_Flash* transaction)
	{
		ChipBookKeepingEntry* chipBKE = &bookKeepingTable[transaction->Address.ChannelID][transaction->Address.ChipID];
		stream_id_type stream_id = transaction->Stream_id;

		for (unsigned int die_id = 0; die_id < die_no_per_chip; die_id++) {
			for (auto &tr : chipBKE->Die_book_keeping_records[die_id].ActiveTransactions) {
				if (tr->Stream_id == stream_id) {
					return tr;
				}
			}
		}

		return NULL;
	}

// Assembly:
movq 0x90(%rdi), %rax
movl 0x38(%rsi), %ecx
movq (%rax,%rcx,8), %rax
movl 0x3c(%rsi), %r8d
movzwl (%rsi), %ecx
movl 0x34(%rdi), %edx
shlq $0x7, %r8
leaq (%rax,%r8), %rsi
addq $0x8, %rsi
xorl %edi, %edi
cmpq %rdx, %rdi
je 0x37e91
movq (%rsi), %rax
imulq $0x68, %rdi, %r8
addq %rax, %r8
addq $0x8, %r8
movq %r8, %r9
movq (%r9), %r9
cmpq %r8, %r9
je 0x37e8b
movq 0x10(%r9), %rax
cmpw %cx, (%rax)
jne 0x37e78
jmp 0x37e90
incq %rdi
jmp 0x37e62
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/NVM_PHY_ONFI_NVDDR2.h
// Function: SSD_Components::DieBookKeepingEntry::PrepareSuspend()
void PrepareSuspend()
		{
			SuspendedCommand = ActiveCommand;
			RemainingExecTime = Expected_finish_time - Simulator->Time();
			SuspendedTransactions.insert(SuspendedTransactions.begin(), ActiveTransactions.begin(), ActiveTransactions.end());
			Suspended = true;
			ActiveCommand = NULL;
			ActiveTransactions.clear();
			Free = true;
		}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x50(%rdi), %r14
movq %rax, 0x20(%rdi)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq %rax, %r14
movq %r14, 0x58(%rbx)
leaq 0x28(%rbx), %rdi
movq 0x8(%rbx), %rdx
movq 0x28(%rbx), %rsi
leaq 0x8(%rbx), %r14
movq %r14, %rcx
callq 0x39960
movb $0x1, %bpl
movb %bpl, 0x49(%rbx)
andq $0x0, (%rbx)
movq %r14, %rdi
callq 0x27258
movb %bpl, 0x48(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/ONFI_Channel_Base.h
// Function: SSD_Components::ONFI_Channel_Base::SetStatus(SSD_Components::BusChannelStatus, NVM::FlashMemory::Flash_Chip*)
void SetStatus(BusChannelStatus new_status, NVM::FlashMemory::Flash_Chip* target_chip)
		{
			if (((status == BusChannelStatus::IDLE && new_status == BusChannelStatus::IDLE)
				|| (status == BusChannelStatus::BUSY && new_status == BusChannelStatus::BUSY))
				&& (current_active_chip != target_chip)) {
				PRINT_ERROR("Bus " << ChannelID << ": illegal bus status transition!")
			}

			status = new_status;
			if (status == BusChannelStatus::BUSY) {
				current_active_chip = target_chip;
			} else {
				current_active_chip = NULL;
			}
		}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %eax
movl %eax, %ecx
xorl $0x1, %ecx
movl %esi, %edi
xorl $0x1, %edi
orl %ecx, %edi
setne %cl
orl %esi, %eax
setne %al
testb %al, %cl
jne 0x391ea
cmpq %rdx, 0x18(%rbx)
jne 0x39201
movl %esi, 0x14(%rbx)
xorl %eax, %eax
testl %esi, %esi
cmoveq %rdx, %rax
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x28de8(%rip), %r14     # 0x61ff0
leaq 0xb379(%rip), %rsi      # 0x44588
movq %r14, %rdi
callq 0x7360
leaq 0xf09e(%rip), %rsi      # 0x482bc
movq %r14, %rdi
callq 0x7360
movl (%rbx), %esi
movq %rax, %rdi
callq 0x7470
leaq 0xf17f(%rip), %rsi      # 0x483b6
movq %rax, %rdi
callq 0x7360
movq %rax, %rdi
callq 0x71a0
movq 0x28d82(%rip), %rdi     # 0x61fd0
callq 0x73d0
pushq $0x1
popq %rdi
callq 0x73e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/../nvm_chip/flash_memory/Flash_Chip.h
// Function: NVM::FlashMemory::Flash_Chip::EndCMDXfer(NVM::FlashMemory::Flash_Command*)
void EndCMDXfer(Flash_Command* command)//End transferring write data to the Flash chip
			{
				this->STAT_totalXferTime += (Simulator->Time() - this->lastTransferStart);
				if (this->idleDieNo != die_no)
					STAT_totalOverlappedXferExecTime += (Simulator->Time() - lastTransferStart);
				this->Dies[command->Address[0].DieID]->STAT_TotalXferTime += (Simulator->Time() - lastTransferStart);

				start_command_execution(command);

				this->lastTransferStart = INVALID_TIME;
			}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq 0x98(%rbx), %rax
addq %rax, 0xe0(%rbx)
movl 0x3c(%rbx), %eax
cmpl 0x48(%rbx), %eax
je 0x392a4
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq 0x98(%rbx), %rax
addq %rax, 0xe8(%rbx)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq 0x98(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%r14), %rdx
movl 0x8(%rdx), %edx
movq (%rcx,%rdx,8), %rcx
addq %rax, 0x58(%rcx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e95e
orq $-0x1, 0x98(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/../nvm_chip/flash_memory/Flash_Chip.h
// Function: NVM::FlashMemory::Flash_Chip::EndDataOutXfer(NVM::FlashMemory::Flash_Command*)
void EndDataOutXfer(Flash_Command* command)
			{
				this->STAT_totalXferTime += (Simulator->Time() - this->lastTransferStart);
				if (this->idleDieNo != die_no)
					STAT_totalOverlappedXferExecTime += (Simulator->Time() - lastTransferStart);
				this->Dies[command->Address[0].DieID]->STAT_TotalXferTime += (Simulator->Time() - lastTransferStart);

				this->lastTransferStart = INVALID_TIME;
			}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq 0x98(%rbx), %rax
addq %rax, 0xe0(%rbx)
movl 0x3c(%rbx), %eax
cmpl 0x48(%rbx), %eax
je 0x393b8
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq 0x98(%rbx), %rax
addq %rax, 0xe8(%rbx)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq 0x98(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%r14), %rdx
movl 0x8(%rdx), %edx
movq (%rcx,%rdx,8), %rcx
addq %rax, 0x58(%rcx)
orq $-0x1, 0x98(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/NVM_PHY_ONFI_NVDDR2.h
// Function: SSD_Components::DieBookKeepingEntry::ClearCommand()
void ClearCommand()
		{
			delete ActiveCommand;
			ActiveCommand = NULL;
			ActiveTransactions.clear();
			Free = true;
		}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x39407
movq %r14, %rdi
callq 0x39ac6
movq %r14, %rdi
callq 0x7340
andq $0x0, (%rbx)
leaq 0x8(%rbx), %rdi
callq 0x27258
movb $0x1, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/NVM_PHY_ONFI_NVDDR2.cpp
// Function: SSD_Components::NVM_PHY_ONFI_NVDDR2::send_resume_command_to_chip(NVM::FlashMemory::Flash_Chip*, SSD_Components::ChipBookKeepingEntry*)
inline void NVM_PHY_ONFI_NVDDR2::send_resume_command_to_chip(NVM::FlashMemory::Flash_Chip* chip, ChipBookKeepingEntry* chipBKE)
	{
		//DEBUG2("Chip " << chip->ChannelID << ", " << chip->ChipID << ": resume command " )
		for (unsigned int i = 0; i < die_no_per_chip; i++) {
			DieBookKeepingEntry *dieBKE = &chipBKE->Die_book_keeping_records[i];
			//Since the time required to send the resume command is very small, MQSim ignores it to simplify the simulation
			dieBKE->PrepareResume();
			chipBKE->PrepareResume();
			chip->Resume(dieBKE->ActiveCommand->Address[0].DieID);
			switch (dieBKE->ActiveCommand->CommandCode) {
				case CMD_READ_PAGE:
				case CMD_READ_PAGE_MULTIPLANE:
				case CMD_READ_PAGE_COPYBACK:
				case CMD_READ_PAGE_COPYBACK_MULTIPLANE:
					chipBKE->Status = ChipStatus::READING;
					break;
				case CMD_PROGRAM_PAGE:
				case CMD_PROGRAM_PAGE_MULTIPLANE:
				case CMD_PROGRAM_PAGE_COPYBACK:
				case CMD_PROGRAM_PAGE_COPYBACK_MULTIPLANE:
					chipBKE->Status = ChipStatus::WRITING;
					break;
				case CMD_ERASE_BLOCK:
				case CMD_ERASE_BLOCK_MULTIPLANE:
					chipBKE->Status = ChipStatus::ERASING;
					break;
			}

		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movl 0x34(%r15), %eax
cmpq %rax, %r13
jae 0x394e1
movq 0x8(%rbx), %rbp
leaq (%r12,%rbp), %rdi
callq 0x39bcc
movb $0x0, 0x20(%rbx)
movq (%rbp,%r12), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %esi
movq %r14, %rdi
callq 0x1ec50
movq (%rbp,%r12), %rax
movq (%rax), %rax
cmpq $0x35, %rax
jbe 0x394bb
leaq -0x60d0(%rax), %rcx
cmpq $0x2, %rcx
jb 0x394d0
leaq -0x8010(%rax), %rcx
cmpq $0x2, %rcx
jb 0x394b7
pushq $0x4
popq %rcx
cmpq $0x321, %rax            # imm = 0x321
je 0x394d3
cmpq $0x85111, %rax          # imm = 0x85111
je 0x394b7
cmpq $0x8510, %rax           # imm = 0x8510
jne 0x394d5
pushq $0x5
jmp 0x394d2
movabsq $0x25000000000000, %rcx # imm = 0x25000000000000
btq %rax, %rcx
pushq $0x4
popq %rcx
jb 0x394d3
jmp 0x39482
pushq $0x6
popq %rcx
movl %ecx, (%rbx)
incq %r13
addq $0x68, %r12
jmp 0x39442
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/NVM_PHY_ONFI_NVDDR2.cpp
// Function: SSD_Components::NVM_PHY_ONFI_NVDDR2::transfer_read_data_from_chip(SSD_Components::ChipBookKeepingEntry*, SSD_Components::DieBookKeepingEntry*, SSD_Components::NVM_Transaction_Flash*)
inline void NVM_PHY_ONFI_NVDDR2::transfer_read_data_from_chip(ChipBookKeepingEntry* chipBKE, DieBookKeepingEntry* dieBKE, NVM_Transaction_Flash* tr)
	{
		//DEBUG2("Chip " << tr->Address.ChannelID << ", " << tr->Address.ChipID << ": transfer read data started for LPA: " << tr->LPA)
		dieBKE->ActiveTransfer = tr;
		channels[tr->Address.ChannelID]->Chips[tr->Address.ChipID]->StartDataOutXfer();
		chipBKE->Status = ChipStatus::DATA_OUT;
		Simulator->Register_sim_event(Simulator->Time() + NVDDR2DataOutTransferTime(tr->Data_and_metadata_size_in_byte, channels[tr->Address.ChannelID]),
			this, dieBKE, (int)NVDDR2_SimEventType::READ_DATA_TRANSFERRED);

		tr->STAT_transfer_time += NVDDR2DataOutTransferTime(tr->Data_and_metadata_size_in_byte, channels[tr->Address.ChannelID]);
		channels[tr->Address.ChannelID]->SetStatus(BusChannelStatus::BUSY, channels[tr->Address.ChannelID]->Chips[tr->Address.ChipID]);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq %rcx, 0x40(%rdx)
movq 0x88(%rdi), %rax
movl 0x38(%rcx), %ecx
movl 0x3c(%rbx), %edx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq (%rax,%rdx,8), %rdi
callq 0x39bb2
movl $0x3, (%r12)
callq 0x1f784
movq %rax, %r12
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %rsi
movl 0x38(%rbx), %ecx
movl 0x50(%rbx), %eax
movq 0x88(%r14), %rdx
movq (%rdx,%rcx,8), %rcx
xorl %edx, %edx
divl 0xd8(%rcx)
shrl %eax
imulq 0x20(%rcx), %rax
addq %rax, %rsi
movq %r12, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x1fb00
movl 0x50(%rbx), %eax
movq 0x88(%r14), %rcx
movl 0x38(%rbx), %edx
movl 0x3c(%rbx), %esi
movq (%rcx,%rdx,8), %rdi
xorl %edx, %edx
divl 0xd8(%rdi)
shrl %eax
imulq 0x20(%rdi), %rax
addq %rax, 0x30(%rbx)
movq 0x8(%rdi), %rax
movq (%rax,%rsi,8), %rdx
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x391c2
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/NVM_PHY_ONFI_NVDDR2.h
// Function: SSD_Components::DieBookKeepingEntry::PrepareResume()
void PrepareResume()
		{
			ActiveCommand = SuspendedCommand;
			Expected_finish_time = Simulator->Time() + RemainingExecTime;
			ActiveTransactions.insert(ActiveTransactions.begin(), SuspendedTransactions.begin(), SuspendedTransactions.end());
			Suspended = false;
			SuspendedCommand = NULL;
			SuspendedTransactions.clear();
			Free = false;
		}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq %rax, (%rdi)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
addq 0x58(%rbx), %rax
movq %rax, 0x50(%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x28(%rbx), %r14
movq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rcx
callq 0x39960
xorl %ebp, %ebp
movb %bpl, 0x49(%rbx)
andq $0x0, 0x20(%rbx)
movq %r14, %rdi
callq 0x27258
movb %bpl, 0x48(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::EnqueueRequest(SSD_Components::NVM_Transaction*)
void Queue_Probe::EnqueueRequest(NVM_Transaction* transaction)
	{
		if (transaction == NULL)
			PRINT_ERROR("Inserting a null object to queue!")

		currentObjectsInQueue[transaction] = Simulator->Time();
		nRequests++;
		nRequestsEpoch++;
		setCount(count + 1);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
testq %rsi, %rsi
je 0x3a72e
movq %rdi, %rbx
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %r14
leaq 0x80(%rbx), %rdi
movq %rsp, %rsi
callq 0x3b570
movq %r14, (%rax)
incq 0x8(%rbx)
incq 0x30(%rbx)
movl (%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0x3a770
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x278bb(%rip), %rbx     # 0x61ff0
leaq 0x9e4c(%rip), %rsi      # 0x44588
movq %rbx, %rdi
callq 0x7360
leaq 0xdcad(%rip), %rsi      # 0x483f8
movq %rbx, %rdi
callq 0x7360
movq %rax, %rdi
callq 0x71a0
movq 0x2786e(%rip), %rdi     # 0x61fd0
callq 0x73d0
pushq $0x1
popq %rdi
callq 0x73e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::setCount(int)
void Queue_Probe::setCount(int val)
	{
		sim_time_type n = Simulator->Time();
		states[count].totalTime += n - lastCountChange;
		statesEpoch[count].totalTime += n - lastCountChange;

		lastCountChange = n;
		count = val;
		if (count > maxQueueLength) {
			maxQueueLength = count;
		}
		while (count + 1 > states.size()) {
			states.push_back(StateStatistics());
		}
		states[count].nEnterances++;
		while (count + 1 > statesEpoch.size()) {
			statesEpoch.push_back(StateStatistics());
		}
		statesEpoch[count].nEnterances++;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %rdx
subq 0x20(%rbx), %rdx
movl (%rbx), %esi
movq 0x50(%rbx), %rcx
shlq $0x4, %rsi
addq %rdx, 0x8(%rcx,%rsi)
movq 0x68(%rbx), %rdi
addq %rdx, 0x8(%rdi,%rsi)
movq %rax, 0x20(%rbx)
movl %r14d, (%rbx)
cmpl %r14d, 0xb8(%rbx)
jae 0x3a7c6
movl %r14d, 0xb8(%rbx)
leaq 0x50(%rbx), %r12
leaq 0x68(%rbx), %r15
movq %rsp, %r13
leal 0x1(%r14), %eax
movq 0x58(%rbx), %rdx
subq %rcx, %rdx
sarq $0x4, %rdx
cmpq %rax, %rdx
jae 0x3a800
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3b414
movl (%rbx), %r14d
movq 0x50(%rbx), %rcx
jmp 0x3a7d1
movl %r14d, %eax
shlq $0x4, %rax
incq (%rcx,%rax)
movq %rsp, %r12
leal 0x1(%r14), %ecx
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
cmpq %rcx, %rdx
jae 0x3a83d
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3b414
movl (%rbx), %r14d
jmp 0x3a80e
movl %r14d, %ecx
shlq $0x4, %rcx
incq (%rax,%rcx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::DequeueRequest(SSD_Components::NVM_Transaction*)
void Queue_Probe::DequeueRequest(NVM_Transaction* transaction)
	{
		nDepartures++;
		nDeparturesEpoch++;

		if (transaction == NULL)
			throw std::logic_error("Object can not be null if accurateTimingEnabled=ture");
		sim_time_type et = currentObjectsInQueue[transaction];
		currentObjectsInQueue.erase(transaction);
		sim_time_type tc = Simulator->Time() - et;
		totalWaitingTime += tc;
		if (tc > maxWaitingTime)
			maxWaitingTime = tc;
		totalWaitingTimeEpoch += tc;
		setCount(count - 1);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
incq 0x10(%rdi)
incq 0x38(%rdi)
testq %rsi, %rsi
je 0x3a8d5
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b570
movq (%rax), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b8b4
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq %r12, %rax
addq %rax, 0x18(%rbx)
cmpq 0xc0(%rbx), %rax
jbe 0x3a8b9
movq %rax, 0xc0(%rbx)
addq %rax, 0x40(%rbx)
movl (%rbx), %esi
decl %esi
movq %rbx, %rdi
callq 0x3a770
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x71b0
movq %rax, %rbx
leaq 0xdb33(%rip), %rsi      # 0x4841a
movq %rax, %rdi
callq 0x74b0
movq 0x276ca(%rip), %rsi     # 0x61fc0
movq 0x27673(%rip), %rdx     # 0x61f70
movq %rbx, %rdi
callq 0x7590
movq %rax, %r14
movq %rbx, %rdi
callq 0x72a0
movq %r14, %rdi
callq 0x75d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::ResetEpochStatistics()
void Queue_Probe::ResetEpochStatistics()
	{
		nRequestsEpoch = 0;
		nDeparturesEpoch = 0;
		totalWaitingTimeEpoch = 0;
		epochStartTime = Simulator->Time();

		for(unsigned int i = 0; i < statesEpoch.size(); i++) {
			statesEpoch[i].totalTime = 0;
			statesEpoch[i].nEnterances = 0;
		}
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
andq $0x0, 0x40(%rdi)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
xorps %xmm0, %xmm0
movq %rax, 0x48(%rbx)
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
xorl %edx, %edx
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0x3a963
movq %rdx, %rsi
shlq $0x4, %rsi
incl %edx
movups %xmm0, (%rax,%rsi)
jmp 0x3a94d
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::AvgQueueLength()
double Queue_Probe::AvgQueueLength()
	{
		sim_time_type sum = 0;
		for (unsigned int len = 0; len < states.size(); len++)
			sum += states[len].totalTime * len;
		return (double)sum / (double)Simulator->Time();
	}

// Assembly:
subq $0x18, %rsp
movq 0x50(%rdi), %rax
movq 0x58(%rdi), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
xorl %edx, %edx
xorl %esi, %esi
movl %esi, %esi
cmpq %rsi, %rcx
jbe 0x3b01b
movq %rsi, %rdi
shlq $0x4, %rdi
movq %rsi, %r8
imulq 0x8(%rax,%rdi), %r8
addq %r8, %rdx
incl %esi
jmp 0x3affd
movq %rdx, %xmm0
punpckldq 0xa7a8(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa7b0(%rip), %xmm0     # 0x457e0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %xmm0
punpckldq 0xa775(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa77d(%rip), %xmm0     # 0x457e0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd (%rsp), %xmm0
divsd %xmm1, %xmm0
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::STDevQueueLength()
double Queue_Probe::STDevQueueLength()
	{
		sim_time_type sum = 0;
		for (unsigned int len = 0; len < states.size(); len++) {
			sum += states[len].totalTime * len;
		}
		double mean = (double)sum / (double)Simulator->Time();
		double stdev = 0.0;
		for (unsigned int len = 0; len < states.size(); len++) {
			stdev += std::pow((double)states[len].totalTime * len / (double)Simulator->Time() - mean, 2);
		}

		return std::sqrt(stdev);
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x50(%rdi), %rax
movq 0x58(%rdi), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
xorl %esi, %esi
xorl %edx, %edx
movl %esi, %esi
cmpq %rsi, %rcx
jbe 0x3b165
movq %rsi, %rdi
shlq $0x4, %rdi
movq %rsi, %r8
imulq 0x8(%rax,%rdi), %r8
addq %r8, %rdx
incl %esi
jmp 0x3b147
movq %rdx, %xmm0
punpckldq 0xa65e(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa666(%rip), %xmm0     # 0x457e0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %xmm0
punpckldq 0xa62b(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa633(%rip), %xmm0     # 0x457e0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd (%rsp), %xmm0
divsd %xmm1, %xmm0
movapd %xmm0, (%rsp)
xorl %eax, %eax
xorpd %xmm0, %xmm0
movl %eax, %r14d
movq 0x50(%rbx), %rax
movq 0x58(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %r14, %rcx
jbe 0x3b281
cvtsi2sd %r14, %xmm3
movq %r14, %rcx
shlq $0x4, %rcx
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rax,%rcx), %xmm1
movsd 0xa5c8(%rip), %xmm2     # 0x457d0
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa5cd(%rip), %xmm2     # 0x457e0
subpd %xmm2, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd %xmm3, %xmm0
movapd %xmm0, 0x20(%rsp)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %xmm0
punpckldq 0xa589(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa591(%rip), %xmm0     # 0x457e0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd 0x20(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd 0x18(%rsp), %xmm0
subsd (%rsp), %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm0
leal 0x1(%r14), %eax
jmp 0x3b1cd
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x3b297
sqrtsd %xmm0, %xmm0
addq $0x38, %rsp
popq %rbx
popq %r14
retq
addq $0x38, %rsp
popq %rbx
popq %r14
jmp 0x72c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::AvgQueueLengthEpoch()
double Queue_Probe::AvgQueueLengthEpoch()
	{
		sim_time_type sum = 0;
		sim_time_type sumTime = 0;
		for (unsigned int len = 0; len < states.size(); len++) {
			sum += statesEpoch[len].totalTime * len;
			sumTime += statesEpoch[len].totalTime;
		}

		return (double)sum / (double)(Simulator->Time() - epochStartTime);
	}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x58(%rdi), %rax
subq 0x50(%rdi), %rax
movq 0x68(%rdi), %rcx
sarq $0x4, %rax
xorl %edx, %edx
xorl %esi, %esi
movl %esi, %esi
cmpq %rsi, %rax
jbe 0x3b2de
movq %rsi, %rdi
shlq $0x4, %rdi
movq %rsi, %r8
imulq 0x8(%rcx,%rdi), %r8
addq %r8, %rdx
incl %esi
jmp 0x3b2c0
movq %rdx, %xmm0
punpckldq 0xa4e5(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa4ed(%rip), %xmm0     # 0x457e0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
subq 0x48(%rbx), %rax
movq %rax, %xmm0
punpckldq 0xa4ae(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa4b6(%rip), %xmm0     # 0x457e0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd (%rsp), %xmm0
divsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Stats.cpp
// Function: SSD_Components::Stats::Clear_stats(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
void Stats::Clear_stats(unsigned int channel_no, unsigned int chip_no_per_channel, unsigned int die_no_per_chip, unsigned int plane_no_per_die,
		unsigned int block_no_per_plane, unsigned int page_no_per_block, unsigned int max_allowed_block_erase_count)
	{
		for (unsigned int channel_cntr = 0; channel_cntr < channel_no; channel_cntr++) {
			for (unsigned int chip_cntr = 0; chip_cntr < chip_no_per_channel; chip_cntr++) {
				for (unsigned int die_cntr = 0; die_cntr < die_no_per_chip; die_cntr++) {
					for (unsigned int plane_cntr = 0; plane_cntr < plane_no_per_die; plane_cntr++) {
						delete[] Block_erase_histogram[channel_cntr][chip_cntr][die_cntr][plane_cntr];
					}
					delete[] Block_erase_histogram[channel_cntr][chip_cntr][die_cntr];
				}
				delete[] Block_erase_histogram[channel_cntr][chip_cntr];
			}
			delete[] Block_erase_histogram[channel_cntr];
		}
		delete[] Block_erase_histogram;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %eax
movq %rax, 0x8(%rsp)
movl %esi, %eax
movq %rax, 0x10(%rsp)
movl %edx, %r15d
movl %ecx, %r12d
xorl %r13d, %r13d
cmpq 0x8(%rsp), %r13
je 0x3be16
xorl %ebp, %ebp
cmpq 0x10(%rsp), %rbp
je 0x3bdf9
xorl %ebx, %ebx
cmpq %r15, %rbx
je 0x3bddb
xorl %r14d, %r14d
movq 0x27958(%rip), %rax     # 0x63700
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%rbx,8), %rdi
cmpq %r14, %r12
je 0x3bdcc
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x3bdc7
callq 0x7430
incq %r14
jmp 0x3bda1
testq %rdi, %rdi
je 0x3bdd6
callq 0x7430
incq %rbx
jmp 0x3bd99
movq 0x2791e(%rip), %rax     # 0x63700
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rdi
testq %rdi, %rdi
je 0x3bdf4
callq 0x7430
incq %rbp
jmp 0x3bd90
movq 0x27900(%rip), %rax     # 0x63700
movq (%rax,%r13,8), %rdi
testq %rdi, %rdi
je 0x3be0e
callq 0x7430
incq %r13
jmp 0x3bd83
movq 0x278e3(%rip), %rdi     # 0x63700
addq $0x18, %rsp
testq %rdi, %rdi
je 0x3be35
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7430
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/TSU_Base.cpp
// Function: SSD_Components::TSU_Base::TSU_Base(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, SSD_Components::FTL*, SSD_Components::NVM_PHY_ONFI_NVDDR2*, SSD_Components::Flash_Scheduling_Type, unsigned int, unsigned int, unsigned int, unsigned int, bool, bool, unsigned long, unsigned long, unsigned long)
TSU_Base::TSU_Base(const sim_object_id_type& id, FTL* ftl, NVM_PHY_ONFI_NVDDR2* NVMController, Flash_Scheduling_Type Type,
		unsigned int ChannelCount, unsigned int chip_no_per_channel, unsigned int DieNoPerChip, unsigned int PlaneNoPerDie,
		bool EraseSuspensionEnabled, bool ProgramSuspensionEnabled,
		sim_time_type WriteReasonableSuspensionTimeForRead,
		sim_time_type EraseReasonableSuspensionTimeForRead,
		sim_time_type EraseReasonableSuspensionTimeForWrite)
		: Sim_Object(id), ftl(ftl), _NVMController(NVMController), type(Type),
		channel_count(ChannelCount), chip_no_per_channel(chip_no_per_channel), die_no_per_chip(DieNoPerChip), plane_no_per_die(PlaneNoPerDie),
		eraseSuspensionEnabled(EraseSuspensionEnabled), programSuspensionEnabled(ProgramSuspensionEnabled),
		writeReasonableSuspensionTimeForRead(WriteReasonableSuspensionTimeForRead), eraseReasonableSuspensionTimeForRead(EraseReasonableSuspensionTimeForRead),
		eraseReasonableSuspensionTimeForWrite(EraseReasonableSuspensionTimeForWrite), opened_scheduling_reqs(0)
	{
		_my_instance = this;
		Round_robin_turn_of_channel = new flash_chip_ID_type[channel_count];
		for (unsigned int channelID = 0; channelID < channel_count; channelID++) {
			Round_robin_turn_of_channel[channelID] = 0;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movl %r8d, %r14d
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %rbx
movl 0x40(%rsp), %r13d
callq 0x11bca
leaq 0x25d2d(%rip), %rax     # 0x61b98
movq %rax, (%rbx)
movq %r12, 0x30(%rbx)
movq %r15, 0x38(%rbx)
movl %r14d, 0x40(%rbx)
movl %ebp, 0x44(%rbx)
movl %r13d, 0x48(%rbx)
movl 0x48(%rsp), %eax
movl %eax, 0x4c(%rbx)
movl 0x50(%rsp), %eax
movl %eax, 0x50(%rbx)
movb 0x58(%rsp), %al
movb %al, 0x54(%rbx)
movb 0x60(%rsp), %al
movb %al, 0x55(%rbx)
movups 0x68(%rsp), %xmm0
movups %xmm0, 0x58(%rbx)
movq 0x78(%rsp), %rax
movq %rax, 0x68(%rbx)
leaq 0x78(%rbx), %r14
movq %r14, 0x80(%rbx)
movq %r14, 0x78(%rbx)
andq $0x0, 0x88(%rbx)
leaq 0x90(%rbx), %r15
movq %r15, 0x98(%rbx)
movq %r15, 0x90(%rbx)
andq $0x0, 0xa0(%rbx)
andl $0x0, 0xa8(%rbx)
movq %rbx, 0x2ac77(%rip)     # 0x66b68
movl %ebp, %r12d
leaq (,%r12,4), %rdi
callq 0x7030
movq %rax, 0x70(%rbx)
xorl %ecx, %ecx
cmpq %r12, %rcx
jae 0x3bf15
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x3bf07
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movq %r15, %rdi
callq 0x27270
movq %r14, %rdi
callq 0x27270
movq %rbx, %rdi
callq 0x11c8c
movq %r12, %rdi
callq 0x75d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/TSU_Base.cpp
// Function: SSD_Components::TSU_Base::Setup_triggers()
void TSU_Base::Setup_triggers()
	{
		Sim_Object::Setup_triggers();
		_NVMController->ConnectToTransactionServicedSignal(handle_transaction_serviced_signal_from_PHY);
		_NVMController->ConnectToChannelIdleSignal(handle_channel_idle_signal);
		_NVMController->ConnectToChipIdleSignal(handle_chip_idle_signal);
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb $0x1, 0x28(%rdi)
movq 0x38(%rdi), %rdi
leaq 0x27(%rip), %rsi        # 0x3bfbe
callq 0x37414
movq 0x38(%rbx), %rdi
leaq 0x19(%rip), %rsi        # 0x3bfc0
callq 0x37458
movq 0x38(%rbx), %rdi
leaq 0x7b(%rip), %rsi        # 0x3c032
popq %rbx
jmp 0x37494
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/TSU_Base.cpp
// Function: SSD_Components::TSU_Base::handle_channel_idle_signal(unsigned int)
void TSU_Base::handle_channel_idle_signal(flash_channel_ID_type channelID)
	{
		for (unsigned int i = 0; i < _my_instance->chip_no_per_channel; i++) {
			//The TSU does not check if the chip is idle or not since it is possible to suspend a busy chip and issue a new command
			_my_instance->process_chip_requests(_my_instance->_NVMController->Get_chip(channelID, _my_instance->Round_robin_turn_of_channel[channelID]));
			_my_instance->Round_robin_turn_of_channel[channelID] = (flash_chip_ID_type)(_my_instance->Round_robin_turn_of_channel[channelID] + 1) % _my_instance->chip_no_per_channel;

			//A transaction has been started, so TSU should stop searching for another chip
			if (_my_instance->_NVMController->Get_channel_status(channelID) == BusChannelStatus::BUSY) {
				break;
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %r15d
pushq $-0x1
popq %rbp
movq 0x2ab92(%rip), %r14     # 0x66b68
incl %ebp
cmpl 0x48(%r14), %ebp
jae 0x3c027
movq 0x38(%r14), %rdi
movq 0x70(%r14), %rax
movl (%rax,%r15,4), %edx
movq (%rdi), %rax
movl %ebx, %esi
callq *0x30(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x3c220
movq 0x2ab64(%rip), %rcx     # 0x66b68
movq 0x70(%rcx), %rsi
movl (%rsi,%r15,4), %eax
incl %eax
xorl %edx, %edx
divl 0x48(%rcx)
movl %edx, (%rsi,%r15,4)
movq 0x38(%rcx), %rdi
movq (%rdi), %rax
movl %ebx, %esi
callq *0x28(%rax)
testl %eax, %eax
jne 0x3bfcf
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/TSU_OutofOrder.cpp
// Function: SSD_Components::TSU_OutOfOrder::service_erase_transaction(NVM::FlashMemory::Flash_Chip*)
bool TSU_OutOfOrder::service_erase_transaction(NVM::FlashMemory::Flash_Chip *chip)
{
	if (_NVMController->GetChipStatus(chip) != ChipStatus::IDLE)
	{
		return false;
	}

	Flash_Transaction_Queue *source_queue = &GCEraseTRQueue[chip->ChannelID][chip->ChipID];
	if (source_queue->size() == 0)
	{
		return false;
	}

	issue_command_to_chip(source_queue, NULL, Transaction_Type::ERASE, false);

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
testl %eax, %eax
je 0x3db04
xorl %eax, %eax
jmp 0x3db3b
movq 0xd0(%rbx), %rax
movl 0x2c(%r14), %ecx
movl 0x30(%r14), %edx
movq (%rax,%rcx,8), %rsi
imulq $0x108, %rdx, %rax      # imm = 0x108
cmpq $0x0, 0x18(%rsi,%rax)
je 0x3db00
addq %rax, %rsi
pushq $0x2
popq %rcx
movq %rbx, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x3c064
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe_Priorities.h
// Function: IO_Flow_Priority_Class::to_string[abi:cxx11](IO_Flow_Priority_Class::Priority)
static std::string to_string(Priority priority)
    {
        switch (priority)
        {
        case URGENT:
            return "URGENT";
        case HIGH:
            return "HIGH";
        case MEDIUM:
            return "MEDIUM";
        case LOW:
            return "LOW";
        default:
            return "";
        }
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x3, %esi
ja 0x3fc2f
movl %esi, %eax
leaq 0x8ade(%rip), %rcx      # 0x486cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x53cf(%rip), %rsi      # 0x44fcd
leaq 0xf(%rsp), %rdx
jmp 0x3fc3b
leaq 0x53cd(%rip), %rsi      # 0x44fd9
leaq 0xd(%rsp), %rdx
jmp 0x3fc3b
leaq 0x53c6(%rip), %rsi      # 0x44fe0
leaq 0xc(%rsp), %rdx
jmp 0x3fc3b
leaq 0x53ac(%rip), %rsi      # 0x44fd4
leaq 0xe(%rsp), %rdx
jmp 0x3fc3b
leaq 0x5cb5(%rip), %rsi      # 0x458eb
leaq 0xb(%rsp), %rdx
movq %rbx, %rdi
callq 0x7150
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/utils/CMRRandomGenerator.cpp
// Function: Utils::CMRRandomGenerator::CMRRandomGenerator(long, int)
CMRRandomGenerator::CMRRandomGenerator(int64_t n, int32_t e)
	{
		for (int i = 0; i <= 1; i++) {
			for (int j = 0; j <= 2; j++) {
				s[i][j] = init_s[i][j];
			}
		}
		Advance(n, e);
	}

// Assembly:
leaq 0x227c5(%rip), %rax     # 0x624d0
xorl %ecx, %ecx
movq %rdi, %r8
cmpq $0x2, %rcx
je 0x3fd42
xorl %r9d, %r9d
cmpq $0x3, %r9
je 0x3fd34
movsd (%rax,%r9,8), %xmm0
movsd %xmm0, (%r8,%r9,8)
incq %r9
jmp 0x3fd1d
incq %rcx
addq $0x18, %rax
addq $0x18, %r8
jmp 0x3fd10
nop