// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/main.cpp
// Function: collect_results(SSD_Device&, Host_System&, char const*)
void collect_results(SSD_Device& ssd, Host_System& host, const char* output_file_path)
{
	Utils::XmlWriter xmlwriter;
	xmlwriter.Open(output_file_path);

	std::string tmp("MQSim_Results");
	xmlwriter.Write_open_tag(tmp);
	
	host.Report_results_in_XML("", xmlwriter);
	ssd.Report_results_in_XML("", xmlwriter);

	xmlwriter.Write_close_tag();

	std::vector<Host_Components::IO_Flow_Base*> IO_flows = host.Get_io_flows();
	for (unsigned int stream_id = 0; stream_id < IO_flows.size(); stream_id++) {
		cout << "Flow " << IO_flows[stream_id]->ID() << " - total requests generated: " << IO_flows[stream_id]->Get_generated_request_count()
			<< " total requests serviced:" << IO_flows[stream_id]->Get_serviced_request_count() << endl;
		cout << "                   - device response time: " << IO_flows[stream_id]->Get_device_response_time() << " (us)"
			<< " end-to-end request delay:" << IO_flows[stream_id]->Get_end_to_end_request_delay() << " (us)" << endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd8(%rsp), %r12
movq %r12, %rdi
callq 0x75d0
xorps %xmm0, %xmm0
movups %xmm0, 0x230(%r12)
movups %xmm0, 0x220(%r12)
movups %xmm0, 0x210(%r12)
leaq 0xb8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %r15, %rsi
callq 0x7180
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x543e6
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9c1a
callq 0x7370
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x4b6cc(%rip), %rsi     # 0x552f6
leaq 0x4b6d2(%rip), %rdx     # 0x55303
leaq 0x18(%rsp), %rdi
callq 0xb0c6
leaq 0xa8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0xb036
leaq 0xd8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x54454
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0x9c88
callq 0x7370
leaq 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4dd40(%rip), %rdx     # 0x579db
leaq 0x78(%rsp), %rdi
movq %rdx, %rsi
callq 0xb0c6
movq (%rbx), %rax
leaq 0x78(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x9ccd
callq 0x7370
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4dcfe(%rip), %rdx     # 0x579db
leaq 0x58(%rsp), %rdi
movq %rdx, %rsi
callq 0xb0c6
movq (%r14), %rax
leaq 0x58(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movq %r14, %rdi
callq *0x20(%rax)
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x9d0f
callq 0x7370
leaq 0xd8(%rsp), %rdi
callq 0x547fc
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x15fda
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x9ef0
movl $0x1, %ebp
leaq 0x48(%rsp), %r13
xorl %r15d, %r15d
movq 0x65246(%rip), %rbx     # 0x6ef90
leaq 0x4b61d(%rip), %r14     # 0x5536e
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x4b5a4(%rip), %rsi     # 0x55304
callq 0x7400
movq (%rsp), %rax
movq (%rax,%r15,8), %rax
movq %r13, 0x38(%rsp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0xb036
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %rbx, %rdi
callq 0x7400
movq %rax, %r12
movl $0x1d, %edx
movq %rax, %rdi
leaq 0x4b55f(%rip), %rsi     # 0x5530a
callq 0x7400
movq (%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x1fa20
movl %eax, %esi
movq %r12, %rdi
callq 0x7280
movq %rax, %r12
movl $0x19, %edx
movq %rax, %rdi
leaq 0x4b54f(%rip), %rsi     # 0x55328
callq 0x7400
movq (%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x1fa28
movl %eax, %esi
movq %r12, %rdi
callq 0x7280
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7380
movsbl %al, %esi
movq %r12, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7290
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x9e2e
callq 0x7370
movl $0x2b, %edx
movq %rbx, %rdi
leaq 0x4b505(%rip), %rsi     # 0x55342
callq 0x7400
movq (%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x1fa30
movl %eax, %esi
movq %rbx, %rdi
callq 0x7280
movq %rax, %r12
movl $0x5, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x7400
movl $0x1a, %edx
movq %r12, %rdi
leaq 0x4b4f9(%rip), %rsi     # 0x55374
callq 0x7400
movq (%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x1faa4
movl %eax, %esi
movq %r12, %rdi
callq 0x7280
movq %rax, %r12
movl $0x5, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x7400
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7380
movsbl %al, %esi
movq %r12, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7290
movl %ebp, %r15d
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
sarq $0x3, %rax
incl %ebp
cmpq %r15, %rax
ja 0x9d51
testq %rdi, %rdi
je 0x9efa
callq 0x7370
leaq 0x2e8(%rsp), %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x9f16
callq 0x7370
leaq 0x300(%rsp), %r14
movq %r14, %rdi
callq 0xaf22
movq %rbx, %rdi
callq 0xaf22
movq 0x6503b(%rip), %rax     # 0x6ef70
movq (%rax), %rcx
movq 0x18(%rax), %rax
movq %rcx, -0x228(%r14)
movq -0x18(%rcx), %rcx
movq %rax, 0xd8(%rsp,%rcx)
leaq 0xe0(%rsp), %rdi
callq 0x7320
leaq 0x1d0(%rsp), %rdi
callq 0x7150
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9fbf
movq %rax, %rbx
movq 0x58(%rsp), %rdi
jmp 0x9fa0
jmp 0x9fbf
movq %rax, %rbx
movq 0x78(%rsp), %rdi
jmp 0x9fa0
jmp 0x9fbf
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
jne 0x9fe6
jmp 0x9feb
jmp 0x9fba
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x9ff5
movq %rax, %rbx
jmp 0x9fff
movq %rax, %rbx
jmp 0x9feb
jmp 0x9fda
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x9fdd
callq 0x7370
jmp 0x9fdd
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x9feb
callq 0x7370
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x9fff
callq 0x7370
leaq 0xd8(%rsp), %rdi
callq 0xab50
movq %rbx, %rdi
callq 0x7620