// File: /workspace/github_cpp_makefile_star2_O1/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 $0x238, %rsp            # imm = 0x238
movl %ecx, %eax
movl %edx, %ecx
movq %rdi, %r14
movq 0x280(%rsp), %rdi
movl 0x270(%rsp), %r11d
leaq 0x8(%r14), %rdx
movq %rdx, 0x8(%rsp)
leaq 0x20(%r14), %rdx
movq %rdx, 0x10(%rsp)
leaq 0x40(%r14), %r10
xorl %edx, %edx
movl %edx, 0x40(%r14)
movq %rdx, 0x48(%r14)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%r14)
movupd %xmm0, 0x18(%r14)
movupd %xmm0, 0x28(%r14)
movq %r10, 0x50(%r14)
movq %r10, 0x58(%r14)
movq %rdx, 0x60(%r14)
leaq 0x70(%r14), %rbx
leaq 0x80(%r14), %r10
movq %r10, 0x30(%rsp)
movq %r10, 0x70(%r14)
movq %rdx, 0x78(%r14)
movb $0x0, 0x80(%r14)
leaq 0x1f0(%r14), %r10
movq %r10, 0x28(%rsp)
leaq 0x1f8(%r14), %r10
movl %edx, 0x1f8(%r14)
movq %rdx, 0x200(%r14)
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 %r10, 0x208(%r14)
movq %r10, 0x210(%r14)
movq %rdx, 0x218(%r14)
movl %r8d, 0xa0(%r14)
movl %eax, 0x9c(%r14)
movl %r9d, 0xb0(%r14)
movl %r9d, 0x20(%rsp)
movl %r9d, %r10d
imull %r8d, %r10d
cltd
idivl %r10d
movl %eax, 0xac(%r14)
movl %r11d, 0xa4(%r14)
subl %r11d, %r8d
movl %r8d, 0xa8(%r14)
movq %rdi, 0xb8(%r14)
movl %esi, (%r14)
movb %cl, 0x4(%r14)
movl %eax, %edi
movq %rbx, 0x18(%rsp)
callq 0x2f06f
testb %al, %al
je 0x19518
movl 0xb0(%r14), %edi
callq 0x2f06f
testb %al, %al
je 0x19537
movq 0x278(%rsp), %rsi
movq %rbx, %rdi
callq 0x51a0
movw $0x0, 0x90(%r14)
movslq 0xac(%r14), %rsi
movq 0x10(%rsp), %rdi
callq 0x1cfb2
movslq 0xac(%r14), %rsi
movq 0x8(%rsp), %rdi
callq 0x1cfb2
cmpl $0x0, 0xac(%r14)
jle 0x18ca7
xorl %ebx, %ebx
xorl %r15d, %r15d
leaq (%r15,%r15,2), %r13
shlq $0x3, %r13
movq 0x20(%r14), %rdi
addq %r13, %rdi
movslq 0xa8(%r14), %rsi
callq 0x1d034
cmpl $0x0, 0xa8(%r14)
jle 0x18b5f
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %r12
xorl %ebp, %ebp
movl $0x170, %edi            # imm = 0x170
callq 0x52e0
movq %rbx, 0xb8(%rax)
movl %ebx, 0xc0(%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x150(%rax)
movq %rbx, 0x160(%rax)
movw $0x0, (%rax)
movl %ebx, 0x128(%rax)
movq %rbx, 0x130(%rax)
movupd %xmm0, 0x8(%rax)
movq %rbx, 0x18(%rax)
movupd %xmm0, 0x28(%rax)
movupd %xmm0, 0x31(%rax)
movupd %xmm0, 0x48(%rax)
movupd %xmm0, 0x58(%rax)
movupd %xmm0, 0x68(%rax)
movupd %xmm0, 0x78(%rax)
movupd %xmm0, 0x88(%rax)
movupd %xmm0, 0x98(%rax)
movupd %xmm0, 0xa4(%rax)
movupd %xmm0, 0x115(%rax)
movupd %xmm0, 0x108(%rax)
movupd %xmm0, 0xf8(%rax)
movupd %xmm0, 0xe8(%rax)
movupd %xmm0, 0xd8(%rax)
movupd %xmm0, 0xc8(%rax)
movl %ebx, 0x148(%rax)
movb $0x0, 0x14c(%rax)
movl $0x3, 0x168(%rax)
movq %rbx, 0x20(%rax)
movupd %xmm0, 0x138(%rax)
movq 0x20(%r14), %rcx
movq (%rcx,%r12), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x20(%r14), %rax
movq (%rax,%r12), %rax
movq (%rax,%rbp,8), %rsi
movq %r14, %rdi
callq 0x1966e
incq %rbp
movslq 0xa8(%r14), %rax
cmpq %rax, %rbp
jl 0x18a5e
addq 0x8(%r14), %r13
movslq 0xa4(%r14), %rsi
movq %r13, %rdi
callq 0x1d034
cmpl $0x0, 0xa4(%r14)
jle 0x18c94
leaq (,%r15,8), %rax
leaq (%rax,%rax,2), %r13
xorl %r12d, %r12d
movl $0x170, %edi            # imm = 0x170
callq 0x52e0
movq %rbx, 0xb8(%rax)
movl %ebx, 0xc0(%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x150(%rax)
movq %rbx, 0x160(%rax)
movw $0x0, (%rax)
movl %ebx, 0x128(%rax)
movq %rbx, 0x130(%rax)
movupd %xmm0, 0x8(%rax)
movq %rbx, 0x18(%rax)
movupd %xmm0, 0x28(%rax)
movupd %xmm0, 0x31(%rax)
movupd %xmm0, 0x48(%rax)
movupd %xmm0, 0x58(%rax)
movupd %xmm0, 0x68(%rax)
movupd %xmm0, 0x78(%rax)
movupd %xmm0, 0x88(%rax)
movupd %xmm0, 0x98(%rax)
movupd %xmm0, 0xa4(%rax)
movupd %xmm0, 0x115(%rax)
movupd %xmm0, 0x108(%rax)
movupd %xmm0, 0xf8(%rax)
movupd %xmm0, 0xe8(%rax)
movupd %xmm0, 0xd8(%rax)
movupd %xmm0, 0xc8(%rax)
movl %ebx, 0x148(%rax)
movb $0x0, 0x14c(%rax)
movl $0x3, 0x168(%rax)
movq %rbx, 0x20(%rax)
movupd %xmm0, 0x138(%rax)
movq 0x8(%r14), %rcx
movq (%rcx,%r13), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x8(%r14), %rax
movq (%rax,%r13), %rax
movq (%rax,%r12,8), %rsi
movb $0x1, 0x40(%rsi)
movq %r14, %rdi
callq 0x1966e
incq %r12
movslq 0xa4(%r14), %rax
cmpq %rax, %r12
jl 0x18b8f
incq %r15
movslq 0xac(%r14), %rax
cmpq %rax, %r15
jl 0x18a27
leaq 0x1cb4b(%rip), %rsi     # 0x357f9
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18df5
leaq 0x1c6d4(%rip), %rsi     # 0x3539e
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18e45
leaq 0x1cb23(%rip), %rsi     # 0x35804
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18e86
leaq 0x1cb17(%rip), %rsi     # 0x3580f
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18ec7
leaq 0x1cb0c(%rip), %rsi     # 0x3581b
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18f08
leaq 0x1caf9(%rip), %rsi     # 0x3581f
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18f49
leaq 0x1caf1(%rip), %rsi     # 0x3582e
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18f87
leaq 0x1cad4(%rip), %rsi     # 0x35828
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18fc5
leaq 0x1e3cc(%rip), %rsi     # 0x37137
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18db4
leaq 0x1cabb(%rip), %rsi     # 0x35839
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18db4
leaq 0x1caac(%rip), %rsi     # 0x3583d
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
je 0x18db4
leaq 0x1ca9e(%rip), %rsi     # 0x35842
movq %rbx, %rdi
callq 0x50f0
testl %eax, %eax
jne 0x19556
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 0xda3c
addq $0x10, %rsp
jmp 0x19001
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 0x282dc
addq $0x10, %rsp
leaq 0x2bc28(%rip), %rax     # 0x44a60
addq $0x10, %rax
movq %rax, (%r13)
jmp 0x19001
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 0x282dc
addq $0x10, %rsp
jmp 0x19001
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 0x298e0
addq $0x10, %rsp
jmp 0x19001
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 0x1ddac
addq $0x10, %rsp
jmp 0x19001
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 0x1fa8c
addq $0x10, %rsp
jmp 0x19001
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 0x651c
addq $0x10, %rsp
jmp 0x19001
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 0x23398
addq $0x10, %rsp
jmp 0x19001
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 0x2aabc
addq $0x10, %rsp
movq %r13, 0x68(%r14)
cmpl $-0x1, (%r14)
je 0x1932d
cvtsi2sdl 0x20(%rsp), %xmm0
callq 0x55b0
addsd 0x1c74e(%rip), %xmm0    # 0x35770
cvttsd2si %xmm0, %eax
movl %eax, 0x94(%r14)
xorps %xmm0, %xmm0
cvtsi2sdl 0xb0(%r14), %xmm0
callq 0x55b0
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0xac(%r14), %xmm0
callq 0x55b0
addsd 0x20(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x98(%r14)
movl $0x10, %edi
callq 0x52e0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0xc0(%r14), %rdi
movq %rax, 0xc0(%r14)
movq %rcx, 0xc8(%r14)
movq %rcx, 0xd0(%r14)
testq %rdi, %rdi
je 0x190a5
callq 0x52a0
movl $0x10, %edi
callq 0x52e0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0xd8(%r14), %rdi
movq %rax, 0xd8(%r14)
movq %rcx, 0xe0(%r14)
movq %rcx, 0xe8(%r14)
testq %rdi, %rdi
je 0x190e8
callq 0x52a0
xorpd %xmm0, %xmm0
movupd %xmm0, 0xf0(%r14)
movl $0x10, %edi
callq 0x52e0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0x110(%r14), %rdi
movq %rax, 0x110(%r14)
movq %rcx, 0x118(%r14)
movq %rcx, 0x120(%r14)
testq %rdi, %rdi
je 0x19130
callq 0x52a0
movl $0x10, %edi
callq 0x52e0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0x128(%r14), %rdi
movq %rax, 0x128(%r14)
movq %rcx, 0x130(%r14)
movq %rcx, 0x138(%r14)
testq %rdi, %rdi
je 0x19173
callq 0x52a0
xorpd %xmm0, %xmm0
movq $0x0, 0x100(%r14)
movupd %xmm0, 0x140(%r14)
movl $0x10, %edi
callq 0x52e0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq 0x170(%r14), %rdi
movq %rax, 0x170(%r14)
movq %rcx, 0x178(%r14)
movq %rcx, 0x180(%r14)
testq %rdi, %rdi
je 0x191c6
callq 0x52a0
movq $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 0x28(%rsp), %rdi
callq 0x1d7da
xorpd %xmm0, %xmm0
movupd %xmm0, 0x160(%r14)
movupd %xmm0, 0x150(%r14)
movl $0x58, %edi
callq 0x52e0
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq $0x0, 0x50(%rax)
movq %rax, %rcx
addq $0x58, %rcx
movq 0x188(%r14), %rdi
movq %rax, 0x188(%r14)
movq %rcx, 0x190(%r14)
movq %rcx, 0x198(%r14)
testq %rdi, %rdi
je 0x19286
callq 0x52a0
leaq 0x2ccc3(%rip), %rbx     # 0x45f50
cmpb $0x1, 0x95(%rbx)
jne 0x192f2
cmpb $0x1, 0x90(%r14)
jne 0x192f2
leaq 0x1c5d9(%rip), %rsi     # 0x35880
leaq 0x38(%rsp), %rdi
movl $0x20, %edx
callq 0x5310
leaq 0x38(%rsp), %rdi
callq 0x5430
movq 0x2bcf9(%rip), %rax     # 0x44fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x40(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x38(%rsp,%rcx)
callq 0x5270
leaq 0x130(%rsp), %rdi
callq 0x5120
cmpb $0x1, 0x89(%rbx)
jne 0x1931b
cmpl $-0x1, (%r14)
jne 0x1931b
leaq 0x1c58b(%rip), %rdi     # 0x35893
leaq 0x1c592(%rip), %rsi     # 0x358a1
callq 0x5470
movq %rax, 0x2c76d(%rip)     # 0x45a88
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1de03(%rip), %rsi     # 0x37137
movq 0x18(%rsp), %rdi
callq 0x50f0
testl %eax, %eax
je 0x1900f
leaq 0x1c4d2(%rip), %rsi     # 0x3581f
movq 0x18(%rsp), %rdi
callq 0x50f0
testl %eax, %eax
je 0x193fb
movl 0xac(%r14), %ecx
leaq 0x2cbe3(%rip), %rsi     # 0x45f50
movl %ecx, %eax
cltd
idivl 0x48(%rsi)
testl %ecx, %ecx
jle 0x1900f
movl %eax, %esi
movl 0xa8(%r14), %edi
movq 0x8(%r14), %r8
movq 0x20(%r14), %r9
movl 0xa4(%r14), %r10d
xorl %eax, %eax
xorl %r11d, %r11d
xorl %edx, %edx
cltq
testl %edi, %edi
jle 0x193c0
leaq (%rax,%rax,2), %rbx
movq (%r9,%rbx,8), %rbx
xorl %r15d, %r15d
movq (%rbx,%r15,8), %r12
movb $0x1, 0x148(%r12)
incq %r15
cmpq %r15, %rdi
jne 0x193ab
testl %r10d, %r10d
jle 0x193e3
leaq (%rax,%rax,2), %rax
movq (%r8,%rax,8), %rax
xorl %ebx, %ebx
movq (%rax,%rbx,8), %r15
movb $0x1, 0x148(%r15)
incq %rbx
cmpq %rbx, %r10
jne 0x193cf
incl %edx
movl %edx, %eax
cltd
idivl %esi
addl %esi, %r11d
movl %edx, %eax
addl %r11d, %eax
cmpl %ecx, %eax
jl 0x1939a
jmp 0x1900f
leaq 0x2cb4e(%rip), %rax     # 0x45f50
movb 0x224(%rax), %cl
movl 0xac(%r14), %eax
movl %eax, %r8d
shrl $0x1f, %r8d
addl %eax, %r8d
sarl %r8d
testb %cl, %cl
cmovel %eax, %r8d
xorl %eax, %eax
cmpb $0x1, %cl
jne 0x19439
movl 0xac(%r14), %ecx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
testl %r8d, %r8d
jle 0x194a2
movl 0xa8(%r14), %ecx
movq 0x8(%r14), %rdx
movq 0x20(%r14), %rsi
movl 0xa4(%r14), %edi
movl %r8d, %r8d
xorl %r9d, %r9d
leaq (%r9,%r9,2), %r10
testl %ecx, %ecx
jle 0x1947c
movq (%rsi,%r10,8), %r11
xorl %ebx, %ebx
movq (%r11,%rbx,8), %r15
movb $0x1, 0x149(%r15)
incq %rbx
cmpq %rbx, %rcx
jne 0x19468
testl %edi, %edi
jle 0x1949a
movq (%rdx,%r10,8), %r10
xorl %r11d, %r11d
movq (%r10,%r11,8), %rbx
movb $0x1, 0x149(%rbx)
incq %r11
cmpq %r11, %rdi
jne 0x19487
incq %r9
cmpq %r8, %r9
jne 0x1945a
movslq 0xac(%r14), %rcx
cmpl %ecx, %eax
jge 0x1900f
movl 0xa8(%r14), %edx
movq 0x8(%r14), %rsi
movq 0x20(%r14), %rdi
movl 0xa4(%r14), %r8d
cltq
leaq (%rax,%rax,2), %r9
testl %edx, %edx
jle 0x194eb
movq (%rdi,%r9,8), %r10
xorl %r11d, %r11d
movq (%r10,%r11,8), %rbx
movb $0x1, 0x14a(%rbx)
incq %r11
cmpq %r11, %rdx
jne 0x194d8
testl %r8d, %r8d
jle 0x1950b
movq (%rsi,%r9,8), %r9
xorl %r10d, %r10d
movq (%r9,%r10,8), %r11
movb $0x1, 0x14a(%r11)
incq %r10
cmpq %r10, %r8
jne 0x194f7
incq %rax
cmpq %rcx, %rax
jne 0x194c9
jmp 0x1900f
leaq 0x1c259(%rip), %rdi     # 0x35778
leaq 0x1c263(%rip), %rsi     # 0x35789
leaq 0x1c26f(%rip), %rcx     # 0x3579c
movl $0x3f, %edx
callq 0x51d0
leaq 0x1c2a7(%rip), %rdi     # 0x357e5
leaq 0x1c244(%rip), %rsi     # 0x35789
leaq 0x1c250(%rip), %rcx     # 0x3579c
movl $0x40, %edx
callq 0x51d0
leaq 0x1c2ec(%rip), %rdi     # 0x35849
leaq 0x1c225(%rip), %rsi     # 0x35789
leaq 0x1c231(%rip), %rcx     # 0x3579c
movl $0x6f, %edx
callq 0x51d0
jmp 0x19596
jmp 0x19596
jmp 0x19596
jmp 0x19596
jmp 0x19596
jmp 0x19596
jmp 0x19596
jmp 0x19596
movq %rax, %rbp
leaq 0x38(%rsp), %rdi
callq 0x5628
jmp 0x195b8
jmp 0x195b5
movq %rax, %rbp
movq %r13, %rdi
callq 0x52a0
jmp 0x195b8
jmp 0x195b5
jmp 0x195b5
jmp 0x195b5
jmp 0x195b5
jmp 0x195b5
jmp 0x195b5
jmp 0x195b5
jmp 0x195b5
jmp 0x195b5
movq %rax, %rbp
leaq 0x170(%r14), %rbx
movq 0x28(%rsp), %rdi
callq 0x1d386
movq 0x188(%r14), %rdi
testq %rdi, %rdi
je 0x195da
callq 0x52a0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x195e7
callq 0x52a0
leaq 0x110(%r14), %rbx
movq 0x128(%r14), %rdi
testq %rdi, %rdi
je 0x195ff
callq 0x52a0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1960c
callq 0x52a0
leaq 0xc0(%r14), %rbx
movq 0xd8(%r14), %rdi
testq %rdi, %rdi
je 0x19624
callq 0x52a0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x19631
callq 0x52a0
movq 0x18(%rsp), %rax
movq (%rax), %rdi
cmpq 0x30(%rsp), %rdi
je 0x19645
callq 0x52a0
addq $0x38, %r14
movq %r14, %rdi
callq 0x1d3d0
movq 0x10(%rsp), %rdi
callq 0x1d066
movq 0x8(%rsp), %rdi
callq 0x1d066
movq %rbp, %rdi
callq 0x55a0
nop