// File: /workspace/github_cpp_makefile_star2_O2/gvaumour[P]cache-simulator/src/SimplePerceptron.cc
// Function: SimplePerceptronPredictor::reportEviction(CacheEntry*, bool)
void
SimplePerceptronPredictor::reportEviction(CacheEntry* entry, bool inNVM)
{
	if(!simu_parameters.printDebug)
		return;
		
	string cl_location = inNVM ? "NVM" : "SRAM";
	string counters = "[";
	string hashes = "[";	
	
	for(unsigned i = 0 ; i < m_features.size()-1; i++)
	{
		int hash = hashing_function1( m_features_hash[i] , entry->address , entry->missPC);		
		int counter = m_features[i]->getCounter(hash);
		counters += to_string(counter) + " , ";
		hashes += to_string(hash) + " , ";
	}
	
	int hash = hashing_function1( m_features_hash[m_features.size()-1] , entry->address , entry->missPC);		
	counters += to_string(m_features[m_features.size()-1]->getCounter(hash)) + " ]";
	hashes	+= to_string(hash) + " ]";
	int first_hash = hashing_function1( m_features_hash[0] , entry->address , entry->missPC);

	debug_file_simple_perceptron << "EVICTION:Dataset n°" << first_hash << ": Cl 0x" << std::hex << entry->address \
	<< std::dec << ", E_SRAM =" << entry->e_sram << " , E_NVM =" << entry->e_nvm << " allocated in " << cl_location << ", Hashes=" << hashes \
        << ", Counters=" << counters << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, 0x8(%rsp)
leaq 0x19f3f(%rip), %rax     # 0x3df50
cmpb $0x1, (%rax)
jne 0x243a9
movq %rdi, %r14
leaq 0x57d8(%rip), %rax      # 0x297fc
leaq 0x57da(%rip), %rsi      # 0x29805
testb %dl, %dl
cmovneq %rax, %rsi
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x5140
leaq 0x5c7e(%rip), %rsi      # 0x29cc8
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x5140
leaq 0x5c68(%rip), %rsi      # 0x29cc8
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x5140
xorl %r13d, %r13d
leaq 0x100(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0x10(%rsp), %rbp
movl %r13d, %r13d
movq 0x278(%r14), %rax
subq 0x270(%r14), %rax
movq 0x288(%r14), %rsi
sarq $0x3, %rax
decq %rax
cmpq %r13, %rax
jbe 0x24166
imulq $0x28, %r13, %rax
addq %rax, %rsi
movq %r15, %rdi
callq 0x9f3a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
movq %r15, %rdi
callq 0x11de8
movl %eax, %ebx
movq %r15, %rdi
callq 0x5618
movq 0x270(%r14), %rax
movq (%rax,%r13,8), %rdi
movl %ebx, %esi
callq 0x22264
movq %r12, %rdi
movl %eax, %esi
callq 0xa0dc
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x56a9(%rip), %rdx      # 0x297ac
callq 0xa0bd
leaq 0x70(%rsp), %rdi
movq %rbp, %rsi
callq 0x55f0
movq %rbp, %rdi
callq 0x5618
movq %r12, %rdi
callq 0x5618
movq %r12, %rdi
movl %ebx, %esi
callq 0xa0dc
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x5670(%rip), %rdx      # 0x297ac
callq 0xa0bd
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x55f0
movq %rbp, %rdi
callq 0x5618
movq %r12, %rdi
callq 0x5618
incl %r13d
jmp 0x24084
imulq $0x28, %rax, %rax
addq %rax, %rsi
leaq 0xd8(%rsp), %rdi
callq 0x9f3a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
leaq 0xd8(%rsp), %rdi
callq 0x11de8
movl %eax, %ebp
leaq 0xd8(%rsp), %rdi
callq 0x5618
movq 0x278(%r14), %rax
movq -0x8(%rax), %rdi
movl %ebp, %esi
callq 0x22264
leaq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0xa0dc
leaq 0x7d31(%rip), %rdx      # 0x2bef9
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xa0bd
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x55f0
leaq 0x10(%rsp), %rdi
callq 0x5618
leaq 0x30(%rsp), %rdi
callq 0x5618
leaq 0x30(%rsp), %rdi
movl %ebp, %esi
callq 0xa0dc
leaq 0x7cec(%rip), %rdx      # 0x2bef9
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xa0bd
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x55f0
leaq 0x10(%rsp), %rdi
callq 0x5618
leaq 0x30(%rsp), %rdi
callq 0x5618
movq 0x288(%r14), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x9f3a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
leaq 0xb0(%rsp), %rdi
callq 0x11de8
movl %eax, %ebx
leaq 0xb0(%rsp), %rdi
callq 0x5618
leaq 0x19a8d(%rip), %rdi     # 0x3dd10
leaq 0x7c92(%rip), %rsi      # 0x2bf1c
callq 0x52c0
movq %rax, %rdi
movl %ebx, %esi
callq 0x5560
leaq 0x7c91(%rip), %rsi      # 0x2bf31
movq %rax, %rdi
callq 0x52c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rsi
movq %rax, %rdi
callq 0x5200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x7c1c(%rip), %rsi      # 0x2bf06
movq %rax, %rdi
callq 0x52c0
movq 0x8(%rsp), %rcx
movq 0x138(%rcx), %rsi
movq %rax, %rdi
callq 0x5200
leaq 0x7c04(%rip), %rsi      # 0x2bf11
movq %rax, %rdi
callq 0x52c0
movq 0x8(%rsp), %rcx
movq 0x140(%rcx), %rsi
movq %rax, %rdi
callq 0x5200
leaq 0x4ef9(%rip), %rsi      # 0x29229
movq %rax, %rdi
callq 0x52c0
leaq 0x90(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x7bea(%rip), %rsi      # 0x2bf39
movq %rax, %rdi
callq 0x52c0
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x7bda(%rip), %rsi      # 0x2bf45
movq %rax, %rdi
callq 0x52c0
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
movq %rax, %rdi
callq 0x5190
leaq 0x50(%rsp), %rdi
callq 0x5618
leaq 0x70(%rsp), %rdi
callq 0x5618
leaq 0x90(%rsp), %rdi
callq 0x5618
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x24422
jmp 0x24406
jmp 0x2441a
jmp 0x24415
jmp 0x24406
jmp 0x2441a
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x24422
jmp 0x24415
movq %rax, %rbx
jmp 0x24431
movq %rax, %rbx
jmp 0x2443b
jmp 0x24415
jmp 0x24415
jmp 0x24415
jmp 0x24415
jmp 0x24415
jmp 0x24406
jmp 0x2441a
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
jmp 0x24422
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5618
jmp 0x2441d
movq %rax, %rbx
jmp 0x24427
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5618
leaq 0x50(%rsp), %rdi
callq 0x5618
leaq 0x70(%rsp), %rdi
callq 0x5618
leaq 0x90(%rsp), %rdi
callq 0x5618
movq %rbx, %rdi
callq 0x5570