// File: /workspace/github_cpp_makefile_star2_O1/gvaumour[P]cache-simulator/src/Cerebron.cc
// Function: CerebronPredictor::updatePolicy(unsigned long, unsigned long, bool, Access, bool)
void
CerebronPredictor::updatePolicy(uint64_t set, uint64_t index, bool inNVM, Access element, bool isWBrequest)
{
	CacheEntry *entry = get_entry(set , index , inNVM);
	RD_TYPE rd = classifyRD( set , index , inNVM );
	stats_access_class[rd][element.isWrite()]++;
	
	entry->policyInfo = m_cpt++;
	if ( element.isDemandAccess())
		update_globalPChistory(element.m_pc);

	entry->cost_value += m_costAccess[element.isWrite()][rd];
	if(entry->isLearning_policy)
	{
		recordAccess( entry , element.block_addr, entry->missPC, set, element.isWrite() , inNVM, index, rd , true);
	}
	if(entry->isLearning_weight)
	{
		if(simu_parameters.Cerebron_fastlearning)
			doLearning(entry, inNVM);
	}

	if(miss_counter < 0)
		miss_counter = 0;

	stats_update++;
	stats_nbHits++;
	miss_counter--;

	if(simu_parameters.Cerebron_enableMigration)
	{
		assert(entry->isValid);
		entry = checkLazyMigration(entry , set , inNVM , index, element.isWrite());		
	}

	reportAccess( element, entry , set , entry->isNVM, string("UPDATE"), string(str_RD_status[rd]) );

	Predictor::updatePolicy(set , index , inNVM , element , isWBrequest);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %r8d, 0x4c(%rsp)
movl %ecx, %r13d
movq %rdi, %r15
movl %ecx, %eax
movq 0x8(%rdi,%rax,8), %rax
movq (%rax), %rax
leaq (%rsi,%rsi,2), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %r12
movq %rsi, 0x40(%rsp)
movq %rdx, 0x50(%rsp)
movl %r13d, %ecx
callq 0x94f6
movl %eax, %r14d
movq 0x4a8(%r15), %rcx
leaq (%r14,%r14,2), %rdx
leaq 0xd0(%rsp), %rbx
movl 0x1c(%rbx), %eax
cmpl $0x3, %eax
sete %sil
cmpl $0x6, %eax
sete %dil
orb %sil, %dil
movzbl %dil, %ebp
movq (%rcx,%rdx,8), %rcx
incl (%rcx,%rbp,4)
movq 0x2f8(%r15), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x2f8(%r15)
movl %ecx, 0x38(%r12)
cmpl $0x3, %eax
ja 0x92b4
cmpl $0x1, %eax
je 0x92b4
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x27862
movq 0x2d8(%r15), %rax
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
movq (%rax,%rcx,8), %rax
cvtsi2sdl (%rax,%r14,4), %xmm0
addsd 0x130(%r12), %xmm0
movsd %xmm0, 0x130(%r12)
cmpb $0x1, 0x149(%r12)
jne 0x9319
movq 0x30(%rbx), %rdx
movq 0x20(%r12), %rcx
xorl %eax, %eax
movl %eax, 0x18(%rsp)
movl %r14d, 0x10(%rsp)
movl %eax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq 0x40(%rsp), %r8
movl %ebp, %r9d
callq 0x80fc
cmpb $0x1, 0x14a(%r12)
movzbl %r13b, %r13d
jne 0x9346
leaq 0x3cc21(%rip), %rax     # 0x45f50
cmpb $0x1, 0x225(%rax)
jne 0x9346
movq %r15, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x95e6
leaq 0x3ce53(%rip), %rax     # 0x461a0
cmpl $0x0, (%rax)
jns 0x9358
movl $0x0, (%rax)
incq 0x410(%r15)
incq 0x3d8(%r15)
decl (%rax)
leaq 0x3cbe1(%rip), %rax     # 0x45f50
cmpb $0x1, 0x223(%rax)
jne 0x93a1
cmpb $0x0, (%r12)
je 0x949c
movq %r15, %rdi
movq %r12, %rsi
movq 0x40(%rsp), %rdx
movl %r13d, %ecx
movq 0x50(%rsp), %r8
movl %ebp, %r9d
callq 0x99a4
movq %rax, %r12
movb 0x40(%r12), %bpl
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2ade4(%rip), %rsi     # 0x3419a
leaq 0x2ade3(%rip), %rdx     # 0x341a0
leaq 0x58(%rsp), %rdi
callq 0xccac
leaq 0x3c062(%rip), %rax     # 0x45430
movq (%rax,%r14,8), %rsi
leaq 0x78(%rsp), %rdi
leaq 0x3f(%rsp), %rdx
callq 0x5140
movq 0x30(%rbx), %rax
movq %rax, 0x30(%rsp)
movupd (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movzbl %bpl, %ecx
leaq 0x58(%rsp), %r8
leaq 0x78(%rsp), %r9
movq %r15, %rdi
movq %r12, %rsi
movq 0x40(%rsp), %rdx
callq 0x83d6
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9439
callq 0x52a0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x944d
callq 0x52a0
movq 0x30(%rbx), %rax
movq %rax, 0x30(%rsp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movzbl 0x4c(%rsp), %r8d
movq %r15, %rdi
movq 0x40(%rsp), %rsi
movq 0x50(%rsp), %rdx
movl %r13d, %ecx
callq 0x275be
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2c675(%rip), %rdi     # 0x35b18
leaq 0x2abe5(%rip), %rsi     # 0x3408f
leaq 0x2ac94(%rip), %rcx     # 0x34145
movl $0xe4, %edx
callq 0x51d0
movq %rax, %rbx
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x94d9
callq 0x52a0
jmp 0x94d9
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x94ed
callq 0x52a0
movq %rbx, %rdi
callq 0x55a0
nop