// File: gvaumour[P]cache-simulator/src/Hierarchy.cc
// Function: Hierarchy::printResults(std::ostream&)
void
Hierarchy::printResults(ostream& out)
{
//	out << "***************" << endl;
	for(unsigned j = 0 ; j < m_private_caches.size() ; j++)
	{
//		out << "Core n°" << j << endl;		
		m_private_caches[j]->printResults(out);
	}
//	out << "***************" << endl;
//	out << "Last Level Cache : " << endl;
	m_LLC->printResults(out);
	out << "***************" << endl;

	out << "Prefetcher:Stats" << endl;
	out << "Prefetcher:issuedPrefetch\t"<< stats_issuedPrefetchs << endl;
	out << "Prefetcher:hitPrefecth\t"<< stats_hitsPrefetch << endl;
	out << "Prefetcher:prefetchErrors\t"<< stats_issuedPrefetchs - stats_hitsPrefetch << endl;


//	out << "MainMem" << endl;
	out << "MainMem:ReadFetch\t" << stats_readMainMem << endl;
	out << "MainMem:WriteFetch\t" << stats_writeMainMem << endl;
	out << "MainMem:CleanWB\t" << stats_cleanWB_MainMem << endl;
	out << "MainMem:DirtyWB\t" << stats_dirtyWB_MainMem << endl;
	
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %eax
movq %rax, (%rsp)
callq 0x33ea0
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0x31738
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %eax
movl %eax, %esi
callq 0x33ec0
movq (%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x47050
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x316f0
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x47050
movq 0x18(%rsp), %rdi
leaq 0x417d7(%rip), %rsi     # 0x72f2e
callq 0x5380
movq %rax, %rdi
movq 0x61852(%rip), %rsi     # 0x92fb8
callq 0x53d0
movq 0x18(%rsp), %rdi
leaq 0x40c37(%rip), %rsi     # 0x723ae
callq 0x5380
movq %rax, %rdi
movq 0x61832(%rip), %rsi     # 0x92fb8
callq 0x53d0
movq 0x18(%rsp), %rdi
leaq 0x40c28(%rip), %rsi     # 0x723bf
callq 0x5380
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x90(%rax), %rsi
callq 0x50f0
movq %rax, %rdi
movq 0x617fe(%rip), %rsi     # 0x92fb8
callq 0x53d0
movq 0x18(%rsp), %rdi
leaq 0x40c0f(%rip), %rsi     # 0x723da
callq 0x5380
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x98(%rax), %rsi
callq 0x50f0
movq %rax, %rdi
movq 0x617ca(%rip), %rsi     # 0x92fb8
callq 0x53d0
movq 0x18(%rsp), %rdi
leaq 0x40bf3(%rip), %rsi     # 0x723f2
callq 0x5380
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x90(%rax), %rsi
subq 0x98(%rax), %rsi
callq 0x50f0
movq %rax, %rdi
movq 0x6178f(%rip), %rsi     # 0x92fb8
callq 0x53d0
movq 0x18(%rsp), %rdi
leaq 0x40bd3(%rip), %rsi     # 0x7240d
callq 0x5380
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rsi
callq 0x50f0
movq %rax, %rdi
movq 0x6175b(%rip), %rsi     # 0x92fb8
callq 0x53d0
movq 0x18(%rsp), %rdi
leaq 0x40bb2(%rip), %rsi     # 0x72420
callq 0x5380
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rsi
callq 0x50f0
movq %rax, %rdi
movq 0x61727(%rip), %rsi     # 0x92fb8
callq 0x53d0
movq 0x18(%rsp), %rdi
leaq 0x40b92(%rip), %rsi     # 0x72434
callq 0x5380
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rsi
callq 0x50f0
movq %rax, %rdi
movq 0x616f6(%rip), %rsi     # 0x92fb8
callq 0x53d0
movq 0x18(%rsp), %rdi
leaq 0x40b72(%rip), %rsi     # 0x72445
callq 0x5380
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq 0x78(%rax), %rsi
callq 0x50f0
movq %rax, %rdi
movq 0x616c5(%rip), %rsi     # 0x92fb8
callq 0x53d0
addq $0x28, %rsp
retq
nopl (%rax)