// File: gvaumour[P]cache-simulator/src/PHC.cc
// Function: PHCPredictor::initFeatures()
void
PHCPredictor::initFeatures()
{
	vector<string>* criterias_name = &m_criterias_names;
	vector<hashing_function>* features_hash = &m_features_hash;
	vector<FeatureTable*>* features = &m_features;		

	for(auto feature : *criterias_name)
	{
		features->push_back( new FeatureTable(m_tableSize, feature, false));
		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:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x130(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %rax, %rcx
addq $0x2a0, %rcx            # imm = 0x2A0
movq %rcx, 0x128(%rsp)
movq %rax, %rcx
addq $0x288, %rcx            # imm = 0x288
movq %rcx, 0x120(%rsp)
addq $0x270, %rax            # imm = 0x270
movq %rax, 0x118(%rsp)
movq 0x128(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rdi
callq 0xebf0
movq %rax, 0x108(%rsp)
movq 0x110(%rsp), %rdi
callq 0xec20
movq %rax, 0x100(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0xec50
testb $0x1, %al
jne 0x49de6
jmp 0x4a3d8
leaq 0x108(%rsp), %rdi
callq 0xec90
movq %rax, %rsi
leaq 0xe0(%rsp), %rdi
callq 0x51b0
movq 0x118(%rsp), %rax
movq %rax, 0x18(%rsp)
movl $0xa8, %edi
callq 0x53a0
movq %rax, 0x20(%rsp)
jmp 0x49e21
movq 0x28(%rsp), %rax
movb $0x1, 0xa7(%rsp)
movl 0x2d0(%rax), %eax
movl %eax, 0x14(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x51b0
jmp 0x49e4f
movl 0x14(%rsp), %esi
movq 0x20(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x2c870
jmp 0x49e69
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movb $0x0, 0xa7(%rsp)
movq %rax, 0xd8(%rsp)
leaq 0xd8(%rsp), %rsi
callq 0xf750
jmp 0x49e92
leaq 0xa8(%rsp), %rdi
callq 0x5768
leaq 0x291b0(%rip), %rsi     # 0x73056
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x13(%rsp)
jmp 0x49eb9
movb 0x13(%rsp), %al
testb $0x1, %al
jne 0x49ec6
jmp 0x49f5c
movq 0x120(%rsp), %rdi
leaq -0x198b5(%rip), %rax    # 0x30620
movq %rax, 0x98(%rsp)
leaq 0x98(%rsp), %rsi
callq 0x4d750
jmp 0x49eec
jmp 0x4a356
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x4a3c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x49f41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x5768
testb $0x1, 0xa7(%rsp)
jne 0x49f4d
jmp 0x49f57
movq 0x20(%rsp), %rdi
callq 0x5340
jmp 0x4a3c9
leaq 0x290fe(%rip), %rsi     # 0x73061
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x12(%rsp)
jmp 0x49f76
movb 0x12(%rsp), %al
testb $0x1, %al
jne 0x49f80
jmp 0x49fab
movq 0x120(%rsp), %rdi
leaq -0x1993f(%rip), %rax    # 0x30650
movq %rax, 0x90(%rsp)
leaq 0x90(%rsp), %rsi
callq 0x4d750
jmp 0x49fa6
jmp 0x4a354
leaq 0x290bb(%rip), %rsi     # 0x7306d
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x11(%rsp)
jmp 0x49fc5
movb 0x11(%rsp), %al
testb $0x1, %al
jne 0x49fcf
jmp 0x49ffa
movq 0x120(%rsp), %rdi
leaq -0x1993e(%rip), %rax    # 0x306a0
movq %rax, 0x88(%rsp)
leaq 0x88(%rsp), %rsi
callq 0x4d750
jmp 0x49ff5
jmp 0x4a352
leaq 0x29077(%rip), %rsi     # 0x73078
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x10(%rsp)
jmp 0x4a014
movb 0x10(%rsp), %al
testb $0x1, %al
jne 0x4a01e
jmp 0x4a049
movq 0x120(%rsp), %rdi
leaq -0x19bcd(%rip), %rax    # 0x30460
movq %rax, 0x80(%rsp)
leaq 0x80(%rsp), %rsi
callq 0x4d750
jmp 0x4a044
jmp 0x4a350
leaq 0x29031(%rip), %rsi     # 0x73081
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0xf(%rsp)
jmp 0x4a063
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x4a06d
jmp 0x4a092
movq 0x120(%rsp), %rdi
leaq -0x19bec(%rip), %rax    # 0x30490
movq %rax, 0x78(%rsp)
leaq 0x78(%rsp), %rsi
callq 0x4d750
jmp 0x4a08d
jmp 0x4a34e
leaq 0x28ff0(%rip), %rsi     # 0x73089
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0xe(%rsp)
jmp 0x4a0ac
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x4a0b6
jmp 0x4a0db
movq 0x120(%rsp), %rdi
leaq -0x199f5(%rip), %rax    # 0x306d0
movq %rax, 0x70(%rsp)
leaq 0x70(%rsp), %rsi
callq 0x4d750
jmp 0x4a0d6
jmp 0x4a34c
leaq 0x28fb3(%rip), %rsi     # 0x73095
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0xd(%rsp)
jmp 0x4a0f5
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0x4a0ff
jmp 0x4a124
movq 0x120(%rsp), %rdi
leaq -0x19a1e(%rip), %rax    # 0x306f0
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rsi
callq 0x4d750
jmp 0x4a11f
jmp 0x4a34a
leaq 0x28f77(%rip), %rsi     # 0x730a2
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0xc(%rsp)
jmp 0x4a13e
movb 0xc(%rsp), %al
testb $0x1, %al
jne 0x4a148
jmp 0x4a16d
movq 0x120(%rsp), %rdi
leaq -0x19997(%rip), %rax    # 0x307c0
movq %rax, 0x60(%rsp)
leaq 0x60(%rsp), %rsi
callq 0x4d750
jmp 0x4a168
jmp 0x4a348
leaq 0x28f38(%rip), %rsi     # 0x730ac
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0xb(%rsp)
jmp 0x4a187
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x4a191
jmp 0x4a1b6
movq 0x120(%rsp), %rdi
leaq -0x199b0(%rip), %rax    # 0x307f0
movq %rax, 0x58(%rsp)
leaq 0x58(%rsp), %rsi
callq 0x4d750
jmp 0x4a1b1
jmp 0x4a346
leaq 0x280dd(%rip), %rsi     # 0x7229a
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0xa(%rsp)
jmp 0x4a1d0
movb 0xa(%rsp), %al
testb $0x1, %al
jne 0x4a1da
jmp 0x4a1ff
movq 0x120(%rsp), %rdi
leaq -0x19aa9(%rip), %rax    # 0x30740
movq %rax, 0x50(%rsp)
leaq 0x50(%rsp), %rsi
callq 0x4d750
jmp 0x4a1fa
jmp 0x4a344
leaq 0x2809e(%rip), %rsi     # 0x722a4
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x9(%rsp)
jmp 0x4a219
movb 0x9(%rsp), %al
testb $0x1, %al
jne 0x4a223
jmp 0x4a248
movq 0x120(%rsp), %rdi
leaq -0x19ac2(%rip), %rax    # 0x30770
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rsi
callq 0x4d750
jmp 0x4a243
jmp 0x4a342
leaq 0x28e68(%rip), %rsi     # 0x730b7
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x8(%rsp)
jmp 0x4a262
movb 0x8(%rsp), %al
testb $0x1, %al
jne 0x4a26c
jmp 0x4a291
movq 0x120(%rsp), %rdi
leaq -0x19e6b(%rip), %rax    # 0x30410
movq %rax, 0x40(%rsp)
leaq 0x40(%rsp), %rsi
callq 0x4d750
jmp 0x4a28c
jmp 0x4a340
leaq 0x28e2b(%rip), %rsi     # 0x730c3
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x7(%rsp)
jmp 0x4a2ab
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x4a2b5
jmp 0x4a2d7
movq 0x120(%rsp), %rdi
leaq -0x19f04(%rip), %rax    # 0x303c0
movq %rax, 0x38(%rsp)
leaq 0x38(%rsp), %rsi
callq 0x4d750
jmp 0x4a2d5
jmp 0x4a33e
leaq 0x28df1(%rip), %rsi     # 0x730cf
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x6(%rsp)
jmp 0x4a2f1
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0x4a2fb
jmp 0x4a31d
movq 0x120(%rsp), %rdi
leaq -0x19f9a(%rip), %rax    # 0x30370
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rsi
callq 0x4d750
jmp 0x4a31b
jmp 0x4a33c
leaq 0x28db7(%rip), %rdi     # 0x730db
leaq 0x28df0(%rip), %rsi     # 0x7311b
movl $0x89, %edx
leaq 0x28def(%rip), %rcx     # 0x73126
callq 0x5260
jmp 0x4a33e
jmp 0x4a340
jmp 0x4a342
jmp 0x4a344
jmp 0x4a346
jmp 0x4a348
jmp 0x4a34a
jmp 0x4a34c
jmp 0x4a34e
jmp 0x4a350
jmp 0x4a352
jmp 0x4a354
jmp 0x4a356
leaq 0x28d45(%rip), %rsi     # 0x730a2
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x5(%rsp)
jmp 0x4a370
movb 0x5(%rsp), %al
testb $0x1, %al
jne 0x4a39e
jmp 0x4a37a
leaq 0x28d2b(%rip), %rsi     # 0x730ac
leaq 0xe0(%rsp), %rdi
callq 0xfa60
movb %al, 0x4(%rsp)
jmp 0x4a394
movb 0x4(%rsp), %al
testb $0x1, %al
jne 0x4a39e
jmp 0x4a3aa
movq 0x28(%rsp), %rax
movb $0x1, 0x2e0(%rax)
leaq 0xe0(%rsp), %rdi
callq 0x5768
leaq 0x108(%rsp), %rdi
callq 0xeca0
jmp 0x49dc8
leaq 0xe0(%rsp), %rdi
callq 0x5768
jmp 0x4a3e0
addq $0x138, %rsp            # imm = 0x138
retq
movq 0xd0(%rsp), %rdi
callq 0x5690
nopl (%rax)