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

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

	string des = "[" , 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]->getConfidence(hash, true)) + " , ";
		des += string(str_allocDecision[m_features[i]->getAllocDecision(hash, isWrite)]) + " , " ;
		hashes += to_string(hash) + " , ";
		
	}
	
	int first_hash = hashing_function1( m_features_hash[0] , current->address , current->missPC);
	
	debug_file << "Migration:Dataset n°" << first_hash << ", Migration " << cl_location \
	<< " Cl 0x" << std::hex << current->address << std::dec << ", Features Hashes=" << hashes \
	<< "] , Des=" << des << "] , Confidence="  << confidence << "]" << endl;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, 0x8(%rsp)
leaq 0x355ef(%rip), %rax     # 0x3df50
cmpb $0x1, (%rax)
jne 0x8c84
movl %ecx, %ebx
movq %rdi, %r14
leaq 0x20e81(%rip), %rax     # 0x297f7
leaq 0x20e83(%rip), %rsi     # 0x29800
testb %dl, %dl
cmovneq %rax, %rsi
leaq 0xb8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x5140
leaq 0x2132c(%rip), %rsi     # 0x29cc8
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x5140
leaq 0x21316(%rip), %rsi     # 0x29cc8
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x5140
leaq 0x21300(%rip), %rsi     # 0x29cc8
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x5140
xorl %r15d, %r15d
leaq 0x98(%rsp), %r12
leaq 0x20dc3(%rip), %r13     # 0x297ac
leaq 0x78(%rsp), %rbp
movzbl %bl, %eax
movl %eax, 0x14(%rsp)
movl %r15d, %r15d
movq 0x278(%r14), %rax
movq 0x288(%r14), %rsi
subq 0x270(%r14), %rax
sarq $0x3, %rax
cmpq %r15, %rax
jbe 0x8b32
imulq $0x28, %r15, %rax
addq %rax, %rsi
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
callq 0x9f3a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
movq %rbx, %rdi
callq 0x11de8
movq %rbx, %rdi
movl %eax, %ebx
callq 0x5618
movq 0x270(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
pushq $0x1
popq %rdx
callq 0x11132
movq %r12, %rdi
movl %eax, %esi
callq 0xa0dc
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xa0bd
leaq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x55f0
movq %rbp, %rdi
callq 0x5618
movq %r12, %rdi
callq 0x5618
movq 0x270(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
movl 0x14(%rsp), %edx
callq 0x11088
movl %eax, %eax
leaq 0x348d7(%rip), %rcx     # 0x3d390
movq (%rcx,%rax,8), %rsi
movq %r12, %rdi
leaq 0x7(%rsp), %rdx
callq 0x5140
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xa0bd
leaq 0x58(%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
movq %r13, %rdx
callq 0xa0bd
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x55f0
movq %rbp, %rdi
callq 0x5618
movq %r12, %rdi
callq 0x5618
incl %r15d
jmp 0x89f5
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, %ebx
leaq 0xd8(%rsp), %rdi
callq 0x5618
leaq 0x348f1(%rip), %rdi     # 0x3d460
leaq 0x20c94(%rip), %rsi     # 0x2980a
callq 0x52c0
movq %rax, %rdi
movl %ebx, %esi
callq 0x5560
leaq 0x2100a(%rip), %rsi     # 0x29b96
movq %rax, %rdi
callq 0x52c0
leaq 0xb8(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x20f4f(%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 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 0x20ba3(%rip), %rsi     # 0x29798
movq %rax, %rdi
callq 0x52c0
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x20c0f(%rip), %rsi     # 0x29820
movq %rax, %rdi
callq 0x52c0
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x20b83(%rip), %rsi     # 0x297b0
movq %rax, %rdi
callq 0x52c0
leaq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x5290
leaq 0x232b1(%rip), %rsi     # 0x2befa
movq %rax, %rdi
callq 0x52c0
movq %rax, %rdi
callq 0x5190
leaq 0x18(%rsp), %rdi
callq 0x5618
leaq 0x38(%rsp), %rdi
callq 0x5618
leaq 0x58(%rsp), %rdi
callq 0x5618
leaq 0xb8(%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 0xd8(%rsp), %rdi
jmp 0x8cde
movq %rax, %rbx
jmp 0x8cff
movq %rax, %rbx
jmp 0x8d09
movq %rax, %rbx
jmp 0x8d13
jmp 0x8cf2
jmp 0x8cd3
jmp 0x8cf2
jmp 0x8cf2
jmp 0x8cc0
jmp 0x8cd3
jmp 0x8cc0
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x5618
jmp 0x8cd6
jmp 0x8cf2
jmp 0x8cf2
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x5618
jmp 0x8cf5
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
jmp 0x8cde
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5618
leaq 0x38(%rsp), %rdi
callq 0x5618
leaq 0x58(%rsp), %rdi
callq 0x5618
leaq 0xb8(%rsp), %rdi
callq 0x5618
movq %rbx, %rdi
callq 0x5570