// File: /workspace/github_cpp_makefile_star2_O2/gvaumour[P]cache-simulator/src/Perceptron.cc
// Function: PerceptronPredictor::printStats(std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void 
PerceptronPredictor::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];
	}
	
	ofstream file(FILE_OUTPUT_PERCEPTRON);	
	for(unsigned i = 0; i < stats_variances.size() ; i++)
		file << stats_variances[i] << endl;
	file.close();
	
	out << entete << ":PerceptronPredictor:NBBypass\t" << total_BP << endl;
	out << entete << ":PerceptronPredictor:TotalDeadLines\t" << total_DeadLines << endl;
	out << entete << ":PerceptronPredictor:AllocationLearning\t" << stats_allocate_learning << endl;	
	out << entete << ":PerceptronPredictor:Allocation\t" << stats_allocate_learning + stats_allocate << endl;
	out << entete << ":PerceptronPredictor:UpdateLearning\t" << stats_update_learning << endl;
	out << entete << ":PerceptronPredictor:Update\t" << stats_update_learning + stats_update << endl;

	Predictor::printStats(out, entete);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r15
movq %rdi, %r14
movq 0x350(%rdi), %rax
movq 0x358(%rdi), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movq 0x368(%rdi), %r8
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %edi, %edi
movl %edi, %edi
cmpq %rdi, %rcx
jbe 0x1e278
addq (%rax,%rdi,8), %r13
addq (%r8,%rdi,8), %r12
incl %edi
jmp 0x1e265
movq %rdx, (%rsp)
leaq 0xd264(%rip), %rsi      # 0x2b4e7
leaq 0x28(%rsp), %rbp
pushq $0x10
popq %rdx
movq %rbp, %rdi
callq 0x5310
xorl %ebx, %ebx
movl %ebx, %ebx
movq 0x3c0(%r14), %rax
movq 0x3c8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
jbe 0x1e2ca
movsd (%rax,%rbx,8), %xmm0
movq %rbp, %rdi
callq 0x54f0
movq %rax, %rdi
callq 0x5190
incl %ebx
jmp 0x1e295
leaq 0x28(%rsp), %rdi
callq 0x5420
movq %r15, %rbx
movq (%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5290
leaq 0xd210(%rip), %rsi      # 0x2b4fd
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
movq %r13, %rsi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5290
leaq 0xd202(%rip), %rsi      # 0x2b51c
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5290
leaq 0xd1fa(%rip), %rsi      # 0x2b541
movq %rax, %rdi
callq 0x52c0
movq 0x3f0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5290
leaq 0xd1f2(%rip), %rsi      # 0x2b56a
movq %rax, %rdi
callq 0x52c0
movq 0x3e8(%r14), %rsi
addq 0x3f0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5290
leaq 0xd1db(%rip), %rsi      # 0x2b58b
movq %rax, %rdi
callq 0x52c0
movq 0x3e0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5290
leaq 0xd1cf(%rip), %rsi      # 0x2b5b0
movq %rax, %rdi
callq 0x52c0
movq 0x3d8(%r14), %rsi
addq 0x3e0(%r14), %rsi
movq %rax, %rdi
callq 0x5200
movq %rax, %rdi
callq 0x5190
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x5410
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20390
leaq 0x8(%rsp), %rdi
callq 0x5618
leaq 0x28(%rsp), %rdi
callq 0x5620
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5618
jmp 0x1e45e
jmp 0x1e45b
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5620
movq %rbx, %rdi
callq 0x5570