// File: /workspace/github_cpp_makefile_star2_O1/gvaumour[P]cache-simulator/src/Hierarchy.cc
// Function: Hierarchy::prefetchAddress(Access)
void 
Hierarchy::prefetchAddress(Access element)
{
	uint64_t addr = element.m_address;
	uint64_t block_addr = bitRemove(addr , 0 , m_start_index+1);
	

	DPRINTF(DebugHierarchy, "HIERARCHY::Prefetching of block %#lx\n", block_addr);

		
	DirectoryEntry* entry = m_directory->getEntry(block_addr);
	if(entry == NULL){
		entry = m_directory->addEntry(block_addr, element.isInstFetch());
	}
	assert(entry != NULL);

	DirectoryState dir_state = m_directory->getEntry(block_addr)->coherence_state;

	entry->print();
	
	if(dir_state == NOT_PRESENT)
	{
		m_LLC->handleAccess(element);
		m_directory->updateEntry(block_addr);
		m_directory->setCoherenceState(block_addr, CLEAN_LLC);	
		stats_issuedPrefetchs++;
	}
	else
	{
		DPRINTF(DebugHierarchy, "HIERARCHY::Prefetcher Block %#lx already present\n", block_addr);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movq 0xa0(%rsp), %rdi
movl 0x60(%r14), %edx
incl %edx
xorl %esi, %esi
callq 0x2e70a
movq %rax, %rbx
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1dc8b(%rip), %rsi     # 0x35388
leaq 0x1dc92(%rip), %rdx     # 0x35396
leaq 0x40(%rsp), %rdi
callq 0xccac
leaq 0x2e83b(%rip), %rbp     # 0x45f50
leaq 0x8(%rbp), %r13
leaq 0x40(%rsp), %rsi
movq %r13, %rdi
callq 0x182c0
movq %rax, %r12
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x17738
callq 0x52a0
movq %r13, 0x60(%rsp)
addq $0x10, %rbp
cmpq %rbp, %r12
je 0x17757
leaq 0x1de56(%rip), %rdi     # 0x355a3
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5050
leaq 0xa0(%rsp), %r13
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x13236
movq %rax, %r12
testq %rax, %rax
jne 0x1778c
movq 0x20(%r14), %rdi
xorl %edx, %edx
cmpl $0x2, 0x1c(%r13)
setb %dl
movq %rbx, %rsi
callq 0x1311c
movq %rax, %r12
testq %r12, %r12
je 0x1786e
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x13236
movl 0x38(%rax), %r15d
movq %r12, %rdi
callq 0x12fb0
cmpl $0x8, %r15d
jne 0x17808
movq 0x18(%r14), %rdi
movq 0x30(%r13), %rax
movq %rax, 0x30(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups 0x20(%r13), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1ec36
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x13730
movq 0x20(%r14), %rdi
movq %rbx, %rsi
movl $0x6, %edx
callq 0x13482
incq 0x90(%r14)
jmp 0x1785f
leaq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %r15
movq %r15, (%rdi)
leaq 0x1db6c(%rip), %rsi     # 0x35388
leaq 0x1db73(%rip), %rdx     # 0x35396
callq 0xccac
leaq 0x40(%rsp), %rsi
movq 0x60(%rsp), %rdi
callq 0x182c0
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x17849
callq 0x52a0
cmpq %rbp, %r14
je 0x1785f
leaq 0x1dd9c(%rip), %rdi     # 0x355f1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5050
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1f347(%rip), %rdi     # 0x36bbc
leaq 0x1dc46(%rip), %rsi     # 0x354c2
leaq 0x1dd46(%rip), %rcx     # 0x355c9
movl $0xfa, %edx
callq 0x51d0
jmp 0x17891
jmp 0x178a5
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x178a8
callq 0x52a0
jmp 0x178a8
movq %rax, %rbx
movq %rbx, %rdi
callq 0x55a0