// File: /workspace/github_cpp_makefile_star2_O1/gvaumour[P]cache-simulator/src/SimplePerceptron.cc
// Function: SimplePerceptronPredictor::reportAccess(Access, CacheEntry*, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void
SimplePerceptronPredictor::reportAccess(Access element, CacheEntry* current, int set , bool inNVM, string entete)
{
	if(!simu_parameters.printDebug)
		return;
	
	string cl_location = inNVM ? "NVM" : "SRAM";
	string access_type = element.isWrite() ? "WRITE" : "READ";
	
	string is_error= "";
	if( isHitInBPtags(element.block_addr , set) && entete == "INSERTION")
	{
		is_error == "is a BP error";
	}
	//if(element.isSRAMerror)
	//	is_error = "is an SRAM error, ";

	string counters = "[";
	string hashes = "[";	
	
	for(unsigned i = 0 ; i < m_features.size()-1; i++)
	{
		int hash = hashing_function1( m_features_hash[i] , current->address , current->missPC);		
		int counter = m_features[i]->getCounter(hash);
		counters += to_string(counter) + " , ";
		hashes += to_string(hash) + " , ";
	}
	int hash = hashing_function1( m_features_hash[m_features.size()-1] , current->address , current->missPC);		
	counters += to_string(m_features[m_features.size()-1]->getCounter(hash)) + " ]";
	hashes	+= to_string(hash) + " ]";
	
	int first_hash = hashing_function1( m_features_hash[0] , current->address , current->missPC);
	
	debug_file_simple_perceptron << entete << ":Dataset n°" << first_hash << ": " \
	<< access_type << " on Cl 0x" << std::hex << current->address << std::dec << ", E_SRAM =" \
	<< current->e_sram << " , E_NVM =" << current->e_nvm << " allocated in " << cl_location << ", " << is_error << "Hashes=" << hashes \
        << ", Counters=" << counters << endl;	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, 0x20(%rsp)
leaq 0x1a409(%rip), %rax     # 0x45f50
cmpb $0x1, (%rax)
jne 0x2c505
movq %r8, %r15
movl %edx, %ebx
movq %rdi, %r12
leaq 0x1b0(%rsp), %r14
leaq 0x8ca5(%rip), %rax      # 0x3480c
leaq 0x8ca7(%rip), %rsi      # 0x34815
testb %cl, %cl
cmovneq %rax, %rsi
leaq 0xf0(%rsp), %rax
movq %rax, -0x10(%rax)
movzbl %cl, %eax
negq %rax
leaq (%rsi,%rax), %rdx
addq $0x4, %rdx
leaq 0xe0(%rsp), %rdi
callq 0xccac
movl 0x1c(%r14), %eax
cmpl $0x3, %eax
sete %cl
cmpl $0x6, %eax
sete %al
orb %cl, %al
leaq 0xb463(%rip), %rcx      # 0x37017
leaq 0xb452(%rip), %rsi      # 0x3700d
cmovneq %rcx, %rsi
leaq 0xd0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movzbl %al, %eax
leaq (%rsi,%rax), %rdx
addq $0x4, %rdx
leaq 0xc0(%rsp), %rdi
callq 0xccac
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xa086(%rip), %rdx      # 0x35c7c
leaq 0x88(%rsp), %rdi
movq %rdx, %rsi
callq 0xccac
movq 0x30(%r14), %rsi
movq %r12, %r14
movq %r12, %rdi
movl %ebx, %edx
callq 0x278f6
testb %al, %al
je 0x2bc42
leaq 0x8519(%rip), %rsi      # 0x3413b
movq %r15, %rdi
callq 0x50f0
testl %eax, %eax
jne 0x2bc42
leaq 0xb30e(%rip), %rsi      # 0x36f43
leaq 0x88(%rsp), %rdi
callq 0x50f0
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x90b6(%rip), %rsi      # 0x34d08
leaq 0x90b0(%rip), %rdx      # 0x34d09
leaq 0x68(%rsp), %rdi
callq 0xccac
movq %r15, 0xa8(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x908d(%rip), %rsi      # 0x34d08
leaq 0x9087(%rip), %rdx      # 0x34d09
leaq 0x48(%rsp), %rdi
callq 0xccac
movq 0x278(%r14), %rax
subq 0x270(%r14), %rax
sarq $0x3, %rax
decq %rax
je 0x2bfa2
leaq 0x110(%rsp), %rbp
xorl %r15d, %r15d
leaq 0x100(%rsp), %r12
movq %r14, 0xb0(%rsp)
movq %r14, %r13
movq 0x288(%r14), %rbx
leaq (%r15,%r15,4), %r14
movq %rbp, 0x100(%rsp)
movq (%rbx,%r14,8), %rsi
movq 0x8(%rbx,%r14,8), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xcc1c
leaq (%rbx,%r14,8), %rax
movq 0x20(%rax), %rax
movq %rax, 0x120(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
movq %r12, %rdi
callq 0x15bec
movl %eax, %r14d
movq 0x100(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2bd26
callq 0x52a0
movq 0x270(%r13), %rax
movq (%rax,%r15,8), %rdi
movl %r14d, %esi
callq 0x2a38a
movl %eax, %r12d
movl %eax, %ebx
negl %ebx
cmovsl %eax, %ebx
movl $0x1, %ebp
cmpl $0xa, %ebx
jb 0x2bd8e
movl $0x4, %ebp
movl %ebx, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x2bd87
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x2bd8c
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x2bd8e
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebp
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x2bd59
addl $-0x3, %ebp
jmp 0x2bd8e
addl $-0x2, %ebp
jmp 0x2bd8e
decl %ebp
movq %r15, 0xb8(%rsp)
shrl $0x1f, %r12d
leal (%r12,%rbp), %esi
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movl $0x2d, %edx
callq 0x5370
movl %r12d, %edi
addq 0x28(%rsp), %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0xcb5d
movq %r13, %rdi
leaq 0x89e7(%rip), %rsi      # 0x347bc
callq 0x55f0
leaq 0x10(%rsp), %rbx
movq %rbx, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x38(%rsp), %rbp
je 0x2be05
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2be0b
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x68(%rsp), %rdi
callq 0x5100
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x2be44
callq 0x52a0
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2be53
callq 0x52a0
movl %r14d, %ebx
negl %ebx
cmovsl %r14d, %ebx
movl $0x1, %r12d
cmpl $0xa, %ebx
jb 0x2bead
movl $0x4, %r12d
movl %ebx, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0x2bea4
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x2beaa
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x2bead
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x2be74
addl $-0x3, %r12d
jmp 0x2bead
addl $-0x2, %r12d
jmp 0x2bead
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
movq %rbp, 0x28(%rsp)
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movl $0x2d, %edx
callq 0x5370
movl %r14d, %edi
addq 0x28(%rsp), %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0xcb5d
movq %r13, %rdi
leaq 0x88d4(%rip), %rsi      # 0x347bc
callq 0x55f0
leaq 0x10(%rsp), %rbx
movq %rbx, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %r15
je 0x2bf23
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2bf29
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x5100
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x2bf62
callq 0x52a0
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2bf71
callq 0x52a0
movq 0x278(%r14), %rax
subq 0x270(%r14), %rax
incl %r15d
sarq $0x3, %rax
decq %rax
cmpq %r15, %rax
leaq 0x110(%rsp), %rbp
leaq 0x100(%rsp), %r12
ja 0x2bcc2
movq %r14, %r12
movq 0x288(%r14), %rbx
leaq (%rax,%rax,4), %r14
leaq 0x160(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rbx,%r14,8), %rsi
movq 0x8(%rbx,%r14,8), %rdx
addq %rsi, %rdx
leaq 0x150(%rsp), %rdi
callq 0xcc1c
leaq (%rbx,%r14,8), %rax
movq 0x20(%rax), %rax
leaq 0x150(%rsp), %rdi
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x15bec
movl %eax, %r14d
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x2c010
callq 0x52a0
movq %r12, %r13
movq 0x278(%r12), %rax
movq -0x8(%rax), %rdi
movl %r14d, %esi
callq 0x2a38a
movl %eax, %ebx
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x2c084
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x2c07b
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2c081
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2c084
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2c048
addl $-0x3, %r12d
jmp 0x2c084
addl $-0x2, %r12d
jmp 0x2c084
decl %r12d
shrl $0x1f, %ebx
leal (%r12,%rbx), %esi
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x28(%rsp), %rdi
movl $0x2d, %edx
callq 0x5370
movl %ebx, %edi
leaq 0x28(%rsp), %rbx
addq (%rbx), %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0xcb5d
leaq 0xae93(%rip), %rsi      # 0x36f51
movq %rbx, %rdi
callq 0x55f0
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2c0ed
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2c0f5
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x68(%rsp), %rdi
callq 0x5100
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2c12e
callq 0x52a0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x2c13d
callq 0x52a0
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %ebx
cmpl $0xa, %ebp
jb 0x2c194
movl $0x4, %ebx
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x2c18d
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2c192
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2c194
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %ebx
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2c15c
addl $-0x3, %ebx
jmp 0x2c194
addl $-0x2, %ebx
jmp 0x2c194
decl %ebx
shrl $0x1f, %r14d
leal (%rbx,%r14), %esi
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
movl $0x2d, %edx
callq 0x5370
movl %r14d, %edi
leaq 0x28(%rsp), %r14
addq (%r14), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0xcb5d
leaq 0xad88(%rip), %rsi      # 0x36f51
movq %r14, %rdi
callq 0x55f0
movq %r12, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2c1f2
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x2c1fa
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x5100
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2c233
callq 0x52a0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x2c242
callq 0x52a0
movq 0x288(%r13), %rbx
leaq 0x138(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x128(%rsp), %rdi
callq 0xcc1c
movq 0xa8(%rsp), %r15
movq 0x20(%rbx), %rax
leaq 0x128(%rsp), %rdi
movq %rax, 0x20(%rdi)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x15bec
movl %eax, %ebx
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c2aa
callq 0x52a0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
leaq 0x19a58(%rip), %rdi     # 0x45d10
callq 0x5350
movq %rax, %r14
leaq 0x885a(%rip), %rsi      # 0x34b21
movl $0xc, %edx
movq %rax, %rdi
callq 0x5350
movq %r14, %rdi
movl %ebx, %esi
callq 0x5580
movq %rax, %rbx
leaq 0x7d57(%rip), %rsi      # 0x3403f
movl $0x2, %edx
movq %rax, %rdi
callq 0x5350
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0xac3d(%rip), %rsi      # 0x36f54
movl $0x9, %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 0x20(%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 0xabf5(%rip), %rsi      # 0x36f5e
movl $0xa, %edx
movq %rbx, %rdi
callq 0x5350
movq 0x20(%rsp), %rax
movq 0x138(%rax), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
leaq 0xabd5(%rip), %rsi      # 0x36f69
movl $0xa, %edx
movq %rax, %rdi
callq 0x5350
movq 0x20(%rsp), %rax
movq 0x140(%rax), %rsi
movq %rbx, %rdi
callq 0x51e0
movq %rax, %rbx
leaq 0x7e7a(%rip), %rsi      # 0x34239
movl $0xe, %edx
movq %rax, %rdi
callq 0x5350
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0x83cf(%rip), %rsi      # 0x347bd
movl $0x2, %edx
movq %rax, %rdi
callq 0x5350
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0xab76(%rip), %rsi      # 0x36f93
movl $0x7, %edx
movq %rax, %rdi
callq 0x5350
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
leaq 0xab57(%rip), %rsi      # 0x36f9d
movl $0xb, %edx
movq %rax, %rdi
callq 0x5350
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %rbx, %rdi
callq 0x5350
movq %rax, %rbx
movq (%rax), %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 0x2c4a3
callq 0x52a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2c4b7
callq 0x52a0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2c4d1
callq 0x52a0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x2c4eb
callq 0x52a0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2c505
callq 0x52a0
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
jne 0x2c5ed
jmp 0x2c5f7
jmp 0x2c539
jmp 0x2c54c
jmp 0x2c5f4
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2c54f
callq 0x52a0
jmp 0x2c54f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
jmp 0x2c561
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
jne 0x2c5ed
jmp 0x2c5f7
jmp 0x2c5f4
movq %rax, %rbx
jmp 0x2c60b
jmp 0x2c57e
movq %rax, %rbx
jmp 0x2c61f
movq %rax, %rbx
jmp 0x2c639
movq %rax, %rbx
jmp 0x2c653
jmp 0x2c5f4
jmp 0x2c5f4
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x2c5ed
jmp 0x2c5f7
jmp 0x2c5f4
jmp 0x2c5f4
jmp 0x2c5c5
movq %rbx, %rcx
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %rcx, %rdi
jne 0x2c5d9
jmp 0x2c5de
jmp 0x2c5f4
movq %rax, %rbx
jmp 0x2c5de
movq %rbx, %r15
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2c5de
callq 0x52a0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2c5f7
callq 0x52a0
jmp 0x2c5f7
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2c60b
callq 0x52a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2c61f
callq 0x52a0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2c639
callq 0x52a0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x2c653
callq 0x52a0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2c66d
callq 0x52a0
movq %rbx, %rdi
callq 0x55a0
nop