// File: /workspace/github_cpp_makefile_star2_O3/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 0x18cb9(%rip), %rax     # 0x45f50
cmpb $0x1, (%rax)
jne 0x2d7f5
movq %rdi, %r13
leaq 0x7531(%rip), %rax      # 0x347db
leaq 0x7533(%rip), %rsi      # 0x347e4
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 0xcc6c
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x79fe(%rip), %rsi      # 0x34ce8
leaq 0x79f8(%rip), %rdx      # 0x34ce9
leaq 0x68(%rsp), %rdi
callq 0xcc6c
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x79dd(%rip), %rsi      # 0x34ce8
leaq 0x79d7(%rip), %rdx      # 0x34ce9
leaq 0x48(%rsp), %rdi
callq 0xcc6c
movq 0x278(%r13), %rax
cmpq 0x270(%r13), %rax
je 0x2d61c
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 0xcbd6
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 0x159f0
movl %eax, %ebp
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d3a3
callq 0x52b0
movq %r13, %r14
movq 0x270(%r13), %rax
movq (%rax,%r12,8), %rdi
movl %ebp, %esi
callq 0x2a034
movl %eax, %r13d
movl %eax, %r15d
negl %r15d
cmovsl %eax, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0x2d412
movl $0x4, %ebx
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x2d40b
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x2d410
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x2d412
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x2d3dd
addl $-0x3, %ebx
jmp 0x2d412
addl $-0x2, %ebx
jmp 0x2d412
decl %ebx
shrl $0x1f, %r13d
leal (%rbx,%r13), %esi
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x5380
movl %r13d, %edi
addq (%rsp), %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xcb17
movq %rsp, %rdi
leaq 0x7345(%rip), %rsi      # 0x34790
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 0x2d47b
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x2d482
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 0x2d4c2
callq 0x52b0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2d4d0
callq 0x52b0
movl %ebp, %r15d
negl %r15d
cmovsl %ebp, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0x2d527
movl $0x4, %ebx
movl %r15d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x2d520
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x2d525
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x2d527
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x2d4f2
addl $-0x3, %ebx
jmp 0x2d527
addl $-0x2, %ebx
jmp 0x2d527
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 0x5380
movl %ebp, %edi
addq (%rsp), %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xcb17
movq %r13, %rdi
leaq 0x722a(%rip), %rsi      # 0x34790
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 0x2d59e
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x2d5a5
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 0x2d5e8
callq 0x52b0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x2d5f6
callq 0x52b0
incl %r12d
movq 0x278(%r13), %rax
subq 0x270(%r13), %rax
sarq $0x3, %rax
cmpq %r12, %rax
leaq 0xb8(%rsp), %r14
ja 0x2d343
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 0xcbd6
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 0x159f0
movl %eax, %ebx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d67c
callq 0x52b0
leaq 0x1868d(%rip), %rdi     # 0x45d10
leaq 0x7164(%rip), %rsi      # 0x347ee
movl $0x15, %edx
callq 0x5360
leaq 0x18675(%rip), %rdi     # 0x45d10
movl %ebx, %esi
callq 0x5580
movq %rax, %rbx
leaq 0x750a(%rip), %rsi      # 0x34bb6
movl $0xc, %edx
movq %rax, %rdi
callq 0x5360
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x743f(%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 0x40(%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 0x704f(%rip), %rsi      # 0x3477c
movl $0x12, %edx
movq %rbx, %rdi
callq 0x5360
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x983d(%rip), %rsi      # 0x36f93
movl $0xd, %edx
movq %rax, %rdi
callq 0x5360
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0x97cb(%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 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2d7c7
callq 0x52b0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2d7db
callq 0x52b0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2d7f5
callq 0x52b0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
jmp 0x2d82d
movq %rax, %rbx
jmp 0x2d87d
movq %rax, %rbx
jmp 0x2d891
jmp 0x2d866
jmp 0x2d866
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r14, %rdi
jne 0x2d85f
jmp 0x2d869
jmp 0x2d83a
jmp 0x2d83f
jmp 0x2d866
movq %rax, %rbx
jmp 0x2d851
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d851
callq 0x52b0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2d869
callq 0x52b0
jmp 0x2d869
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2d87d
callq 0x52b0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2d891
callq 0x52b0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2d8ab
callq 0x52b0
movq %rbx, %rdi
callq 0x55a0
nop