// File: /workspace/github_cpp_makefile_star2_O2/gvaumour[P]cache-simulator/src/PHC.cc
// Function: PHCPredictor::printStats(std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void 
PHCPredictor::printStats(std::ostream& out, std::string entete) { 

	uint64_t total_BP = 0, total_DeadLines = 0;
	for(unsigned i = 0 ; i < stats_nbBPrequests.size() ; i++ )
	{
		total_BP+= stats_nbBPrequests[i];		
		total_DeadLines += stats_nbDeadLine[i];
	}
	
	uint64_t global_errors = 0;
	for(unsigned i = 0 ; i < stats_global_error.size() ; i++)
	{
		for(unsigned j = 0; j < stats_global_error[i].size(); j++)
			global_errors += stats_global_error[i][j];
	}
	
	vector<int> local_errors = vector<int>(m_features.size() , 0);
	for(unsigned i = 0 ; i < stats_local_error[0].size(); i++)
	{
		for(unsigned j = 0 ; j < stats_local_error.size() ; j++)
			local_errors[j] += stats_local_error[j][i];
	}
	
	out << entete << ":PHCPredictor:PredictionPreemptive\t" << stats_prediction_preemptive << endl;
	out << entete << ":PHCPredictor:PredictionConfident\t" << stats_prediction_confident << endl;
	out << entete << ":PHCPredictor:NBBypass\t" << total_BP << endl;
	out << entete << ":PHCPredictor:TotalDeadLines\t" << total_DeadLines << endl;
	out << entete << ":PHCPredictor:AllocationLearning\t" << stats_allocate_learning << endl;	
	out << entete << ":PHCPredictor:Allocation\t" << stats_allocate_learning + stats_allocate << endl;
	out << entete << ":PHCPredictor:UpdateLearning\t" << stats_update_learning << endl;
	out << entete << ":PHCPredictor:Update\t" << stats_update_learning + stats_update << endl;
	out << entete << ":PHCPredictor:SRAMerror\t" << stats_cptSRAMerror << endl;
	out << entete << ":PHCPredictor:LearningSRAMerror\t" << stats_cptLearningSRAMerror << endl;
	

	out << entete << ":PHCPredictor:AccessClassification" << endl;
	for(unsigned i = 0 ; i < stats_access_class.size() ; i++)
	{
		if(stats_access_class[i][0] != 0 || stats_access_class[i][1] != 1)
		{
			out << entete << ":PHCPredictor:Read" <<  str_RD_status[i]	<< "\t" << stats_access_class[i][false] << endl;	
			out << entete << ":PHCPredictor:Write" << str_RD_status[i] << "\t" << stats_access_class[i][true] << endl; 		
		}
	}
	
	for(unsigned j = 0 ; j < m_features.size() ; j++)
		out << entete << ":PHCPredictor:" << m_criterias_names[j] << "_errors\t" << local_errors[j] << endl;
	out << entete << ":PHCPredictor:GlobalErrors\t" << global_errors << endl; 
	Predictor::printStats(out, entete);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
movq 0x320(%rdi), %rax
movq 0x328(%rdi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movq 0x338(%rdi), %rdx
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %esi, %esi
movl %esi, %esi
cmpq %rsi, %rcx
jbe 0x1b779
addq (%rax,%rsi,8), %rbp
addq (%rdx,%rsi,8), %r13
incl %esi
jmp 0x1b766
movq 0x418(%r14), %rcx
movq 0x420(%r14), %rax
subq %rcx, %rax
pushq $0x18
popq %rsi
cqto
idivq %rsi
xorl %r12d, %r12d
xorl %edx, %edx
movl %edx, %edx
cmpq %rdx, %rax
jbe 0x1b7cd
imulq $0x18, %rdx, %rdi
movq (%rcx,%rdi), %rsi
movq 0x8(%rcx,%rdi), %rdi
subq %rsi, %rdi
sarq $0x2, %rdi
xorl %r8d, %r8d
movl %r8d, %r8d
cmpq %r8, %rdi
jbe 0x1b7c9
movslq (%rsi,%r8,4), %r9
addq %r9, %r12
incl %r8d
jmp 0x1b7b5
incl %edx
jmp 0x1b797
movq 0x278(%r14), %rsi
subq 0x270(%r14), %rsi
sarq $0x3, %rsi
leaq 0x1c(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0x1b(%rsp), %rcx
callq 0x9c8a
movq 0x400(%r14), %rcx
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
movq 0x408(%r14), %rax
sarq $0x2, %rsi
subq %rcx, %rax
cqto
pushq $0x18
popq %rdi
idivq %rdi
xorl %edx, %edx
movl %edx, %edx
cmpq %rdx, %rsi
jbe 0x1b84c
xorl %r8d, %r8d
movq 0x20(%rsp), %rdi
movl %r8d, %r8d
cmpq %r8, %rax
jbe 0x1b848
imulq $0x18, %r8, %r9
movq (%rcx,%r9), %r9
movl (%r9,%rdx,4), %r9d
addl %r9d, (%rdi,%r8,4)
incl %r8d
jmp 0x1b82b
incl %edx
jmp 0x1b81c
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf91f(%rip), %rsi      # 0x2b181
movq %rax, %rdi
callq 0x52c0
movq 0x3e0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf90e(%rip), %rsi      # 0x2b1a5
movq %rax, %rdi
callq 0x52c0
movq 0x3d8(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf8fc(%rip), %rsi      # 0x2b1c8
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf8e3(%rip), %rsi      # 0x2b1e0
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
movq %r13, %rsi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf8d0(%rip), %rsi      # 0x2b1fe
movq %rax, %rdi
callq 0x52c0
movq 0x3c0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf8bd(%rip), %rsi      # 0x2b220
movq %rax, %rdi
callq 0x52c0
movq 0x3b8(%r14), %rsi
addq 0x3c0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf89b(%rip), %rsi      # 0x2b23a
movq %rax, %rdi
callq 0x52c0
movq 0x3b0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf884(%rip), %rsi      # 0x2b258
movq %rax, %rdi
callq 0x52c0
movq 0x3a8(%r14), %rsi
addq 0x3b0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf85e(%rip), %rsi      # 0x2b26e
movq %rax, %rdi
callq 0x52c0
movq 0x3d0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf842(%rip), %rsi      # 0x2b287
movq %rax, %rdi
callq 0x52c0
movq 0x3c8(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf82e(%rip), %rsi      # 0x2b2a8
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
callq 0x5190
xorl %r13d, %r13d
leaq 0x2199c(%rip), %rbx     # 0x3d430
leaq 0xf188(%rip), %rbp      # 0x2ac23
movl %r13d, %r13d
movq 0x430(%r14), %rcx
movq 0x438(%r14), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
cmpq %r13, %rax
jbe 0x1bb84
imulq $0x18, %r13, %r15
movq (%rcx,%r15), %rax
cmpl $0x0, (%rax)
jne 0x1bad7
cmpl $0x1, 0x4(%rax)
je 0x1bb7c
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
movq %rax, %rdi
leaq 0xf7db(%rip), %rsi      # 0x2b2cb
callq 0x52c0
movq (%rbx,%r13,8), %rsi
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x52c0
movq 0x430(%r14), %rcx
movq (%rcx,%r15), %rcx
movl (%rcx), %esi
movq %rax, %rdi
callq 0x5560
movq %rax, %rdi
callq 0x5190
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
movq %rax, %rdi
leaq 0xf79c(%rip), %rsi      # 0x2b2de
callq 0x52c0
movq (%rbx,%r13,8), %rsi
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x52c0
movq 0x430(%r14), %rcx
movq (%rcx,%r15), %rcx
movl 0x4(%rcx), %esi
movq %rax, %rdi
callq 0x5560
movq %rax, %rdi
callq 0x5190
incl %r13d
jmp 0x1ba9b
xorl %ebx, %ebx
leaq 0xf765(%rip), %r13      # 0x2b2f2
leaq 0xe191(%rip), %rbp      # 0x29d25
movl %ebx, %ebx
movq 0x278(%r14), %rax
subq 0x270(%r14), %rax
sarq $0x3, %rax
cmpq %rbx, %rax
jbe 0x1bc04
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
movq %rax, %rdi
movq %r13, %rsi
callq 0x52c0
movq %rbx, %rsi
shlq $0x5, %rsi
addq 0x2a0(%r14), %rsi
movq %rax, %rdi
callq 0x5290
movq %rax, %rdi
movq %rbp, %rsi
callq 0x52c0
movq 0x20(%rsp), %rcx
movl (%rcx,%rbx,4), %esi
movq %rax, %rdi
callq 0x5560
movq %rax, %rdi
callq 0x5190
incl %ebx
jmp 0x1bb94
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5290
leaq 0xf6e7(%rip), %rsi      # 0x2b301
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x5200
movq %rax, %rdi
callq 0x5190
leaq 0x38(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x5410
leaq 0x38(%rsp), %rdx
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x20390
leaq 0x38(%rsp), %rdi
callq 0x5618
leaq 0x20(%rsp), %rdi
callq 0xa49a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5618
jmp 0x1bc8f
jmp 0x1bc8c
jmp 0x1bc8c
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa49a
movq %rbx, %rdi
callq 0x5570
nop