// File: 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:
subq $0x2c8, %rsp            # imm = 0x2C8
movb %cl, %al
movb %dl, %cl
movq %rdi, 0x2c0(%rsp)
movq %rsi, 0x2b8(%rsp)
andb $0x1, %cl
movb %cl, 0x2b7(%rsp)
andb $0x1, %al
movb %al, 0x2b6(%rsp)
movq 0x2c0(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq 0x87e3b(%rip), %rax     # 0x93ff0
testb $0x1, (%rax)
jne 0xc1bf
jmp 0xc990
movb 0x2b7(%rsp), %dl
leaq 0x65651(%rip), %rcx     # 0x7181e
leaq 0x65653(%rip), %rax     # 0x71827
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0xc0(%rsp)
leaq 0x28f(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0x56a0
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
leaq 0x290(%rsp), %rdi
callq 0x5530
jmp 0xc217
leaq 0x28f(%rsp), %rdi
callq 0x53e0
leaq 0x257(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0x56a0
movq 0xb8(%rsp), %rdx
leaq 0x65a90(%rip), %rsi     # 0x71cd8
leaq 0x258(%rsp), %rdi
callq 0x5530
jmp 0xc257
leaq 0x257(%rsp), %rdi
callq 0x53e0
leaq 0x22f(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
callq 0x56a0
movq 0xb0(%rsp), %rdx
leaq 0x65a50(%rip), %rsi     # 0x71cd8
leaq 0x230(%rsp), %rdi
callq 0x5530
jmp 0xc297
leaq 0x22f(%rsp), %rdi
callq 0x53e0
leaq 0x207(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0x56a0
movq 0xa8(%rsp), %rdx
leaq 0x65a10(%rip), %rsi     # 0x71cd8
leaq 0x208(%rsp), %rdi
callq 0x5530
jmp 0xc2d7
leaq 0x207(%rsp), %rdi
callq 0x53e0
movl $0x0, 0x200(%rsp)
movq 0xd0(%rsp), %rdi
movl 0x200(%rsp), %eax
movq %rax, 0xa0(%rsp)
addq $0x270, %rdi            # imm = 0x270
callq 0xf840
movq %rax, %rcx
movq 0xa0(%rsp), %rax
cmpq %rcx, %rax
jae 0xc773
movq 0xd0(%rsp), %rdi
addq $0x288, %rdi            # imm = 0x288
movl 0x200(%rsp), %eax
movl %eax, %esi
callq 0xf860
movq %rax, %rsi
leaq 0x1d0(%rsp), %rdi
callq 0xf880
jmp 0xc355
movq 0x2b8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
leaq 0x1d0(%rsp), %rdi
callq 0x2ff40
movl %eax, 0x9c(%rsp)
jmp 0xc37b
leaq 0x1d0(%rsp), %rdi
callq 0xf7b0
movl 0x9c(%rsp), %eax
movq 0xd0(%rsp), %rdi
movl %eax, 0x1fc(%rsp)
addq $0x270, %rdi            # imm = 0x270
movl 0x200(%rsp), %eax
movl %eax, %esi
callq 0xf8c0
movq (%rax), %rdi
movl 0x1fc(%rsp), %esi
movl $0x1, %edx
callq 0x2d520
movl %eax, 0x98(%rsp)
jmp 0xc3d0
movl 0x98(%rsp), %esi
leaq 0x190(%rsp), %rdi
callq 0x101d0
jmp 0xc3e6
leaq 0x653e6(%rip), %rdx     # 0x717d3
leaq 0x1b0(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x10180
jmp 0xc404
leaq 0x230(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x54f0
jmp 0xc41b
leaq 0x1b0(%rsp), %rdi
callq 0x5768
leaq 0x190(%rsp), %rdi
callq 0x5768
movq 0xd0(%rsp), %rdi
addq $0x270, %rdi            # imm = 0x270
movl 0x200(%rsp), %eax
movl %eax, %esi
callq 0xf8c0
movq (%rax), %rdi
movl 0x1fc(%rsp), %esi
movzbl 0x2b6(%rsp), %edx
andl $0x1, %edx
callq 0x2d360
movl %eax, 0x94(%rsp)
jmp 0xc475
movl 0x94(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x86fa9(%rip), %rax     # 0x93430
movq (%rax,%rcx,8), %rax
movq %rax, 0x80(%rsp)
leaq 0x14f(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x56a0
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
leaq 0x150(%rsp), %rdi
callq 0x5530
jmp 0xc4c7
leaq 0x65305(%rip), %rdx     # 0x717d3
leaq 0x170(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x10180
jmp 0xc4e5
leaq 0x258(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x54f0
jmp 0xc4fc
leaq 0x170(%rsp), %rdi
callq 0x5768
leaq 0x150(%rsp), %rdi
callq 0x5768
leaq 0x14f(%rsp), %rdi
callq 0x53e0
movl 0x1fc(%rsp), %esi
leaq 0x108(%rsp), %rdi
callq 0x101d0
jmp 0xc539
leaq 0x65293(%rip), %rdx     # 0x717d3
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x10180
jmp 0xc557
leaq 0x208(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x54f0
jmp 0xc56e
leaq 0x128(%rsp), %rdi
callq 0x5768
leaq 0x108(%rsp), %rdi
callq 0x5768
movl 0x200(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x200(%rsp)
jmp 0xc2ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0x28f(%rsp), %rdi
callq 0x53e0
jmp 0xc9ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0x257(%rsp), %rdi
callq 0x53e0
jmp 0xc9e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0x22f(%rsp), %rdi
callq 0x53e0
jmp 0xc9d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0x207(%rsp), %rdi
callq 0x53e0
jmp 0xc9c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
jmp 0xc9b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0xf7b0
jmp 0xc9b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
jmp 0xc6ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0x5768
leaq 0x190(%rsp), %rdi
callq 0x5768
jmp 0xc9b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
jmp 0xc718
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
jmp 0xc70b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x5768
leaq 0x150(%rsp), %rdi
callq 0x5768
leaq 0x14f(%rsp), %rdi
callq 0x53e0
jmp 0xc9b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
jmp 0xc761
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0x128(%rsp), %rdi
callq 0x5768
leaq 0x108(%rsp), %rdi
callq 0x5768
jmp 0xc9b9
movq 0xd0(%rsp), %rdi
addq $0x288, %rdi            # imm = 0x288
xorl %eax, %eax
movl %eax, %esi
callq 0xf860
movq %rax, %rsi
leaq 0xd8(%rsp), %rdi
callq 0xf880
jmp 0xc79d
movq 0x2b8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
leaq 0xd8(%rsp), %rdi
callq 0x2ff40
movl %eax, 0x7c(%rsp)
jmp 0xc7c0
leaq 0xd8(%rsp), %rdi
callq 0xf7b0
movl 0x7c(%rsp), %eax
movl %eax, 0x104(%rsp)
leaq 0x86d21(%rip), %rdi     # 0x93500
leaq 0x6504b(%rip), %rsi     # 0x71831
callq 0x5380
movq %rax, 0x70(%rsp)
jmp 0xc7f2
movq 0x70(%rsp), %rdi
movl 0x104(%rsp), %esi
callq 0x5680
movq %rax, 0x68(%rsp)
jmp 0xc80a
movq 0x68(%rsp), %rdi
leaq 0x65390(%rip), %rsi     # 0x71ba6
callq 0x5380
movq %rax, 0x60(%rsp)
jmp 0xc822
movq 0x60(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x5330
movq %rax, 0x58(%rsp)
jmp 0xc83b
movq 0x58(%rsp), %rdi
leaq 0x652c3(%rip), %rsi     # 0x71b0a
callq 0x5380
movq %rax, 0x50(%rsp)
jmp 0xc853
movq 0x50(%rsp), %rdi
leaq 0x2fa1(%rip), %rsi      # 0xf800
callq 0x5160
movq %rax, 0x48(%rsp)
jmp 0xc86b
movq 0x48(%rsp), %rdi
movq 0x2b8(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x50f0
movq %rax, 0x40(%rsp)
jmp 0xc888
movq 0x40(%rsp), %rdi
leaq 0x2f8c(%rip), %rsi      # 0xf820
callq 0x5160
movq %rax, 0x38(%rsp)
jmp 0xc8a0
movq 0x38(%rsp), %rdi
leaq 0x64f13(%rip), %rsi     # 0x717bf
callq 0x5380
movq %rax, 0x30(%rsp)
jmp 0xc8b8
movq 0x30(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x5330
movq %rax, 0x28(%rsp)
jmp 0xc8d1
movq 0x28(%rsp), %rdi
leaq 0x64f6a(%rip), %rsi     # 0x71847
callq 0x5380
movq %rax, 0x20(%rsp)
jmp 0xc8e9
movq 0x20(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0x5330
movq %rax, 0x18(%rsp)
jmp 0xc902
movq 0x18(%rsp), %rdi
leaq 0x64ec9(%rip), %rsi     # 0x717d7
callq 0x5380
movq %rax, 0x10(%rsp)
jmp 0xc91a
movq 0x10(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x5330
movq %rax, 0x8(%rsp)
jmp 0xc933
movq 0x8(%rsp), %rdi
leaq 0x675b5(%rip), %rsi     # 0x73ef4
callq 0x5380
movq %rax, (%rsp)
jmp 0xc94a
movq (%rsp), %rdi
movq 0x86663(%rip), %rsi     # 0x92fb8
callq 0x53d0
jmp 0xc95c
leaq 0x208(%rsp), %rdi
callq 0x5768
leaq 0x230(%rsp), %rdi
callq 0x5768
leaq 0x258(%rsp), %rdi
callq 0x5768
leaq 0x290(%rsp), %rdi
callq 0x5768
addq $0x2c8, %rsp            # imm = 0x2C8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x280(%rsp)
movl %eax, 0x27c(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0xf7b0
leaq 0x208(%rsp), %rdi
callq 0x5768
leaq 0x230(%rsp), %rdi
callq 0x5768
leaq 0x258(%rsp), %rdi
callq 0x5768
leaq 0x290(%rsp), %rdi
callq 0x5768
movq 0x280(%rsp), %rdi
callq 0x5690
nopw (%rax,%rax)