// File: CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_Base.cpp
// Function: SSD_Components::Input_Stream_Manager_Base::Update_transaction_statistics(SSD_Components::NVM_Transaction*)
void Input_Stream_Manager_Base::Update_transaction_statistics(NVM_Transaction* transaction)
	{
		switch (transaction->Type)
		{
			case Transaction_Type::READ:
				this->input_streams[transaction->Stream_id]->STAT_sum_of_read_transactions_execution_time += transaction->STAT_execution_time;
				this->input_streams[transaction->Stream_id]->STAT_sum_of_read_transactions_transfer_time += transaction->STAT_transfer_time;
				this->input_streams[transaction->Stream_id]->STAT_sum_of_read_transactions_waiting_time += (Simulator->Time() - transaction->Issue_time) - transaction->STAT_execution_time - transaction->STAT_transfer_time;
				break;
			case Transaction_Type::WRITE:
				this->input_streams[transaction->Stream_id]->STAT_sum_of_write_transactions_execution_time += transaction->STAT_execution_time;
				this->input_streams[transaction->Stream_id]->STAT_sum_of_write_transactions_transfer_time += transaction->STAT_transfer_time;
				this->input_streams[transaction->Stream_id]->STAT_sum_of_write_transactions_waiting_time += (Simulator->Time() - transaction->Issue_time) - transaction->STAT_execution_time - transaction->STAT_transfer_time;
				break;
			default:
				break;
		}
	}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x44(%rsp)
testl %eax, %eax
je 0x8491c
jmp 0x8490a
movl 0x44(%rsp), %eax
subl $0x1, %eax
je 0x849e2
jmp 0x84aa5
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x20(%rsp)
addq $0x10, %rdi
movq 0x48(%rsp), %rax
movzwl (%rax), %eax
movl %eax, %esi
callq 0x85300
movq 0x20(%rsp), %rcx
movq 0x38(%rsp), %rdi
movq (%rax), %rax
addq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x28(%rsp)
addq $0x10, %rdi
movq 0x48(%rsp), %rax
movzwl (%rax), %eax
movl %eax, %esi
callq 0x85300
movq 0x28(%rsp), %rcx
movq (%rax), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rcx
subq 0x20(%rcx), %rax
movq 0x48(%rsp), %rcx
subq 0x28(%rcx), %rax
movq 0x48(%rsp), %rcx
subq 0x30(%rcx), %rax
movq %rax, 0x30(%rsp)
addq $0x10, %rdi
movq 0x48(%rsp), %rax
movzwl (%rax), %eax
movl %eax, %esi
callq 0x85300
movq 0x30(%rsp), %rcx
movq (%rax), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
jmp 0x84aa7
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
addq $0x10, %rdi
movq 0x48(%rsp), %rax
movzwl (%rax), %eax
movl %eax, %esi
callq 0x85300
movq 0x8(%rsp), %rcx
movq 0x38(%rsp), %rdi
movq (%rax), %rax
addq 0x30(%rax), %rcx
movq %rcx, 0x30(%rax)
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x10(%rsp)
addq $0x10, %rdi
movq 0x48(%rsp), %rax
movzwl (%rax), %eax
movl %eax, %esi
callq 0x85300
movq 0x10(%rsp), %rcx
movq (%rax), %rax
addq 0x38(%rax), %rcx
movq %rcx, 0x38(%rax)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rcx
subq 0x20(%rcx), %rax
movq 0x48(%rsp), %rcx
subq 0x28(%rcx), %rax
movq 0x48(%rsp), %rcx
subq 0x30(%rcx), %rax
movq %rax, 0x18(%rsp)
addq $0x10, %rdi
movq 0x48(%rsp), %rax
movzwl (%rax), %eax
movl %eax, %esi
callq 0x85300
movq 0x18(%rsp), %rcx
movq (%rax), %rax
addq 0x40(%rax), %rcx
movq %rcx, 0x40(%rax)
jmp 0x84aa7
jmp 0x84aa7
addq $0x58, %rsp
retq
nopl (%rax)