LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe.cpp
// Function: SSD_Components::Input_Stream_Manager_NVMe::Handle_new_arrived_request(SSD_Components::User_Request*)
inline void Input_Stream_Manager_NVMe::Handle_new_arrived_request(User_Request *request)
{
	((Input_Stream_NVMe *)input_streams[request->Stream_id])->Submission_head_informed_to_host++;
	if (((Input_Stream_NVMe *)input_streams[request->Stream_id])->Submission_head_informed_to_host == ((Input_Stream_NVMe *)input_streams[request->Stream_id])->Submission_queue_size)
	{ //Circular queue implementation
		((Input_Stream_NVMe *)input_streams[request->Stream_id])->Submission_head_informed_to_host = 0;
	}
	if (request->Type == UserRequestType::READ)
	{
		((Input_Stream_NVMe *)input_streams[request->Stream_id])->Waiting_user_requests.push_back(request);
		((Input_Stream_NVMe *)input_streams[request->Stream_id])->STAT_number_of_read_requests++;
		segment_user_request(request);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x68(%rsi), %eax
movq 0x10(%rdi), %rcx
movq (%rcx,%rax,8), %r12
movl 0x7c(%r12), %eax
incl %eax
xorl %ecx, %ecx
cmpw 0x68(%r12), %ax
cmovnel %eax, %ecx
movw %cx, 0x7c(%r12)
movl 0x64(%rsi), %ebp
leaq 0x88(%r12), %r15
movl $0x18, %edi
callq 0x73a0
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x7060
incq 0x98(%r12)
movzwl 0x68(%rbx), %eax
movq 0x10(%r14), %rcx
movq (%rcx,%rax,8), %rax
testl %ebp, %ebp
je 0x438b1
incl 0xc(%rax)
movq 0x8(%r14), %rax
movq 0x58(%rax), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
incl 0x8(%rax)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
movq 0x8(%r14), %r14
movq 0x68(%r14), %r15
cmpq 0x70(%r14), %r15
je 0x438da
movq %rbx, %rdi
callq *(%r15)
addq $0x8, %r15
jmp 0x438c8
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_SATA.cpp
// Function: SSD_Components::Input_Stream_SATA::~Input_Stream_SATA()
Input_Stream_SATA::~Input_Stream_SATA()
	{
		for (auto &user_request : Waiting_user_requests) {
			delete user_request;
		}
		for (auto &user_request : Completed_user_requests) {
			delete user_request;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x2abee(%rip), %rax     # 0x6e880
movq %rax, (%rdi)
leaq 0x78(%rdi), %r15
movq %rdi, (%rsp)
movq 0x78(%rdi), %r12
cmpq %r15, %r12
je 0x43ced
movq 0x10(%r12), %r14
testq %r14, %r14
je 0x43ce7
leaq 0x40(%r14), %r13
movq 0x40(%r14), %rdi
cmpq %r13, %rdi
je 0x43ccd
movq (%rdi), %rbp
callq 0x7370
movq %rbp, %rdi
cmpq %r13, %rbp
jne 0x43cbd
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x43cdf
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r12), %r12
jmp 0x43ca1
movq (%rsp), %rax
leaq 0x90(%rax), %r12
movq 0x90(%rax), %r13
cmpq %r12, %r13
je 0x43d4a
movq 0x10(%r13), %r14
testq %r14, %r14
je 0x43d44
leaq 0x40(%r14), %rbp
movq 0x40(%r14), %rdi
cmpq %rbp, %rdi
je 0x43d2a
movq (%rdi), %rbx
callq 0x7370
movq %rbx, %rdi
cmpq %rbp, %rbx
jne 0x43d1a
movq 0x8(%r14), %rdi
leaq 0x18(%r14), %rax
cmpq %rax, %rdi
je 0x43d3c
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq (%r13), %r13
jmp 0x43cff
movq (%rsp), %rax
leaq 0xa8(%rax), %r14
movq 0xa8(%rax), %rdi
cmpq %r14, %rdi
je 0x43d71
movq (%rdi), %r13
callq 0x7370
movq %r13, %rdi
cmpq %r14, %r13
jne 0x43d61
movq (%r12), %rdi
cmpq %r12, %rdi
je 0x43d8a
movq (%rdi), %r14
callq 0x7370
movq %r14, %rdi
cmpq %r12, %r14
jne 0x43d7a
movq (%r15), %rdi
cmpq %r15, %rdi
je 0x43da2
movq (%rdi), %r14
callq 0x7370
movq %r14, %rdi
cmpq %r15, %r14
jne 0x43d92
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_SATA.cpp
// Function: SSD_Components::Input_Stream_Manager_SATA::Input_Stream_Manager_SATA(SSD_Components::Host_Interface_Base*, unsigned short, unsigned long, unsigned long)
Input_Stream_Manager_SATA::Input_Stream_Manager_SATA(Host_Interface_Base* host_interface, uint16_t ncq_depth,
		LHA_type start_logical_sector_address, LHA_type end_logical_sector_address) :
		ncq_depth(ncq_depth), Input_Stream_Manager_Base(host_interface)
	{
		if (end_logical_sector_address < start_logical_sector_address) {
			PRINT_ERROR("Error in allocating address range to a stream in host interface: the start address should be smaller than the end address.")
		}
		Input_Stream_SATA* input_stream = new Input_Stream_SATA(start_logical_sector_address, end_logical_sector_address, 0, 0);
		this->input_streams.push_back(input_stream);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %r15
movq %rcx, %r12
movl %edx, %ebp
movq %rdi, %rbx
callq 0x411e6
leaq 0x2aba1(%rip), %rax     # 0x6e990
movq %rax, (%rbx)
movw %bp, 0x28(%rbx)
cmpq %r12, %r15
jb 0x43ec4
movl $0xc8, %edi
callq 0x73a0
movq %rax, %r14
movq %rax, %rdi
callq 0x40f48
leaq 0x2aa65(%rip), %rax     # 0x6e880
movq %rax, (%r14)
movq %r12, 0x48(%r14)
movq %r15, 0x50(%r14)
leaq 0x78(%r14), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%r14)
movups %xmm0, 0x62(%r14)
movq %rax, 0x80(%r14)
movq %rax, 0x78(%r14)
xorl %eax, %eax
movq %rax, 0x88(%r14)
leaq 0x90(%r14), %rcx
movq %rcx, 0x98(%r14)
movq %rcx, 0x90(%r14)
movq %rax, 0xa0(%r14)
movq %r14, %rcx
addq $0xa8, %rcx
movq %rcx, 0xb0(%r14)
movq %rcx, 0xa8(%r14)
movq %rax, 0xb8(%r14)
movw $0x0, 0xc0(%r14)
movq %r14, 0x8(%rsp)
movq 0x18(%rbx), %rsi
cmpq 0x20(%rbx), %rsi
je 0x43ea9
movq %r14, (%rsi)
addq $0x8, 0x18(%rbx)
jmp 0x43eb7
leaq 0x10(%rbx), %rdi
leaq 0x8(%rsp), %rdx
callq 0x43b48
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x2b125(%rip), %rdi     # 0x6eff0
leaq 0x126d6(%rip), %rsi     # 0x565a8
movl $0x6, %edx
callq 0x7400
movq 0x2b10d(%rip), %rdi     # 0x6eff0
leaq 0x15ff8(%rip), %rsi     # 0x59ee2
movl $0x7a, %edx
callq 0x7400
movq 0x2b0f5(%rip), %rdi     # 0x6eff0
callq 0x71c0
movq 0x2b0c9(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
jmp 0x43f27
jmp 0x43f27
movq %rax, %r15
movq %r14, %rdi
callq 0x7370
jmp 0x43f2a
movq %rax, %r15
movq %rbx, %rdi
callq 0x40f66
movq %r15, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_SATA.cpp
// Function: SSD_Components::Request_Fetch_Unit_SATA::Process_pcie_write_message(unsigned long, void*, unsigned int)
void Request_Fetch_Unit_SATA::Process_pcie_write_message(uint64_t address, void * payload, unsigned int payload_size)
	{
		Host_Interface_SATA* hi = (Host_Interface_SATA*)host_interface;
		uint64_t val = (uint64_t)payload;
		switch (address)
		{
			case NCQ_SUBMISSION_REGISTER:
				((Input_Stream_Manager_SATA*)(hi->input_stream_manager))->Submission_queue_tail_pointer_update((uint16_t)val);
				break;
			case NCQ_COMPLETION_REGISTER:
				((Input_Stream_Manager_SATA*)(hi->input_stream_manager))->Completion_queue_head_pointer_update((uint16_t)val);
				break;
			default:
				throw std::invalid_argument("Unknown register is written in Request_Fetch_Unit_SATA!");
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x8(%rdi), %rax
cmpq $0x1003, %rsi           # imm = 0x1003
je 0x441b4
cmpq $0x1000, %rsi           # imm = 0x1000
jne 0x44234
movq 0x50(%rax), %r15
movq 0x10(%r15), %rax
movq (%rax), %rax
movw %dx, 0x6c(%rax)
movq 0x8(%r15), %rax
movq 0x58(%rax), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x10(%rax)
movq 0x10(%r15), %rax
movq (%rax), %rax
incw 0xc0(%rax)
addq $0x68, %rax
jmp 0x4421a
movq 0x50(%rax), %r15
movq 0x10(%r15), %rax
movq (%rax), %rax
movw %dx, 0x6e(%rax)
movq 0xa0(%rax), %rcx
testq %rcx, %rcx
je 0x4422e
movq 0x90(%rax), %rbx
movq 0x10(%rbx), %r14
decq %rcx
movq %rcx, 0xa0(%rax)
movq %rbx, %rdi
callq 0x7580
movq %rbx, %rdi
callq 0x7370
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
movq 0x58(%rax), %rdi
movq (%rcx), %rax
movzwl 0x6a(%rax), %edx
movq %r14, %rsi
callq 0x444ce
movq 0x10(%r15), %rax
movq (%rax), %rax
addq $0x70, %rax
movl (%rax), %ecx
incl %ecx
movw %cx, (%rax)
xorl %edx, %edx
cmpw 0x28(%r15), %cx
cmovnel %ecx, %edx
movw %dx, (%rax)
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x16014(%rip), %rsi     # 0x5a25c
movq %rax, %rdi
callq 0x7680
movq 0x2ad71(%rip), %rsi     # 0x6efc8
movq 0x2ad52(%rip), %rdx     # 0x6efb0
movq %rbx, %rdi
callq 0x75e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x10, %edi
callq 0x73a0
movq %rax, %r14
movl $0x0, (%rax)
movq $0x0, 0x8(%rax)
leaq 0x10(%rbx), %r15
movl $0x18, %edi
callq 0x73a0
movq %r14, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x7060
incq 0x20(%rbx)
movq 0x8(%rbx), %rdi
movq 0x50(%rdi), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movzwl 0x68(%rax), %ecx
leaq (%rcx,%rcx,8), %rsi
shll $0x3, %esi
addq 0x58(%rax), %rsi
movl $0x48, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x4110c
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x10, %edi
callq 0x73a0
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
movq %r15, %rdi
movq %rax, %rdx
movl $0x10, %ecx
callq 0x41150
movl 0x2c(%rbx), %eax
incl %eax
movl %eax, 0x2c(%rbx)
movzwl 0x30(%rbx), %ecx
xorl %edx, %edx
divl %ecx
testl %edx, %edx
jne 0x44556
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_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 0x4110a
cmpq $0x0, 0x50(%rbx)
je 0x44672
cmpq $0x0, 0x58(%rbx)
je 0x44690
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x15913(%rip), %rsi     # 0x59f99
movq %rax, %rdi
callq 0x7500
jmp 0x446ac
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x15928(%rip), %rsi     # 0x59fcc
movq %rax, %rdi
callq 0x7500
movq 0x2a90d(%rip), %rsi     # 0x6efc0
movq 0x2a8ce(%rip), %rdx     # 0x6ef88
movq %rbx, %rdi
callq 0x75e0
jmp 0x446c4
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/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 %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rax
movq (%rax), %r12
movzwl 0x6a(%r12), %eax
incl %eax
movw %ax, 0x6a(%r12)
xorl %ecx, %ecx
cmpw 0x28(%rdi), %ax
cmovnel %eax, %ecx
movq %rsi, %rbx
movw %cx, 0x6a(%r12)
movl 0x64(%rsi), %ebp
leaq 0x78(%r12), %r15
movl $0x18, %edi
callq 0x73a0
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x7060
incq 0x88(%r12)
movq 0x10(%r14), %rax
movq (%rax), %rax
testl %ebp, %ebp
je 0x454eb
incl 0xc(%rax)
movq 0x8(%r14), %rax
movq 0x58(%rax), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
incl 0x8(%rax)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
movq 0x8(%r14), %r14
movq 0x68(%r14), %r15
cmpq 0x70(%r14), %r15
je 0x45514
movq %rbx, %rdi
callq *(%r15)
addq $0x8, %r15
jmp 0x45502
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/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 0x40(%rdi), %r15
cmpq 0x48(%rdi), %r15
je 0x45817
movq %rdi, %r14
movq %rbx, %rdi
callq *(%r15)
addq $0x8, %r15
cmpq 0x48(%r14), %r15
jne 0x45807
testq %rbx, %rbx
je 0x45829
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x7370
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
movl 0x34(%rdi), %ecx
testq %rcx, %rcx
je 0x4636a
movzwl (%rsi), %edx
movl 0x38(%rsi), %eax
movl 0x3c(%rsi), %esi
movq 0x90(%rdi), %rdi
movq (%rdi,%rax,8), %rax
shlq $0x7, %rsi
movq 0x8(%rax,%rsi), %rsi
xorl %edi, %edi
imulq $0x68, %rdi, %r8
addq %rsi, %r8
addq $0x8, %r8
movq %r8, %r9
movq (%r9), %r9
cmpq %r8, %r9
je 0x4635d
movq 0x10(%r9), %r10
cmpw %dx, (%r10)
cmoveq %r10, %rax
jne 0x46347
cmpq %r8, %r9
jne 0x4636c
incq %rdi
cmpq %rcx, %rdi
jne 0x46339
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x50(%rdi), %r14
movq %rax, 0x20(%rdi)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
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 0x48432
movb $0x1, 0x49(%rbx)
movq $0x0, (%rbx)
movq 0x8(%rbx), %rdi
cmpq %r14, %rdi
je 0x47e09
movq (%rdi), %r15
callq 0x7370
movq %r15, %rdi
cmpq %r14, %r15
jne 0x47df9
movq %r14, 0x10(%rbx)
movq %r14, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
movb $0x1, 0x48(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x47e4c
cmpq %rdx, 0x18(%rbx)
jne 0x47e63
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 0x27186(%rip), %r14     # 0x6eff0
leaq 0xe737(%rip), %rsi      # 0x565a8
movq %r14, %rdi
callq 0x7390
leaq 0x1256c(%rip), %rsi     # 0x5a3ec
movq %r14, %rdi
callq 0x7390
movl (%rbx), %esi
movq %rax, %rdi
callq 0x74c0
leaq 0x1264d(%rip), %rsi     # 0x5a4e6
movq %rax, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x27120(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x281b4
movq %rax, %rdi
callq 0x285a6
subq 0x98(%rbx), %rax
addq %rax, 0xe0(%rbx)
movl 0x3c(%rbx), %eax
cmpl 0x48(%rbx), %eax
je 0x47f08
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
subq 0x98(%rbx), %rax
addq %rax, 0xe8(%rbx)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
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 0x26e1e
movq $-0x1, 0x98(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x281b4
movq %rax, %rdi
callq 0x285a6
subq 0x98(%rbx), %rax
addq %rax, 0xe0(%rbx)
movl 0x3c(%rbx), %eax
cmpl 0x48(%rbx), %eax
je 0x48024
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
subq 0x98(%rbx), %rax
addq %rax, 0xe8(%rbx)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
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 $-0x1, 0x98(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x48092
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0x4807c
callq 0x7370
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x4808a
callq 0x7370
movq %r14, %rdi
callq 0x7370
movq $0x0, (%rbx)
leaq 0x8(%rbx), %r14
movq 0x8(%rbx), %rdi
cmpq %r14, %rdi
je 0x480b6
movq (%rdi), %r15
callq 0x7370
movq %r15, %rdi
cmpq %r14, %r15
jne 0x480a6
movq %r14, 0x10(%rbx)
movq %r14, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
movb $0x1, 0x48(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
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), %r13
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
movq %rax, 0x98(%r13)
movl $0x3, (%r12)
callq 0x281b4
movq %rax, %r12
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
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 0x285aa
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
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x47e24
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq %rax, (%rdi)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
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 0x48432
movb $0x0, 0x49(%rbx)
movq $0x0, 0x20(%rbx)
movq 0x28(%rbx), %rdi
cmpq %r14, %rdi
je 0x485a5
movq (%rdi), %r15
callq 0x7370
movq %r15, %rdi
cmpq %r14, %r15
jne 0x48595
movq %r14, 0x30(%rbx)
movq %r14, 0x28(%rbx)
movq $0x0, 0x38(%rbx)
movb $0x0, 0x48(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x490ea
movq %rdi, %rbx
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
movq %rax, %r14
leaq 0x80(%rbx), %rdi
movq %rsp, %rsi
callq 0x4a648
movq %r14, (%rax)
incq 0x8(%rbx)
incq 0x30(%rbx)
movl (%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0x4912e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x25eff(%rip), %rbx     # 0x6eff0
leaq 0xd4b0(%rip), %rsi      # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x11421(%rip), %rsi     # 0x5a528
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x25eb2(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
movq %rax, %rcx
subq 0x20(%rbx), %rcx
movl (%rbx), %edx
movq 0x50(%rbx), %rsi
shlq $0x4, %rdx
addq %rcx, 0x8(%rsi,%rdx)
movq 0x68(%rbx), %rsi
addq %rcx, 0x8(%rsi,%rdx)
movq %rax, 0x20(%rbx)
movl %ebp, (%rbx)
cmpl %ebp, 0xb8(%rbx)
jae 0x4917d
movl %ebp, 0xb8(%rbx)
movl (%rbx), %eax
leal 0x1(%rax), %edx
movq 0x58(%rbx), %rsi
movq 0x50(%rbx), %rcx
movq %rsi, %rdi
subq %rcx, %rdi
sarq $0x4, %rdi
cmpq %rdx, %rdi
jae 0x491e1
leaq 0x50(%rbx), %r14
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%rsp)
cmpq 0x60(%rbx), %rsi
je 0x491b7
movups %xmm0, (%rsi)
addq $0x10, 0x58(%rbx)
jmp 0x491c5
movq %r14, %rdi
movq %r15, %rdx
callq 0x4a510
xorps %xmm0, %xmm0
movl (%rbx), %eax
leal 0x1(%rax), %edx
movq 0x58(%rbx), %rsi
movq 0x50(%rbx), %rcx
movq %rsi, %rdi
subq %rcx, %rdi
sarq $0x4, %rdi
cmpq %rdx, %rdi
jb 0x491a3
movl %eax, %eax
shlq $0x4, %rax
incq (%rcx,%rax)
movl (%rbx), %eax
leal 0x1(%rax), %edx
movq 0x70(%rbx), %rsi
movq 0x68(%rbx), %rcx
movq %rsi, %rdi
subq %rcx, %rdi
sarq $0x4, %rdi
cmpq %rdx, %rdi
jae 0x4924f
leaq 0x68(%rbx), %r14
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%rsp)
cmpq 0x78(%rbx), %rsi
je 0x49225
movups %xmm0, (%rsi)
addq $0x10, 0x70(%rbx)
jmp 0x49233
movq %r14, %rdi
movq %r15, %rdx
callq 0x4a510
xorps %xmm0, %xmm0
movl (%rbx), %eax
leal 0x1(%rax), %edx
movq 0x70(%rbx), %rsi
movq 0x68(%rbx), %rcx
movq %rsi, %rdi
subq %rcx, %rdi
sarq $0x4, %rdi
cmpq %rdx, %rdi
jb 0x49211
movl %eax, %eax
shlq $0x4, %rax
incq (%rcx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x492e3
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4a648
movq (%rax), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x4a902
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
subq %r12, %rax
addq %rax, 0x18(%rbx)
cmpq 0xc0(%rbx), %rax
jbe 0x492c7
movq %rax, 0xc0(%rbx)
addq %rax, 0x40(%rbx)
movl (%rbx), %esi
decl %esi
movq %rbx, %rdi
callq 0x4912e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x11253(%rip), %rsi     # 0x5a54a
movq %rax, %rdi
callq 0x7500
movq 0x25cba(%rip), %rsi     # 0x6efc0
movq 0x25c7b(%rip), %rdx     # 0x6ef88
movq %rbx, %rdi
callq 0x75e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O1/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)
movq $0x0, 0x40(%rdi)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
xorps %xmm0, %xmm0
movq 0x68(%rbx), %rcx
movq 0x70(%rbx), %rdx
movq %rax, 0x48(%rbx)
subq %rcx, %rdx
je 0x4937b
sarq $0x4, %rdx
movl $0x1, %eax
xorl %esi, %esi
shlq $0x4, %rsi
movups %xmm0, (%rcx,%rsi)
movl %eax, %edi
incl %eax
movq %rdi, %rsi
cmpq %rdi, %rdx
ja 0x49367
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
je 0x4a0d7
sarq $0x4, %rcx
addq $0x8, %rax
xorl %edx, %edx
xorl %esi, %esi
movq (%rax), %rdi
imulq %rdx, %rdi
addq %rdi, %rsi
incq %rdx
movl %edx, %edi
addq $0x10, %rax
cmpq %rdi, %rcx
ja 0x4a097
movq %rsi, %xmm0
punpckldq 0xd804(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd80c(%rip), %xmm0     # 0x578d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
jmp 0x4a0e0
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
movq %rax, %xmm0
punpckldq 0xd7c6(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd7ce(%rip), %xmm0     # 0x578d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd (%rsp), %xmm0
divsd %xmm1, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movq %rdi, %rbx
movq 0x50(%rdi), %rax
movq 0x58(%rdi), %rcx
xorpd %xmm1, %xmm1
subq %rax, %rcx
je 0x4a236
sarq $0x4, %rcx
addq $0x8, %rax
xorl %edx, %edx
xorl %esi, %esi
movq (%rax), %rdi
imulq %rdx, %rdi
addq %rdi, %rsi
incq %rdx
movl %edx, %edi
addq $0x10, %rax
cmpq %rdi, %rcx
ja 0x4a1fd
movq %rsi, %xmm0
punpckldq 0xd69e(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd6a6(%rip), %xmm0     # 0x578d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
movapd (%rsp), %xmm2
xorpd %xmm0, %xmm0
movq 0x50(%rbx), %rcx
cmpq %rcx, 0x58(%rbx)
je 0x4a347
movq %rax, %xmm0
punpckldq 0xd654(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd65c(%rip), %xmm0     # 0x578d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm2
xorpd %xmm0, %xmm0
xorl %eax, %eax
xorl %r14d, %r14d
movapd %xmm2, (%rsp)
movsd %xmm0, 0x20(%rsp)
shlq $0x4, %rax
movsd 0x8(%rcx,%rax), %xmm2
movsd 0xd616(%rip), %xmm0     # 0x578c0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movapd 0xd61b(%rip), %xmm0     # 0x578d0
subpd %xmm0, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
movl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
movapd (%rsp), %xmm2
movq %rax, %xmm0
punpckldq 0xd5c7(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd5cf(%rip), %xmm0     # 0x578d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x18(%rsp), %xmm3
divsd %xmm1, %xmm3
movsd 0x20(%rsp), %xmm0
subsd %xmm2, %xmm3
mulsd %xmm3, %xmm3
incl %r14d
movq 0x50(%rbx), %rcx
movq 0x58(%rbx), %rdx
addsd %xmm3, %xmm0
subq %rcx, %rdx
sarq $0x4, %rdx
movq %r14, %rax
cmpq %r14, %rdx
ja 0x4a292
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x4a35d
sqrtsd %xmm0, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r14
retq
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x72f0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x50(%rdi), %rcx
subq %rcx, %rax
je 0x4a3cf
sarq $0x4, %rax
movq 0x68(%rbx), %rcx
addq $0x8, %rcx
xorl %edx, %edx
xorl %esi, %esi
movq (%rcx), %rdi
imulq %rdx, %rdi
addq %rdi, %rsi
incq %rdx
movl %edx, %edi
addq $0x10, %rcx
cmpq %rdi, %rax
ja 0x4a38f
movq %rsi, %xmm0
punpckldq 0xd50c(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd514(%rip), %xmm0     # 0x578d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, (%rsp)
jmp 0x4a3d8
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
subq 0x48(%rbx), %rax
movq %rax, %xmm0
punpckldq 0xd4ca(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xd4d2(%rip), %xmm0     # 0x578d0
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_O1/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 $0x28, %rsp
movl %ecx, 0x14(%rsp)
movl %edx, 0x10(%rsp)
movl %esi, 0xc(%rsp)
testl %edi, %edi
je 0x4ae89
movl %edi, %eax
movq %rax, 0x18(%rsp)
movl 0xc(%rsp), %eax
movq %rax, 0x20(%rsp)
movl 0x10(%rsp), %r13d
movl 0x14(%rsp), %r15d
xorl %r14d, %r14d
cmpl $0x0, 0xc(%rsp)
je 0x4ae66
xorl %ebp, %ebp
cmpl $0x0, 0x10(%rsp)
je 0x4ae3f
xorl %r12d, %r12d
cmpl $0x0, 0x14(%rsp)
je 0x4ae1a
xorl %ebx, %ebx
movq 0x25938(%rip), %rax     # 0x70730
movq (%rax,%r14,8), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0x4ae12
callq 0x7480
incq %rbx
cmpq %rbx, %r15
jne 0x4adf1
movq 0x2590f(%rip), %rax     # 0x70730
movq (%rax,%r14,8), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r12,8), %rdi
testq %rdi, %rdi
je 0x4ae37
callq 0x7480
incq %r12
cmpq %r13, %r12
jne 0x4ade8
movq 0x258ea(%rip), %rax     # 0x70730
movq (%rax,%r14,8), %rax
movq (%rax,%rbp,8), %rdi
testq %rdi, %rdi
je 0x4ae58
callq 0x7480
incq %rbp
cmpq 0x20(%rsp), %rbp
jne 0x4adde
movq 0x258c3(%rip), %rax     # 0x70730
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x4ae7b
callq 0x7480
incq %r14
cmpq 0x18(%rsp), %r14
jne 0x4add1
movq 0x258a0(%rip), %rdi     # 0x70730
addq $0x28, %rsp
testq %rdi, %rdi
je 0x4aea8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7480
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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        # 0x4b0de
callq 0x457c8
movq 0x38(%rbx), %rdi
leaq 0x19(%rip), %rsi        # 0x4b0e0
callq 0x45830
movq 0x38(%rbx), %rdi
leaq 0x89(%rip), %rsi        # 0x4b160
popq %rbx
jmp 0x45884
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x28aaa(%rip), %r14     # 0x73b98
cmpl $0x0, 0x48(%r14)
je 0x4b154
movl %edi, %ebx
movl %edi, %r15d
xorl %ebp, %ebp
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 0x4b466
movq 0x28a76(%rip), %rcx     # 0x73b98
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
je 0x4b154
incl %ebp
movq 0x28a4a(%rip), %r14     # 0x73b98
cmpl 0x48(%r14), %ebp
jb 0x4b0fc
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/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 0x4e4c4
xorl %eax, %eax
jmp 0x4e504
movq 0xd0(%rbx), %rax
movl 0x2c(%r14), %ecx
movl 0x30(%r14), %edx
movq (%rax,%rcx,8), %rsi
movq %rdx, %rax
shlq $0x8, %rax
leaq (%rax,%rdx,8), %rcx
cmpq $0x0, 0x18(%rsi,%rcx)
setne %al
je 0x4e504
addq %rcx, %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x4b192
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
cmpl $0x3, %esi
ja 0x5223b
movl %esi, %eax
leaq 0x8615(%rip), %rcx      # 0x5a7fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4e46(%rip), %rsi      # 0x5703d
leaq 0x4e45(%rip), %rdx      # 0x57043
jmp 0x5222e
leaq 0x4e42(%rip), %rsi      # 0x57049
leaq 0x4e41(%rip), %rdx      # 0x5704f
jmp 0x5222e
leaq 0x4e39(%rip), %rsi      # 0x57050
leaq 0x4e35(%rip), %rdx      # 0x57053
jmp 0x5222e
leaq 0x4e1d(%rip), %rsi      # 0x57044
leaq 0x4e1a(%rip), %rdx      # 0x57048
movq %rbx, %rdi
callq 0xb0c6
movq %rbx, %rax
popq %rbx
retq
leaq 0x5799(%rip), %rdx      # 0x579db
movq %rbx, %rdi
movq %rdx, %rsi
jmp 0x52231
nop
// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/utils/CMRRandomGenerator.cpp
// Function: Utils::CMRRandomGenerator::NextDouble()
double CMRRandomGenerator::NextDouble()
	{
		double p1 = mod(a12 * s[0][1] + a13 * s[0][0], m1);
		s[0][0] = s[0][1];
		s[0][1] = s[0][2];
		s[0][2] = p1;
		double p2 = mod(a21 * s[1][2] + a23 * s[1][0], m2);
		s[1][0] = s[1][1];
		s[1][1] = s[1][2];
		s[1][2] = p2;
		double p = p1 - p2;
		if (p < 0.0) {
			p += m1;
		}

		return (p + 1) * norm;
	}

// Assembly:
movsd 0x1ce40(%rip), %xmm1    # 0x6f4c8
movupd (%rdi), %xmm3
movupd 0x8(%rdi), %xmm2
movupd 0x20(%rdi), %xmm0
movsd 0x1ce42(%rip), %xmm4    # 0x6f4e0
movsd 0x1ce32(%rip), %xmm5    # 0x6f4d8
movupd %xmm2, (%rdi)
movhpd 0x1ce3e(%rip), %xmm4    # xmm4 = xmm4[0],mem[0]
movhpd 0x18(%rdi), %xmm3       # xmm3 = xmm3[0],mem[0]
mulpd %xmm4, %xmm3
movhpd 0x1ce25(%rip), %xmm5    # xmm5 = xmm5[0],mem[0]
shufpd $0x2, %xmm0, %xmm2      # xmm2 = xmm2[0],xmm0[1]
mulpd %xmm5, %xmm2
addpd %xmm3, %xmm2
movapd %xmm1, %xmm3
movhpd 0x1cdf4(%rip), %xmm3    # xmm3 = xmm3[0],mem[0]
movapd %xmm2, %xmm4
divpd %xmm3, %xmm4
cvttsd2si %xmm4, %rax
unpckhpd %xmm4, %xmm4            # xmm4 = xmm4[1,1]
cvttsd2si %xmm4, %rcx
xorps %xmm4, %xmm4
cvtsi2sd %rax, %xmm4
xorps %xmm5, %xmm5
cvtsi2sd %rcx, %xmm5
unpcklpd %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0]
mulpd %xmm3, %xmm4
subpd %xmm4, %xmm2
xorpd %xmm4, %xmm4
movapd %xmm2, %xmm5
cmpltpd %xmm4, %xmm5
addpd %xmm2, %xmm3
andpd %xmm5, %xmm3
andnpd %xmm2, %xmm5
orpd %xmm3, %xmm5
movlpd %xmm5, 0x10(%rdi)
movupd %xmm0, 0x18(%rdi)
pshufd $0xee, %xmm5, %xmm2     # xmm2 = xmm5[2,3,2,3]
subsd %xmm2, %xmm5
addsd %xmm5, %xmm1
xorpd %xmm3, %xmm3
movapd %xmm5, %xmm0
cmpltsd %xmm3, %xmm0
andpd %xmm0, %xmm1
andnpd %xmm5, %xmm0
orpd %xmm1, %xmm0
addsd 0x54ad(%rip), %xmm0     # 0x57c10
movlpd %xmm2, 0x28(%rdi)
mulsd 0x1cd50(%rip), %xmm0    # 0x6f4c0
retq
nop