// File: /workspace/github_cpp_makefile_star2_O3/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 $0x138, %rsp            # imm = 0x138
movl %ecx, 0xbc(%rsp)
movq %rsi, 0xb0(%rsp)
leaq 0x3bc73(%rip), %rax     # 0x45f50
cmpb $0x1, (%rax)
jne 0xa993
movq %rdi, %r13
leaq 0x2a4eb(%rip), %rax     # 0x347db
leaq 0x2a4ed(%rip), %rsi     # 0x347e4
testb %dl, %dl
cmovneq %rax, %rsi
leaq 0xa0(%rsp), %r15
movq %r15, -0x10(%r15)
movzbl %dl, %edx
xorq $0x9, %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0xcc6c
leaq 0x80(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2a9b4(%rip), %rsi     # 0x34ce8
leaq 0x2a9ae(%rip), %rdx     # 0x34ce9
leaq 0x70(%rsp), %rdi
callq 0xcc6c
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2a993(%rip), %rsi     # 0x34ce8
leaq 0x2a98d(%rip), %rdx     # 0x34ce9
leaq 0x50(%rsp), %rdi
callq 0xcc6c
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2a96f(%rip), %rsi     # 0x34ce8
leaq 0x2a969(%rip), %rdx     # 0x34ce9
leaq 0xc8(%rsp), %rdi
callq 0xcc6c
movq 0x278(%r13), %rax
cmpq 0x270(%r13), %rax
je 0xa768
leaq 0x20(%rsp), %r14
xorl %r12d, %r12d
leaq 0xe8(%rsp), %rbp
movq %r13, 0xc0(%rsp)
movq 0x288(%r13), %rbx
leaq (%r12,%r12,4), %r15
leaq 0xf8(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq (%rbx,%r15,8), %rsi
movq 0x8(%rbx,%r15,8), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xcbd6
leaq (%rbx,%r15,8), %rax
movq 0x20(%rax), %rax
movq %rax, 0x108(%rsp)
movq 0xb0(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
movq %rbp, %rdi
callq 0x159f0
movl %eax, %ebp
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0xa42c
callq 0x52b0
movq 0x270(%r13), %rax
movq (%rax,%r12,8), %rdi
movl %ebp, %esi
movl $0x1, %edx
callq 0x1491e
movl %eax, %r13d
movl %eax, %r15d
negl %r15d
cmovsl %eax, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0xa49d
movl $0x4, %ebx
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0xa496
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xa49b
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xa49d
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xa468
addl $-0x3, %ebx
jmp 0xa49d
addl $-0x2, %ebx
jmp 0xa49d
decl %ebx
shrl $0x1f, %r13d
leal (%rbx,%r13), %esi
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rdi
movl $0x2d, %edx
callq 0x5380
movl %r13d, %edi
addq 0x30(%rsp), %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xcb17
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
leaq 0x2a2b1(%rip), %rsi     # 0x34790
callq 0x55f0
movq %r14, %r15
movq %r14, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x40(%rsp), %r13
je 0xa50f
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0xa516
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x50(%rsp), %rdi
callq 0x5100
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xa551
callq 0x52b0
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0xa560
callq 0x52b0
movq 0xc0(%rsp), %rax
movq 0x270(%rax), %rax
movq (%rax,%r12,8), %rdi
movzbl 0xbc(%rsp), %edx
movl %ebp, %esi
callq 0x147cc
movl %eax, %eax
leaq 0x3ae05(%rip), %rcx     # 0x45390
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
leaq 0xf(%rsp), %rdx
callq 0x5140
movq %rbx, %rdi
leaq 0x2a1ea(%rip), %rsi     # 0x34790
callq 0x55f0
movq %r15, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xa5ce
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0xa5d5
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x70(%rsp), %rdi
callq 0x5100
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xa610
callq 0x52b0
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0xa61f
callq 0x52b0
movl %ebp, %r15d
negl %r15d
cmovsl %ebp, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0xa676
movl $0x4, %ebx
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0xa66f
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xa674
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xa676
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xa641
addl $-0x3, %ebx
jmp 0xa676
addl $-0x2, %ebx
jmp 0xa676
decl %ebx
movq %r12, %r13
shrl $0x1f, %ebp
leal (%rbx,%rbp), %esi
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x5380
movl %ebp, %edi
addq 0x30(%rsp), %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xcb17
movq %r12, %rdi
leaq 0x2a0da(%rip), %rsi     # 0x34790
callq 0x55f0
movq %r14, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0xe8(%rsp), %rbp
movq %r13, %r12
je 0xa6e9
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0xa6f0
movups (%rcx), %xmm0
movups %xmm0, (%r14)
leaq 0x40(%rsp), %rbx
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0xc8(%rsp), %rdi
callq 0x5100
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xa733
callq 0x52b0
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xa742
callq 0x52b0
incl %r12d
movq 0xc0(%rsp), %r13
movq 0x278(%r13), %rax
subq 0x270(%r13), %rax
sarq $0x3, %rax
cmpq %r12, %rax
ja 0xa3b9
movq 0x288(%r13), %rbx
leaq 0x120(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %rdi
leaq 0xa0(%rsp), %r15
leaq 0x80(%rsp), %r12
callq 0xcbd6
movq 0x20(%rbx), %rax
leaq 0x110(%rsp), %rdi
movq %rax, 0x20(%rdi)
movq 0xb0(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x159f0
movl %eax, %ebx
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0xa7db
callq 0x52b0
leaq 0x3ac7e(%rip), %rdi     # 0x45460
leaq 0x2a005(%rip), %rsi     # 0x347ee
movl $0x15, %edx
callq 0x5360
leaq 0x3ac66(%rip), %rdi     # 0x45460
movl %ebx, %esi
callq 0x5580
movq %rax, %rbx
leaq 0x2a3ab(%rip), %rsi     # 0x34bb6
movl $0xc, %edx
movq %rax, %rdi
callq 0x5360
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x2a2e0(%rip), %rsi     # 0x34b1a
movl $0x6, %edx
movq %rax, %rdi
callq 0x5360
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq 0xb0(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x51f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x29eed(%rip), %rsi     # 0x3477c
movl $0x12, %edx
movq %rbx, %rdi
callq 0x5360
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x29f46(%rip), %rsi     # 0x34804
movl $0x8, %edx
movq %rax, %rdi
callq 0x5360
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x29ead(%rip), %rsi     # 0x34794
movl $0xf, %edx
movq %rax, %rdi
callq 0x5360
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x2c63a(%rip), %rsi     # 0x36f4a
movl $0x1, %edx
movq %rax, %rdi
callq 0x5360
movq (%rbx), %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 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0xa95e
callq 0x52b0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xa972
callq 0x52b0
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xa981
callq 0x52b0
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xa993
callq 0x52b0
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
jne 0xaa48
jmp 0xaa52
movq %rax, %rbx
leaq 0xa0(%rsp), %r15
leaq 0x80(%rsp), %r12
leaq 0x60(%rsp), %r14
jmp 0xaa81
movq %rax, %rbx
jmp 0xaa90
movq %rax, %rbx
jmp 0xaa9f
movq %rax, %rbx
jmp 0xaa62
jmp 0xaa4f
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
jmp 0xaa43
jmp 0xaa22
jmp 0xaa11
jmp 0xaa4f
jmp 0xaa4f
jmp 0xaa22
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
jne 0xaa34
jmp 0xaa39
jmp 0xaa4f
movq %rax, %rbx
jmp 0xaa39
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xaa39
callq 0x52b0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xaa52
callq 0x52b0
jmp 0xaa52
movq %rax, %rbx
leaq 0xa0(%rsp), %r15
leaq 0x80(%rsp), %r12
leaq 0x60(%rsp), %r14
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0xaa81
callq 0x52b0
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xaa90
callq 0x52b0
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xaa9f
callq 0x52b0
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xaab1
callq 0x52b0
movq %rbx, %rdi
callq 0x55a0
nop