// File: /workspace/github_cpp_makefile_star2_O2/gvaumour[P]cache-simulator/src/HybridCache.cc
// Function: HybridCache::HybridCache(int, bool, int, int, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Level*)
HybridCache::HybridCache(int id, bool isInstructionCache, int size , int assoc , int blocksize , int nbNVMways, string policy, Level* system){

	m_assoc = assoc;
	m_cache_size = size;
	m_blocksize = blocksize;
	m_nb_set = size / (assoc * blocksize);
	m_nbNVMways = nbNVMways;	
	m_nbSRAMways = m_assoc - m_nbNVMways;
	m_system = system;
	m_ID = id;
	m_isInstructionCache = isInstructionCache;
	
	assert(isPow2(m_nb_set));
	assert(isPow2(m_blocksize));

	m_policy = policy;
	m_printStats = false;
	m_isWarmup = false;
		
	m_tableSRAM.resize(m_nb_set);
	m_tableNVM.resize(m_nb_set);
	for(int i = 0  ; i < m_nb_set ; i++){
		m_tableSRAM[i].resize(m_nbSRAMways);
		for(int j = 0 ; j < m_nbSRAMways ; j++){
			m_tableSRAM[i][j] = new CacheEntry();
			initializeLearningCl(m_tableSRAM[i][j]);
		}

		m_tableNVM[i].resize(m_nbNVMways);
		for(int j = 0 ; j < m_nbNVMways ; j++){
			m_tableNVM[i][j] = new CacheEntry();
			m_tableNVM[i][j]->isNVM = true;	
			initializeLearningCl(m_tableNVM[i][j]);

		}
	}

	if(m_policy == "preemptive")
		 m_predictor = new PreemptivePredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM,this);	
	else if(m_policy == "LRU")
		 m_predictor = new LRUPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM, this);	
	else if(m_policy == "Saturation")
		 m_predictor = new SaturationCounter(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);	
	else if(m_policy == "Instruction")
		 m_predictor = new InstructionPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);	
	else if(m_policy == "PHC")
		 m_predictor = new PHCPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);	
	else if(m_policy == "Cerebron")
		 m_predictor = new CerebronPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);	
	/*else if(m_policy == "Monitor")
		 m_predictor = new monitorPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);*/
	else if(m_policy == "Perceptron")
		 m_predictor = new PerceptronPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);	
	else if(m_policy == "SimplePerceptron")
		 m_predictor = new SimplePerceptronPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);	
	//else if(m_policy == "SimplePerceptron")
	//	 m_predictor = new SimplePerceptronPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);	
	else if(m_policy == "DBAMB" || m_policy == "DBA" || m_policy == "DBAM" || m_policy == "DBAMBS")
		 m_predictor = new DBAMBPredictor(m_ID, m_assoc, m_nb_set, m_nbNVMways, m_tableSRAM, m_tableNVM , this);	
	else {
		assert(false && "Cannot initialize predictor for HybridCache");
	}
	
	if(m_ID == -1 && m_policy != "DBAMB")
	{
		
		if(m_policy == "Cerebron" )
		{		
			int learning_policy_sets = simu_parameters.Cerebron_separateLearning ? m_nb_set/2 : m_nb_set;
			int learning_weight_sets = simu_parameters.Cerebron_separateLearning ? m_nb_set/2 : 0;

			for(int i = 0 ; i < learning_policy_sets; i++)
			{
				for(int j = 0 ; j < m_nbSRAMways ; j++)
					m_tableSRAM[i][j]->isLearning_policy = true;
				for(int j = 0 ; j < m_nbNVMways ; j++)
					m_tableNVM[i][j]->isLearning_policy = true;
			}
			for(int i = learning_weight_sets ; i < m_nb_set; i++)
			{
				for(int j = 0 ; j < m_nbSRAMways ; j++)
					m_tableSRAM[i][j]->isLearning_weight = true;
				for(int j = 0 ; j < m_nbNVMways ; j++)
					m_tableNVM[i][j]->isLearning_weight = true;
			}
		}
		else
		{
			int constituency = m_nb_set / simu_parameters.nb_sampled_sets;
			int index = 0;
		
			for(int i = 0 ; i+index < m_nb_set; i += constituency)
			{
				for(int j = 0 ; j < m_nbSRAMways ; j++)
					m_tableSRAM[i+index][j]->isLearning = true;
				for(int j = 0 ; j < m_nbNVMways ; j++)
					m_tableNVM[i+index][j]->isLearning = true;
	
				index = (index+1)%constituency;
			}
		}		
	}
	
	m_start_index = log2(blocksize)-1;
	m_end_index = log2(m_blocksize) + log2(m_nb_set);

	stats_missSRAM = vector<uint64_t>(2 , 0);
	stats_hitsSRAM = vector<uint64_t>(2 , 0);
	stats_cleanWBSRAM = 0;
	stats_dirtyWBSRAM = 0;

	stats_missNVM = vector<uint64_t>(2 , 0);
	stats_hitsNVM = vector<uint64_t>(2 , 0);
	stats_cleanWBNVM = 0;
	stats_dirtyWBNVM = 0;
	stats_evict = 0;

	stats_migration = vector<uint64_t>(2,0);
	
	stats_nbFetchedLines = 0;
	stats_nbAlmostROlines = 0;
	stats_nbLostLine = 0;
	stats_nbROlines = 0;
	stats_nbROaccess = 0;
	stats_nbRWlines = 0;
	stats_nbRWaccess = 0;
	stats_nbAlmostROaccess = 0;
	stats_nbWOlines = 0 ;
	stats_nbWOaccess = 0;
	stats_bypass = 0;
	stats_nbDeadMigration = 0;
	stats_nbPingMigration = 0;
	
	stats_histo_ratioRW.clear();
	stats_allocateWB = 0, stats_allocateDemand = 0;
	stats_demand_BP = 0, stats_WB_BP = 0;
	
	// Record the number of operations issued by the cache 
	stats_operations = vector<uint64_t>(NUM_MEM_CMDS , 0); 

	if(simu_parameters.enablePCHistoryTracking && m_printStats){	
		ofstream file_history_cache("LLC_PC_History.out", std::ofstream::trunc); //Create the file
		file_history_cache.close(); 
	}
	
	if(simu_parameters.traceLLC && m_ID == -1)
		LLC_trace = gzopen("LLC_trace.out", "wb8");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movl %r9d, %r15d
movl %ecx, %eax
movl %edx, %ecx
movq %rdi, %r14
movq 0x2b0(%rsp), %rdi
movl 0x2a0(%rsp), %r9d
leaq 0x8(%r14), %rdx
movq %rdx, 0x8(%rsp)
leaq 0x40(%r14), %rdx
andl $0x0, 0x40(%r14)
andq $0x0, 0x48(%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%r14)
movupd %xmm0, 0x18(%r14)
movupd %xmm0, 0x28(%r14)
movq %rdx, 0x50(%r14)
movq %rdx, 0x58(%r14)
andq $0x0, 0x60(%r14)
leaq 0x20(%r14), %rdx
movq %rdx, 0x10(%rsp)
leaq 0x70(%r14), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x80(%r14), %rdx
movq %rdx, 0x70(%r14)
andq $0x0, 0x78(%r14)
movb $0x0, 0x80(%r14)
leaq 0xc0(%r14), %rdx
movq %rdx, 0x58(%rsp)
andl $0x0, 0x1f8(%r14)
leaq 0xd8(%r14), %rdx
movq %rdx, 0x50(%rsp)
andq $0x0, 0x200(%r14)
leaq 0x1f8(%r14), %rdx
movupd %xmm0, 0xc0(%r14)
movupd %xmm0, 0xd0(%r14)
movupd %xmm0, 0xe0(%r14)
movupd %xmm0, 0x110(%r14)
movupd %xmm0, 0x120(%r14)
movupd %xmm0, 0x130(%r14)
movupd %xmm0, 0x190(%r14)
movupd %xmm0, 0x180(%r14)
movupd %xmm0, 0x170(%r14)
movq %rdx, 0x208(%r14)
movq %rdx, 0x210(%r14)
andq $0x0, 0x218(%r14)
movl %r8d, 0xa0(%r14)
movl %eax, 0x9c(%r14)
movl %r15d, 0xb0(%r14)
movl %r15d, %r10d
imull %r8d, %r10d
cltd
idivl %r10d
movl %eax, 0xac(%r14)
movl %r9d, 0xa4(%r14)
subl %r9d, %r8d
leaq 0x110(%r14), %rdx
movq %rdx, 0x48(%rsp)
movl %r8d, 0xa8(%r14)
leaq 0x128(%r14), %rdx
movq %rdx, 0x40(%rsp)
movq %rdi, 0xb8(%r14)
leaq 0x170(%r14), %rdx
movq %rdx, 0x38(%rsp)
movl %esi, (%r14)
leaq 0x188(%r14), %rdx
movq %rdx, 0x28(%rsp)
movb %cl, 0x4(%r14)
leaq 0x1f0(%r14), %rcx
movq %rcx, 0x30(%rsp)
movl %eax, %edi
callq 0x2558a
testb %al, %al
je 0x14980
movl 0xb0(%r14), %edi
callq 0x2558a
testb %al, %al
je 0x14999
movq 0x2a8(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x51b0
andw $0x0, 0x90(%r14)
movslq 0xac(%r14), %rsi
movq 0x10(%rsp), %rdi
callq 0x173aa
movslq 0xac(%r14), %rsi
movq 0x8(%rsp), %rdi
callq 0x173aa
xorl %r12d, %r12d
movslq 0xac(%r14), %rax
cmpq %rax, %r12
jge 0x141e0
imulq $0x18, %r12, %rbp
movq 0x20(%r14), %rdi
addq %rbp, %rdi
movslq 0xa8(%r14), %rsi
callq 0x173e0
xorl %ebx, %ebx
movslq 0xa8(%r14), %rax
cmpq %rax, %rbx
jge 0x14179
movl $0x170, %edi            # imm = 0x170
callq 0x52e0
movq %rax, %r13
movq %rax, %rdi
callq 0x17412
movq 0x20(%r14), %rax
movq (%rax,%rbp), %rax
movq %r13, (%rax,%rbx,8)
movq 0x20(%r14), %rax
movq (%rax,%rbp), %rax
movq (%rax,%rbx,8), %rsi
movq %r14, %rdi
callq 0x14a8e
incq %rbx
jmp 0x14133
movq 0x8(%r14), %rdi
addq %rbp, %rdi
movslq 0xa4(%r14), %rsi
callq 0x173e0
xorl %ebx, %ebx
movslq 0xa4(%r14), %rax
cmpq %rax, %rbx
jge 0x141d8
movl $0x170, %edi            # imm = 0x170
callq 0x52e0
movq %rax, %r13
movq %rax, %rdi
callq 0x17412
movq 0x8(%r14), %rax
movq (%rax,%rbp), %rax
movq %r13, (%rax,%rbx,8)
movq 0x8(%r14), %rax
movq (%rax,%rbp), %rax
movq (%rax,%rbx,8), %rsi
movb $0x1, 0x40(%rsi)
movq %r14, %rdi
callq 0x14a8e
incq %rbx
jmp 0x1418e
incq %r12
jmp 0x1410a
leaq 0x165ba(%rip), %rsi     # 0x2a7a1
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x14237
movl $0x278, %edi            # imm = 0x278
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0x17494
popq %rax
popq %rcx
jmp 0x144ff
leaq 0x160dc(%rip), %rsi     # 0x2a31a
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x14289
movl $0x278, %edi            # imm = 0x278
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0x20686
popq %rax
popq %rcx
jmp 0x144ff
leaq 0x1651c(%rip), %rsi     # 0x2a7ac
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x142db
movl $0x290, %edi            # imm = 0x290
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0x219dc
popq %rax
popq %rcx
jmp 0x144ff
leaq 0x164d5(%rip), %rsi     # 0x2a7b7
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x1432d
movl $0x310, %edi            # imm = 0x310
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0x18710
popq %rax
popq %rcx
jmp 0x144ff
leaq 0x1648f(%rip), %rsi     # 0x2a7c3
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x1437f
movl $0x448, %edi            # imm = 0x448
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0x19fc8
popq %rax
popq %rcx
jmp 0x144ff
leaq 0x16441(%rip), %rsi     # 0x2a7c7
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x143d1
movl $0x4d8, %edi            # imm = 0x4D8
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0x5d4c
popq %rax
popq %rcx
jmp 0x144ff
leaq 0x163fe(%rip), %rsi     # 0x2a7d6
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x14423
movl $0x3f8, %edi            # imm = 0x3F8
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0x1cb18
popq %rax
popq %rcx
jmp 0x144ff
leaq 0x163a6(%rip), %rsi     # 0x2a7d0
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x14475
movl $0x368, %edi            # imm = 0x368
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0x228cc
popq %rax
popq %rcx
jmp 0x144ff
leaq 0x17c6b(%rip), %rsi     # 0x2c0e7
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
jne 0x144c5
leaq 0x16352(%rip), %rsi     # 0x2a7e1
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
jne 0x144c5
leaq 0x16343(%rip), %rsi     # 0x2a7e5
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
jne 0x144c5
leaq 0x16335(%rip), %rsi     # 0x2a7ea
movq %rbx, %rdi
callq 0x9f59
testb %al, %al
je 0x149b6
movl $0x418, %edi            # imm = 0x418
callq 0x52e0
movq %rax, %r13
movl (%r14), %esi
movl 0xa0(%r14), %edx
movl 0xac(%r14), %ecx
movl 0xa4(%r14), %r8d
movq %rax, %rdi
movq 0x10(%rsp), %r9
pushq %r14
pushq 0x10(%rsp)
callq 0xb730
popq %rax
popq %rcx
movq %r13, 0x68(%r14)
cmpl $-0x1, (%r14)
jne 0x146f7
leaq 0x17bd3(%rip), %rsi     # 0x2c0e7
movq 0x18(%rsp), %rdi
callq 0x9c80
testb %al, %al
je 0x146f7
leaq 0x1629a(%rip), %rsi     # 0x2a7c7
movq 0x18(%rsp), %rdi
callq 0x9f59
testb %al, %al
je 0x14568
leaq 0x29a0e(%rip), %rax     # 0x3df50
movl 0xac(%r14), %ecx
xorl %esi, %esi
cmpb $0x1, 0x224(%rax)
jne 0x14606
pushq $0x2
popq %rdi
movl %ecx, %eax
cltd
idivl %edi
movslq %eax, %rdx
jmp 0x1460a
movl 0xac(%r14), %ecx
leaq 0x299da(%rip), %rsi     # 0x3df50
movl %ecx, %eax
cltd
idivl 0x48(%rsi)
movl %eax, %esi
movl 0xa4(%r14), %edi
movl 0xa8(%r14), %r8d
xorl %eax, %eax
testl %r8d, %r8d
cmovlel %eax, %r8d
testl %edi, %edi
cmovlel %eax, %edi
xorl %r9d, %r9d
leal (%r9,%rax), %edx
cmpl %ecx, %edx
jge 0x146f7
movslq %edx, %rdx
imulq $0x18, %rdx, %rdx
movq 0x10(%rsp), %r10
movq (%r10), %r10
addq %rdx, %r10
xorl %r11d, %r11d
cmpq %r11, %r8
je 0x145d6
movq (%r10), %rbx
movq (%rbx,%r11,8), %rbx
movb $0x1, 0x148(%rbx)
incq %r11
jmp 0x145be
movq 0x8(%rsp), %r10
addq (%r10), %rdx
xorl %r10d, %r10d
cmpq %r10, %rdi
je 0x145fa
movq (%rdx), %r11
movq (%r11,%r10,8), %r11
movb $0x1, 0x148(%r11)
incq %r10
jmp 0x145e1
incl %eax
cltd
idivl %esi
addl %esi, %r9d
movl %edx, %eax
jmp 0x1459d
movl %ecx, %eax
xorl %edx, %edx
movl 0xa8(%r14), %edi
testl %edi, %edi
cmovlel %esi, %edi
movl 0xa4(%r14), %r8d
testl %r8d, %r8d
cmovlel %esi, %r8d
movslq %ecx, %rcx
testl %eax, %eax
cmovlel %esi, %eax
cmpq %rax, %rsi
je 0x14684
imulq $0x18, %rsi, %r9
movq 0x10(%rsp), %r10
movq (%r10), %r10
addq %r9, %r10
xorl %r11d, %r11d
cmpq %r11, %rdi
je 0x1465b
movq (%r10), %rbx
movq (%rbx,%r11,8), %rbx
movb $0x1, 0x149(%rbx)
incq %r11
jmp 0x14643
movq 0x8(%rsp), %r10
addq (%r10), %r9
xorl %r10d, %r10d
cmpq %r10, %r8
je 0x1467f
movq (%r9), %r11
movq (%r11,%r10,8), %r11
movb $0x1, 0x149(%r11)
incq %r10
jmp 0x14666
incq %rsi
jmp 0x1462c
movl 0xa8(%r14), %eax
xorl %edi, %edi
testl %eax, %eax
cmovlel %edi, %eax
movl 0xa4(%r14), %esi
testl %esi, %esi
cmovlel %edi, %esi
cmpq %rcx, %rdx
jge 0x146f7
imulq $0x18, %rdx, %rdi
movq 0x10(%rsp), %r8
movq (%r8), %r8
addq %rdi, %r8
xorl %r9d, %r9d
cmpq %r9, %rax
je 0x146ce
movq (%r8), %r10
movq (%r10,%r9,8), %r10
movb $0x1, 0x14a(%r10)
incq %r9
jmp 0x146b5
movq 0x8(%rsp), %r8
addq (%r8), %rdi
xorl %r8d, %r8d
cmpq %r8, %rsi
je 0x146f2
movq (%rdi), %r9
movq (%r9,%r8,8), %r9
movb $0x1, 0x14a(%r9)
incq %r8
jmp 0x146d9
incq %rdx
jmp 0x1469e
movl %r15d, %edi
callq 0x100cb
addsd 0x15fe9(%rip), %xmm0    # 0x2a6f0
cvttsd2si %xmm0, %eax
movl %eax, 0x94(%r14)
movl 0xb0(%r14), %edi
callq 0x100cb
movsd %xmm0, 0x60(%rsp)
movl 0xac(%r14), %edi
callq 0x100cb
addsd 0x60(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x98(%r14)
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x7(%rsp), %rcx
callq 0x9d90
leaq 0x68(%rsp), %r13
movq 0x58(%rsp), %rdi
movq %r13, %rsi
callq 0xab1e
movq %r13, %rdi
callq 0xa4a8
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x7(%rsp), %rcx
callq 0x9d90
leaq 0x68(%rsp), %r13
movq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0xab1e
movq %r13, %rdi
callq 0xa4a8
xorpd %xmm0, %xmm0
movupd %xmm0, 0xf0(%r14)
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x7(%rsp), %rcx
callq 0x9d90
leaq 0x68(%rsp), %r13
movq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0xab1e
movq %r13, %rdi
callq 0xa4a8
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x7(%rsp), %rcx
callq 0x9d90
leaq 0x68(%rsp), %r13
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0xab1e
movq %r13, %rdi
callq 0xa4a8
andq $0x0, 0x100(%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x140(%r14)
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
pushq $0x2
popq %rsi
leaq 0x7(%rsp), %rcx
callq 0x9d90
leaq 0x68(%rsp), %r13
movq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0xab1e
movq %r13, %rdi
callq 0xa4a8
andq $0x0, 0x108(%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x1a0(%r14)
movupd %xmm0, 0x1b0(%r14)
movupd %xmm0, 0x1c0(%r14)
movupd %xmm0, 0x1d0(%r14)
movupd %xmm0, 0x1e0(%r14)
movupd %xmm0, 0x220(%r14)
movq 0x30(%rsp), %rdi
callq 0x17e1c
xorpd %xmm0, %xmm0
movupd %xmm0, 0x160(%r14)
movupd %xmm0, 0x150(%r14)
leaq 0x20(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x68(%rsp), %rdi
pushq $0xb
popq %rsi
leaq 0x7(%rsp), %rcx
callq 0x9d90
leaq 0x68(%rsp), %r13
movq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0xab1e
movq %r13, %rdi
callq 0xa4a8
leaq 0x29646(%rip), %rbx     # 0x3df50
cmpb $0x1, 0x95(%rbx)
jne 0x14945
cmpb $0x1, 0x90(%r14)
jne 0x14945
leaq 0x15f04(%rip), %rsi     # 0x2a828
leaq 0x68(%rsp), %rdi
pushq $0x20
popq %rdx
callq 0x5310
leaq 0x68(%rsp), %rdi
callq 0x5420
leaq 0x68(%rsp), %rdi
callq 0x5620
cmpb $0x1, 0x89(%rbx)
jne 0x1496e
cmpl $-0x1, (%r14)
jne 0x1496e
leaq 0x15ee0(%rip), %rdi     # 0x2a83b
leaq 0x15ee7(%rip), %rsi     # 0x2a849
callq 0x5450
movq %rax, 0x2911a(%rip)     # 0x3da88
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15d99(%rip), %rdi     # 0x2a720
leaq 0x15da3(%rip), %rsi     # 0x2a731
leaq 0x15daf(%rip), %rcx     # 0x2a744
pushq $0x3f
jmp 0x149b0
leaq 0x15ded(%rip), %rdi     # 0x2a78d
leaq 0x15d8a(%rip), %rsi     # 0x2a731
leaq 0x15d96(%rip), %rcx     # 0x2a744
pushq $0x40
popq %rdx
callq 0x51e0
leaq 0x15e34(%rip), %rdi     # 0x2a7f1
leaq 0x15d6d(%rip), %rsi     # 0x2a731
leaq 0x15d79(%rip), %rcx     # 0x2a744
pushq $0x6f
jmp 0x149b0
jmp 0x14a04
jmp 0x14a04
jmp 0x14a04
jmp 0x14a04
jmp 0x14a04
jmp 0x14a04
jmp 0x14a04
movq %rax, %rbp
leaq 0x68(%rsp), %rdi
callq 0x5620
jmp 0x14a16
jmp 0x14a13
jmp 0x14a04
jmp 0x14a04
jmp 0x14a13
jmp 0x14a13
jmp 0x14a13
jmp 0x14a13
jmp 0x14a13
jmp 0x14a13
jmp 0x14a13
jmp 0x14a13
jmp 0x14a04
movq %rax, %rbp
movq %r13, %rdi
callq 0x52a0
jmp 0x14a16
jmp 0x14a13
movq %rax, %rbp
addq $0x38, %r14
movq 0x30(%rsp), %rdi
callq 0x178ba
movq 0x28(%rsp), %rdi
callq 0xa4a8
movq 0x38(%rsp), %rdi
callq 0xa4a8
movq 0x40(%rsp), %rdi
callq 0xa4a8
movq 0x48(%rsp), %rdi
callq 0xa4a8
movq 0x50(%rsp), %rdi
callq 0xa4a8
movq 0x58(%rsp), %rdi
callq 0xa4a8
movq 0x18(%rsp), %rdi
callq 0x5618
movq %r14, %rdi
callq 0x17902
movq 0x10(%rsp), %rdi
callq 0x174be
movq 0x8(%rsp), %rdi
callq 0x174be
movq %rbp, %rdi
callq 0x5570