// File: /workspace/github_cpp_makefile_star2_O3/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 $0x88, %rsp
movq %rdi, %rbx
movaps 0xc0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x25a74
leaq 0x1a568(%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 0x1b74b(%rip), %r14     # 0x45f50
movl 0x1c8(%r14), %eax
movl %eax, 0x2b8(%rbx)
leaq 0x230(%r14), %rsi
movq %rdi, 0x50(%rsp)
movq %rbx, 0x20(%rsp)
callq 0xc3b4
movq %rbx, %rdi
callq 0x2aaea
movq 0x230(%r14), %r15
movq 0x238(%r14), %rbx
cmpq %rbx, %r15
je 0x2a8ac
leaq 0x40(%rsp), %r14
leaq 0x30(%rsp), %r12
movq 0x1a77c(%rip), %r13     # 0x44fd0
leaq 0x97bb(%rip), %rbp      # 0x34016
movq %r14, 0x30(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xcbd6
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rdi
callq 0x5360
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x5360
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a8a3
callq 0x52b0
addq $0x20, %r15
cmpq %rbx, %r15
jne 0x2a85b
movq 0x1a71d(%rip), %rdi     # 0x44fd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
movq 0x20(%rsp), %rbx
callq 0x52c0
leaq 0x1b680(%rip), %r14     # 0x45f50
movsbl %al, %esi
movq 0x1a6f6(%rip), %rdi     # 0x44fd0
callq 0x5030
movq %rax, %rdi
callq 0x5200
movl $0xe8, %esi
addq 0x1a6ad(%rip), %rsi     # 0x44fa0
movq 0x28(%rsp), %rdi
callq 0xca20
leaq 0x2e0(%rbx), %rdi
movl $0x100, %esi            # imm = 0x100
addq 0x1a690(%rip), %rsi     # 0x44fa0
callq 0xca20
leaq 0x2f8(%rbx), %rdi
movl $0x118, %esi            # imm = 0x118
addq 0x1a678(%rip), %rsi     # 0x44fa0
callq 0xca20
movq $0x0, 0x2c0(%rbx)
cmpb $0x1, (%r14)
jne 0x2a956
leaq 0x1b3cb(%rip), %rdi     # 0x45d10
leaq 0xc378(%rip), %rsi      # 0x36cc4
movl $0x10, %edx
callq 0x5060
movl $0x8, %edi
callq 0x52f0
leaq 0x58(%rsp), %rdx
movq %rax, (%rdx)
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x10(%rdx)
movq $0x0, (%rax)
movq %rcx, 0x8(%rdx)
leaq 0x70(%rsp), %rdi
leaq 0x1f(%rsp), %rcx
movl $0x3, %esi
callq 0xc524
movq 0x348(%rbx), %rax
leaq 0x70(%rsp), %r12
movaps (%r12), %xmm0
movq 0x10(%r12), %rcx
movq %rcx, 0x348(%rbx)
movups 0x338(%rbx), %xmm1
movups %xmm0, 0x338(%rbx)
leaq 0x30(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
movq $0x0, 0x10(%r12)
callq 0xc5b4
movq %r12, %rdi
callq 0xc5b4
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x2a9f6
callq 0x52b0
movl $0x8, %edi
callq 0x52f0
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 0x2aa34
callq 0x52b0
xorps %xmm0, %xmm0
movups %xmm0, 0x328(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2aa65
movq %rax, %r12
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
jne 0x2aa77
jmp 0x2aa7c
jmp 0x2aa65
jmp 0x2aa65
movq %rax, %r12
jmp 0x2aa7c
movq %rax, %r12
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x2aa7c
callq 0x52b0
movq 0x20(%rsp), %rax
leaq 0x270(%rax), %rbx
leaq 0x288(%rax), %r13
leaq 0x338(%rax), %rbp
movq 0x350(%rax), %rdi
testq %rdi, %rdi
je 0x2aaa7
callq 0x52b0
movq %rbp, %rdi
callq 0xc5b4
movq 0x28(%rsp), %rdi
callq 0xc792
movq 0x50(%rsp), %rdi
callq 0xc7c2
movq %r13, %rdi
callq 0xc80c
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2aad8
callq 0x52b0
movq 0x20(%rsp), %rdi
callq 0x2819a
movq %r12, %rdi
callq 0x55a0