// File: gvaumour[P]cache-simulator/src/HybridCache.cc
// Function: HybridCache::initializeLearningCl(CacheEntry*)
void
HybridCache::initializeLearningCl(CacheEntry* entry)
{

	if(m_policy == "Perceptron")
	{
		entry->perceptron_BPpred = vector<int>(simu_parameters.perceptron_BP_features.size() , 0);
		entry->perceptron_BPHash = vector<int>(simu_parameters.perceptron_BP_features.size() , 0);
		entry->predictedReused = vector<bool>(simu_parameters.perceptron_BP_features.size() , false);

		entry->perceptron_Allocpred = vector<int>(simu_parameters.perceptron_Allocation_features.size() , 0);
		entry->perceptron_AllocHash = vector<int>(simu_parameters.perceptron_Allocation_features.size() , 0);	
	}

	if(m_policy == "PHC" || m_policy == "Cerebron")
	{
		entry->PHC_allocation_pred = vector< pair<int,allocDecision> >(simu_parameters.PHC_features.size()\
			 , pair<int,allocDecision>(0, ALLOCATE_IN_SRAM) );
	}
	
	if( m_policy == "SimplePerceptron")
	{
		entry->simple_perceptron_pred =  vector<allocDecision>(simu_parameters.simple_perceptron_features.size() , ALLOCATE_IN_NVM);
		entry->simple_perceptron_hash = vector<int>(simu_parameters.simple_perceptron_features.size() , 0);
	}
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x1f0(%rsp)
movq %rsi, 0x1e8(%rsp)
movq 0x1f0(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
addq $0x70, %rdi
leaq 0x3b2a5(%rip), %rsi     # 0x727f7
callq 0xfa60
testb $0x1, %al
jne 0x37560
jmp 0x378ff
leaq 0x5ca89(%rip), %rdi     # 0x93ff0
addq $0x180, %rdi            # imm = 0x180
callq 0xf190
movq %rax, 0xa0(%rsp)
movl $0x0, 0x1cc(%rsp)
leaq 0x1cb(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0xed30
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rcx
leaq 0x1d0(%rsp), %rdi
leaq 0x1cc(%rsp), %rdx
callq 0xed40
jmp 0x375c2
movq 0x1e8(%rsp), %rdi
addq $0x48, %rdi
leaq 0x1d0(%rsp), %rsi
movq %rsi, 0x88(%rsp)
callq 0xf150
movq 0x88(%rsp), %rdi
callq 0xef00
leaq 0x1cb(%rsp), %rdi
callq 0xef60
leaq 0x5c9ec(%rip), %rdi     # 0x93ff0
addq $0x180, %rdi            # imm = 0x180
callq 0xf190
movq %rax, 0x90(%rsp)
movl $0x0, 0x19c(%rsp)
leaq 0x19b(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0xed30
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rcx
leaq 0x1a0(%rsp), %rdi
leaq 0x19c(%rsp), %rdx
callq 0xed40
jmp 0x3765f
movq 0x1e8(%rsp), %rdi
addq $0x78, %rdi
leaq 0x1a0(%rsp), %rsi
movq %rsi, 0x70(%rsp)
callq 0xf150
movq 0x70(%rsp), %rdi
callq 0xef00
leaq 0x19b(%rsp), %rdi
callq 0xef60
leaq 0x5c955(%rip), %rdi     # 0x93ff0
addq $0x180, %rdi            # imm = 0x180
callq 0xf190
movq %rax, 0x78(%rsp)
movb $0x0, 0x16f(%rsp)
leaq 0x16e(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x3d3c0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rcx
leaq 0x170(%rsp), %rdi
leaq 0x16f(%rsp), %rdx
callq 0x3d3d0
jmp 0x376ed
movq 0x1e8(%rsp), %rdi
addq $0xa8, %rdi
leaq 0x170(%rsp), %rsi
movq %rsi, 0x58(%rsp)
callq 0x3d450
movq 0x58(%rsp), %rdi
callq 0x211c0
leaq 0x16e(%rsp), %rdi
callq 0x3d4c0
leaq 0x5c8c4(%rip), %rdi     # 0x93ff0
addq $0x198, %rdi            # imm = 0x198
callq 0xf190
movq %rax, 0x60(%rsp)
movl $0x0, 0x14c(%rsp)
leaq 0x14b(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0xed30
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rcx
leaq 0x150(%rsp), %rdi
leaq 0x14c(%rsp), %rdx
callq 0xed40
jmp 0x3777b
movq 0x1e8(%rsp), %rdi
addq $0x60, %rdi
leaq 0x150(%rsp), %rsi
movq %rsi, 0x40(%rsp)
callq 0xf150
movq 0x40(%rsp), %rdi
callq 0xef00
leaq 0x14b(%rsp), %rdi
callq 0xef60
leaq 0x5c839(%rip), %rdi     # 0x93ff0
addq $0x198, %rdi            # imm = 0x198
callq 0xf190
movq %rax, 0x48(%rsp)
movl $0x0, 0x12c(%rsp)
leaq 0x12b(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xed30
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rcx
leaq 0x130(%rsp), %rdi
leaq 0x12c(%rsp), %rdx
callq 0xed40
jmp 0x37806
movq 0x1e8(%rsp), %rdi
addq $0x90, %rdi
leaq 0x130(%rsp), %rsi
callq 0xf150
leaq 0x130(%rsp), %rdi
callq 0xef00
leaq 0x12b(%rsp), %rdi
callq 0xef60
jmp 0x378ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x1cb(%rsp), %rdi
callq 0xef60
jmp 0x37ba3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x19b(%rsp), %rdi
callq 0xef60
jmp 0x37ba3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x16e(%rsp), %rdi
callq 0x3d4c0
jmp 0x37ba3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x14b(%rsp), %rdi
callq 0xef60
jmp 0x37ba3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x12b(%rsp), %rdi
callq 0xef60
jmp 0x37ba3
movq 0xb0(%rsp), %rdi
addq $0x70, %rdi
leaq 0x3aed2(%rip), %rsi     # 0x727e4
callq 0xfa60
testb $0x1, %al
jne 0x3793c
movq 0xb0(%rsp), %rdi
addq $0x70, %rdi
leaq 0x3aeba(%rip), %rsi     # 0x727e8
callq 0xfa60
testb $0x1, %al
jne 0x3793c
jmp 0x37a1a
leaq 0x5c6ad(%rip), %rdi     # 0x93ff0
addq $0x1d0, %rdi            # imm = 0x1D0
callq 0xf190
movq %rax, 0x28(%rsp)
movl $0x0, 0x104(%rsp)
movl $0x0, 0x100(%rsp)
leaq 0x108(%rsp), %rdi
movq %rdi, 0x30(%rsp)
leaq 0x104(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x3d4d0
leaq 0xff(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x3d500
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
leaq 0x110(%rsp), %rdi
callq 0x3d510
jmp 0x379bc
movq 0x1e8(%rsp), %rdi
addq $0xd0, %rdi
leaq 0x110(%rsp), %rsi
callq 0x3d590
leaq 0x110(%rsp), %rdi
callq 0x3d5d0
leaq 0xff(%rsp), %rdi
callq 0x3d630
jmp 0x37a1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0xff(%rsp), %rdi
callq 0x3d630
jmp 0x37ba3
movq 0xb0(%rsp), %rdi
addq $0x70, %rdi
leaq 0x3adc4(%rip), %rsi     # 0x727f1
callq 0xfa60
testb $0x1, %al
jne 0x37a3b
jmp 0x37b9b
leaq 0x5c5ae(%rip), %rdi     # 0x93ff0
addq $0x230, %rdi            # imm = 0x230
callq 0xf190
movq %rax, 0x18(%rsp)
movl $0x1, 0xdc(%rsp)
leaq 0xdb(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x3d640
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0xe0(%rsp), %rdi
leaq 0xdc(%rsp), %rdx
callq 0x3d650
jmp 0x37a91
movq 0x1e8(%rsp), %rdi
addq $0xe8, %rdi
leaq 0xe0(%rsp), %rsi
movq %rsi, (%rsp)
callq 0x3d6d0
movq (%rsp), %rdi
callq 0x21ac0
leaq 0xdb(%rsp), %rdi
callq 0x21c90
leaq 0x5c522(%rip), %rdi     # 0x93ff0
addq $0x230, %rdi            # imm = 0x230
callq 0xf190
movq %rax, 0x8(%rsp)
movl $0x0, 0xbc(%rsp)
leaq 0xbb(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xed30
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
leaq 0xc0(%rsp), %rdi
leaq 0xbc(%rsp), %rdx
callq 0xed40
jmp 0x37b1d
movq 0x1e8(%rsp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0xc0(%rsp), %rsi
callq 0xf150
leaq 0xc0(%rsp), %rdi
callq 0xef00
leaq 0xbb(%rsp), %rdi
callq 0xef60
jmp 0x37b9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0xdb(%rsp), %rdi
callq 0x21c90
jmp 0x37ba3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0xbb(%rsp), %rdi
callq 0xef60
jmp 0x37ba3
addq $0x1f8, %rsp            # imm = 0x1F8
retq
movq 0x1c0(%rsp), %rdi
callq 0x5690