// File: /workspace/github_cpp_makefile_star2_O1/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 $0x238, %rsp            # imm = 0x238
movq %rdi, %r14
movq 0x350(%rdi), %rax
movq 0x358(%rdi), %rcx
subq %rax, %rcx
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
je 0x25170
sarq $0x3, %rcx
movq 0x368(%r14), %rdx
xorl %esi, %esi
xorl %r12d, %r12d
xorl %r13d, %r13d
addq (%rax,%rsi,8), %r13
addq (%rdx,%rsi,8), %r12
incq %rsi
movl %esi, %edi
cmpq %rdi, %rcx
ja 0x2515c
jmp 0x25176
xorl %r13d, %r13d
xorl %r12d, %r12d
leaq 0x113c2(%rip), %rsi     # 0x3653f
leaq 0x38(%rsp), %rdi
movl $0x10, %edx
callq 0x5310
movq 0x3c0(%r14), %rax
cmpq %rax, 0x3c8(%r14)
je 0x25200
movl $0x1, %r15d
xorl %ecx, %ecx
leaq 0x38(%rsp), %rbp
movsd (%rax,%rcx,8), %xmm0
movq %rbp, %rdi
callq 0x5500
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 %r15d, %ecx
movq 0x3c0(%r14), %rax
movq 0x3c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r15d
cmpq %rcx, %rdx
ja 0x251a9
leaq 0x38(%rsp), %rdi
callq 0x5430
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %r15
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x11328(%rip), %rsi     # 0x36555
movl $0x1e, %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 (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x112ec(%rip), %rsi     # 0x36574
movl $0x24, %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
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x112b6(%rip), %rsi     # 0x36599
movl $0x28, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3f0(%r14), %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 (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5350
movq %rax, %r12
leaq 0x11280(%rip), %rsi     # 0x365c2
movl $0x20, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3e8(%r14), %rsi
addq 0x3f0(%r14), %rsi
movq %r12, %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 (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x1123b(%rip), %rsi     # 0x365e3
movl $0x24, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3e0(%r14), %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 (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5350
movq %rax, %r12
leaq 0x11201(%rip), %rsi     # 0x36608
movl $0x1c, %edx
movq %rax, %rdi
callq 0x5350
movq 0x3d8(%r14), %rsi
addq 0x3e0(%r14), %rsi
movq %r12, %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 %r15, %rax
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0xcc1c
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x27d9c
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x25493
callq 0x52a0
movq 0x1fb26(%rip), %rax     # 0x44fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x40(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x38(%rsp,%rcx)
callq 0x5270
leaq 0x130(%rsp), %rdi
callq 0x5120
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x254f0
callq 0x52a0
jmp 0x254f0
jmp 0x254ed
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5628
movq %rbx, %rdi
callq 0x55a0