// File: /workspace/github_cpp_makefile_star2_O3/gvaumour[P]cache-simulator/src/Perceptron.cc
// Function: PerceptronPredictor::initFeatures(bool)
void
PerceptronPredictor::initFeatures(bool isBP)
{
	vector<FeatureTable*>* features;
	vector<string>* criterias_name;
	vector<hashing_function>* features_hash;

	if(isBP)
	{
		criterias_name = &m_BP_criterias_names;
		features_hash = &m_BP_features_hash;
		features = &m_BP_features;		
	}
	else
	{
		criterias_name = &m_Allocation_criterias_names;
		features_hash = &m_Allocation_features_hash;
		features = &m_Allocation_features;
	}

	for(auto feature : *criterias_name)
	{
		features->push_back( new FeatureTable(m_tableSize, feature, isBP));
		if(feature == "MissPC_LSB")
			features_hash->push_back(hashingMissPC_LSB);
		else if(feature == "MissPC_LSB1")
			features_hash->push_back(hashingMissPC_LSB1);
		else if(feature == "MissPC_MSB")
			features_hash->push_back(hashingMissPC_MSB);		

		else if(feature == "TagBlock")
			features_hash->push_back(hashingTag_block);
		else if(feature == "TagPage")
			features_hash->push_back(hashingTag_page);
	
		else if(feature == "MissCounter")
			features_hash->push_back(hashing_MissCounter);	
		else if(feature == "MissCounter1")
			features_hash->push_back(hashing_MissCounter1);
		
		else if( feature == "CallStack")
			features_hash->push_back(hashing_CallStack);
		else if( feature == "CallStack1")	
			features_hash->push_back(hashing_CallStack1);
			
		else if(feature == "currentPC")
			features_hash->push_back(hashing_currentPC);
		else if(feature == "currentPC1")
			features_hash->push_back(hashing_currentPC1);
		else if(feature == "currentPC_3")
			features_hash->push_back(hashingcurrentPC_3);
		else if(feature == "currentPC_2")
			features_hash->push_back(hashingcurrentPC_2);
		else if(feature == "currentPC_1")
			features_hash->push_back(hashingcurrentPC_1);
		else
			assert(false && "Error while initializing the features , wrong name\n");


		if(feature == "CallStack" || feature == "CallStack1")
			m_need_callee_file = true;
	}	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
leaq 0x2a0(%rdi), %rax
leaq 0x2e8(%rdi), %rcx
leaq 0x288(%rdi), %rdx
leaq 0x2d0(%rdi), %rbx
leaq 0x270(%rdi), %r8
movq %rdi, 0x18(%rsp)
leaq 0x2b8(%rdi), %rbp
testl %esi, %esi
cmovneq %rcx, %rax
cmoveq %rdx, %rbx
cmoveq %r8, %rbp
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq %rax, %rcx
je 0x23d59
leaq 0x30(%rsp), %r12
leaq 0x20(%rsp), %r14
movzbl %sil, %eax
movl %eax, 0x14(%rsp)
movq %rbx, 0x40(%rsp)
movq %r14, %rdi
movq %rbp, %rbx
movq %r12, 0x20(%rsp)
movq (%rcx), %rsi
movq %rcx, 0x50(%rsp)
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
callq 0xcbd6
movl $0xa8, %edi
callq 0x52f0
movq %rax, %r13
movq 0x18(%rsp), %rax
movl 0x300(%rax), %ebp
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0xcbd6
movb $0x1, %r12b
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
movl 0x14(%rsp), %ecx
callq 0x140e4
movq %rbx, %rbp
movq %r13, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2396e
movq %r13, (%rsi)
addq $0x8, 0x8(%rbp)
jmp 0x2397e
xorl %r12d, %r12d
movq %rbp, %rdi
leaq 0x8(%rsp), %rdx
callq 0xd14c
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x23992
callq 0x52b0
movq %r14, %rdi
leaq 0x12712(%rip), %rsi     # 0x360ae
callq 0x50f0
testl %eax, %eax
leaq 0x30(%rsp), %r12
movq 0x40(%rsp), %rbx
leaq -0xd989(%rip), %rax     # 0x1602b
leaq -0xd981(%rip), %r15     # 0x1603a
je 0x23b2d
movq %r14, %rdi
leaq 0x126ee(%rip), %rsi     # 0x360b9
callq 0x50f0
testl %eax, %eax
je 0x23b52
movq %r14, %rdi
leaq 0x126e3(%rip), %rsi     # 0x360c5
callq 0x50f0
testl %eax, %eax
je 0x23b69
movq %r14, %rdi
leaq 0x126d7(%rip), %rsi     # 0x360d0
callq 0x50f0
testl %eax, %eax
leaq -0xdb19(%rip), %rax     # 0x15eee
leaq -0xdb11(%rip), %r15     # 0x15efd
je 0x23b95
movq %r14, %rdi
leaq 0x126bb(%rip), %rsi     # 0x360d9
callq 0x50f0
testl %eax, %eax
je 0x23bcc
movq %r14, %rdi
leaq 0x126ac(%rip), %rsi     # 0x360e1
callq 0x50f0
testl %eax, %eax
je 0x23bed
movq %r14, %rdi
leaq 0x126a1(%rip), %rsi     # 0x360ed
callq 0x50f0
testl %eax, %eax
leaq -0xd9a3(%rip), %rax     # 0x160b7
leaq -0xd8a3(%rip), %r15     # 0x161be
je 0x23c19
movq %r14, %rdi
leaq 0x12689(%rip), %rsi     # 0x360fa
callq 0x50f0
testl %eax, %eax
je 0x23c37
movq %r14, %rdi
leaq 0x1267c(%rip), %rsi     # 0x36104
callq 0x50f0
testl %eax, %eax
je 0x23c59
movq %r14, %rdi
leaq 0x1180b(%rip), %rsi     # 0x352aa
callq 0x50f0
testl %eax, %eax
leaq -0xd99d(%rip), %rax     # 0x16110
je 0x23c7e
movq %r14, %rdi
leaq 0x117f7(%rip), %rsi     # 0x352b4
callq 0x50f0
testl %eax, %eax
je 0x23cf0
movq %r14, %rdi
leaq 0x1263b(%rip), %rsi     # 0x3610f
callq 0x50f0
testl %eax, %eax
je 0x23d0b
movq %r14, %rdi
leaq 0x12630(%rip), %rsi     # 0x3611b
callq 0x50f0
testl %eax, %eax
je 0x23d3b
movq %r14, %rdi
leaq 0x12625(%rip), %rsi     # 0x36127
callq 0x50f0
testl %eax, %eax
jne 0x23d68
leaq -0xdddd(%rip), %rax     # 0x15d39
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22b46
jmp 0x23c99
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x23c91
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
movq %r15, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x23bba
movq %r15, (%rsi)
jmp 0x23c94
leaq -0xdad5(%rip), %rax     # 0x1609b
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x23c91
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x23c91
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
movq %r15, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x23b61
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
leaq -0xdb47(%rip), %rax     # 0x160ad
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x23c91
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x23c91
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
movq %r15, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x23b61
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
leaq -0xda57(%rip), %rax     # 0x16209
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jne 0x23c91
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x23d29
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
movq %r14, %rdi
leaq 0x12457(%rip), %rsi     # 0x360fa
callq 0x50f0
testl %eax, %eax
je 0x23cbf
movq %r14, %rdi
leaq 0x1244e(%rip), %rsi     # 0x36104
callq 0x50f0
testl %eax, %eax
jne 0x23ccb
movq 0x18(%rsp), %rax
movb $0x1, 0x310(%rax)
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x23cda
callq 0x52b0
movq 0x50(%rsp), %rcx
addq $0x20, %rcx
cmpq 0x48(%rsp), %rcx
jne 0x238e3
jmp 0x23d59
leaq -0xdb9c(%rip), %rax     # 0x1615b
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22b46
jmp 0x23c99
leaq -0xdeb6(%rip), %rax     # 0x15e5c
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22b46
jmp 0x23c99
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x22eb6
jmp 0x23c99
leaq -0xdf78(%rip), %rax     # 0x15dca
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22b46
jmp 0x23c99
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x123c4(%rip), %rdi     # 0x36133
leaq 0x1274a(%rip), %rsi     # 0x364c0
leaq 0x12755(%rip), %rcx     # 0x364d2
movl $0x8f, %edx
callq 0x51d0
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
jmp 0x23da3
movq %rax, %rbx
jmp 0x23dd1
movq %rax, %rbx
jmp 0x23dc9
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x23dc4
callq 0x52b0
testb %r12b, %r12b
je 0x23dd1
movq %r13, %rdi
callq 0x52b0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x23de5
callq 0x52b0
movq %rbx, %rdi
callq 0x55a0
nop