// File: /workspace/github_cpp_makefile_star2_O1/gvaumour[P]cache-simulator/src/HybridCache.cc
// Function: HybridCache::updateStatsDeallocate(CacheEntry*)
void
HybridCache::updateStatsDeallocate(CacheEntry* current)
{

	if(!current->isValid || m_isWarmup)
		return;
	
	if(simu_parameters.enablePCHistoryTracking && m_printStats){	
		ofstream file_history_cache("LLC_PC_History.out", std::ostream::app);
		file_history_cache << std::hex << current->address << "\t";
		for(unsigned i = 0; i < current->pc_history.size()-1; i++)
			file_history_cache << current->pc_history[i] << ",";
		file_history_cache << current->pc_history[current->pc_history.size()-1] << endl;
		file_history_cache << std::dec;
		file_history_cache.close();
	}
	
	if(stats_histo_ratioRW.count(current->nbWrite) == 0)
		stats_histo_ratioRW.insert(pair<int,int>(current->nbWrite , 0));
		
	stats_histo_ratioRW[current->nbWrite]++;
	
	if(current->justMigrate)
		stats_nbDeadMigration++;
	
	if(current->nbWrite == 0 && current->nbRead > 0){
		stats_nbROlines++;
		stats_nbROaccess+= current->nbRead; 
	}
	else if(current->nbWrite > 0 && current->nbRead == 0){
		stats_nbWOlines++;
		stats_nbWOaccess+= current->nbWrite; 	
	}
	else if( current->nbWrite == 0 && current->nbRead == 0){	
		stats_nbLostLine++;
	}
	else if( current->nbWrite == 1 && current->nbRead > 0){
		stats_nbAlmostROlines++;
		stats_nbAlmostROaccess+= current->nbWrite + current->nbRead; 		
	}
	else
	{
		stats_nbRWlines++;
		stats_nbRWaccess+= current->nbWrite + current->nbRead; 	
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
cmpb $0x1, (%rsi)
jne 0x1a07f
movq %rdi, %rbx
cmpb $0x0, 0x91(%rdi)
jne 0x1a07f
movq %rsi, %r14
leaq 0x2c158(%rip), %rax     # 0x45f50
cmpb $0x1, 0x95(%rax)
jne 0x19f4a
cmpb $0x1, 0x90(%rbx)
jne 0x19f4a
leaq 0x1ba67(%rip), %rsi     # 0x35880
movq %rsp, %r15
movq %r15, %rdi
movl $0x1, %edx
callq 0x5310
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rsp,%rax)
movq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x51e0
leaq 0x1be2a(%rip), %rsi     # 0x35c7b
movl $0x1, %edx
movq %rax, %rdi
callq 0x5350
movq 0x150(%r14), %rax
movq 0x158(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
decq %rdx
je 0x19ec6
movl $0x1, %ebp
xorl %ecx, %ecx
movq %rsp, %r15
leaq 0x1a1b9(%rip), %r12     # 0x34042
movq (%rax,%rcx,8), %rsi
movq %r15, %rdi
callq 0x51e0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x5350
movl %ebp, %ecx
movq 0x150(%r14), %rax
movq 0x158(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
decq %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x19e89
movq (%rax,%rdx,8), %rsi
movq %rsp, %rdi
callq 0x51e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x52b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movq %rsp, %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x18(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rsp,%rax)
callq 0x5430
movq 0x2b0a0(%rip), %rax     # 0x44fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x8(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, (%rsp,%rcx)
callq 0x5270
leaq 0xf8(%rsp), %rdi
callq 0x5120
movl 0x11c(%r14), %eax
movslq %eax, %rdx
movq 0x200(%rbx), %rdi
leaq 0x1f8(%rbx), %rcx
movq %rcx, %rsi
testq %rdi, %rdi
je 0x19f86
movq %rcx, %rsi
xorl %r8d, %r8d
cmpq %rdx, 0x20(%rdi)
setb %r8b
cmovaeq %rdi, %rsi
movq 0x10(%rdi,%r8,8), %rdi
testq %rdi, %rdi
jne 0x19f6d
movq %rcx, %rdi
cmpq %rcx, %rsi
je 0x19f99
cmpq %rdx, 0x20(%rsi)
cmovaq %rcx, %rsi
movq %rsi, %rdi
leaq 0x1f0(%rbx), %r15
cmpq %rcx, %rdi
jne 0x19fb9
movq %rsp, %rsi
movl %eax, (%rsi)
movl $0x0, 0x4(%rsi)
movq %r15, %rdi
callq 0x1d9d2
movslq 0x11c(%r14), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x1d29a
incq (%rax)
cmpb $0x1, 0x14c(%r14)
jne 0x19fe2
incq 0x220(%rbx)
movl 0x11c(%r14), %eax
testq %rax, %rax
je 0x1a02b
testl %eax, %eax
jle 0x19ffc
cmpl $0x0, 0x120(%r14)
je 0x1a060
testq %rax, %rax
jne 0x1a00b
cmpl $0x0, 0x120(%r14)
je 0x1a071
cmpl $0x1, %eax
jne 0x1a045
movl 0x120(%r14), %ecx
testl %ecx, %ecx
jle 0x1a045
incq 0x1e0(%rbx)
addl %eax, %ecx
movl $0x1e8, %edx            # imm = 0x1E8
jmp 0x1a07b
movslq 0x120(%r14), %rcx
testq %rcx, %rcx
jle 0x19fee
incq 0x1b0(%rbx)
movl $0x1b8, %edx            # imm = 0x1B8
jmp 0x1a07b
incq 0x1c0(%rbx)
movslq 0x120(%r14), %rdx
movslq %eax, %rcx
addq %rdx, %rcx
movl $0x1c8, %edx            # imm = 0x1C8
jmp 0x1a07b
incq 0x1d0(%rbx)
movl $0x1d8, %edx            # imm = 0x1D8
movq %rax, %rcx
jmp 0x1a07b
movl $0x1, %ecx
movl $0x1a8, %edx            # imm = 0x1A8
addq %rcx, (%rbx,%rdx)
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a091
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5628
movq %rbx, %rdi
callq 0x55a0