// File: /workspace/github_cpp_makefile_star2_O1/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 $0x98, %rsp
movq %rdi, %rbx
movaps 0xd0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x25c7c
leaq 0x1a208(%rip), %rax     # 0x44cf0
movq %rax, (%rbx)
leaq 0x2a0(%rbx), %rdi
leaq 0x2c8(%rbx), %rax
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x2c8(%rbx)
movups %xmm0, 0x2d8(%rbx)
movups %xmm0, 0x2e8(%rbx)
movups %xmm0, 0x2f8(%rbx)
xorl %eax, %eax
movq %rax, 0x308(%rbx)
movups %xmm0, 0x270(%rbx)
movups %xmm0, 0x280(%rbx)
movups %xmm0, 0x290(%rbx)
movups %xmm0, 0x2a0(%rbx)
movq %rax, 0x2b0(%rbx)
movups %xmm0, 0x338(%rbx)
movups %xmm0, 0x348(%rbx)
movups %xmm0, 0x358(%rbx)
leaq 0x1b3eb(%rip), %r14     # 0x45f50
movl 0x1c8(%r14), %eax
movl %eax, 0x2b8(%rbx)
leaq 0x230(%r14), %rsi
movq %rdi, 0x58(%rsp)
movq %rbx, 0x20(%rsp)
callq 0xc46a
movq %rbx, %rdi
callq 0x2ae74
movq 0x230(%r14), %r15
movq 0x238(%r14), %rbx
cmpq %rbx, %r15
je 0x2ac0c
leaq 0x40(%rsp), %r14
leaq 0x30(%rsp), %r12
movq 0x1a41c(%rip), %r13     # 0x44fd0
leaq 0x9487(%rip), %rbp      # 0x34042
movq %r14, 0x30(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xcc1c
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rdi
callq 0x5350
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x5350
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x2ac03
callq 0x52a0
addq $0x20, %r15
cmpq %rbx, %r15
jne 0x2abbb
movq 0x1a3bd(%rip), %rdi     # 0x44fd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
movq 0x20(%rsp), %rbx
callq 0x52b0
leaq 0x1b320(%rip), %r14     # 0x45f50
movsbl %al, %esi
movq 0x1a396(%rip), %rdi     # 0x44fd0
callq 0x5030
movq %rax, %rdi
callq 0x51f0
movl $0xe8, %esi
addq 0x1a34d(%rip), %rsi     # 0x44fa0
movq 0x28(%rsp), %rdi
callq 0xca74
leaq 0x2e0(%rbx), %rdi
movl $0x100, %esi            # imm = 0x100
addq 0x1a330(%rip), %rsi     # 0x44fa0
callq 0xca74
leaq 0x2f8(%rbx), %rdi
movl $0x118, %esi            # imm = 0x118
addq 0x1a318(%rip), %rsi     # 0x44fa0
callq 0xca74
movq $0x0, 0x2c0(%rbx)
cmpb $0x1, (%r14)
jne 0x2acb6
leaq 0x1b06b(%rip), %rdi     # 0x45d10
leaq 0xc020(%rip), %rsi      # 0x36ccc
movl $0x10, %edx
callq 0x5060
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movl $0x8, %edi
callq 0x52e0
leaq 0x60(%rsp), %rdx
movq %rax, (%rdx)
movq %rax, 0x8(%rdx)
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x10(%rdx)
movq $0x0, (%rax)
movq %rcx, 0x8(%rdx)
leaq 0x80(%rsp), %rdi
leaq 0x1f(%rsp), %rcx
movl $0x3, %esi
callq 0xc5b2
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movups 0x338(%rbx), %xmm0
movq 0x348(%rbx), %rax
leaq 0x80(%rsp), %r12
movaps (%r12), %xmm1
movups %xmm1, 0x338(%rbx)
movq 0x10(%r12), %rcx
movq %rcx, 0x348(%rbx)
movq 0x10(%rdi), %rcx
movq %rax, 0x10(%rdi)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movaps %xmm1, (%r12)
movq %rcx, 0x10(%r12)
callq 0xc642
movq %r12, %rdi
callq 0xc642
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x2ad7f
callq 0x52a0
movl $0x8, %edi
callq 0x52e0
movq $0x0, (%rax)
movq %rax, %rcx
addq $0x8, %rcx
movq 0x350(%rbx), %rdi
movq %rax, 0x350(%rbx)
movq %rcx, 0x358(%rbx)
movq %rcx, 0x360(%rbx)
testq %rdi, %rdi
je 0x2adbd
callq 0x52a0
xorps %xmm0, %xmm0
movups %xmm0, 0x328(%rbx)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2adee
movq %rax, %r12
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
jne 0x2ae00
jmp 0x2ae05
jmp 0x2adee
jmp 0x2adee
movq %rax, %r12
jmp 0x2ae05
movq %rax, %r12
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x2ae05
callq 0x52a0
movq 0x20(%rsp), %rax
leaq 0x270(%rax), %rbx
leaq 0x288(%rax), %r13
leaq 0x338(%rax), %rbp
movq 0x350(%rax), %rdi
testq %rdi, %rdi
je 0x2ae30
callq 0x52a0
movq %rbp, %rdi
callq 0xc642
movq 0x28(%rsp), %rdi
callq 0xc800
movq 0x58(%rsp), %rdi
callq 0xc830
movq %r13, %rdi
callq 0xc874
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2ae61
callq 0x52a0
movq 0x20(%rsp), %rdi
callq 0x284d2
movq %r12, %rdi
callq 0x55a0
nop