// File: /workspace/github_cpp_makefile_star2_O1/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, 0x40(%rsp)
leaq 0x1893d(%rip), %rax     # 0x45f50
cmpb $0x1, (%rax)
jne 0x2db71
movq %rdi, %r13
leaq 0x71e1(%rip), %rax      # 0x34807
leaq 0x71e3(%rip), %rsi      # 0x34810
testb %dl, %dl
cmovneq %rax, %rsi
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
movzbl %dl, %edx
xorq $0x9, %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0xccac
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x76a2(%rip), %rsi      # 0x34d08
leaq 0x769c(%rip), %rdx      # 0x34d09
leaq 0x68(%rsp), %rdi
callq 0xccac
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7681(%rip), %rsi      # 0x34d08
leaq 0x767b(%rip), %rdx      # 0x34d09
leaq 0x48(%rsp), %rdi
callq 0xccac
movq 0x278(%r13), %rax
cmpq 0x270(%r13), %rax
je 0x2d998
leaq 0xb8(%rsp), %r14
xorl %r12d, %r12d
leaq 0xa8(%rsp), %rbp
movq 0x288(%r13), %rbx
leaq (%r12,%r12,4), %r15
movq %r14, 0xa8(%rsp)
movq (%rbx,%r15,8), %rsi
movq 0x8(%rbx,%r15,8), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xcc1c
leaq (%rbx,%r15,8), %rax
movq 0x20(%rax), %rax
movq %rax, 0xc8(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
movq %rbp, %rdi
callq 0x15bec
movl %eax, %ebp
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d71f
callq 0x52a0
movq %r13, %r14
movq 0x270(%r13), %rax
movq (%rax,%r12,8), %rdi
movl %ebp, %esi
callq 0x2a38a
movl %eax, %r13d
movl %eax, %r15d
negl %r15d
cmovsl %eax, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0x2d78e
movl $0x4, %ebx
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x2d787
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x2d78c
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x2d78e
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x2d759
addl $-0x3, %ebx
jmp 0x2d78e
addl $-0x2, %ebx
jmp 0x2d78e
decl %ebx
shrl $0x1f, %r13d
leal (%rbx,%r13), %esi
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x5370
movl %r13d, %edi
addq (%rsp), %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xcb5d
movq %rsp, %rdi
leaq 0x6ff5(%rip), %rsi      # 0x347bc
callq 0x55f0
leaq 0x30(%rsp), %r15
movq %r15, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %r14, %r13
je 0x2d7f7
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x2d7fe
movups (%rcx), %xmm0
movups %xmm0, (%r15)
leaq 0x10(%rsp), %r14
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x68(%rsp), %rdi
callq 0x5100
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d83e
callq 0x52a0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2d84c
callq 0x52a0
movl %ebp, %r15d
negl %r15d
cmovsl %ebp, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0x2d8a3
movl $0x4, %ebx
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x2d89c
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x2d8a1
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x2d8a3
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x2d86e
addl $-0x3, %ebx
jmp 0x2d8a3
addl $-0x2, %ebx
jmp 0x2d8a3
decl %ebx
movq %r12, %r14
movq %r13, %r12
shrl $0x1f, %ebp
leal (%rbx,%rbp), %esi
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %r13
movq %r13, %rdi
movl $0x2d, %edx
callq 0x5370
movl %ebp, %edi
addq (%rsp), %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xcb5d
movq %r13, %rdi
leaq 0x6eda(%rip), %rsi      # 0x347bc
callq 0x55f0
leaq 0x30(%rsp), %r15
movq %r15, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0xa8(%rsp), %rbp
movq %r12, %r13
je 0x2d91a
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x2d921
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %r14, %r12
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x5100
leaq 0x10(%rsp), %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d964
callq 0x52a0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x2d972
callq 0x52a0
incl %r12d
movq 0x278(%r13), %rax
subq 0x270(%r13), %rax
sarq $0x3, %rax
cmpq %r12, %rax
leaq 0xb8(%rsp), %r14
ja 0x2d6bf
movq 0x288(%r13), %rbx
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0xcc1c
movq 0x20(%rbx), %rax
leaq 0xd0(%rsp), %rdi
movq %rax, 0x20(%rdi)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x15bec
movl %eax, %ebx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d9f8
callq 0x52a0
leaq 0x18311(%rip), %rdi     # 0x45d10
leaq 0x6e14(%rip), %rsi      # 0x3481a
movl $0x15, %edx
callq 0x5350
leaq 0x182f9(%rip), %rdi     # 0x45d10
movl %ebx, %esi
callq 0x5580
movq %rax, %rbx
leaq 0x71ae(%rip), %rsi      # 0x34bd6
movl $0xc, %edx
movq %rax, %rdi
callq 0x5350
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x70e3(%rip), %rsi      # 0x34b3a
movl $0x6, %edx
movq %rax, %rdi
callq 0x5350
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x51e0
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 0x6cff(%rip), %rsi      # 0x347a8
movl $0x12, %edx
movq %rbx, %rdi
callq 0x5350
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x94c9(%rip), %rsi      # 0x36f9b
movl $0xd, %edx
movq %rax, %rdi
callq 0x5350
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x9457(%rip), %rsi      # 0x36f52
movl $0x1, %edx
movq %rax, %rdi
callq 0x5350
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2db43
callq 0x52a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2db57
callq 0x52a0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2db71
callq 0x52a0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
jmp 0x2dba9
movq %rax, %rbx
jmp 0x2dbf9
movq %rax, %rbx
jmp 0x2dc0d
jmp 0x2dbe2
jmp 0x2dbe2
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x2dbdb
jmp 0x2dbe5
jmp 0x2dbb6
jmp 0x2dbbb
jmp 0x2dbe2
movq %rax, %rbx
jmp 0x2dbcd
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x2dbcd
callq 0x52a0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2dbe5
callq 0x52a0
jmp 0x2dbe5
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2dbf9
callq 0x52a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2dc0d
callq 0x52a0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2dc27
callq 0x52a0
movq %rbx, %rdi
callq 0x55a0
nop