// File: /workspace/github_cpp_makefile_star2_O1/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 $0x68, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
movq 0x320(%rdi), %rax
movq 0x328(%rdi), %rcx
subq %rax, %rcx
je 0x2194a
sarq $0x3, %rcx
movq 0x338(%r15), %rdx
xorl %esi, %esi
xorl %r13d, %r13d
xorl %ebp, %ebp
addq (%rax,%rsi,8), %rbp
addq (%rdx,%rsi,8), %r13
incq %rsi
movl %esi, %edi
cmpq %rdi, %rcx
ja 0x21936
jmp 0x2194f
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x418(%r15), %rax
movq 0x420(%r15), %rcx
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
subq %rax, %rcx
je 0x219b0
sarq $0x3, %rcx
imulq %rbx, %rcx
xorl %edx, %edx
xorl %r12d, %r12d
leaq (%rdx,%rdx,2), %rdi
movq (%rax,%rdi,8), %rsi
movq 0x8(%rax,%rdi,8), %rdi
subq %rsi, %rdi
je 0x219a4
sarq $0x2, %rdi
xorl %r8d, %r8d
movslq (%rsi,%r8,4), %r9
addq %r9, %r12
incq %r8
movl %r8d, %r9d
cmpq %r9, %rdi
ja 0x21992
incq %rdx
movl %edx, %esi
cmpq %rsi, %rcx
ja 0x21979
jmp 0x219b3
xorl %r12d, %r12d
movq 0x278(%r15), %rsi
subq 0x270(%r15), %rsi
sarq $0x3, %rsi
leaq 0x2c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x1f(%rsp), %rcx
callq 0x15482
movq 0x400(%r15), %rax
movq 0x8(%rax), %rcx
movq (%rax), %rdx
subq %rdx, %rcx
je 0x21a40
sarq $0x2, %rcx
movq 0x408(%r15), %rdx
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
imulq %rbx, %rsi
movq 0x30(%rsp), %rdi
xorl %r8d, %r8d
cmpq %rax, %rdx
je 0x21a38
xorl %r9d, %r9d
movq %rax, %r10
movq (%r10), %r11
movl (%r11,%r8,4), %r11d
addl %r11d, (%rdi,%r9,4)
incq %r9
movl %r9d, %r11d
addq $0x18, %r10
cmpq %r11, %rsi
ja 0x21a1e
incl %r8d
cmpq %r8, %rcx
ja 0x21a13
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x14779(%rip), %rsi     # 0x361d9
movl $0x23, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3e0(%r15), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x14737(%rip), %rsi     # 0x361fd
movl $0x22, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3d8(%r15), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x146f4(%rip), %rsi     # 0x36220
movl $0x17, %edx
movq %rax, %rdi
callq 0x5350
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x146aa(%rip), %rsi     # 0x36238
movl $0x1d, %edx
movq %rax, %rdi
callq 0x5350
movq %rbx, %rdi
movq %r13, %rsi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x14666(%rip), %rsi     # 0x36256
movl $0x21, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3c0(%r15), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x14622(%rip), %rsi     # 0x36278
movl $0x19, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3b8(%r15), %rsi
addq 0x3c0(%r15), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x145cf(%rip), %rsi     # 0x36292
movl $0x1d, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3b0(%r15), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x14587(%rip), %rsi     # 0x362b0
movl $0x15, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3a8(%r15), %rsi
addq 0x3b0(%r15), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x14530(%rip), %rsi     # 0x362c6
movl $0x18, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3d0(%r15), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x144e3(%rip), %rsi     # 0x362df
movl $0x20, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3c8(%r15), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %r13
leaq 0x1449e(%rip), %rsi     # 0x36300
movl $0x22, %edx
movq %rax, %rdi
callq 0x5350
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x430(%r15), %rax
cmpq %rax, 0x438(%r15)
movq %r15, 0x20(%rsp)
je 0x22096
movl $0x1, %ebp
xorl %r14d, %r14d
leaq (%r14,%r14,2), %r15
movq (%rax,%r15,8), %rax
cmpl $0x0, (%rax)
jne 0x21ecf
cmpl $0x1, 0x4(%rax)
je 0x22060
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %r13
movl $0x12, %edx
movq %rax, %rdi
leaq 0x1442c(%rip), %rsi     # 0x36323
callq 0x5350
leaq 0x2352d(%rip), %rax     # 0x45430
movq (%rax,%r14,8), %rbx
testq %rbx, %rbx
je 0x21f24
movq %rbx, %rdi
callq 0x5160
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5350
jmp 0x21f3f
movq (%r13), %rax
movq -0x18(%rax), %rax
movq %r13, %rdi
addq %rax, %rdi
movl 0x20(%r13,%rax), %esi
orl $0x1, %esi
callq 0x5560
movl $0x1, %edx
movq %r13, %rdi
leaq 0x13d2d(%rip), %rsi     # 0x35c7b
callq 0x5350
movq 0x20(%rsp), %rax
movq 0x430(%rax), %rax
movq (%rax,%r15,8), %rax
movl (%rax), %esi
movq %r13, %rdi
callq 0x5580
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %r13
movl $0x13, %edx
movq %rax, %rdi
leaq 0x14377(%rip), %rsi     # 0x36336
callq 0x5350
leaq 0x23465(%rip), %rax     # 0x45430
movq (%rax,%r14,8), %rbx
testq %rbx, %rbx
je 0x21fec
movq %rbx, %rdi
callq 0x5160
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5350
jmp 0x22007
movq (%r13), %rax
movq -0x18(%rax), %rax
movq %r13, %rdi
addq %rax, %rdi
movl 0x20(%r13,%rax), %esi
orl $0x1, %esi
callq 0x5560
movl $0x1, %edx
movq %r13, %rdi
leaq 0x13c65(%rip), %rsi     # 0x35c7b
callq 0x5350
movq 0x20(%rsp), %rax
movq 0x430(%rax), %rax
movq (%rax,%r15,8), %rax
movl 0x4(%rax), %esi
movq %r13, %rdi
callq 0x5580
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movl %ebp, %r14d
movq 0x20(%rsp), %r15
movq 0x430(%r15), %rax
movq 0x438(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
incl %ebp
cmpq %r14, %rcx
ja 0x21eb8
movq 0x278(%r15), %rax
cmpq 0x270(%r15), %rax
je 0x22182
movl $0x1, %r14d
xorl %r15d, %r15d
leaq 0x14290(%rip), %r13     # 0x3634a
leaq 0x12ca4(%rip), %rbp     # 0x34d65
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq %rax, %rbx
movl $0xe, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x5350
movq 0x20(%rsp), %rax
movq 0x2a0(%rax), %rax
movq %r15, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x5350
movq 0x30(%rsp), %rax
movl (%rax,%r15,4), %esi
movq %rbx, %rdi
callq 0x5580
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x20(%rsp), %rcx
movq 0x278(%rcx), %rax
subq 0x270(%rcx), %rax
movl %r14d, %r15d
sarq $0x3, %rax
incl %r14d
cmpq %r15, %rax
ja 0x220c1
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x10(%rsp), %rdi
callq 0x5350
movq 0x20(%rsp), %r15
movq %rax, %rbx
leaq 0x141b2(%rip), %rsi     # 0x36359
movl $0x1b, %edx
movq %rax, %rdi
callq 0x5350
movq %rbx, %rdi
movq %r12, %rsi
callq 0x51e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0xcc1c
leaq 0x48(%rsp), %rdx
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x27d9c
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x2222c
callq 0x52a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2223b
callq 0x52a0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x22265
callq 0x52a0
jmp 0x22265
jmp 0x22262
jmp 0x22262
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x22274
callq 0x52a0
movq %rbx, %rdi
callq 0x55a0