// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, 0x10(%rsp)
callq 0x1529c
leaq 0x14249(%rip), %rsi     # 0x2a84d
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5140
leaq 0x27936(%rip), %rbx     # 0x3df50
addq $0x8, %rbx
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x138f8
movq %rax, %r12
leaq 0x18(%rsp), %rdi
callq 0x5618
testq %r12, %r12
je 0x1664e
leaq 0x14512(%rip), %rdi     # 0x2ab56
movq %r15, %rsi
xorl %eax, %eax
callq 0x5040
leaq 0x38(%r14), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1817e
movq %rax, %r15
leaq 0x40(%r14), %rax
cmpq %rax, %r15
je 0x16740
leaq 0x141da(%rip), %rsi     # 0x2a84d
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5140
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x138f8
movq %rax, %r12
leaq 0x18(%rsp), %rdi
callq 0x5618
testq %r12, %r12
je 0x166b4
movq 0x10(%rsp), %rsi
leaq 0x144e4(%rip), %rdi     # 0x2ab91
xorl %eax, %eax
callq 0x5040
movq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x1636e
movslq 0x28(%r15), %rcx
cltq
leaq 0x20(%r14), %rdx
leaq 0x8(%r14), %rsi
testb $0x1, 0x2c(%r15)
cmovneq %rsi, %rdx
movq (%rdx), %rdx
imulq $0x18, %rax, %rax
movq (%rdx,%rax), %rax
movq (%rax,%rcx,8), %r15
movq %r14, %rdi
callq 0x1529c
leaq 0x14157(%rip), %rsi     # 0x2a84d
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5140
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x138f8
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5618
testq %rbx, %rbx
je 0x16736
movq 0x8(%r15), %rsi
leaq 0x1442c(%rip), %rdi     # 0x2ab5b
xorl %eax, %eax
callq 0x5040
movb $0x0, (%r15)
movb 0x1(%r15), %bl
jmp 0x1678e
leaq 0x14106(%rip), %rsi     # 0x2a84d
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5140
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x138f8
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5618
testq %rbx, %rbx
je 0x1678c
movq 0x10(%rsp), %rsi
leaq 0x14423(%rip), %rdi     # 0x2aba4
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x5040
jmp 0x1678e
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x167a8
jmp 0x167b7
jmp 0x167a8
jmp 0x167b7
jmp 0x167a8
jmp 0x167b7
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5618
jmp 0x167ba
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5570