// File: /workspace/github_cpp_makefile_star2_O2/gvaumour[P]cache-simulator/src/SimplePerceptron.cc
// Function: SimplePerceptronPredictor::SimplePerceptronPredictor(int, int, int, int, std::vector<std::vector<CacheEntry*, std::allocator<CacheEntry*>>, std::allocator<std::vector<CacheEntry*, std::allocator<CacheEntry*>>>>&, std::vector<std::vector<CacheEntry*, std::allocator<CacheEntry*>>, std::allocator<std::vector<CacheEntry*, std::allocator<CacheEntry*>>>>&, HybridCache*)
SimplePerceptronPredictor::SimplePerceptronPredictor(int id, int nbAssoc , int nbSet, int nbNVMways, DataArray& SRAMtable, DataArray& NVMtable, HybridCache* cache) :\
	Predictor(id, nbAssoc , nbSet , nbNVMways , SRAMtable , NVMtable , cache)
{	
	m_tableSize = simu_parameters.perceptron_table_size;

	m_feature_names = simu_parameters.simple_perceptron_features;
	
	initFeatures();
	
	for(auto p : simu_parameters.simple_perceptron_features)
		cout << p << ",";
	cout << endl;
	
	m_costParameters = simu_parameters.optTarget;
	
	m_cpt = 0;
	
	if(simu_parameters.printDebug)
		debug_file_simple_perceptron.open(SIMPLE_PERCEPTRON_DEBUG_FILE);	
	
	stats_access_class = vector<vector<int> >(NUM_RD_TYPE ,  vector<int>(2, 0));
	stats_nbMigrations = vector<int>(2,0);

	stats_good_alloc = 0, stats_wrong_alloc = 0;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movaps 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x1e8c0
leaq 0x1a413(%rip), %rax     # 0x3cd08
movq %rax, (%rbx)
leaq 0x2a0(%rbx), %rdi
leaq 0x2c8(%rbx), %rax
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x2c8(%rbx)
movups %xmm0, 0x2d8(%rbx)
movups %xmm0, 0x2e8(%rbx)
andq $0x0, 0x308(%rbx)
movups %xmm0, 0x2f8(%rbx)
leaq 0x338(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0x350(%rbx), %rax
movq %rax, 0x20(%rsp)
movups %xmm0, 0x270(%rbx)
movups %xmm0, 0x280(%rbx)
andq $0x0, 0x2b0(%rbx)
movups %xmm0, 0x290(%rbx)
movups %xmm0, 0x2a0(%rbx)
movups %xmm0, 0x338(%rbx)
movups %xmm0, 0x348(%rbx)
movups %xmm0, 0x358(%rbx)
leaq 0x1b5c6(%rip), %rcx     # 0x3df50
movl 0x1c8(%rcx), %eax
movl %eax, 0x2b8(%rbx)
leaq 0x230(%rcx), %rsi
movq %rdi, 0x38(%rsp)
callq 0x9bc0
movq %rbx, %rdi
callq 0x22b7a
leaq 0x1b59a(%rip), %rax     # 0x3df50
movq 0x230(%rax), %rbp
movq 0x238(%rax), %r13
leaq 0x58(%rsp), %r14
movq 0x1a600(%rip), %r15     # 0x3cfd0
leaq 0x665b(%rip), %r12      # 0x29032
cmpq %r13, %rbp
je 0x22a0b
movq %r14, %rdi
movq %rbp, %rsi
callq 0x5410
movq %r15, %rdi
movq %r14, %rsi
callq 0x5290
movq %rax, %rdi
movq %r12, %rsi
callq 0x52c0
movq %r14, %rdi
callq 0x5618
addq $0x20, %rbp
jmp 0x229d7
movq 0x1a5be(%rip), %rdi     # 0x3cfd0
callq 0x5190
movl $0xe8, %esi
addq 0x1a58d(%rip), %rsi     # 0x3cfb0
movq 0x30(%rsp), %rdi
callq 0x9d58
andq $0x0, 0x2c0(%rbx)
leaq 0x1b514(%rip), %rax     # 0x3df50
cmpb $0x1, (%rax)
jne 0x22a57
leaq 0x1b2c8(%rip), %rdi     # 0x3dd10
leaq 0x9225(%rip), %rsi      # 0x2bc74
pushq $0x10
popq %rdx
callq 0x5050
leaq 0x1c(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x40(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x1b(%rsp), %rcx
callq 0x9c8a
leaq 0x58(%rsp), %rdi
pushq $0x3
popq %rsi
leaq 0x40(%rsp), %rdx
leaq 0x1a(%rsp), %rcx
callq 0x9ce0
leaq 0x58(%rsp), %r14
movq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0xa710
movq %r14, %rdi
callq 0x9d36
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0xa49a
andl $0x0, (%r14)
leaq 0x58(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x40(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
callq 0x9c8a
leaq 0x58(%rsp), %r14
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0xa52e
movq %r14, %rdi
callq 0xa49a
xorps %xmm0, %xmm0
movups %xmm0, 0x328(%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x22b12
movq %rax, %rbp
leaq 0x40(%rsp), %rdi
callq 0xa49a
jmp 0x22b24
jmp 0x22b12
jmp 0x22b12
movq %rax, %rbp
jmp 0x22b24
movq %rax, %rbp
leaq 0x58(%rsp), %rdi
callq 0x5618
leaq 0x270(%rbx), %r14
leaq 0x288(%rbx), %r15
movq 0x20(%rsp), %rdi
callq 0xa49a
movq 0x28(%rsp), %rdi
callq 0x9d36
movq 0x30(%rsp), %rdi
callq 0x9ed6
movq 0x38(%rsp), %rdi
callq 0x9ef6
movq %r15, %rdi
callq 0x9f18
movq %r14, %rdi
callq 0x24ce8
movq %rbx, %rdi
callq 0x2087a
movq %rbp, %rdi
callq 0x5570