// File: /workspace/github_cpp_makefile_star2_O3/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 0x24f96
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 0x24f82
jmp 0x24f9c
xorl %r13d, %r13d
xorl %r12d, %r12d
leaq 0x11594(%rip), %rsi     # 0x36537
leaq 0x38(%rsp), %rdi
movl $0x10, %edx
callq 0x5320
movq 0x3c0(%r14), %rax
cmpq %rax, 0x3c8(%r14)
je 0x25026
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 0x52c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5200
movl %r15d, %ecx
movq 0x3c0(%r14), %rax
movq 0x3c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r15d
cmpq %rcx, %rdx
ja 0x24fcf
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 0x5360
movq %rax, %rbx
leaq 0x114fa(%rip), %rsi     # 0x3654d
movl $0x1e, %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 (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x114be(%rip), %rsi     # 0x3656c
movl $0x24, %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
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x11488(%rip), %rsi     # 0x36591
movl $0x28, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3f0(%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 (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5360
movq %rax, %r12
leaq 0x11452(%rip), %rsi     # 0x365ba
movl $0x20, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3e8(%r14), %rsi
addq 0x3f0(%r14), %rsi
movq %r12, %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 (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x1140d(%rip), %rsi     # 0x365db
movl $0x24, %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 (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbp, %rdi
callq 0x5360
movq %rax, %r12
leaq 0x113d3(%rip), %rsi     # 0x36600
movl $0x1c, %edx
movq %rax, %rdi
callq 0x5360
movq 0x3d8(%r14), %rsi
addq 0x3e0(%r14), %rsi
movq %r12, %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 %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 0xcbd6
leaq 0x18(%rsp), %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x27a64
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x252b9
callq 0x52b0
movq 0x1fd00(%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 0x5280
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 0x25316
callq 0x52b0
jmp 0x25316
jmp 0x25313
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5628
movq %rbx, %rdi
callq 0x55a0