// File: /workspace/github_cpp_makefile_star2_O1/gvaumour[P]cache-simulator/src/HybridCache.cc
// Function: HybridCache::receiveInvalidation(unsigned long)
bool
HybridCache::receiveInvalidation(uint64_t block_addr)
{
	entete_debug();
	DPRINTF(DebugCache , "HERE Receive Invalidation for the block [%#lx] by the LLC\n" , block_addr);

	map<uint64_t,HybridLocation>::iterator p = m_tag_index.find(block_addr);
	
	if (p != m_tag_index.end()){

	
		DPRINTF(DebugCache , "Find block [%#lx]\n" , block_addr);

		int id_set = blockAddressToCacheSet(block_addr);
		HybridLocation loc = p->second;
		CacheEntry* entry = NULL;

		if(loc.m_inNVM)
			entry = m_tableNVM[id_set][loc.m_way];
		else 
			entry = m_tableSRAM[id_set][loc.m_way];	
	
		entete_debug();
		DPRINTF(DebugCache , "Receive Invalidation for the block [%#lx] by the LLC\n" , entry->address);

		entry->isValid = false;
		return entry->isDirty;
	}
	else{
		DPRINTF(DebugCache , "Didn't find block [%#lx]\n" , block_addr);
		return false;
	
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r15
callq 0x1a158
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x19d70(%rip), %rsi     # 0x358a5
leaq 0x19d73(%rip), %rdx     # 0x358af
leaq 0x8(%rsp), %rdi
callq 0xccac
leaq 0x2a403(%rip), %rbp     # 0x45f50
leaq 0x8(%rbp), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x182c0
movq %rax, %r12
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1bb70
callq 0x52a0
addq $0x10, %rbp
cmpq %rbp, %r12
je 0x1bb8a
leaq 0x1a02e(%rip), %rdi     # 0x35bae
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5050
movq 0x48(%r15), %rdx
leaq 0x40(%r15), %rax
movq %rax, %rcx
testq %rdx, %rdx
je 0x1bbb5
movq %rax, %rcx
xorl %esi, %esi
cmpq %rbx, 0x20(%rdx)
setb %sil
cmovaeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x1bb9d
movq %rax, %r13
cmpq %rax, %rcx
je 0x1bbc8
cmpq %rbx, 0x20(%rcx)
cmovaq %rax, %rcx
movq %rcx, %r13
leaq 0x8(%rsp), %rdi
cmpq %rax, %r13
je 0x1bcc7
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
leaq 0x19cc0(%rip), %rsi     # 0x358a5
leaq 0x19cc3(%rip), %rdx     # 0x358af
callq 0xccac
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x182c0
movq %rax, %r12
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1bc15
callq 0x52a0
cmpq %rbp, %r12
je 0x1bc2b
leaq 0x19fc8(%rip), %rdi     # 0x35be9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5050
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1b828
movslq 0x28(%r13), %rcx
cltq
leaq 0x20(%r15), %rdx
leaq 0x8(%r15), %rsi
testb $0x1, 0x2c(%r13)
cmovneq %rsi, %rdx
movq (%rdx), %rdx
leaq (%rax,%rax,2), %rax
movq (%rdx,%rax,8), %rax
movq (%rax,%rcx,8), %r12
movq %r15, %rdi
callq 0x1a158
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r15
movq %r15, (%rdi)
leaq 0x19c2d(%rip), %rsi     # 0x358a5
leaq 0x19c30(%rip), %rdx     # 0x358af
callq 0xccac
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x182c0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bca3
callq 0x52a0
cmpq %rbp, %rbx
je 0x1bcbb
movq 0x8(%r12), %rsi
leaq 0x19eff(%rip), %rdi     # 0x35bb3
xorl %eax, %eax
callq 0x5050
movb $0x0, (%r12)
movb 0x1(%r12), %bpl
jmp 0x1bd1d
leaq 0x18(%rsp), %r15
movq %r15, (%rdi)
leaq 0x19bcf(%rip), %rsi     # 0x358a5
leaq 0x19bd2(%rip), %rdx     # 0x358af
callq 0xccac
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x182c0
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bd01
callq 0x52a0
cmpq %rbp, %r14
je 0x1bd1b
leaq 0x19eef(%rip), %rdi     # 0x35bfc
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5050
jmp 0x1bd1d
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1bd32
jmp 0x1bd6d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x1bd66
jmp 0x1bd70
jmp 0x1bd6d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x1bd66
jmp 0x1bd70
jmp 0x1bd6d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1bd70
callq 0x52a0
jmp 0x1bd70
movq %rax, %rbx
movq %rbx, %rdi
callq 0x55a0