// File: /workspace/github_cpp_makefile_star2_O1/estwings57[P]CasHMC/sources/CommandQueue.cpp
// Function: CasHMC::CommandQueue::CmdPop(CasHMC::DRAMCommand**)
bool CommandQueue::CmdPop(DRAMCommand **popedCMD)
{
	//Decrement all the counters we have going
	for(int i=0; i<tFAWCountdown.size(); i++) {
		tFAWCountdown[i]--;
	}
	//The head will always be the smallest counter, so check if it has reached 0
	if(tFAWCountdown.size()>0 && tFAWCountdown[0]==0) {
		tFAWCountdown.erase(tFAWCountdown.begin());
	}

	//HMC command scheduling policy
	//Close page
	if(OPEN_PAGE == false) {
		bool foundIssuable = false;
		if(refreshWaiting) {
			//Look into all bank
			bool refreshPossible = true;
			for(int b=0; b<NUM_BANKS; b++) {
				//Issuing writing-back atomic command
				if(atomicLock[b]) {
					if(POPCYCLE(issuedBank) == 0 && ACCESSQUE(b).size()>0 && ACCESSQUE(b)[0]->packetTAG == atomicLockTag[b]) {
						if(isIssuable(ACCESSQUE(b)[0])) {
							if(ACCESSQUE(b)[0]->commandType == WRITE || ACCESSQUE(b)[0]->commandType == WRITE_P) {
								atomicLock[b] = false;
								atomicLockTag[b] = 0;
							}
							*popedCMD = ACCESSQUE(b)[0];
							ACCESSQUE(b).erase(ACCESSQUE(b).begin());
							foundIssuable = true;
						}
					}
					refreshPossible = false;
					break;
				}
				else {
					//Need to check whether bank is open or not
					if(BANKSTATE(b)->currentBankState == ROW_ACTIVE) {
						refreshPossible = false;
						
						for(int i=0; i<ACCESSQUE(b).size(); i++) {
							DRAMCommand *tempCMD = ACCESSQUE(b)[i];
							//If a command in the queue is going to the same bank and row
							if(b==tempCMD->bank && BANKSTATE(b)->openRowAddress==tempCMD->row) {
								//and is not an activate
								if(tempCMD->commandType != ACTIVATE) {
									//and can be issued
									if(isIssuable(tempCMD)) {
										if(tempCMD->atomic
										&& (tempCMD->packetCMD != EQ16 && tempCMD->packetCMD != EQ8)) {
											atomicLock[tempCMD->bank] = true;
											atomicLockTag[tempCMD->bank] = tempCMD->packetTAG;
										}
										*popedCMD = tempCMD;
										ACCESSQUE(b).erase(ACCESSQUE(b).begin()+i);
										foundIssuable = true;
									}
									break;
								}
								else {
									break;
								}
							}
						}
						break;
					}
					//The next ACT and next REF can be issued at the same. nextActivate is considered as nextRefresh
					else if(BANKSTATE(b)->nextActivate > currentClockCycle) {
						refreshPossible = false;
						break;
					}
				}
			}
			if(refreshPossible && BANKSTATE(0)->currentBankState!=POWERDOWN) {
				*popedCMD = new DRAMCommand(REFRESH, 0, 0, 0, 0, 0, false, NULL, true, NULL_, false, false);
				foundIssuable = true;
				refreshWaiting = false;
			}
			if(!foundIssuable)	return false;
		}
		//Normal command scheduling
		else {
			int bankQueChk = 0;
			
			while(1) {
				if(POPCYCLE(issuedBank) == 0) {
					//Issuing writing-back atomic command
					if(atomicLock[issuedBank]) {
						if(ACCESSQUE(issuedBank).size() > 0 && ACCESSQUE(issuedBank)[0]->atomic) {
							if(ACCESSQUE(issuedBank)[0]->packetTAG == atomicLockTag[issuedBank]) {
								if(isIssuable(ACCESSQUE(issuedBank)[0])) {
									if(ACCESSQUE(issuedBank)[0]->commandType == WRITE || ACCESSQUE(issuedBank)[0]->commandType == WRITE_P) {
										atomicLock[issuedBank] = false;
										atomicLockTag[issuedBank] = 0;
									}
									*popedCMD = ACCESSQUE(issuedBank)[0];
									ACCESSQUE(issuedBank).erase(ACCESSQUE(issuedBank).begin());
									foundIssuable = true;
								}
							}
						}
						break;
					}
					else {
						//Search from beginning to find first issuable command
						for(int i=0; i<ACCESSQUE(issuedBank).size(); i++) {
							if(isIssuable(ACCESSQUE(issuedBank)[i])) {
								//Check to make sure not removing a read/write that is paired with an activate
								int j;
								bool dependencyFound = false;
									for(j=0; j<i; j++) {
										DRAMCommand *prevCMD = ACCESSQUE(issuedBank)[j];
										if(prevCMD->commandType==ACTIVATE
										&& prevCMD->packetTAG==ACCESSQUE(issuedBank)[i]->packetTAG) {
											dependencyFound = true;
											break;
										}
									}
								if(dependencyFound) continue;
								
								if(ACCESSQUE(issuedBank)[i]->atomic
								&& (ACCESSQUE(issuedBank)[i]->packetCMD != EQ16
								&& ACCESSQUE(issuedBank)[i]->packetCMD != EQ8)) {
									atomicLock[ACCESSQUE(issuedBank)[i]->bank] = true;
									atomicLockTag[ACCESSQUE(issuedBank)[i]->bank] = ACCESSQUE(issuedBank)[i]->packetTAG;
								}
								*popedCMD = ACCESSQUE(issuedBank)[i];
								ACCESSQUE(issuedBank).erase(ACCESSQUE(issuedBank).begin()+i);
								foundIssuable = true;
								break;
							}
						}
					}
				}
				bankQueChk++;
				issuedBank = (issuedBank<NUM_BANKS-1) ? issuedBank+1 : 0;

				if(foundIssuable)	break;
				else if(bankQueChk == NUM_BANKS)	break;
			}
			if(!foundIssuable)	return false;
		}
	}
	//Open page
	else {
		bool sendingREForPRE = false;
		if(refreshWaiting) {
			//Look into all bank
			bool refreshPossible = true;
			for(int b=0; b<NUM_BANKS; b++) {
				//Issuing writing-back atomic command
				if(atomicLock[b]) {
					if(POPCYCLE(issuedBank) == 0 && ACCESSQUE(b).size()>0 && ACCESSQUE(b)[0]->packetTAG == atomicLockTag[b]) {
						if(isIssuable(ACCESSQUE(b)[0])) {
							if(ACCESSQUE(b)[0]->commandType == WRITE || ACCESSQUE(b)[0]->commandType == WRITE_P) {
								atomicLock[b] = false;
								atomicLockTag[b] = 0;
							}
							*popedCMD = ACCESSQUE(b)[0];
							ACCESSQUE(b).erase(ACCESSQUE(b).begin());
							sendingREForPRE = true;
						}
					}
					refreshPossible = false;
					break;
				}
				else {
					//Need to check whether bank is open or not
					if(BANKSTATE(b)->currentBankState == ROW_ACTIVE) {
						refreshPossible = false;
						bool closeRow = true;

						for(int i=0; i<ACCESSQUE(b).size(); i++) {
							DRAMCommand *tempCMD = ACCESSQUE(b)[i];
							//If a command in the queue is going to the same bank and row
							if(b==tempCMD->bank && BANKSTATE(b)->openRowAddress==tempCMD->row) {
								//and is not an activate
								if(tempCMD->commandType != ACTIVATE) {
									closeRow = false;
									//and can be issued
									if(isIssuable(tempCMD)) {
										if(tempCMD->atomic
										&& (tempCMD->packetCMD != EQ16 && tempCMD->packetCMD != EQ8)) {
											atomicLock[tempCMD->bank] = true;
											atomicLockTag[tempCMD->bank] = tempCMD->packetTAG;
										}
										*popedCMD = tempCMD;
										ACCESSQUE(b).erase(ACCESSQUE(b).begin()+i);
										sendingREForPRE = true;
									}
									break;
								}
								else {
									break;
								}
							}
						}
						if(closeRow && BANKSTATE(b)->nextPrecharge<=currentClockCycle) {
							rowAccessCounter[b]=0;
							*popedCMD = new DRAMCommand(PRECHARGE, 0, b, 0, 0, 0, false, NULL, true, NULL_, false, false);
							sendingREForPRE = true;
						}
						break;
					}
					//The next ACT and next REF can be issued at the same. nextActivate is considered as nextRefresh
					else if(BANKSTATE(b)->nextActivate > currentClockCycle) {
						refreshPossible = false;
						break;
					}
				}
			}
			
			if(refreshPossible && BANKSTATE(0)->currentBankState!=POWERDOWN) {
				*popedCMD = new DRAMCommand(REFRESH, 0, 0, 0, 0, 0, false, NULL, true, NULL_, false, false);
				sendingREForPRE = true;
				refreshWaiting = false;
			}
		}
		//Normal command scheduling
		if(!sendingREForPRE) {
			bool foundIssuable = false;
			int bankQueChk = 0;
		
			while(1) {
				if(POPCYCLE(issuedBank) == 0) {
					//Issuing writing-back atomic command
					if(atomicLock[issuedBank]) {
						if(ACCESSQUE(issuedBank).size() > 0 && ACCESSQUE(issuedBank)[0]->atomic) {
							if(ACCESSQUE(issuedBank)[0]->packetTAG == atomicLockTag[issuedBank]) {
								if(isIssuable(ACCESSQUE(issuedBank)[0])) {
									if(ACCESSQUE(issuedBank)[0]->commandType == WRITE || ACCESSQUE(issuedBank)[0]->commandType == WRITE_P) {
										atomicLock[issuedBank] = false;
										atomicLockTag[issuedBank] = 0;
									}
									*popedCMD = ACCESSQUE(issuedBank)[0];
									ACCESSQUE(issuedBank).erase(ACCESSQUE(issuedBank).begin());
									foundIssuable = true;
								}
							}
						}
					}
					else {
						//Search from beginning to find first issuable command
						for(int i=0; i<ACCESSQUE(issuedBank).size(); i++) {
							if(isIssuable(ACCESSQUE(issuedBank)[i])) {
								//Check for dependencies
								int j;
								bool dependencyFound = false;
								for(j=0; j<i; j++) {
									DRAMCommand *prevCMD = ACCESSQUE(issuedBank)[j];
									if(prevCMD->commandType != ACTIVATE
									&& prevCMD->bank == ACCESSQUE(issuedBank)[i]->bank
									&& prevCMD->row == ACCESSQUE(issuedBank)[i]->row) {
										dependencyFound = true;
										break;
									}
								}
								if(dependencyFound) continue;
								if(ACCESSQUE(issuedBank)[i]->atomic
								&& (ACCESSQUE(issuedBank)[i]->packetCMD != EQ16 && ACCESSQUE(issuedBank)[i]->packetCMD != EQ8)) {
									atomicLock[issuedBank] = true;
									atomicLockTag[issuedBank] = ACCESSQUE(issuedBank)[i]->packetTAG;
								}
								*popedCMD = ACCESSQUE(issuedBank)[i];
								//If the previous bus packet is an activate, that activate have to be removed
								//(check i>0 because if i==0 then theres nothing before it)
								if(i>0 && ACCESSQUE(issuedBank)[i-1]->commandType==ACTIVATE) {
									rowAccessCounter[issuedBank]++;
									delete ACCESSQUE(issuedBank)[i-1];
									ACCESSQUE(issuedBank).erase(ACCESSQUE(issuedBank).begin()+i-1, ACCESSQUE(issuedBank).begin()+i+1);
								}
								else{
									ACCESSQUE(issuedBank).erase(ACCESSQUE(issuedBank).begin()+i);
								}
								foundIssuable = true;
								break;
							}
						}
					}
				}
				bankQueChk++;
				issuedBank = (issuedBank<NUM_BANKS-1) ? issuedBank+1 : 0;
				
				if(foundIssuable)	break;
				else if(bankQueChk == NUM_BANKS)	break;
			}
		
			//If nothing was issuable to open bank, issue PRE command
			if(!foundIssuable) {
				bool sendingPRE = false;
				
				for(int b=0; b<NUM_BANKS; b++) {
					bool found = false;
					if(BANKSTATE(b)->currentBankState == ROW_ACTIVE) {
						if(!atomicLock[b]) {
							for(int i=0; i<ACCESSQUE(b).size(); i++) {
								//If there is something going to opened bank and row, don't send PRE command
								if(ACCESSQUE(b)[i]->bank==b && ACCESSQUE(b)[i]->row == BANKSTATE(b)->openRowAddress) {
									found = true;
									break;
								}
							}
							//Too many accesses have happend, close it
							if(!found || rowAccessCounter[b]>=MAX_ROW_ACCESSES) {
								if(BANKSTATE(b)->nextPrecharge <= currentClockCycle) {
									rowAccessCounter[b]=0;
									*popedCMD = new DRAMCommand(PRECHARGE, 0, b, 0, 0, 0, false, NULL, true, NULL_, false, false);
									sendingPRE = true;
									break;
								}
							}
						}
					}
				}

				if(!sendingPRE)	return false;
			}
		}
	}
	
	if((*popedCMD)->commandType == ACTIVATE) {
		tFAWCountdown.push_back(tFAW);
	}

	if(QUE_PER_BANK) {
		classID.str( string() );	classID.clear();
		classID << (*popedCMD)->bank;
		DEBUG(ALI(18)<<(header+"-"+classID.str()+")")<<ALI(15)<<**popedCMD<<"Down) POP command from command queue");
	}
	else {
		DEBUG(ALI(18)<<(header+")")<<(*popedCMD)->bank<<")"<<ALI(15)<<**popedCMD<<"Down) POP command from command queue");
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
movq 0x250(%rdi), %rdi
movq 0x258(%r14), %rdx
movq %rdx, %rax
subq %rdi, %rax
je 0x155b0
sarq $0x2, %rax
cmpq $0x1, %rax
adcq $0x0, %rax
xorl %ecx, %ecx
decl (%rdi,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x155a5
cmpq %rdi, %rdx
je 0x155d3
cmpl $0x0, (%rdi)
jne 0x155d3
leaq 0x4(%rdi), %rsi
cmpq %rdx, %rsi
je 0x155cb
subq %rsi, %rdx
callq 0x4480
addq $-0x4, 0x258(%r14)
leaq 0x26fb7(%rip), %rcx     # 0x3c591
movb 0x1d0(%r14), %al
cmpb $0x0, (%rcx)
je 0x15ddf
testb %al, %al
je 0x156e3
leaq 0x26f87(%rip), %rax     # 0x3c580
movslq (%rax), %rax
testq %rax, %rax
setg %bpl
jle 0x15668
movq 0x1e0(%r14), %rdx
movq 0x8(%r14), %rsi
movq 0x1d8(%r14), %rdi
xorl %r15d, %r15d
movl $0x1, %ebx
movl %r15d, %ecx
shlq %cl, %rbx
movq %r15, %r12
shrq $0x6, %r12
movq (%rdx,%r12,8), %rcx
btq %r15, %rcx
jb 0x166c6
movq 0x210(%rdi), %rcx
movq 0x1d8(%rcx), %rcx
movq (%rcx,%r15,8), %rcx
cmpl $0x1, 0x4(%rcx)
je 0x16831
cmpq %rsi, 0x10(%rcx)
ja 0x15668
incq %r15
cmpq %rax, %r15
setb %bpl
jne 0x1561a
xorl %r8d, %r8d
testb $0x1, %bpl
jne 0x156d9
movq 0x1d8(%r14), %rax
movq 0x210(%rax), %rax
movq 0x1d8(%rax), %rax
movq (%rax), %rax
cmpl $0x4, 0x4(%rax)
je 0x156d9
movl $0x38, %edi
callq 0x42f0
movq %rax, %r15
subq $0x8, %rsp
xorl %eax, %eax
movq %r15, %rdi
movl $0x8, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
pushq %rax
pushq $0x1
pushq $0x0
pushq %rax
pushq %rax
callq 0x1c9f0
addq $0x40, %rsp
movq 0x8(%rsp), %rax
movq %r15, (%rax)
movb $0x0, 0x1d0(%r14)
movb $0x1, %r8b
testb $0x1, %r8b
jne 0x1635c
xorl %r15d, %r15d
leaq 0x26ea3(%rip), %r13     # 0x3c590
movq $0x0, 0x10(%rsp)
xorl %ebx, %ebx
movb (%r13), %al
movl 0x1cc(%r14), %ecx
movq 0x220(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
cmpl $0x0, (%rdx,%rcx,4)
je 0x1574f
movl 0x1cc(%r14), %ecx
leaq 0x26e5c(%rip), %rax     # 0x3c580
movl (%rax), %eax
leal -0x1(%rax), %edx
leal 0x1(%rcx), %esi
cmpl %edx, %ecx
cmovael %r15d, %esi
movl %esi, 0x1cc(%r14)
testb $0x1, 0x10(%rsp)
jne 0x15c60
incl %ebx
cmpl %eax, %ebx
jne 0x156f8
jmp 0x15c60
movl 0x1cc(%r14), %ecx
movq 0x1e0(%r14), %rdx
movl %ecx, %esi
shrl $0x6, %esi
movq (%rdx,%rsi,8), %rdx
btq %rcx, %rdx
jae 0x15901
movq 0x238(%r14), %rdx
testb %al, %al
movl $0x0, %esi
cmovneq %rcx, %rsi
leaq (%rsi,%rsi,2), %rsi
movq 0x8(%rdx,%rsi,8), %rdi
cmpq (%rdx,%rsi,8), %rdi
je 0x15716
movq 0x238(%r14), %rdx
testb %al, %al
movl $0x0, %esi
cmovneq %rcx, %rsi
leaq (%rsi,%rsi,2), %rsi
movq (%rdx,%rsi,8), %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x30(%rdx)
jne 0x15716
movq 0x208(%r14), %rdx
movq 0x238(%r14), %rsi
testb %al, %al
movl $0x0, %edi
cmovneq %rcx, %rdi
leaq (%rdi,%rdi,2), %rdi
movq (%rsi,%rdi,8), %rsi
movq (%rsi), %rsi
movl 0x14(%rsi), %esi
cmpl (%rdx,%rcx,4), %esi
jne 0x15716
testb %al, %al
cmoveq %r15, %rcx
movq 0x238(%r14), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1705a
testb %al, %al
je 0x15716
movb (%r13), %al
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rcx
cmpl $0x3, 0x10(%rcx)
je 0x1585e
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rcx
cmpl $0x4, 0x10(%rcx)
jne 0x1588d
movl 0x1cc(%r14), %ecx
movq 0x1e0(%r14), %rdx
movl %ecx, %esi
movq $-0x2, %rdi
rolq %cl, %rdi
shrl $0x6, %esi
andq %rdi, (%rdx,%rsi,8)
movq 0x208(%r14), %rdx
movl $0x0, (%rdx,%rcx,4)
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rax
movq (%rdx,%rax,8), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movl 0x1cc(%r14), %eax
movl $0x0, %ecx
movq 0x238(%r14), %r15
cmoveq %rcx, %rax
leaq (%rax,%rax,2), %r12
movq (%r15,%r12,8), %rdi
movq 0x8(%r15,%r12,8), %rdx
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x158e9
subq %rsi, %rdx
callq 0x4480
leaq (%r15,%r12,8), %rax
addq $-0x8, 0x8(%rax)
movb $0x1, %al
movq %rax, 0x10(%rsp)
xorl %r15d, %r15d
jmp 0x15716
movb (%r13), %al
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rdx,%rcx,8), %rsi
cmpq (%rdx,%rcx,8), %rsi
je 0x15716
xorl %ebp, %ebp
movl 0x1cc(%r14), %ecx
testb $0x1, %al
cmoveq %r15, %rcx
movq 0x238(%r14), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%rbp,8), %rsi
movq %r14, %rdi
callq 0x1705a
testb %al, %al
je 0x15b5d
testq %rbp, %rbp
je 0x159d4
movl 0x1cc(%r14), %eax
movq 0x238(%r14), %rcx
xorl %r12d, %r12d
cmpb $0x0, (%r13)
cmoveq %r12, %rax
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
movq (%rax), %rcx
movl $0x1, %edx
movq -0x8(%rcx,%rdx,8), %rsi
cmpl $0x0, 0x10(%rsi)
je 0x159be
movl 0x18(%rsi), %edi
movq (%rax), %r8
movq (%r8,%rbp,8), %r8
cmpl 0x18(%r8), %edi
jne 0x159be
movl 0x20(%rsi), %esi
movq (%rax), %rdi
movq (%rdi,%rbp,8), %rdi
cmpl 0x20(%rdi), %esi
jne 0x159be
movb $0x1, %r12b
xorl %esi, %esi
jmp 0x159c1
movb $0x1, %sil
testb %sil, %sil
je 0x159d7
leaq 0x1(%rdx), %rsi
cmpq %rbp, %rdx
movq %rsi, %rdx
jb 0x1598d
jmp 0x159d7
xorl %r12d, %r12d
testb $0x1, %r12b
jne 0x15b53
movb (%r13), %al
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%rbp,8), %rcx
cmpb $0x1, 0x30(%rcx)
jne 0x15aa5
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%rbp,8), %rcx
cmpl $0x68, 0x2c(%rcx)
je 0x15aa5
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%rbp,8), %rcx
cmpl $0x69, 0x2c(%rcx)
je 0x15aa5
movl 0x1cc(%r14), %ecx
movq 0x1e0(%r14), %rdx
movl %ecx, %esi
movl $0x1, %edi
shlq %cl, %rdi
shrl $0x6, %esi
orq %rdi, (%rdx,%rsi,8)
movq 0x208(%r14), %rdx
movq 0x238(%r14), %rsi
testb %al, %al
movl $0x0, %edi
cmovneq %rcx, %rdi
leaq (%rdi,%rdi,2), %rdi
movq (%rsi,%rdi,8), %rsi
movq (%rsi,%rbp,8), %rsi
movl 0x14(%rsi), %esi
movl %esi, (%rdx,%rcx,4)
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%rbp,8), %rcx
movq 0x8(%rsp), %rdx
movq %rcx, (%rdx)
testq %rbp, %rbp
je 0x15afd
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq -0x8(%rcx,%rbp,8), %rcx
cmpl $0x0, 0x10(%rcx)
je 0x15b97
movl 0x1cc(%r14), %ecx
xorl %edx, %edx
movq 0x238(%r14), %r15
testb %al, %al
cmoveq %rdx, %rcx
leaq (%rcx,%rcx,2), %r13
movq (%r15,%r13,8), %rax
movq 0x8(%r15,%r13,8), %rdx
leaq (%rax,%rbp,8), %rsi
addq $0x8, %rsi
cmpq %rdx, %rsi
je 0x15b39
leaq (%rax,%rbp,8), %rdi
subq %rsi, %rdx
callq 0x4480
leaq (%r15,%r13,8), %rax
addq $-0x8, 0x8(%rax)
movb $0x1, %al
movq %rax, 0x10(%rsp)
leaq 0x26a40(%rip), %r13     # 0x3c590
xorl %r15d, %r15d
testb $0x1, %r12b
je 0x15716
incq %rbp
movb (%r13), %al
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rdx,%rcx,8), %rsi
subq (%rdx,%rcx,8), %rsi
sarq $0x3, %rsi
cmpq %rbp, %rsi
ja 0x1592e
jmp 0x15716
movl 0x1cc(%r14), %ecx
movq 0x268(%r14), %rdx
incl (%rdx,%rcx,4)
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rax
movq (%rdx,%rax,8), %rax
movq -0x8(%rax,%rbp,8), %rdi
testq %rdi, %rdi
je 0x15bd4
movq (%rdi), %rax
callq *0x8(%rax)
movl 0x1cc(%r14), %eax
cmpb $0x0, (%r13)
cmoveq %r15, %rax
movb $0x1, %cl
movq %rcx, 0x10(%rsp)
testb %r15b, %r15b
jne 0x15b53
movq 0x238(%r14), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %r8
movq (%r8), %rax
leaq (%rax,%rbp,8), %r15
addq $-0x8, %r15
leaq (%rax,%rbp,8), %rsi
addq $0x8, %rsi
movq 0x8(%r8), %rdx
subq %rsi, %rdx
je 0x15c41
movq %r15, %rdi
movq %r8, 0x18(%rsp)
movq %rsi, 0xa0(%rsp)
callq 0x4480
movq 0xa0(%rsp), %rsi
movq 0x18(%rsp), %r8
movq 0x8(%r8), %rax
movq %rax, %rcx
subq %rsi, %rcx
addq %rcx, %r15
cmpq %r15, %rax
je 0x15b50
movq %r15, 0x8(%r8)
jmp 0x15b50
testb $0x1, 0x10(%rsp)
jne 0x1635c
xorl %r15d, %r15d
leaq 0x2690b(%rip), %rax     # 0x3c580
cmpl $0x0, (%rax)
jle 0x16edc
leaq 0x2690f(%rip), %rbx     # 0x3c594
xorl %r12d, %r12d
xorl %eax, %eax
movq 0x1d8(%r14), %rcx
movq 0x210(%rcx), %rcx
movq 0x1d8(%rcx), %rcx
movq (%rcx,%r12,8), %rdx
movb $0x1, %cl
cmpl $0x1, 0x4(%rdx)
jne 0x15db8
movq 0x1e0(%r14), %rsi
movq %r12, %rdi
shrq $0x6, %rdi
movq (%rsi,%rdi,8), %rsi
btq %r12, %rsi
jb 0x15db8
movb (%r13), %dil
movq 0x238(%r14), %r8
testb %dil, %dil
movl $0x0, %esi
cmovneq %r12, %rsi
leaq (%rsi,%rsi,2), %r9
movq 0x8(%r8,%r9,8), %rsi
subq (%r8,%r9,8), %rsi
je 0x15d55
sarq $0x3, %rsi
testb %dil, %dil
movl $0x0, %edi
cmovneq %r12, %rdi
movq 0x238(%r14), %r8
leaq (%rdi,%rdi,2), %rdi
leaq (%r8,%rdi,8), %rdi
movq (%rdi), %r8
cmpq $0x1, %rsi
adcq $0x0, %rsi
xorl %r9d, %r9d
movq (%r8,%r9,8), %r10
movl 0x18(%r10), %r10d
cmpq %r10, %r12
jne 0x15d3c
movq (%rdi), %r10
movq (%r10,%r9,8), %r10
movl 0x20(%r10), %r10d
cmpl 0x8(%rdx), %r10d
je 0x15d46
incq %r9
cmpq %r9, %rsi
jne 0x15d1e
jmp 0x15d55
movq 0x268(%r14), %rsi
movl (%rsi,%r12,4), %esi
cmpl (%rbx), %esi
jb 0x15db8
movq 0x28(%rdx), %rdx
cmpq 0x8(%r14), %rdx
ja 0x15db8
movq 0x268(%r14), %rax
movl %r15d, (%rax,%r12,4)
movl $0x38, %edi
callq 0x42f0
movq %rax, %r13
subq $0x8, %rsp
movq %rax, %rdi
movl $0x7, %esi
xorl %edx, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r15
pushq %r15
pushq %r15
pushq $0x1
pushq $0x0
pushq %r15
pushq %r15
callq 0x1c9f0
addq $0x40, %rsp
movq 0x8(%rsp), %rax
movq %r13, (%rax)
movb $0x1, %al
xorl %ecx, %ecx
leaq 0x267d8(%rip), %r13     # 0x3c590
testb %cl, %cl
je 0x15dd2
incq %r12
leaq 0x267ba(%rip), %rcx     # 0x3c580
movslq (%rcx), %rcx
cmpq %rcx, %r12
jl 0x15c8a
testb $0x1, %al
je 0x15ed7
jmp 0x1635c
testb %al, %al
je 0x15edf
leaq 0x26792(%rip), %rax     # 0x3c580
movslq (%rax), %rax
testq %rax, %rax
setg %bpl
jle 0x15e5d
movq 0x1e0(%r14), %rdx
movq 0x8(%r14), %rsi
movq 0x1d8(%r14), %rdi
xorl %r15d, %r15d
movl $0x1, %ebx
movl %r15d, %ecx
shlq %cl, %rbx
movq %r15, %r12
shrq $0x6, %r12
movq (%rdx,%r12,8), %rcx
btq %r15, %rcx
jb 0x169ee
movq 0x210(%rdi), %rcx
movq 0x1d8(%rcx), %rcx
movq (%rcx,%r15,8), %rcx
cmpl $0x1, 0x4(%rcx)
je 0x16b59
cmpq %rsi, 0x10(%rcx)
ja 0x15e5d
incq %r15
cmpq %rax, %r15
setb %bpl
jne 0x15e0f
xorl %edi, %edi
testb $0x1, %bpl
jne 0x15ecd
movq 0x1d8(%r14), %rax
movq 0x210(%rax), %rax
movq 0x1d8(%rax), %rax
movq (%rax), %rax
cmpl $0x4, 0x4(%rax)
je 0x15ecd
movl $0x38, %edi
callq 0x42f0
movq %rax, %r15
subq $0x8, %rsp
xorl %eax, %eax
movq %r15, %rdi
movl $0x8, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
pushq %rax
pushq $0x1
pushq $0x0
pushq %rax
pushq %rax
callq 0x1c9f0
addq $0x40, %rsp
movq 0x8(%rsp), %rax
movq %r15, (%rax)
movb $0x0, 0x1d0(%r14)
movb $0x1, %dil
testb $0x1, %dil
jne 0x1635c
xorl %r15d, %r15d
jmp 0x16edc
xorl %r15d, %r15d
leaq 0x266a7(%rip), %rbx     # 0x3c590
xorl %edi, %edi
xorl %ebp, %ebp
movb (%rbx), %al
movl 0x1cc(%r14), %ecx
movq 0x220(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
cmpl $0x0, (%rdx,%rcx,4)
movl %edi, 0x10(%rsp)
je 0x15f49
movl 0x1cc(%r14), %ecx
leaq 0x26665(%rip), %rax     # 0x3c580
movl (%rax), %eax
leal -0x1(%rax), %edx
leal 0x1(%rcx), %esi
cmpl %edx, %ecx
cmovael %r15d, %esi
movl %esi, 0x1cc(%r14)
testb $0x1, %bpl
movl 0x10(%rsp), %edi
jne 0x16352
incl %edi
cmpl %eax, %edi
jne 0x15eed
jmp 0x16352
movl 0x1cc(%r14), %ecx
movq 0x1e0(%r14), %rdx
movl %ecx, %esi
shrl $0x6, %esi
movq (%rdx,%rsi,8), %rdx
btq %rcx, %rdx
jb 0x161d3
movb (%rbx), %al
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rdx,%rcx,8), %rsi
cmpq (%rdx,%rcx,8), %rsi
je 0x15f0d
xorl %r12d, %r12d
movl 0x1cc(%r14), %ecx
testb $0x1, %al
cmoveq %r15, %rcx
movq 0x238(%r14), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
callq 0x1705a
testb %al, %al
je 0x1619b
testq %r12, %r12
je 0x1602a
movl 0x1cc(%r14), %eax
movq 0x238(%r14), %rcx
xorl %r13d, %r13d
cmpb $0x0, (%rbx)
cmoveq %r13, %rax
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
movq (%rax), %rcx
movl $0x1, %edx
movq -0x8(%rcx,%rdx,8), %rsi
cmpl $0x0, 0x10(%rsi)
jne 0x16014
movl 0x14(%rsi), %esi
movq (%rax), %rdi
movq (%rdi,%r12,8), %rdi
cmpl 0x14(%rdi), %esi
jne 0x16014
movb $0x1, %r13b
xorl %esi, %esi
jmp 0x16017
movb $0x1, %sil
testb %sil, %sil
je 0x1602d
leaq 0x1(%rdx), %rsi
cmpq %r12, %rdx
movq %rsi, %rdx
jb 0x15ff3
jmp 0x1602d
xorl %r13d, %r13d
testb $0x1, %r13b
jne 0x16191
movb (%rbx), %al
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%r12,8), %rcx
cmpb $0x1, 0x30(%rcx)
jne 0x1611e
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%r12,8), %rcx
cmpl $0x68, 0x2c(%rcx)
je 0x1611e
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%r12,8), %rcx
cmpl $0x69, 0x2c(%rcx)
je 0x1611e
movl 0x1cc(%r14), %ecx
testb %al, %al
cmoveq %r15, %rcx
movq 0x238(%r14), %rdx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%r12,8), %rcx
movl 0x18(%rcx), %ecx
movq 0x1e0(%r14), %rdx
movl %ecx, %esi
movl $0x1, %edi
shlq %cl, %rdi
shrl $0x6, %esi
orq %rdi, (%rdx,%rsi,8)
testb %al, %al
movl 0x1cc(%r14), %ecx
cmoveq %r15, %rcx
movq 0x238(%r14), %rdx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx,%r12,8), %rcx
movl 0x14(%rcx), %edx
movl 0x18(%rcx), %ecx
movq 0x208(%r14), %rsi
movl %edx, (%rsi,%rcx,4)
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rax
movq (%rdx,%rax,8), %rax
movq (%rax,%r12,8), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movl 0x1cc(%r14), %eax
movq 0x238(%r14), %rbx
cmoveq %r15, %rax
leaq (%rax,%rax,2), %rbp
movq (%rbx,%rbp,8), %rax
movq 0x8(%rbx,%rbp,8), %rdx
leaq (%rax,%r12,8), %rsi
addq $0x8, %rsi
cmpq %rdx, %rsi
je 0x1617e
leaq (%rax,%r12,8), %rdi
subq %rsi, %rdx
callq 0x4480
leaq (%rbx,%rbp,8), %rax
addq $-0x8, 0x8(%rax)
movb $0x1, %bpl
leaq 0x263ff(%rip), %rbx     # 0x3c590
testb $0x1, %r13b
je 0x15f0d
incq %r12
movb (%rbx), %al
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
testb %al, %al
cmoveq %r15, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rdx,%rcx,8), %rsi
subq (%rdx,%rcx,8), %rsi
sarq $0x3, %rsi
cmpq %r12, %rsi
ja 0x15f96
jmp 0x15f0d
movq 0x238(%r14), %rdx
xorl %esi, %esi
testb %al, %al
cmovneq %rcx, %rsi
leaq (%rsi,%rsi,2), %rsi
movq 0x8(%rdx,%rsi,8), %rdi
cmpq (%rdx,%rsi,8), %rdi
je 0x16352
movq 0x238(%r14), %rdx
xorl %esi, %esi
testb %al, %al
cmovneq %rcx, %rsi
leaq (%rsi,%rsi,2), %rsi
movq (%rdx,%rsi,8), %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x30(%rdx)
jne 0x16352
movq 0x208(%r14), %rdx
movq 0x238(%r14), %rsi
xorl %edi, %edi
testb %al, %al
cmovneq %rcx, %rdi
leaq (%rdi,%rdi,2), %rdi
movq (%rsi,%rdi,8), %rsi
movq (%rsi), %rsi
movl 0x14(%rsi), %esi
cmpl (%rdx,%rcx,4), %esi
jne 0x16352
xorl %edx, %edx
testb %al, %al
cmovneq %rcx, %rdx
movq 0x238(%r14), %rax
leaq (%rdx,%rdx,2), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1705a
testb %al, %al
je 0x16352
movb (%rbx), %al
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
xorl %esi, %esi
testb %al, %al
cmovneq %rcx, %rsi
leaq (%rsi,%rsi,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rcx
cmpl $0x3, 0x10(%rcx)
je 0x162c0
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
xorl %esi, %esi
testb %al, %al
cmovneq %rcx, %rsi
leaq (%rsi,%rsi,2), %rcx
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rcx
cmpl $0x4, 0x10(%rcx)
jne 0x162ef
movl 0x1cc(%r14), %ecx
movq 0x1e0(%r14), %rdx
movl %ecx, %esi
movq $-0x2, %rdi
rolq %cl, %rdi
shrl $0x6, %esi
andq %rdi, (%rdx,%rsi,8)
movq 0x208(%r14), %rdx
movl $0x0, (%rdx,%rcx,4)
movl 0x1cc(%r14), %ecx
movq 0x238(%r14), %rdx
xorl %esi, %esi
testb %al, %al
cmoveq %rsi, %rcx
leaq (%rcx,%rcx,2), %rax
movq (%rdx,%rax,8), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movl 0x1cc(%r14), %eax
movq 0x238(%r14), %rcx
cmoveq %rsi, %rax
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rbx
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x1634a
subq %rsi, %rdx
callq 0x4480
addq $-0x8, 0x8(%rbx)
movb $0x1, %bpl
testb $0x1, %bpl
je 0x15ed7
movq 0x8(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x10(%rax)
jne 0x163a5
movq 0x258(%r14), %rsi
cmpq 0x260(%r14), %rsi
je 0x16392
leaq 0x2625f(%rip), %rax     # 0x3c5e0
movl (%rax), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x258(%r14)
jmp 0x163a5
leaq 0x250(%r14), %rdi
leaq 0x26240(%rip), %rdx     # 0x3c5e0
callq 0x14232
leaq 0x261e4(%rip), %rax     # 0x3c590
cmpb $0x1, (%rax)
jne 0x16531
leaq 0x30(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
leaq 0x58(%r14), %r12
leaq 0x20(%rsp), %rsi
movq %r12, %rdi
callq 0x4400
leaq 0x40(%r14), %r15
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x163f6
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x40(%r14), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x44e0
leaq 0x50(%r14), %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl 0x18(%rax), %esi
callq 0x41e0
leaq 0x26065(%rip), %rax     # 0x3c488
movb $0x1, %r15b
cmpb $0x1, (%rax)
jne 0x16edc
leaq 0x26053(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x16edc
movq 0x25b8a(%rip), %rax     # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r13
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x16484
movq %r13, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r13)
movb $0x1, 0xe1(%r13)
movb $0x20, 0xe0(%r13)
leaq 0x70(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x1430e
leaq 0x1b483(%rip), %rsi     # 0x31937
movq %r14, %rdi
callq 0x4580
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
callq 0x4450
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x88(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x164f1
movq 0x70(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1651a
leaq 0x90(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x16511
movq 0x90(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x16d14
movq 0x80(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x4110
jmp 0x16d25
leaq 0x25f50(%rip), %rax     # 0x3c488
movb $0x1, %r15b
cmpb $0x1, (%rax)
jne 0x16edc
leaq 0x25f3e(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x16edc
movq 0x25a75(%rip), %rax     # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r12
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x1659b
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x1430e
leaq 0x1de95(%rip), %rsi     # 0x34461
movq %r14, %rdi
callq 0x4580
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x259eb(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movl 0x18(%rcx), %esi
movq %rax, %rdi
callq 0x41e0
movq %rax, %r14
leaq 0x1de5a(%rip), %rsi     # 0x34461
movl $0x1, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
movq %r14, %r12
addq %rax, %r12
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x16657
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %rbx
leaq 0x1c369(%rip), %rsi     # 0x329e3
movl $0x24, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x16edc
movq 0x30(%rsp), %rsi
jmp 0x16ed4
leaq 0x25ec3(%rip), %r13     # 0x3c590
movb (%r13), %al
movl 0x1cc(%r14), %ecx
movq 0x220(%r14), %rdx
xorl %r8d, %r8d
testb %al, %al
cmoveq %r8, %rcx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x1566b
movq 0x238(%r14), %rcx
xorl %r8d, %r8d
testb %al, %al
movl $0x0, %edx
cmovneq %r15, %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rcx,%rdx,8), %rsi
cmpq (%rcx,%rdx,8), %rsi
je 0x1566b
movq 0x208(%r14), %rcx
movq 0x238(%r14), %rdx
xorl %r8d, %r8d
testb %al, %al
movl $0x0, %esi
cmovneq %r15, %rsi
leaq (%rsi,%rsi,2), %rsi
movq (%rdx,%rsi,8), %rdx
movq (%rdx), %rdx
movl 0x14(%rdx), %edx
cmpl (%rcx,%r15,4), %edx
jne 0x1566b
testb %al, %al
movl $0x0, %eax
cmovneq %r15, %rax
movq 0x238(%r14), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1705a
testb %al, %al
je 0x15668
movb (%r13), %al
movq 0x238(%r14), %rcx
xorl %edx, %edx
testb %al, %al
cmovneq %r15, %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
cmpl $0x3, 0x10(%rcx)
je 0x167bf
movq 0x238(%r14), %rcx
xorl %edx, %edx
testb %al, %al
cmovneq %r15, %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
cmpl $0x4, 0x10(%rcx)
jne 0x167dc
movq 0x1e0(%r14), %rcx
notq %rbx
andq %rbx, (%rcx,%r12,8)
movq 0x208(%r14), %rcx
movl $0x0, (%rcx,%r15,4)
xorl %ecx, %ecx
testb %al, %al
cmovneq %r15, %rcx
movq 0x238(%r14), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq 0x238(%r14), %rax
leaq (%rax,%rcx), %rbx
movq (%rax,%rcx), %rdi
movq 0x8(%rax,%rcx), %rdx
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x16827
subq %rsi, %rdx
callq 0x4480
addq $-0x8, 0x8(%rbx)
jmp 0x16f6e
leaq 0x25d58(%rip), %r9      # 0x3c590
movb (%r9), %al
movq 0x238(%r14), %rcx
xorl %r8d, %r8d
testb %al, %al
movl $0x0, %edx
cmovneq %r15, %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rcx,%rdx,8), %rsi
cmpq (%rcx,%rdx,8), %rsi
je 0x16ef1
movb %bpl, 0x18(%rsp)
movb $0x1, %cl
movl $0x8, %ebp
movq $-0x8, %r13
xorl %ebx, %ebx
xorl %r8d, %r8d
movq %r15, %rdx
testb $0x1, %al
jne 0x16884
xorl %edx, %edx
movq 0x238(%r14), %rax
leaq (%rdx,%rdx,2), %rdx
movq (%rax,%rdx,8), %rax
movq -0x8(%rax,%rbp), %r12
movb $0x1, %dl
cmpl %r15d, 0x18(%r12)
jne 0x169a8
movq 0x1d8(%r14), %rax
movq 0x210(%rax), %rax
movq 0x1d8(%rax), %rax
movq (%rax,%r15,8), %rax
movl 0x8(%rax), %eax
cmpl 0x20(%r12), %eax
jne 0x169a8
cmpl $0x0, 0x10(%r12)
je 0x169a6
movq %r14, %rdi
movq %r12, %rsi
movq %r8, 0x10(%rsp)
callq 0x1705a
leaq 0x25ca1(%rip), %r9      # 0x3c590
movq 0x10(%rsp), %r8
xorl %ecx, %ecx
movl $0x0, %edx
testb %al, %al
je 0x169a8
cmpb $0x1, 0x30(%r12)
jne 0x16944
movl 0x2c(%r12), %eax
andl $-0x2, %eax
cmpl $0x68, %eax
je 0x16944
movl 0x18(%r12), %ecx
movq 0x1e0(%r14), %rax
movl %ecx, %edx
movl $0x1, %esi
shlq %cl, %rsi
shrl $0x6, %edx
orq %rsi, (%rax,%rdx,8)
movl 0x14(%r12), %eax
movq 0x208(%r14), %rdx
movl %eax, (%rdx,%rcx,4)
movq 0x8(%rsp), %rax
movq %r12, (%rax)
movq 0x238(%r14), %rcx
cmpb $0x0, (%r9)
movq %r15, %rax
jne 0x1695e
xorl %eax, %eax
leaq (%rax,%rax,2), %r12
movq (%rcx,%r12,8), %rax
movq 0x8(%rcx,%r12,8), %rdx
leaq (%rax,%rbp), %rsi
cmpq %rdx, %rsi
je 0x16998
leaq (%rax,%rbp), %rdi
addq $-0x8, %rdi
subq %rax, %rdx
addq %r13, %rdx
movq %rcx, 0x10(%rsp)
callq 0x4480
movq 0x10(%rsp), %rcx
leaq 0x25bf8(%rip), %r9      # 0x3c590
leaq (%rcx,%r12,8), %rax
addq $-0x8, 0x8(%rax)
movb $0x1, %r8b
xorl %ecx, %ecx
xorl %edx, %edx
testb %dl, %dl
je 0x169e4
movb (%r9), %al
movq %r15, %rdx
testb %al, %al
jne 0x169b8
xorl %edx, %edx
incq %rbx
movq 0x238(%r14), %rsi
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rsi,%rdx,8), %rdi
subq (%rsi,%rdx,8), %rdi
sarq $0x3, %rdi
addq $0x8, %rbp
addq $-0x8, %r13
cmpq %rbx, %rdi
ja 0x1687b
movb 0x18(%rsp), %bpl
jmp 0x16ef3
leaq 0x25b9b(%rip), %r13     # 0x3c590
movb (%r13), %al
movl 0x1cc(%r14), %ecx
movq 0x220(%r14), %rdx
xorl %edi, %edi
testb %al, %al
cmoveq %rdi, %rcx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x15e5f
movq 0x238(%r14), %rcx
xorl %edi, %edi
testb %al, %al
movl $0x0, %edx
cmovneq %r15, %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rcx,%rdx,8), %rsi
cmpq (%rcx,%rdx,8), %rsi
je 0x15e5f
movq 0x208(%r14), %rcx
movq 0x238(%r14), %rdx
xorl %edi, %edi
testb %al, %al
movl $0x0, %esi
cmovneq %r15, %rsi
leaq (%rsi,%rsi,2), %rsi
movq (%rdx,%rsi,8), %rdx
movq (%rdx), %rdx
movl 0x14(%rdx), %edx
cmpl (%rcx,%r15,4), %edx
jne 0x15e5f
testb %al, %al
movl $0x0, %eax
cmovneq %r15, %rax
movq 0x238(%r14), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1705a
testb %al, %al
je 0x15e5d
movb (%r13), %al
movq 0x238(%r14), %rcx
xorl %edx, %edx
testb %al, %al
cmovneq %r15, %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
cmpl $0x3, 0x10(%rcx)
je 0x16ae4
movq 0x238(%r14), %rcx
xorl %edx, %edx
testb %al, %al
cmovneq %r15, %rdx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
cmpl $0x4, 0x10(%rcx)
jne 0x16b01
movq 0x1e0(%r14), %rcx
notq %rbx
andq %rbx, (%rcx,%r12,8)
movq 0x208(%r14), %rcx
movl $0x0, (%rcx,%r15,4)
xorl %ecx, %ecx
testb %al, %al
cmovneq %r15, %rcx
movq 0x238(%r14), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq 0x238(%r14), %rax
leaq (%rax,%rcx), %rbx
movq (%rax,%rcx), %rdi
movq 0x8(%rax,%rcx), %rdx
leaq 0x8(%rdi), %rsi
cmpq %rdx, %rsi
je 0x16b4c
subq %rsi, %rdx
callq 0x4480
addq $-0x8, 0x8(%rbx)
movb $0x1, %dil
jmp 0x15e5f
leaq 0x25a30(%rip), %r8      # 0x3c590
movb (%r8), %al
movq 0x238(%r14), %rcx
xorl %edi, %edi
testb %al, %al
movl $0x0, %edx
cmovneq %r15, %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rcx,%rdx,8), %rsi
cmpq (%rcx,%rdx,8), %rsi
je 0x15e5f
movb %bpl, 0x18(%rsp)
movl $0x8, %ebp
movq $-0x8, %r13
xorl %ebx, %ebx
xorl %edi, %edi
movq %r15, %rcx
testb $0x1, %al
jne 0x16ba8
xorl %ecx, %ecx
movq 0x238(%r14), %rax
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rax,%rbp), %r12
movb $0x1, %al
cmpl %r15d, 0x18(%r12)
jne 0x16cce
movq 0x1d8(%r14), %rcx
movq 0x210(%rcx), %rcx
movq 0x1d8(%rcx), %rcx
movq (%rcx,%r15,8), %rcx
movl 0x8(%rcx), %ecx
cmpl 0x20(%r12), %ecx
jne 0x16cce
cmpl $0x0, 0x10(%r12)
je 0x16cbc
movq %rdi, 0x10(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1705a
testb %al, %al
je 0x16cc0
cmpb $0x1, 0x30(%r12)
leaq 0x2596f(%rip), %r8      # 0x3c590
jne 0x16c5c
movl 0x2c(%r12), %eax
andl $-0x2, %eax
cmpl $0x68, %eax
je 0x16c5c
movl 0x18(%r12), %ecx
movq 0x1e0(%r14), %rax
movl %ecx, %edx
movl $0x1, %esi
shlq %cl, %rsi
shrl $0x6, %edx
orq %rsi, (%rax,%rdx,8)
movl 0x14(%r12), %eax
movq 0x208(%r14), %rdx
movl %eax, (%rdx,%rcx,4)
movq 0x8(%rsp), %rax
movq %r12, (%rax)
movq 0x238(%r14), %rcx
cmpb $0x0, (%r8)
movq %r15, %rax
jne 0x16c76
xorl %eax, %eax
leaq (%rax,%rax,2), %r12
movq (%rcx,%r12,8), %rax
movq 0x8(%rcx,%r12,8), %rdx
leaq (%rax,%rbp), %rsi
cmpq %rdx, %rsi
je 0x16cb0
leaq (%rax,%rbp), %rdi
addq $-0x8, %rdi
subq %rax, %rdx
addq %r13, %rdx
movq %rcx, 0x10(%rsp)
callq 0x4480
movq 0x10(%rsp), %rcx
leaq 0x258e0(%rip), %r8      # 0x3c590
leaq (%rcx,%r12,8), %rax
addq $-0x8, 0x8(%rax)
movb $0x1, %dil
xorl %eax, %eax
jmp 0x16cce
xorl %eax, %eax
movq 0x10(%rsp), %rdi
leaq 0x258c2(%rip), %r8      # 0x3c590
testb %al, %al
je 0x16d0a
movb (%r8), %al
movq %r15, %rcx
testb %al, %al
jne 0x16cde
xorl %ecx, %ecx
incq %rbx
movq 0x238(%r14), %rdx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rdx,%rcx,8), %rsi
subq (%rdx,%rcx,8), %rsi
sarq $0x3, %rsi
addq $0x8, %rbp
addq $-0x8, %r13
cmpq %rbx, %rsi
ja 0x16b9f
movb 0x18(%rsp), %bpl
jmp 0x15e5f
leaq 0x80(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4320
leaq 0x50(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x16d49
movq %rsi, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x16d4f
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1d6ee(%rip), %rsi     # 0x34461
leaq 0x40(%rsp), %rdi
callq 0x4580
movq %rbp, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x16da0
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x16da7
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x25200(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
movq %r14, %r12
addq %rax, %r12
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x16e1b
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %rbx
leaq 0x1bba5(%rip), %rsi     # 0x329e3
movl $0x24, %edx
movq %rax, %rdi
callq 0x4340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16e89
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16ea4
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16ec5
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x16edc
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
movl %r15d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %cl
testb $0x1, %cl
je 0x1566b
movq 0x1d8(%r14), %rax
movq 0x210(%rax), %rax
movq 0x1d8(%rax), %rax
movq (%rax,%r15,8), %rax
movq 0x28(%rax), %rax
cmpq 0x8(%r14), %rax
ja 0x1566b
movq 0x268(%r14), %rax
xorl %ebx, %ebx
movl %ebx, (%rax,%r15,4)
movl $0x38, %edi
callq 0x42f0
movq %rax, %r12
subq $0x8, %rsp
movq %rax, %rdi
movl $0x7, %esi
xorl %edx, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rbx
pushq %rbx
pushq %rbx
pushq $0x1
pushq $0x0
pushq %rbx
pushq %rbx
callq 0x1c9f0
addq $0x40, %rsp
movq 0x8(%rsp), %rax
movq %r12, (%rax)
movb $0x1, %r8b
jmp 0x1566b
movq %rax, %rbx
movl $0x38, %esi
movq %r12, %rdi
jmp 0x1704c
jmp 0x16f88
movq %rax, %rbx
movl $0x38, %esi
movq %r15, %rdi
jmp 0x1704c
movq %rax, %rbx
jmp 0x16fea
movq %rax, %rbx
jmp 0x17005
jmp 0x16fa4
movq %rax, %rbx
jmp 0x17026
jmp 0x17037
movq %rax, %rbx
movl $0x38, %esi
movq %r13, %rdi
jmp 0x1704c
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x17044
jmp 0x17051
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16fea
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17005
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17026
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x17051
movq 0x70(%rsp), %rsi
jmp 0x17049
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x17051
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x4540
nop