// File: /workspace/github_cpp_makefile_star2_O2/gvaumour[P]cache-simulator/src/SimplePerceptron.cc
// Function: SimplePerceptronPredictor::reportMigration(CacheEntry*, bool, bool)
void
SimplePerceptronPredictor::reportMigration(CacheEntry* current, bool fromNVM, bool isWrite)
{
	
	if(!simu_parameters.printDebug)
		return;	

	string cl_location = fromNVM ? "from NVM" : "from SRAM";

	string confidence = "[", hashes = "[";	
	for(unsigned i = 0 ; i < m_features.size() ; i++)
	{
		int hash = hashing_function1( m_features_hash[i] , current->address , current->missPC);		
		confidence += to_string(m_features[i]->getCounter(hash)) + " , ";
		hashes += to_string(hash) + " , ";
		
	}
	
	int first_hash = hashing_function1( m_features_hash[0] , current->address , current->missPC);
	
	debug_file_simple_perceptron << "Migration:Dataset n°" << first_hash << ", Migration " << cl_location \
	<< " Cl 0x" << std::hex << current->address << std::dec << ", Features Hashes=" << hashes \
	<< "] , Counters="  << confidence << "]" << endl;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, (%rsp)
leaq 0x19ab4(%rip), %rax     # 0x3df50
cmpb $0x1, (%rax)
jne 0x24711
movq %rdi, %r14
leaq 0x5348(%rip), %rax      # 0x297f7
leaq 0x534a(%rip), %rsi      # 0x29800
testb %dl, %dl
cmovneq %rax, %rsi
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x5140
leaq 0x57f6(%rip), %rsi      # 0x29cc8
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x5140
leaq 0x57e0(%rip), %rsi      # 0x29cc8
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x5140
xorl %ebx, %ebx
leaq 0xd0(%rsp), %r15
leaq 0xb0(%rsp), %r12
leaq 0x48(%rsp), %rbp
movl %ebx, %ebx
movq 0x278(%r14), %rax
movq 0x288(%r14), %rsi
subq 0x270(%r14), %rax
sarq $0x3, %rax
cmpq %rbx, %rax
jbe 0x245ed
imulq $0x28, %rbx, %rax
addq %rax, %rsi
movq %r15, %rdi
callq 0x9f3a
movq (%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
movq %r15, %rdi
callq 0x11de8
movl %eax, %r13d
movq %r15, %rdi
callq 0x5618
movq 0x270(%r14), %rax
movq (%rax,%rbx,8), %rdi
movl %r13d, %esi
callq 0x22264
movq %r12, %rdi
movl %eax, %esi
callq 0xa0dc
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x5222(%rip), %rdx      # 0x297ac
callq 0xa0bd
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x55f0
movq %rbp, %rdi
callq 0x5618
movq %r12, %rdi
callq 0x5618
movq %r12, %rdi
movl %r13d, %esi
callq 0xa0dc
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x51e8(%rip), %rdx      # 0x297ac
callq 0xa0bd
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x55f0
movq %rbp, %rdi
callq 0x5618
movq %r12, %rdi
callq 0x5618
incl %ebx
jmp 0x2450e
leaq 0x88(%rsp), %rdi
callq 0x9f3a
movq (%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
leaq 0x88(%rsp), %rdi
callq 0x11de8
movl %eax, %ebp
leaq 0x88(%rsp), %rdi
callq 0x5618
leaq 0x196e7(%rip), %rdi     # 0x3dd10
leaq 0x51da(%rip), %rsi      # 0x2980a
callq 0x52c0
movq %rax, %rdi
movl %ebp, %esi
callq 0x5560
leaq 0x5550(%rip), %rsi      # 0x29b96
movq %rax, %rdi
callq 0x52c0
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x5498(%rip), %rsi      # 0x29afa
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 (%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 0x50ed(%rip), %rsi      # 0x29798
movq %rax, %rdi
callq 0x52c0
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x787c(%rip), %rsi      # 0x2bf43
movq %rax, %rdi
callq 0x52c0
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x7817(%rip), %rsi      # 0x2befa
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
callq 0x5190
leaq 0x8(%rsp), %rdi
callq 0x5618
leaq 0x28(%rsp), %rdi
callq 0x5618
leaq 0x68(%rsp), %rdi
callq 0x5618
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
jmp 0x2476b
movq %rax, %rbx
jmp 0x2477f
movq %rax, %rbx
jmp 0x24789
jmp 0x24772
jmp 0x24772
jmp 0x24742
jmp 0x24760
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x5618
jmp 0x24763
jmp 0x24772
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
jmp 0x2476b
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x5618
jmp 0x24775
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5618
leaq 0x28(%rsp), %rdi
callq 0x5618
leaq 0x68(%rsp), %rdi
callq 0x5618
movq %rbx, %rdi
callq 0x5570
nop