// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rdi, %rbx
leaq 0x2a0(%rdi), %rax
leaq 0x2e8(%rdi), %rcx
leaq 0x288(%rdi), %rdx
leaq 0x2d0(%rdi), %r8
addq $0x270, %rdi            # imm = 0x270
leaq 0x2b8(%rbx), %r9
testl %esi, %esi
cmovneq %rcx, %rax
cmoveq %rdx, %r8
movq %r8, 0x8(%rsp)
cmoveq %rdi, %r9
movq %r9, 0x18(%rsp)
movq (%rax), %r12
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
leaq 0x48(%rsp), %r13
leaq 0x28(%rsp), %rbp
movzbl %sil, %eax
movl %eax, 0x14(%rsp)
cmpq 0x20(%rsp), %r12
je 0x1d3fb
movq %r13, %rdi
movq %r12, %rsi
callq 0x5410
movl $0xa8, %edi
callq 0x52e0
movq %rax, %r14
movl 0x300(%rbx), %r15d
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5410
movq %rbp, %rdx
movb $0x1, %bpl
movq %r14, %rdi
movl %r15d, %esi
movq %rdx, %r15
movl 0x14(%rsp), %ecx
callq 0x10b8c
movq %r14, (%rsp)
xorl %ebp, %ebp
movq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0xae24
movq %r15, %rbp
movq %r15, %rdi
callq 0x5618
movq %r13, %rdi
leaq 0xdf2c(%rip), %rsi      # 0x2b05e
callq 0x9f59
testb %al, %al
je 0x1d158
leaq -0xb036(%rip), %rax     # 0x1210c
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xdf07(%rip), %rsi      # 0x2b069
callq 0x9f59
testb %al, %al
je 0x1d188
leaq -0xb059(%rip), %rax     # 0x12119
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xdee3(%rip), %rsi      # 0x2b075
callq 0x9f59
testb %al, %al
je 0x1d1b8
leaq -0xb05c(%rip), %rax     # 0x12146
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xdebe(%rip), %rsi      # 0x2b080
callq 0x9f59
testb %al, %al
je 0x1d1e8
leaq -0xb1a7(%rip), %rax     # 0x1202b
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xde97(%rip), %rsi      # 0x2b089
callq 0x9f59
testb %al, %al
je 0x1d218
leaq -0xb1cc(%rip), %rax     # 0x12036
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xde6f(%rip), %rsi      # 0x2b091
callq 0x9f59
testb %al, %al
je 0x1d248
leaq -0xb0de(%rip), %rax     # 0x12154
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xde4b(%rip), %rsi      # 0x2b09d
callq 0x9f59
testb %al, %al
je 0x1d278
leaq -0xb104(%rip), %rax     # 0x1215e
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xde28(%rip), %rsi      # 0x2b0aa
callq 0x9f59
testb %al, %al
je 0x1d2a8
leaq -0xb0c2(%rip), %rax     # 0x121d0
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xde02(%rip), %rsi      # 0x2b0b4
callq 0x9f59
testb %al, %al
je 0x1d2d8
leaq -0xb0da(%rip), %rax     # 0x121e8
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xcf74(%rip), %rsi      # 0x2a256
callq 0x9f59
testb %al, %al
je 0x1d308
leaq -0xb170(%rip), %rax     # 0x12182
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xcf4e(%rip), %rsi      # 0x2a260
callq 0x9f59
testb %al, %al
je 0x1d338
leaq -0xb188(%rip), %rax     # 0x1219a
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xdd7d(%rip), %rsi      # 0x2b0bf
callq 0x9f59
testb %al, %al
je 0x1d365
leaq -0xb35e(%rip), %rax     # 0x11ff4
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xdd5c(%rip), %rsi      # 0x2b0cb
callq 0x9f59
testb %al, %al
je 0x1d392
leaq -0xb3c2(%rip), %rax     # 0x11fbd
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
jmp 0x1d3bd
movq %r13, %rdi
leaq 0xdd3b(%rip), %rsi      # 0x2b0d7
callq 0x9f59
testb %al, %al
je 0x1d40a
leaq -0xb425(%rip), %rax     # 0x11f87
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x1c78a
movq %r13, %rdi
leaq 0xdce3(%rip), %rsi      # 0x2b0aa
callq 0x9f59
testb %al, %al
jne 0x1d3e3
movq %r13, %rdi
leaq 0xdcda(%rip), %rsi      # 0x2b0b4
callq 0x9f59
testb %al, %al
je 0x1d3ea
movb $0x1, 0x310(%rbx)
movq %r13, %rdi
callq 0x5618
addq $0x20, %r12
jmp 0x1d0bd
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdcd2(%rip), %rdi      # 0x2b0e3
leaq 0xe058(%rip), %rsi      # 0x2b470
leaq 0xe063(%rip), %rcx      # 0x2b482
movl $0x8f, %edx
callq 0x51e0
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
jmp 0x1d44a
movq %rax, %rbx
jmp 0x1d461
movq %rax, %rbx
jmp 0x1d469
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5618
testb %bpl, %bpl
je 0x1d469
movq %r14, %rdi
callq 0x52a0
leaq 0x48(%rsp), %rdi
callq 0x5618
movq %rbx, %rdi
callq 0x5570
nop