// File: /workspace/github_cpp_makefile_star2_O3/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, (%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
movq 0x320(%rdi), %rax
movq 0x328(%rdi), %rcx
subq %rax, %rcx
je 0x217b7
sarq $0x3, %rcx
movq 0x338(%r14), %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 0x217a3
jmp 0x217bc
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x418(%r14), %rax
movq 0x420(%r14), %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
subq %rax, %rcx
je 0x2181d
sarq $0x3, %rcx
imulq %rdx, %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 0x21811
sarq $0x2, %rdi
xorl %r8d, %r8d
movslq (%rsi,%r8,4), %r9
addq %r9, %r12
incq %r8
movl %r8d, %r9d
cmpq %r9, %rdi
ja 0x217ff
incq %rdx
movl %edx, %esi
cmpq %rsi, %rcx
ja 0x217e6
jmp 0x21820
xorl %r12d, %r12d
movq 0x278(%r14), %rsi
subq 0x270(%r14), %rsi
sarq $0x3, %rsi
leaq 0x1c(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0x1b(%rsp), %rcx
callq 0x152ee
movq 0x400(%r14), %rax
movq 0x8(%rax), %rcx
movq (%rax), %rdx
subq %rdx, %rcx
je 0x218b7
sarq $0x2, %rcx
movq 0x408(%r14), %rdx
movq %rdx, %rsi
subq %rax, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rsi
movq 0x20(%rsp), %rdi
xorl %r8d, %r8d
cmpq %rax, %rdx
je 0x218af
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 0x21895
incl %r8d
cmpq %r8, %rcx
ja 0x2188a
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x148fb(%rip), %rsi     # 0x361d1
movl $0x23, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3e0(%r14), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x148ba(%rip), %rsi     # 0x361f5
movl $0x22, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3d8(%r14), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x14878(%rip), %rsi     # 0x36218
movl $0x17, %edx
movq %rax, %rdi
callq 0x5360
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x1482f(%rip), %rsi     # 0x36230
movl $0x1d, %edx
movq %rax, %rdi
callq 0x5360
movq %rbx, %rdi
movq %r13, %rsi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x147ec(%rip), %rsi     # 0x3624e
movl $0x21, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3c0(%r14), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x147a9(%rip), %rsi     # 0x36270
movl $0x19, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3b8(%r14), %rsi
addq 0x3c0(%r14), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x14757(%rip), %rsi     # 0x3628a
movl $0x1d, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3b0(%r14), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x14710(%rip), %rsi     # 0x362a8
movl $0x15, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3a8(%r14), %rsi
addq 0x3b0(%r14), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x146ba(%rip), %rsi     # 0x362be
movl $0x18, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3d0(%r14), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x1466e(%rip), %rsi     # 0x362d7
movl $0x20, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3c8(%r14), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %r13
leaq 0x1462a(%rip), %rsi     # 0x362f8
movl $0x22, %edx
movq %rax, %rdi
callq 0x5360
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq 0x430(%r14), %rax
movq %r14, 0x10(%rsp)
movq 0x438(%r14), %rcx
cmpq %rax, %rcx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
je 0x21f10
movl $0x1, %ebp
xorl %r14d, %r14d
leaq (%r14,%r14,2), %r15
movq (%rax,%r15,8), %rdx
cmpl $0x0, (%rdx)
jne 0x21d48
cmpl $0x1, 0x4(%rdx)
je 0x21ef4
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %r13
movl $0x12, %edx
movq %rax, %rdi
leaq 0x145ac(%rip), %rsi     # 0x3631b
callq 0x5360
leaq 0x236b5(%rip), %rax     # 0x45430
movq (%rax,%r14,8), %rbx
testq %rbx, %rbx
je 0x21d9c
movq %rbx, %rdi
callq 0x5160
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5360
jmp 0x21db7
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 0x13ead(%rip), %rsi     # 0x35c73
callq 0x5360
movq 0x10(%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 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %r13
movl $0x13, %edx
movq %rax, %rdi
leaq 0x144f8(%rip), %rsi     # 0x3632e
callq 0x5360
leaq 0x235ee(%rip), %rax     # 0x45430
movq (%rax,%r14,8), %rbx
testq %rbx, %rbx
je 0x21e63
movq %rbx, %rdi
callq 0x5160
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5360
jmp 0x21e7e
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 0x13de6(%rip), %rsi     # 0x35c73
callq 0x5360
movq 0x10(%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 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq 0x10(%rsp), %rcx
movq 0x430(%rcx), %rax
movq 0x438(%rcx), %rcx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
movl %ebp, %r14d
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rsi, %rdx
incl %ebp
cmpq %r14, %rdx
ja 0x21d31
movq 0x10(%rsp), %rcx
movq 0x278(%rcx), %rax
cmpq 0x270(%rcx), %rax
je 0x22000
movl $0x1, %r14d
xorl %r15d, %r15d
leaq 0x14409(%rip), %r13     # 0x36342
leaq 0x12e05(%rip), %rbp     # 0x34d45
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq %rax, %rbx
movl $0xe, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x5360
movq 0x10(%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 0x5360
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x5360
movq 0x20(%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 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movq 0x10(%rsp), %rcx
movq 0x278(%rcx), %rax
subq 0x270(%rcx), %rax
movl %r14d, %r15d
sarq $0x3, %rax
incl %r14d
cmpq %r15, %rax
ja 0x21f40
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x8(%rsp), %rdi
callq 0x5360
movq 0x10(%rsp), %r15
movq %rax, %rbx
leaq 0x1432d(%rip), %rsi     # 0x36351
movl $0x1b, %edx
movq %rax, %rdi
callq 0x5360
movq %rbx, %rdi
movq %r12, %rsi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
leaq 0x48(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0xcbd6
leaq 0x38(%rsp), %rdx
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq 0x27a64
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x220a8
callq 0x52b0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x220b7
callq 0x52b0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x220e1
callq 0x52b0
jmp 0x220e1
jmp 0x220de
jmp 0x220de
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x220f0
callq 0x52b0
movq %rbx, %rdi
callq 0x55a0