// File: /workspace/github_cpp_makefile_star2_O3/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 0x19e2a
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x19fe0(%rip), %rsi     # 0x3589d
leaq 0x19fe3(%rip), %rdx     # 0x358a7
movq %rsp, %rdi
callq 0xcc6c
leaq 0x2a67d(%rip), %rbp     # 0x45f50
leaq 0x8(%rbp), %r14
movq %rsp, %rsi
movq %r14, %rdi
callq 0x1800c
movq %rax, %r12
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1b8f3
callq 0x52b0
addq $0x10, %rbp
cmpq %rbp, %r12
je 0x1b90d
leaq 0x1a2a3(%rip), %rdi     # 0x35ba6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5050
movq 0x48(%r15), %rax
testq %rax, %rax
je 0x1b940
leaq 0x40(%r15), %rcx
movq %rcx, %r12
xorl %edx, %edx
cmpq %rbx, 0x20(%rax)
setb %dl
cmovaeq %rax, %r12
movq 0x10(%rax,%rdx,8), %rax
testq %rax, %rax
jne 0x1b91d
cmpq %rcx, %r12
je 0x1b940
cmpq %rbx, 0x20(%r12)
jbe 0x1b999
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x19f50(%rip), %rsi     # 0x3589d
leaq 0x19f53(%rip), %rdx     # 0x358a7
callq 0xcc6c
movq %rsp, %rsi
movq %r14, %rdi
callq 0x1800c
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1b975
callq 0x52b0
cmpq %rbp, %r14
je 0x1b992
leaq 0x1a273(%rip), %rdi     # 0x35bf4
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5050
jmp 0x1ba7d
xorl %ebp, %ebp
jmp 0x1ba7d
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x19ef7(%rip), %rsi     # 0x3589d
leaq 0x19efa(%rip), %rdx     # 0x358a7
callq 0xcc6c
movq %rsp, %rsi
movq %r14, %rdi
callq 0x1800c
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1b9d5
movq %rax, 0x20(%rsp)
callq 0x52b0
movq 0x20(%rsp), %rax
cmpq %rbp, %rax
je 0x1b9eb
leaq 0x1a200(%rip), %rdi     # 0x35be1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5050
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1b5c0
movslq 0x28(%r12), %rcx
cltq
leaq 0x20(%r15), %rdx
leaq 0x8(%r15), %rsi
testb $0x1, 0x2c(%r12)
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 0x19e2a
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x19e6a(%rip), %rsi     # 0x3589d
leaq 0x19e6d(%rip), %rdx     # 0x358a7
callq 0xcc6c
movq %rsp, %rsi
movq %r14, %rdi
callq 0x1800c
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1ba5b
callq 0x52b0
cmpq %rbp, %rbx
je 0x1ba73
movq 0x8(%r12), %rsi
leaq 0x1a13f(%rip), %rdi     # 0x35bab
xorl %eax, %eax
callq 0x5050
movb $0x0, (%r12)
movb 0x1(%r12), %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ba9a
jmp 0x1baad
jmp 0x1ba9a
jmp 0x1baad
jmp 0x1ba9a
jmp 0x1baad
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1bab0
callq 0x52b0
jmp 0x1bab0
movq %rax, %rbx
movq %rbx, %rdi
callq 0x55a0