LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Base.cpp
// Function: Host_Components::IO_Flow_Base::Start_simulation()
void IO_Flow_Base::Start_simulation()
	{
		next_logging_milestone = logging_period;
		if (enabled_logging) {
			log_file.open(logging_file_path, std::ofstream::out);
		}
		log_file << "SimulationTime(us)\t" << "ReponseTime(us)\t" << "EndToEndDelay(us)"<< std::endl;
		STAT_sum_device_response_time_short_term = 0;
		STAT_serviced_request_count_short_term = 0;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x228(%rdi), %rax
movq %rax, 0x230(%rdi)
cmpb $0x1, 0x220(%rdi)
jne 0x1e90a
leaq 0x258(%rbx), %rdi
leaq 0x238(%rbx), %rsi
movl $0x10, %edx
callq 0x71b0
leaq 0x258(%rbx), %r14
leaq 0x3909f(%rip), %rsi     # 0x579b7
movl $0x13, %edx
movq %r14, %rdi
callq 0x7400
leaq 0x3909f(%rip), %rsi     # 0x579cb
movl $0x10, %edx
movq %r14, %rdi
callq 0x7400
leaq 0x3909c(%rip), %rsi     # 0x579dc
movl $0x11, %edx
movq %r14, %rdi
callq 0x7400
movq 0x258(%rbx), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7380
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7290
movq $0x0, 0x458(%rbx)
movl $0x0, 0x468(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::~IO_Flow_Synthetic()
IO_Flow_Synthetic::~IO_Flow_Synthetic()
	{
		delete random_request_type_generator;
		delete random_address_generator;
		delete random_hot_cold_generator;
		delete random_hot_address_generator;
		delete random_request_size_generator;
		delete random_time_interval_generator;
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x4ba69(%rip), %rax     # 0x6dc70
movq %rax, (%rdi)
leaq 0x4bab7(%rip), %rax     # 0x6dcc8
movq %rax, 0x30(%rdi)
movq 0x480(%rdi), %rdi
callq 0x7370
movq 0x498(%rbx), %rdi
callq 0x7370
movq 0x4a8(%rbx), %rdi
callq 0x7370
movq 0x4b8(%rbx), %rdi
callq 0x7370
movq 0x4e8(%rbx), %rdi
callq 0x7370
movq 0x4f8(%rbx), %rdi
callq 0x7370
movq %rbx, %rdi
popq %rbx
jmp 0x1e6e0
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::NVMe_consume_io_request(Completion_Queue_Entry*)
void IO_Flow_Synthetic::NVMe_consume_io_request(Completion_Queue_Entry* io_request)
	{
		IO_Flow_Base::NVMe_consume_io_request(io_request);
		IO_Flow_Base::NVMe_update_and_submit_completion_queue_tail();
		if (generator_type == Utils::Request_Generator_Type::QUEUE_DEPTH) {
			Host_IO_Request* request = Generate_next_request();
			
			/* In the demand based execution mode, the Generate_next_request() function may return NULL
			* if 1) the simulation stop is met, or 2) the number of generated I/O requests reaches its threshold.*/
			if (request != NULL) {
				Submit_io_request(request);
			}
		}
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1ef0a
movq %rbx, %rdi
callq 0x1f922
cmpl $0x1, 0x4f4(%rbx)
jne 0x225fe
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testq %rax, %rax
je 0x225fe
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x1f77a
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::SATA_consume_io_request(Host_Components::Host_IO_Request*)
void IO_Flow_Synthetic::SATA_consume_io_request(Host_IO_Request* io_request)
	{
		IO_Flow_Base::SATA_consume_io_request(io_request);
		if (generator_type == Utils::Request_Generator_Type::QUEUE_DEPTH) {
			Host_IO_Request* request = Generate_next_request();
			/* In the demand based execution mode, the Generate_next_request() function may return NULL
			* if 1) the simulation stop is met, or 2) the number of generated I/O requests reaches its threshold.*/
			if (request != NULL) {
				Submit_io_request(request);
			}
		}
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1e996
cmpl $0x1, 0x4f4(%rbx)
jne 0x2262c
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testq %rax, %rax
je 0x2262c
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x1f77a
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::Start_simulation()
void IO_Flow_Synthetic::Start_simulation() 
	{
		IO_Flow_Base::Start_simulation();

		if (address_distribution == Utils::Address_Distribution_Type::STREAMING) {
			streaming_next_address = random_address_generator->Uniform_ulong(start_lsa_on_device, end_lsa_on_device);
			if (generate_aligned_addresses) {
				streaming_next_address -= streaming_next_address % alignment_value;
			}
		}

		if (generator_type == Utils::Request_Generator_Type::BANDWIDTH) {
			Simulator->Register_sim_event((sim_time_type)random_time_interval_generator->Exponential((double)Average_inter_arrival_time_nano_sec), this, 0, 0);
		} else {
			Simulator->Register_sim_event((sim_time_type)1, this, 0, 0);
		}
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x1e8d4
cmpl $0x1, 0x48c(%rbx)
jne 0x2267f
movq 0x498(%rbx), %rdi
movq 0x68(%rbx), %rsi
movq 0x70(%rbx), %rdx
callq 0x5333a
movq %rax, 0x4d0(%rbx)
cmpb $0x1, 0x514(%rbx)
jne 0x2267f
movq %rax, %rcx
movl 0x518(%rbx), %esi
xorl %edx, %edx
divq %rsi
subq %rdx, %rcx
movq %rcx, 0x4d0(%rbx)
movl 0x4f4(%rbx), %ebp
callq 0x28018
movq %rax, %r14
movl $0x1, %esi
testl %ebp, %ebp
jne 0x226e4
movsd 0x508(%rbx), %xmm1
unpcklps 0x3521b(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x35223(%rip), %xmm1    # 0x578d0
movq 0x4f8(%rbx), %rdi
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x533a4
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x32977(%rip), %xmm0    # 0x55050
cvttsd2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %rbp
jmp 0x2841e
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::Execute_simulator_event(MQSimEngine::Sim_Event*)
void IO_Flow_Synthetic::Execute_simulator_event(MQSimEngine::Sim_Event* event)
	{
		if (generator_type == Utils::Request_Generator_Type::BANDWIDTH) {
			Host_IO_Request* req = Generate_next_request();
			if (req != NULL) {
				Submit_io_request(req);
				Simulator->Register_sim_event(Simulator->Time() + (sim_time_type)random_time_interval_generator->Exponential((double)Average_inter_arrival_time_nano_sec), this, 0, 0);
			}
		} else {
			for (unsigned int i = 0; i < average_number_of_enqueued_requests; i++) {
				Submit_io_request(Generate_next_request());
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x4f4(%rdi)
je 0x2273f
cmpl $0x0, 0x510(%rbx)
je 0x227df
xorl %ebp, %ebp
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1f77a
incl %ebp
cmpl 0x510(%rbx), %ebp
jb 0x2271c
jmp 0x227df
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testq %rax, %rax
je 0x227df
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1f77a
callq 0x28018
movq %rax, %r14
callq 0x28018
movq %rax, %rdi
callq 0x2841a
movq %rax, %r15
movsd 0x508(%rbx), %xmm1
unpcklps 0x3513d(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x35145(%rip), %xmm1    # 0x578d0
movq 0x4f8(%rbx), %rdi
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x533a4
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x32899(%rip), %xmm0    # 0x55050
cvttsd2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
addq %r15, %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2841e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/../utils/StringTools.h
// Function: Utils::Helper_Functions::Tokenize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
static void Tokenize(const std::string& str, char delimiter, std::vector<std::string>& output_tokens_list)
		{
			int size = (int) str.size();
			int start = 0, end = 0;
			while (end < size) {
				if (str[end] == delimiter && start <= end) {
					output_tokens_list.push_back(std::string(str.substr(start, end - start + 1)));
					start = end + 1;
				}
				end++;
			}
			if (str[end - 1] != delimiter) {
				output_tokens_list.push_back(std::string(str.substr(start, end - start)));
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rdi), %r12
testl %r12d, %r12d
jle 0x23ca7
movq %r12, (%rsp)
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
xorl %eax, %eax
movq (%r14), %rcx
cmpb %bpl, (%rcx,%r13)
jne 0x23c99
movslq %eax, %rdx
cmpq %rdx, %r13
jl 0x23c99
movl %r13d, %eax
subl %edx, %eax
incl %eax
movslq %eax, %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x73c0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23d90
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x23c91
callq 0x7370
incq %r13
movl %r13d, %eax
jmp 0x23c9c
incq %r13
cmpq %r12, %r13
jne 0x23c4c
movq (%rsp), %rsi
jmp 0x23cab
xorl %eax, %eax
xorl %esi, %esi
movq (%r14), %rcx
movl %esi, %edx
cmpb %bpl, -0x1(%rcx,%rdx)
je 0x23ced
movslq %eax, %rdx
subl %edx, %esi
movslq %esi, %rcx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x73c0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23d90
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x23ced
callq 0x7370
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x23d17
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x23d21
callq 0x7370
movq %rbx, %rdi
callq 0x7620
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/PCIe_Link.cpp
// Function: Host_Components::PCIe_Link::Deliver(Host_Components::PCIe_Message*)
void PCIe_Link::Deliver(PCIe_Message* message)
	{
		switch (message->Destination) {
			case PCIe_Destination_Type::HOST://Message from SSD device to the host
				Message_buffer_toward_root_complex.push(message);
				if (Message_buffer_toward_root_complex.size() > 1) {//There are active transfers
					return;
				}
				Simulator->Register_sim_event(Simulator->Time() + estimate_transfer_time(message), this, (void*)(intptr_t)PCIe_Destination_Type::HOST, static_cast<int>(PCIe_Link_Event_Type::DELIVER));
				break;
			case PCIe_Destination_Type::DEVICE://Message from Host to the SSD device
				Message_buffer_toward_ssd_device.push(message);
				if (Message_buffer_toward_ssd_device.size() > 1) {
					return;
				}
				Simulator->Register_sim_event(Simulator->Time() + estimate_transfer_time(message), this, (void*)(intptr_t)PCIe_Destination_Type::DEVICE, static_cast<int>(PCIe_Link_Event_Type::DELIVER));
				break;
			default:
				break;
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movl (%rsi), %eax
cmpl $0x1, %eax
je 0x24682
testl %eax, %eax
jne 0x247ef
movq 0xe0(%rbx), %rax
movq 0xf0(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x246b7
movq %rsi, (%rax)
movq 0xe0(%rbx), %rax
addq $0x8, %rax
movq %rax, 0xe0(%rbx)
jmp 0x246cf
movq 0x90(%rbx), %rax
movq 0xa0(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x24755
movq %rsi, (%rax)
movq 0x90(%rbx), %rax
addq $0x8, %rax
movq %rax, 0x90(%rbx)
jmp 0x2476a
leaq 0xb0(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x24b82
movq 0xe0(%rbx), %rax
movq 0xd0(%rbx), %rcx
movq 0xf8(%rbx), %rdx
movq %rdx, %rsi
subq 0xd8(%rbx), %rsi
shrq $0x3, %rsi
cmpq $0x1, %rdx
adcq $-0x1, %rsi
subq 0xe8(%rbx), %rax
shlq $0x6, %rsi
sarq $0x3, %rax
subq 0xc0(%rbx), %rcx
sarq $0x3, %rcx
addq %rsi, %rcx
addq %rax, %rcx
cmpq $0x1, %rcx
ja 0x247ef
callq 0x28018
movq %rax, %r14
callq 0x28018
movq %rax, %rdi
callq 0x2841a
movq %rax, %r15
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2497c
addq %rax, %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
jmp 0x247e7
leaq 0x60(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x24b82
movq 0x90(%rbx), %rax
movq 0x80(%rbx), %rcx
movq 0xa8(%rbx), %rdx
movq %rdx, %rsi
subq 0x88(%rbx), %rsi
shrq $0x3, %rsi
cmpq $0x1, %rdx
adcq $-0x1, %rsi
subq 0x98(%rbx), %rax
shlq $0x6, %rsi
sarq $0x3, %rax
subq 0x70(%rbx), %rcx
sarq $0x3, %rcx
addq %rsi, %rcx
addq %rax, %rcx
cmpq $0x1, %rcx
ja 0x247ef
callq 0x28018
movq %rax, %r14
callq 0x28018
movq %rax, %rdi
callq 0x2841a
movq %rax, %r15
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2497c
addq %rax, %r15
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0x2841e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/PCIe_Link.cpp
// Function: Host_Components::PCIe_Link::Execute_simulator_event(MQSimEngine::Sim_Event*)
void PCIe_Link::Execute_simulator_event(MQSimEngine::Sim_Event* event)
	{
		PCIe_Message* message = NULL;
		PCIe_Destination_Type destination = (PCIe_Destination_Type)(intptr_t)event->Parameters;
		switch (destination) {
			case PCIe_Destination_Type::HOST:
				message = Message_buffer_toward_root_complex.front();
				Message_buffer_toward_root_complex.pop();
				root_complex->Consume_pcie_message(message);
				if (Message_buffer_toward_root_complex.size() > 0) {//There are active transfers
					Simulator->Register_sim_event(Simulator->Time() + estimate_transfer_time(Message_buffer_toward_root_complex.front()),
						this, (void*)(intptr_t)PCIe_Destination_Type::HOST, static_cast<int>(PCIe_Link_Event_Type::DELIVER));
				}
				break;
			case PCIe_Destination_Type::DEVICE:
				message = Message_buffer_toward_ssd_device.front();
				Message_buffer_toward_ssd_device.pop();
				pcie_switch->Deliver_to_device(message);
				if (Message_buffer_toward_ssd_device.size() > 0) {
					Simulator->Register_sim_event(Simulator->Time() + estimate_transfer_time(Message_buffer_toward_ssd_device.front()),
						this, (void*)(intptr_t)PCIe_Destination_Type::DEVICE, static_cast<int>(PCIe_Link_Event_Type::DELIVER));
				}
				break;
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rsi), %eax
cmpl $0x1, %eax
je 0x248ca
testl %eax, %eax
jne 0x24930
leaq 0xb0(%rbx), %rdi
movq 0xc0(%rbx), %rax
movq (%rax), %r14
callq 0x24d7a
movq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x249e6
movq 0xf8(%rbx), %rax
movq %rax, %rcx
subq 0xd8(%rbx), %rcx
shrq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
shlq $0x6, %rcx
movq 0xd0(%rbx), %rax
movq 0xe0(%rbx), %rdx
subq 0xe8(%rbx), %rdx
sarq $0x3, %rdx
addq %rcx, %rdx
subq 0xc0(%rbx), %rax
sarq $0x3, %rax
addq %rdx, %rax
je 0x24930
callq 0x28018
movq %rax, %r14
callq 0x28018
movq %rax, %rdi
callq 0x2841a
movq %rax, %r15
movq 0xc0(%rbx), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x2497c
addq %rax, %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
jmp 0x2496e
leaq 0x60(%rbx), %rdi
movq 0x70(%rbx), %rax
movq (%rax), %r14
callq 0x24d7a
movq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x24f4c
movq 0xa8(%rbx), %rax
movq %rax, %rcx
subq 0x88(%rbx), %rcx
shrq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
shlq $0x6, %rcx
movq 0x80(%rbx), %rax
movq 0x90(%rbx), %rdx
subq 0x98(%rbx), %rdx
sarq $0x3, %rdx
addq %rcx, %rdx
subq 0x70(%rbx), %rax
sarq $0x3, %rax
addq %rdx, %rax
jne 0x24936
popq %rbx
popq %r14
popq %r15
retq
callq 0x28018
movq %rax, %r14
callq 0x28018
movq %rax, %rdi
callq 0x2841a
movq %rax, %r15
movq 0x70(%rbx), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x2497c
addq %rax, %r15
movl $0x1, %ecx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %r15
jmp 0x2841e
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/PCIe_Link.h
// Function: Host_Components::PCIe_Link::estimate_transfer_time(Host_Components::PCIe_Message*)
sim_time_type estimate_transfer_time(PCIe_Message* message)
		{
			switch (message->Type) {
				case PCIe_Message_Type::READ_COMP:
				case PCIe_Message_Type::WRITE_REQ:
				{
					int total_transfered_bytes = (message->Payload_size / tlp_max_payload_size) * (tlp_max_payload_size + packet_overhead)
						+ (message->Payload_size % tlp_max_payload_size == 0 ? 0 : message->Payload_size % tlp_max_payload_size + packet_overhead);
					return (sim_time_type)(((double)((total_transfered_bytes / lane_count) + (total_transfered_bytes % lane_count == 0 ? 0 : 1))) / lane_bandwidth_GBPs);
				}
				case PCIe_Message_Type::READ_REQ:
					return (sim_time_type)((((packet_overhead + 4) / lane_count) + ((packet_overhead + 4) % lane_count == 0 ? 0 : 1)) / lane_bandwidth_GBPs);
			}
			
			return 0;
		}

// Assembly:
movl 0x4(%rsi), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jae 0x249a4
movl 0x10(%rsi), %eax
movl 0x50(%rdi), %esi
movl 0x5c(%rdi), %ecx
xorl %edx, %edx
divl %esi
addl %ecx, %esi
imull %esi, %eax
addl %edx, %ecx
testl %edx, %edx
cmovel %edx, %ecx
addl %eax, %ecx
jmp 0x249ae
testl %eax, %eax
jne 0x249e3
movl 0x5c(%rdi), %ecx
addl $0x4, %ecx
movl %ecx, %eax
cltd
idivl 0x48(%rdi)
cmpl $0x1, %edx
sbbl $-0x1, %eax
cvtsi2sd %eax, %xmm0
divsd 0x40(%rdi), %xmm0
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subsd 0x30679(%rip), %xmm0    # 0x55050
cvttsd2si %xmm0, %rax
andq %rdx, %rax
orq %rcx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/PCIe_Root_Complex.h
// Function: Host_Components::PCIe_Root_Complex::Consume_pcie_message(Host_Components::PCIe_Message*)
void Consume_pcie_message(PCIe_Message* messages)//Modern processors support DDIO, where all writes to memory are going through LLC
		{
			switch (messages->Type)
			{
			case PCIe_Message_Type::READ_REQ:
				Read_from_memory(messages->Address, (unsigned int)(intptr_t)messages->Payload);
				break;
			case PCIe_Message_Type::WRITE_REQ:
				Write_to_memory(messages->Address, messages->Payload);
				break;
			default:
				break;
			}
			delete messages;
		}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movl 0x4(%rsi), %eax
cmpl $0x1, %eax
je 0x24a04
testl %eax, %eax
jne 0x24a11
movq 0x18(%rbx), %rsi
movl 0x8(%rbx), %edx
callq 0x24ea0
jmp 0x24a11
movq 0x8(%rbx), %rdx
movq 0x18(%rbx), %rsi
callq 0x24dd4
movq %rbx, %rdi
popq %rbx
jmp 0x7370
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/PCIe_Root_Complex.cpp
// Function: Host_Components::PCIe_Root_Complex::Write_to_memory(unsigned long, void const*)
void PCIe_Root_Complex::Write_to_memory(const uint64_t address, const void* payload)
	{
		//This is a request to write back a read request data into memory (in modern systems the write is done to LLC)
		if (address >= DATA_MEMORY_REGION) {
			//nothing to do
		} else {
			switch (SSD_device_type) {
				case HostInterface_Types::NVME:
				{
					unsigned int flow_id = QUEUE_ID_TO_FLOW_ID(((Completion_Queue_Entry*)payload)->SQ_ID);
					((*IO_flows)[flow_id])->NVMe_consume_io_request((Completion_Queue_Entry*)payload);
					break;
				}
				case HostInterface_Types::SATA:
					sata_hba->SATA_consume_io_request((Completion_Queue_Entry*)payload);
					break;
				default:
					PRINT_ERROR("Uknown Host Interface type in PCIe_Root_Complex")
			}
		}
	}

// Assembly:
shrq $0x28, %rsi
cmpl $0xfe, %esi
jbe 0x24de1
retq
movl 0x8(%rdi), %eax
testl %eax, %eax
je 0x24e0a
cmpl $0x1, %eax
jne 0x24e16
movzwl 0xa(%rdx), %eax
decl %eax
movq 0x18(%rdi), %rcx
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
movq 0x28(%rax), %rax
movq %rdx, %rsi
jmpq *%rax
movq 0x10(%rdi), %rdi
movq %rdx, %rsi
jmp 0x2584a
pushq %rbx
movq 0x4a1d2(%rip), %rbx     # 0x6eff0
leaq 0x31783(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x331ae(%rip), %rsi     # 0x57fe2
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x4a185(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/PCIe_Root_Complex.cpp
// Function: Host_Components::PCIe_Root_Complex::Read_from_memory(unsigned long, unsigned int)
void PCIe_Root_Complex::Read_from_memory(const uint64_t address, const unsigned int read_size)
	{
		PCIe_Message* new_pcie_message = new Host_Components::PCIe_Message;
		new_pcie_message->Type = PCIe_Message_Type::READ_COMP;
		new_pcie_message->Destination = Host_Components::PCIe_Destination_Type::DEVICE;
		new_pcie_message->Address = address;

		//This is a request to read the data of a write request
		if (address >= DATA_MEMORY_REGION) {
			//nothing to do
			new_pcie_message->Payload_size = read_size;
			new_pcie_message->Payload = NULL;//No need to transfer data in the standalone mode of MQSim
		} else {
			switch (SSD_device_type) {
				case HostInterface_Types::NVME:
				{
					uint16_t flow_id = QUEUE_ID_TO_FLOW_ID(uint16_t(address >> NVME_COMP_Q_MEMORY_REGION));
					new_pcie_message->Payload = (*IO_flows)[flow_id]->NVMe_read_sqe(address);
					new_pcie_message->Payload_size = sizeof(Submission_Queue_Entry);
					break;
				}
				case HostInterface_Types::SATA:
					new_pcie_message->Payload = sata_hba->Read_ncq_entry(address);
					new_pcie_message->Payload_size = sizeof(Submission_Queue_Entry);
					break;
			}
		}

		pcie_link->Deliver(new_pcie_message);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movl $0x20, %edi
callq 0x73a0
movq %rax, %r14
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, (%r14)
movq %r15, 0x18(%r14)
movq %r15, %rax
shrq $0x28, %rax
cmpl $0xff, %eax
jb 0x24ee9
movl %ebp, 0x10(%r14)
movq $0x0, 0x8(%r14)
jmp 0x24f27
movl 0x8(%rbx), %ecx
testl %ecx, %ecx
je 0x24f0f
cmpl $0x1, %ecx
jne 0x24f27
decl %eax
movq 0x18(%rbx), %rcx
movzwl %ax, %eax
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rdi
movq %r15, %rsi
callq 0x1f5e6
jmp 0x24f1b
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x2591a
movq %rax, 0x8(%r14)
movl $0x48, 0x10(%r14)
movq (%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x24634
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/SATA_HBA.cpp
// Function: Host_Components::SATA_HBA::~SATA_HBA()
SATA_HBA::~SATA_HBA()
	{
		for (auto &req : sata_ncq.queue) {
			if (req.second) {
				delete req.second;
			}
		}
		for (auto &req : waiting_requests_for_submission) {
			if (req) {
				delete req;
			}
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x48b9b(%rip), %rax     # 0x6ddc8
movq %rax, (%rdi)
movq 0x88(%rdi), %r14
testq %r14, %r14
je 0x2524f
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x2524a
callq 0x7370
movq (%r14), %r14
jmp 0x25237
leaq 0xf8(%rbx), %r14
movq 0xf8(%rbx), %r15
cmpq %r14, %r15
je 0x25275
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x25270
callq 0x7370
movq (%r15), %r15
jmp 0x2525d
leaq 0x160(%rbx), %rdi
callq 0x25a00
leaq 0x110(%rbx), %rdi
callq 0x25a4a
movq 0xf8(%rbx), %rdi
cmpq %r14, %rdi
je 0x252a9
movq (%rdi), %r15
callq 0x7370
movq %r15, %rdi
cmpq %r14, %r15
jne 0x25299
movq 0xe0(%rbx), %rdi
testq %rdi, %rdi
je 0x252ba
callq 0x7370
leaq 0xb0(%rbx), %rdi
callq 0x21688
leaq 0x78(%rbx), %rdi
callq 0x21626
leaq 0x48792(%rip), %rax     # 0x6da68
movq %rax, (%rbx)
movq 0x8(%rbx), %rdi
addq $0x18, %rbx
cmpq %rbx, %rdi
je 0x252f0
popq %rbx
popq %r14
popq %r15
jmp 0x7370
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/host/SATA_HBA.cpp
// Function: Host_Components::SATA_HBA::Read_ncq_entry(unsigned long)
Submission_Queue_Entry* SATA_HBA::Read_ncq_entry(uint64_t address)
	{
		Submission_Queue_Entry* ncq_entry = new Submission_Queue_Entry;
		Host_IO_Request* request = request_queue_in_memory[(uint16_t)((address - sata_ncq.Submission_queue_memory_base_address) / sizeof(Submission_Queue_Entry))];
		
		if (request == NULL) {
			throw std::invalid_argument("SATA HBA: Request to access an NCQ entry that does not exist.");
		}

		ncq_entry->Command_Identifier = request->IO_queue_info;
		//For simplicity, MQSim's SATA host interface uses NVMe opcodes
		if (request->Type == Host_IO_Request_Type::READ) {
			ncq_entry->Opcode = NVME_READ_OPCODE;
			ncq_entry->Command_specific[0] = (uint32_t)request->Start_LBA;
			ncq_entry->Command_specific[1] = (uint32_t)(request->Start_LBA >> 32);
			ncq_entry->Command_specific[2] = ((uint32_t)((uint16_t)request->LBA_count)) & (uint32_t)(0x0000ffff);
			ncq_entry->PRP_entry_1 = (DATA_MEMORY_REGION);//Dummy addresses, just to emulate data read/write access
			ncq_entry->PRP_entry_2 = (DATA_MEMORY_REGION + 0x1000);//Dummy addresses
		} else {
			ncq_entry->Opcode = NVME_WRITE_OPCODE;
			ncq_entry->Command_specific[0] = (uint32_t)request->Start_LBA;
			ncq_entry->Command_specific[1] = (uint32_t)(request->Start_LBA >> 32);
			ncq_entry->Command_specific[2] = ((uint32_t)((uint16_t)request->LBA_count)) & (uint32_t)(0x0000ffff);
			ncq_entry->PRP_entry_1 = (DATA_MEMORY_REGION);//Dummy addresses, just to emulate data read/write access
			ncq_entry->PRP_entry_2 = (DATA_MEMORY_REGION + 0x1000);//Dummy addresses
		}

		return ncq_entry;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x48, %edi
callq 0x73a0
movq %rax, %rcx
subq 0x58(%r14), %rbx
movabsq $-0x1c71c71c71c71c71, %rdx # imm = 0xE38E38E38E38E38F
movq %rbx, %rax
mulq %rdx
movq 0xe0(%r14), %rax
shrl $0x3, %edx
andl $0x7fff8, %edx          # imm = 0x7FFF8
movq (%rax,%rdx), %rax
testq %rax, %rax
je 0x259a9
movzwl 0x20(%rax), %edx
movw %dx, 0x2(%rcx)
xorl %edx, %edx
cmpl $0x1, 0x1c(%rax)
adcb $0x1, %dl
movzwl 0x18(%rax), %esi
movq 0x10(%rax), %rax
movb %dl, (%rcx)
movl %eax, 0x30(%rcx)
shrq $0x20, %rax
movl %eax, 0x34(%rcx)
movl %esi, 0x38(%rcx)
movabsq $0xff0000000000, %rax   # imm = 0xFF0000000000
movq %rax, 0x20(%rcx)
orq $0x1000, %rax           # imm = 0x1000
movq %rax, 0x28(%rcx)
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x326a7(%rip), %rsi     # 0x58064
movq %rax, %rdi
callq 0x7680
movq 0x495fc(%rip), %rsi     # 0x6efc8
movq 0x495d5(%rip), %rdx     # 0x6efa8
movq %rbx, %rdi
callq 0x75e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/nvm_chip/flash_memory/Flash_Chip.cpp
// Function: NVM::FlashMemory::Flash_Chip::~Flash_Chip()
Flash_Chip::~Flash_Chip()
		{
			for (unsigned int dieID = 0; dieID < die_no; dieID++) {
				delete Dies[dieID];
			}
			delete[] Dies;
			delete[] _readLatency;
			delete[] _programLatency;
		}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x478d7(%rip), %rax     # 0x6de20
movq %rax, (%rdi)
cmpl $0x0, 0x48(%rdi)
je 0x2657d
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x2656a
movq %r14, %rdi
callq 0x262ec
movq %r14, %rdi
callq 0x7370
incq %r15
movl 0x48(%rbx), %eax
cmpq %rax, %r15
jb 0x26555
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x2658b
callq 0x7480
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x26599
callq 0x7480
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x265a7
callq 0x7480
movq 0xf0(%rbx), %rdi
testq %rdi, %rdi
je 0x265b8
callq 0x7370
leaq 0x474a9(%rip), %rax     # 0x6da68
movq %rax, (%rbx)
movq 0x8(%rbx), %rdi
addq $0x18, %rbx
cmpq %rbx, %rdi
je 0x265d9
popq %rbx
popq %r14
popq %r15
jmp 0x7370
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/nvm_chip/flash_memory/Flash_Chip.cpp
// Function: NVM::FlashMemory::Flash_Chip::Suspend(unsigned int)
void Flash_Chip::Suspend(flash_die_ID_type dieID)
		{
			STAT_totalExecTime += Simulator->Time() - executionStartTime;

			Die* targetDie = Dies[dieID];
			if (targetDie->Suspended) {
				PRINT_ERROR("Flash chip" << ID() << ": suspending a previously suspended flash chip! This is illegal.")
			}

			/*if (targetDie->CurrentCMD & CMD_READ != 0)
			throw "Suspend is not supported for read operations!";*/

			targetDie->RemainingSuspendedExecTime = targetDie->Expected_finish_time - Simulator->Time();
			Simulator->Ignore_sim_event(targetDie->CommandFinishEvent);//The simulator engine should not execute the finish event for the suspended command
			targetDie->CommandFinishEvent = NULL;

			targetDie->SuspendedCMD = targetDie->CurrentCMD;
			targetDie->CurrentCMD = NULL;
			targetDie->Suspended = true;
			STAT_totalSuspensionCount++;

			targetDie->Status = DieStatus::IDLE;
			this->idleDieNo++;
			if (this->idleDieNo == die_no) {
				this->status = Internal_Status::IDLE;
			}

			executionStartTime = INVALID_TIME;
			expectedFinishTime = INVALID_TIME;
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x28018
movq %rax, %rdi
callq 0x2841a
subq 0xa0(%rbx), %rax
addq %rax, 0xd8(%rbx)
movq 0x40(%rbx), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %r15
cmpb $0x1, 0x38(%r15)
je 0x26f2f
leaq 0xa0(%rbx), %r14
movq 0x18(%r15), %r12
callq 0x28018
movq %rax, %rdi
callq 0x2841a
subq %rax, %r12
movq %r12, 0x20(%r15)
callq 0x28018
movq 0x10(%r15), %rsi
movq %rax, %rdi
callq 0x2847e
xorl %eax, %eax
movq %rax, 0x10(%r15)
movq 0x28(%r15), %rcx
movq %rcx, 0x30(%r15)
movq %rax, 0x28(%r15)
movb $0x1, 0x38(%r15)
incq 0xc8(%rbx)
movl $0x1, 0xc(%r15)
movl 0x3c(%rbx), %eax
incl %eax
movl %eax, 0x3c(%rbx)
cmpl 0x48(%rbx), %eax
jne 0x26f19
movl $0x0, 0x38(%rbx)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%r14)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x480ba(%rip), %r14     # 0x6eff0
leaq 0x2f66b(%rip), %rsi     # 0x565a8
movl $0x6, %edx
movq %r14, %rdi
callq 0x7400
leaq 0x31189(%rip), %rsi     # 0x580da
movl $0xa, %edx
movq %r14, %rdi
callq 0x7400
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xaf32
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x7400
movq %rax, %rbx
leaq 0x311b5(%rip), %rsi     # 0x5814b
movl $0x40, %edx
movq %rax, %rdi
callq 0x7400
movq %rbx, %rdi
callq 0x71c0
movq %rsp, %rdi
callq 0x76b8
movq 0x48016(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x26fda
callq 0x7370
movq %rbx, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/nvm_chip/flash_memory/Flash_Chip.cpp
// Function: NVM::FlashMemory::Flash_Chip::Resume(unsigned int)
void Flash_Chip::Resume(flash_die_ID_type dieID)
		{
			Die* targetDie = Dies[dieID];
			if (!targetDie->Suspended) {
				PRINT_ERROR("Flash chip " << ID() << ": resume flash command is requested, but there is no suspended flash command!")
			}

			targetDie->CurrentCMD = targetDie->SuspendedCMD;
			targetDie->SuspendedCMD = NULL;
			targetDie->Suspended = false;
			STAT_totalResumeCount++;

			targetDie->Expected_finish_time = Simulator->Time() + targetDie->RemainingSuspendedExecTime;
			targetDie->CommandFinishEvent = Simulator->Register_sim_event(targetDie->Expected_finish_time,
				this, targetDie->CurrentCMD, static_cast<int>(Chip_Sim_Event_Type::COMMAND_FINISHED));
			if (targetDie->Expected_finish_time > this->expectedFinishTime) {
				this->expectedFinishTime = targetDie->Expected_finish_time;
			}

			targetDie->Status = DieStatus::BUSY;
			this->idleDieNo--;
			this->status = Internal_Status::BUSY;
			executionStartTime = Simulator->Time();
		}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %r14
cmpb $0x0, 0x38(%r14)
je 0x27097
movq 0x30(%r14), %rax
movq %rax, 0x28(%r14)
movq $0x0, 0x30(%r14)
movb $0x0, 0x38(%r14)
incq 0xd0(%rbx)
callq 0x28018
movq %rax, %rdi
callq 0x2841a
addq 0x20(%r14), %rax
movq %rax, 0x18(%r14)
callq 0x28018
movq 0x18(%r14), %rsi
movq 0x28(%r14), %rcx
movq %rax, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0x2841e
movq %rax, 0x10(%r14)
movq 0x18(%r14), %rax
cmpq 0xa8(%rbx), %rax
jbe 0x27067
movq %rax, 0xa8(%rbx)
movl $0x0, 0xc(%r14)
decl 0x3c(%rbx)
movl $0x1, 0x38(%rbx)
callq 0x28018
movq %rax, %rdi
callq 0x2841a
movq %rax, 0xa0(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x47f52(%rip), %r14     # 0x6eff0
leaq 0x2f503(%rip), %rsi     # 0x565a8
movl $0x6, %edx
movq %r14, %rdi
callq 0x7400
leaq 0x31006(%rip), %rsi     # 0x580bf
movl $0xb, %edx
movq %r14, %rdi
callq 0x7400
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xaf32
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x7400
movq %rax, %rbx
leaq 0x3108e(%rip), %rsi     # 0x5818c
movl $0x4d, %edx
movq %rax, %rdi
callq 0x7400
movq %rbx, %rdi
callq 0x71c0
movq %rsp, %rdi
callq 0x76b8
movq 0x47eae(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x27142
callq 0x7370
movq %rbx, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/nvm_chip/flash_memory/Flash_Chip.h
// Function: NVM::FlashMemory::Flash_Chip::Get_command_execution_latency(unsigned long, unsigned int)
sim_time_type Get_command_execution_latency(command_code_type CMDCode, flash_page_ID_type pageID)
			{
				int latencyType = 0;
				if (flash_technology == Flash_Technology_Type::MLC) {
					latencyType = pageID % 2;
				} else if (flash_technology == Flash_Technology_Type::TLC) {
					//From: Yaakobi et al., "Characterization and Error-Correcting Codes for TLC Flash Memories", ICNC 2012
					latencyType = (pageID <= 5) ? 0 : ((pageID <= 7) ? 1 : (((pageID - 8) >> 1) % 3));;
				}

				switch (CMDCode)
				{
					case CMD_READ_PAGE:
					case CMD_READ_PAGE_MULTIPLANE:
					case CMD_READ_PAGE_COPYBACK:
					case CMD_READ_PAGE_COPYBACK_MULTIPLANE:
						return _readLatency[latencyType] + _RBSignalDelayRead;
					case CMD_PROGRAM_PAGE:
					case CMD_PROGRAM_PAGE_MULTIPLANE:
					case CMD_PROGRAM_PAGE_COPYBACK:
					case CMD_PROGRAM_PAGE_COPYBACK_MULTIPLANE:
						return _programLatency[latencyType] + _RBSignalDelayWrite;
					case CMD_ERASE_BLOCK:
					case CMD_ERASE_BLOCK_MULTIPLANE:
						return _eraseLatency + _RBSignalDelayErase;
					default:
						throw std::invalid_argument("Unsupported command for flash chip.");
				}
			}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x34(%rdi), %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
je 0x27cfc
cmpl $0x2, %ecx
jne 0x27d0f
andl $0x1, %edx
movl %edx, %eax
jmp 0x27d0f
cmpl $0x6, %edx
jb 0x27d0f
movl $0x1, %eax
cmpl $0x8, %edx
jae 0x27d9f
cmpq $0x800f, %rsi           # imm = 0x800F
jg 0x27d36
cmpq $0x35, %rsi
jbe 0x27d66
leaq -0x60d0(%rsi), %rcx
cmpq $0x2, %rcx
jae 0x27d78
leaq 0x68(%rdi), %rcx
movl $0x90, %eax
jmp 0x27d90
leaq -0x8010(%rsi), %rcx
cmpq $0x2, %rcx
jb 0x27d55
cmpq $0x8510, %rsi           # imm = 0x8510
je 0x27d55
cmpq $0x85111, %rsi          # imm = 0x85111
jne 0x27db9
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x60(%rdi), %rcx
movl $0x88, %eax
jmp 0x27d90
movabsq $0x25000000000000, %rcx # imm = 0x25000000000000
btq %rsi, %rcx
jb 0x27d81
jmp 0x27d1e
cmpq $0x321, %rsi            # imm = 0x321
jne 0x27db9
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x58(%rdi), %rcx
movl $0x80, %eax
movq (%rdi,%rax), %rax
addq (%rcx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addl $-0x8, %edx
shrl %edx
imulq $0x55555556, %rdx, %rax # imm = 0x55555556
shrq $0x20, %rax
leal (%rax,%rax,2), %eax
subl %eax, %edx
jmp 0x27cf8
movl $0x10, %edi
callq 0x71d0
movq %rax, %rbx
leaq 0x30495(%rip), %rsi     # 0x58262
movq %rax, %rdi
callq 0x7680
movq 0x471ec(%rip), %rsi     # 0x6efc8
movq 0x471c5(%rip), %rdx     # 0x6efa8
movq %rbx, %rdi
callq 0x75e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x72c0
movq %r14, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/nvm_chip/flash_memory/Plane.cpp
// Function: NVM::FlashMemory::Plane::Plane(unsigned int, unsigned int)
Plane::Plane(unsigned int BlocksNoPerPlane, unsigned int PagesNoPerBlock) :
			Read_count(0), Progam_count(0), Erase_count(0)
		{
			Healthy_block_no = BlocksNoPerPlane;
			Blocks = new Block*[BlocksNoPerPlane];
			for (unsigned int i = 0; i < BlocksNoPerPlane; i++) {
				Blocks[i] = new Block(PagesNoPerBlock, i);
			}
			Allocated_streams = NULL;
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movl %esi, 0x8(%rdi)
movl %esi, %r13d
leaq (,%r13,8), %rdi
callq 0x7030
movq %rax, (%r14)
testl %ebp, %ebp
je 0x27f9b
xorl %r15d, %r15d
movl $0x10, %edi
callq 0x73a0
movq %rax, %r12
movq %rax, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0x261e8
movq (%r14), %rax
movq %r12, (%rax,%r15,8)
incq %r15
cmpq %r15, %r13
jne 0x27f72
movq $0x0, 0x28(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x7370
movq %rbx, %rdi
callq 0x7620
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/sim/Engine.cpp
// Function: MQSimEngine::Engine::Reset()
void Engine::Reset()
	{
		_EventList->Clear();
		_ObjectList.clear();
		_sim_time = 0;
		stop = false;
		started = false;
		Utils::Logical_Address_Partitioning_Unit::Reset();
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x290bc
leaq 0x10(%rbx), %rdi
callq 0x28518
movq $0x0, (%rbx)
movw $0x0, 0x48(%rbx)
popq %rbx
jmp 0x522b4
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/sim/Engine.cpp
// Function: MQSimEngine::Engine::GetObject(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Sim_Object* Engine::GetObject(sim_object_id_type object_id)
	{
		auto itr = _ObjectList.find(object_id);
		if (itr == _ObjectList.end()) {
			return NULL;
		}

		return (*itr).second;
	}

// Assembly:
pushq %rax
addq $0x10, %rdi
callq 0x28590
testq %rax, %rax
je 0x28283
movq 0x28(%rax), %rax
jmp 0x28285
xorl %eax, %eax
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/sim/Engine.cpp
// Function: MQSimEngine::Engine::RemoveObject(MQSimEngine::Sim_Object*)
void Engine::RemoveObject(Sim_Object* obj)
	{
		std::unordered_map<sim_object_id_type, Sim_Object*>::iterator it = _ObjectList.find(obj->ID());
		if (it == _ObjectList.end()) {
			throw std::invalid_argument("Removing an unregistered object.");
		}
		_ObjectList.erase(it);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
addq $0x10, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rdx
addq %rax, %rdx
movq %rsp, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0xaf32
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28590
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x282d6
callq 0x7370
testq %r14, %r14
je 0x282f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x289b8
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x71d0
movq %rax, %r14
leaq 0x2ffc9(%rip), %rsi     # 0x582cd
movq %rax, %rdi
callq 0x7680
movq 0x46cb5(%rip), %rsi     # 0x6efc8
movq 0x46c8e(%rip), %rdx     # 0x6efa8
movq %r14, %rdi
callq 0x75e0
movq %rax, %rbx
movq %r14, %rdi
callq 0x72c0
jmp 0x28340
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x28340
callq 0x7370
movq %rbx, %rdi
callq 0x7620
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/sim/Engine.cpp
// Function: MQSimEngine::Engine::Start_simulation()
void Engine::Start_simulation()
	{
		started = true;

		for(std::unordered_map<sim_object_id_type, Sim_Object*>::iterator obj = _ObjectList.begin();
			obj != _ObjectList.end();
			++obj) {
			if (!obj->second->IsTriggersSetUp()) {
				obj->second->Setup_triggers();
			}
		}

		for (std::unordered_map<sim_object_id_type, Sim_Object*>::iterator obj = _ObjectList.begin();
			obj != _ObjectList.end();
			++obj) {
			obj->second->Validate_simulation_config();
		}
		
		for (std::unordered_map<sim_object_id_type, Sim_Object*>::iterator obj = _ObjectList.begin();
			obj != _ObjectList.end();
			++obj) {
			obj->second->Start_simulation();
		}
		
		Sim_Event* ev = NULL;
		while (true) {
			if (_EventList->Count == 0 || stop) {
				break;
			}

			EventTreeNode* minNode = _EventList->Get_min_node();
			ev = minNode->FirstSimEvent;

			_sim_time = ev->Fire_time;

			while (ev != NULL) {
				if(!ev->Ignore) {
					ev->Target_sim_object->Execute_simulator_event(ev);
				}
				Sim_Event* consumed_event = ev;
				ev = ev->Next_event;
				delete consumed_event;
			}
			_EventList->Remove(minNode);
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x1, 0x49(%rdi)
movq 0x20(%rdi), %r14
testq %r14, %r14
je 0x283fa
movq 0x28(%r14), %rdi
cmpb $0x0, 0x28(%rdi)
jne 0x28374
movq (%rdi), %rax
callq *0x10(%rax)
movq (%r14), %r14
testq %r14, %r14
jne 0x28364
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x283fa
movq 0x28(%r14), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq (%r14), %r14
testq %r14, %r14
jne 0x28385
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x283fa
movq 0x28(%r14), %rdi
movq (%rdi), %rax
callq *(%rax)
movq (%r14), %r14
jmp 0x2839b
cmpb $0x0, 0x48(%rbx)
jne 0x28403
callq 0x28e2e
movq %rax, %r14
movq 0x8(%rax), %r15
movq (%r15), %rax
movq %rax, (%rbx)
cmpb $0x0, 0x28(%r15)
jne 0x283da
movq 0x8(%r15), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x18(%rax)
movq 0x20(%r15), %r12
movq %r15, %rdi
callq 0x7370
movq %r12, %r15
testq %r12, %r12
jne 0x283c6
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x28f28
movq 0x8(%rbx), %rdi
cmpl $0x0, (%rdi)
jne 0x283ae
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::EventTree()
EventTree::EventTree()
	{
		// set up the sentinel node. the sentinel node is the key to a successfull
		// implementation and for understanding the red-black tree properties.
		SentinelNode = new EventTreeNode();
		SentinelNode->Left = NULL;
		SentinelNode->Right = NULL;
		SentinelNode->Parent = NULL;
		SentinelNode->Color = 1;
		rbTree = SentinelNode;
		lastNodeFound = SentinelNode;
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x38, %edi
callq 0x73a0
movq %rax, 0x46b5b(%rip)     # 0x6f5f0
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movl $0x1, 0x18(%rax)
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::Add(unsigned long, MQSimEngine::Sim_Event*)
void EventTree::Add(sim_time_type key, Sim_Event* data)
	{
		// traverse tree - find where node belongs
		// create new node
		EventTreeNode* node = new EventTreeNode();
		// grab the rbTree node of the tree
		EventTreeNode* temp = rbTree;

		while (temp != SentinelNode) {
			// find Parent
			node->Parent = temp;
			
			if (key > temp->Key)
				temp = temp->Right;
			else
				temp = temp->Left;
		}

		// setup node
		node->Key = key;
		node->FirstSimEvent = data;
		node->LastSimEvent = data;
		node->Left = SentinelNode;
		node->Right = SentinelNode;

		// insert node into tree starting at parent's location
		if (node->Parent != NULL) {
			if (node->Key > (node->Parent->Key)) {
				node->Parent->Right = node;
			} else {
				node->Parent->Left = node;
			}
		} else {
			// first node added
			rbTree = node;
		}

		// restore red-black properities
		RestoreAfterInsert(node);
		lastNodeFound = node;
		Count++;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movl $0x38, %edi
callq 0x73a0
movq %rax, %r14
movl $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq 0x46aed(%rip), %rcx     # 0x6f5f0
movq 0x8(%rbx), %rdx
cmpq %rcx, %rdx
je 0x28b43
movq %rdx, %rax
movq %rdx, 0x30(%r14)
xorl %edx, %edx
cmpq %r15, (%rax)
setb %dl
movq 0x20(%rax,%rdx,8), %rdx
cmpq %rcx, %rdx
jne 0x28b0c
movq %r15, (%r14)
movq %r12, 0x8(%r14)
movq %r12, 0x10(%r14)
movq %rcx, 0x20(%r14)
movq %rcx, 0x28(%r14)
cmpq %r15, (%rax)
jae 0x28b5c
addq $0x28, %rax
jmp 0x28b60
leaq 0x8(%rbx), %rax
movq %r15, (%r14)
movq %r12, 0x8(%r14)
movq %r12, 0x10(%r14)
movq %rcx, 0x20(%r14)
movq %rcx, 0x28(%r14)
jmp 0x28b60
addq $0x20, %rax
movq %r14, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28b80
movq %r14, 0x10(%rbx)
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::Insert_sim_event(MQSimEngine::Sim_Event*)
void EventTree::Insert_sim_event(Sim_Event* event)
	{
		if (event->Fire_time < Engine::Instance()->Time()) {
			PRINT_ERROR("Illegal request to register a simulation event before Now!")
		}

		sim_time_type key = event->Fire_time;
		EventTreeNode* treeNode = rbTree;     // begin at root

												// traverse tree until node is found
		while (treeNode != SentinelNode)
		{
			if (key == treeNode->Key) {
				treeNode->LastSimEvent->Next_event = event;
				treeNode->LastSimEvent = event;
				return;
			}
			if (key < (treeNode->Key)) {
				treeNode = treeNode->Left;
			} else {
				treeNode = treeNode->Right;
			}
		}
		Add(event->Fire_time, event);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r15
callq 0x28018
movq %rax, %rdi
callq 0x2841a
cmpq %rax, %r15
jb 0x28dcb
movq (%rbx), %rsi
movq 0x46862(%rip), %rcx     # 0x6f5f0
movq 0x8(%r14), %rax
cmpq %rcx, %rax
je 0x28da9
cmpq (%rax), %rsi
je 0x28db9
setae %dl
movzbl %dl, %edx
movq 0x20(%rax,%rdx,8), %rax
jmp 0x28d92
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x28ac8
movq 0x10(%rax), %rcx
movq %rbx, 0x20(%rcx)
movq %rbx, 0x10(%rax)
popq %rbx
popq %r14
popq %r15
retq
movq 0x4621e(%rip), %rbx     # 0x6eff0
leaq 0x2d7cf(%rip), %rsi     # 0x565a8
movq %rbx, %rdi
callq 0x7390
leaq 0x2f506(%rip), %rsi     # 0x582ee
movq %rbx, %rdi
callq 0x7390
movq %rax, %rdi
callq 0x71c0
movq 0x461d1(%rip), %rdi     # 0x6efd0
callq 0x7430
movl $0x1, %edi
callq 0x7440
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::~Cached_Mapping_Table()
Cached_Mapping_Table::~Cached_Mapping_Table()
	{
		std::unordered_map<LPA_type, CMTSlotType*> addressMap;
		std::list<std::pair<LPA_type, CMTSlotType*>> lruList;

		auto entry = addressMap.begin();
		while (entry != addressMap.end()) {
			delete (*entry).second;
			addressMap.erase(entry++);
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movq %rsp, %rdi
callq 0x3049c
leaq 0x38(%rbx), %r14
movq 0x38(%rbx), %rdi
cmpq %r14, %rdi
je 0x293aa
movq (%rdi), %r15
callq 0x7370
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2939a
movq %rbx, %rdi
callq 0x3049c
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Retrieve_ppa(unsigned short, unsigned long)
PPA_type Cached_Mapping_Table::Retrieve_ppa(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);
		auto it = addressMap.find(key);
		assert(it != addressMap.end());
		assert(it->second->Status == CMTEntryStatus::VALID);
		lruList.splice(lruList.begin(), lruList, it->second->listPtr);
		
		return it->second->PPA;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
shlq $0x38, %rsi
orq %rdx, %rsi
movq %rsp, %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x30a0c
testq %rax, %rax
je 0x29410
movq %rax, %r14
movq 0x10(%rax), %rax
cmpl $0x2, 0x14(%rax)
jne 0x2942f
movq 0x38(%rbx), %rsi
addq $0x38, %rbx
movq 0x18(%rax), %rcx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x30a68
movq 0x10(%r14), %rax
movq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2f129(%rip), %rdi     # 0x58540
leaq 0x2f139(%rip), %rsi     # 0x58557
leaq 0x2f15e(%rip), %rcx     # 0x58583
movl $0x30, %edx
callq 0x7270
leaq 0x2f1af(%rip), %rdi     # 0x585e5
leaq 0x2f11a(%rip), %rsi     # 0x58557
leaq 0x2f13f(%rip), %rcx     # 0x58583
movl $0x31, %edx
callq 0x7270