// File: /workspace/github_cpp_makefile_star2_O1/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), %r15
leaq 0x270(%rdi), %r8
movq %rdi, 0x18(%rsp)
addq $0x2b8, %rdi            # imm = 0x2B8
testl %esi, %esi
cmovneq %rcx, %rax
cmoveq %rdx, %r15
cmoveq %r8, %rdi
movq %rdi, 0x48(%rsp)
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
cmpq %rax, %rcx
je 0x23f5a
leaq 0x30(%rsp), %rbp
leaq 0x20(%rsp), %r13
movzbl %sil, %eax
movl %eax, 0x14(%rsp)
movq %rbp, 0x20(%rsp)
movq (%rcx), %rsi
movq %rcx, 0x50(%rsp)
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
movq %r13, %r14
movq %r13, %rdi
callq 0xcc1c
movl $0xa8, %edi
callq 0x52e0
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), %rbx
movq %rbx, %rdi
callq 0xcc1c
movb $0x1, %r12b
movq %r13, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movl 0x14(%rsp), %ecx
leaq 0x30(%rsp), %rbp
callq 0x141d2
movq %r13, 0x8(%rsp)
movq 0x48(%rsp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x23b67
movq %r13, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x23b74
xorl %r12d, %r12d
leaq 0x8(%rsp), %rdx
callq 0xd186
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x23b88
callq 0x52a0
movq %r14, %r13
movq %r14, %rdi
leaq 0x12521(%rip), %rsi     # 0x360b6
callq 0x50f0
testl %eax, %eax
je 0x23d19
movq %r13, %rdi
leaq 0x12515(%rip), %rsi     # 0x360c1
callq 0x50f0
testl %eax, %eax
leaq -0xd91d(%rip), %rax     # 0x1629d
leaq -0xd8ba(%rip), %rbx     # 0x16307
leaq -0xda89(%rip), %r14     # 0x1613f
je 0x23d3e
movq %r13, %rdi
leaq 0x124f5(%rip), %rsi     # 0x360cd
callq 0x50f0
testl %eax, %eax
je 0x23db3
movq %r13, %rdi
leaq 0x124e9(%rip), %rsi     # 0x360d8
callq 0x50f0
testl %eax, %eax
je 0x23dc7
movq %r13, %rdi
leaq 0x124db(%rip), %rsi     # 0x360e1
callq 0x50f0
testl %eax, %eax
je 0x23df0
movq %r13, %rdi
leaq 0x124cc(%rip), %rsi     # 0x360e9
callq 0x50f0
testl %eax, %eax
leaq -0xd912(%rip), %rax     # 0x16319
leaq -0xd90f(%rip), %rbx     # 0x16323
leaq -0xd7ca(%rip), %r14     # 0x1646f
je 0x23e2e
movq %r13, %rdi
leaq 0x124ac(%rip), %rsi     # 0x360f5
callq 0x50f0
testl %eax, %eax
je 0x23e65
movq %r13, %rdi
leaq 0x124a2(%rip), %rsi     # 0x36102
callq 0x50f0
testl %eax, %eax
je 0x23e8a
movq %r13, %rdi
leaq 0x12495(%rip), %rsi     # 0x3610c
callq 0x50f0
testl %eax, %eax
je 0x23eaf
movq %r13, %rdi
leaq 0x1164c(%rip), %rsi     # 0x352da
callq 0x50f0
testl %eax, %eax
leaq -0xd917(%rip), %rax     # 0x16385
je 0x23edb
movq %r13, %rdi
leaq 0x11638(%rip), %rsi     # 0x352e4
callq 0x50f0
testl %eax, %eax
je 0x23f00
movq %r13, %rdi
leaq 0x12454(%rip), %rsi     # 0x36117
callq 0x50f0
testl %eax, %eax
je 0x23f1e
movq %r13, %rdi
leaq 0x12449(%rip), %rsi     # 0x36123
callq 0x50f0
testl %eax, %eax
je 0x23f3c
movq %r13, %rdi
leaq 0x1243e(%rip), %rsi     # 0x3612f
callq 0x50f0
testl %eax, %eax
jne 0x23f69
leaq -0xdd95(%rip), %rax     # 0x15f70
movq %rax, 0x8(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22d02
jmp 0x23d59
leaq -0xda92(%rip), %rax     # 0x1628e
movq %rax, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
jne 0x23d51
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
movq %rax, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x23dde
movq %rax, (%rsi)
addq $0x8, 0x8(%r15)
movq %r13, %rdi
leaq 0x1239f(%rip), %rsi     # 0x36102
callq 0x50f0
testl %eax, %eax
je 0x23d7f
movq %r13, %rdi
leaq 0x12396(%rip), %rsi     # 0x3610c
callq 0x50f0
testl %eax, %eax
jne 0x23d8b
movq 0x18(%rsp), %rax
movb $0x1, 0x310(%rax)
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x23d9a
callq 0x52a0
movq 0x50(%rsp), %rcx
addq $0x20, %rcx
cmpq 0x40(%rsp), %rcx
jne 0x23ad5
jmp 0x23f5a
movq %rbx, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x23e1c
movq %rbx, (%rsi)
jmp 0x23d54
movq %r14, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x23e53
movq %r14, (%rsi)
jmp 0x23d54
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
leaq -0xdca9(%rip), %rax     # 0x1614e
movq %rax, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
jne 0x23d51
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
movq %rax, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
jne 0x23d51
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
movq %rbx, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
jne 0x23dc2
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
movq %r14, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
jne 0x23dd6
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
leaq -0xd9f3(%rip), %rax     # 0x164c3
movq %rax, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
jne 0x23d51
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
movq %rax, 0x8(%rsp)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
jne 0x23d51
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0x2306c
jmp 0x23d59
leaq -0xdb2e(%rip), %rax     # 0x163d9
movq %rax, 0x8(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22d02
jmp 0x23d59
leaq -0xde81(%rip), %rax     # 0x160a4
movq %rax, 0x8(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22d02
jmp 0x23d59
leaq -0xdf3a(%rip), %rax     # 0x16009
movq %rax, 0x8(%rsp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22d02
jmp 0x23d59
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x121cb(%rip), %rdi     # 0x3613b
leaq 0x12551(%rip), %rsi     # 0x364c8
leaq 0x1255c(%rip), %rcx     # 0x364da
movl $0x8f, %edx
callq 0x51d0
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
jmp 0x23fa4
movq %rax, %rbx
jmp 0x23fd5
movq %rax, %rbx
movb $0x1, %r12b
jmp 0x23fc8
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x23fc8
callq 0x52a0
testb %r12b, %r12b
je 0x23fd5
movq %r13, %rdi
callq 0x52a0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x23fe9
callq 0x52a0
movq %rbx, %rdi
callq 0x55a0
nop