// File: /workspace/github_cpp_makefile_star2_O1/estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::Update()
void VaultController::Update()
{
	//Update DRAM state and various countdown
	UpdateCountdown();

	//Convert request packet into DRAM commands
	if(bufPopDelay == 0) {
		for(int i=0; i<downBuffers.size(); i++) {
			//Make sure that buffer[0] is not virtual tail packet.
			if(downBuffers[i] != NULL) {
				if(ConvPacketIntoCMDs(downBuffers[i])) {
					int tempLNG = downBuffers[i]->LNG;
					delete downBuffers[i];
					downBuffers.erase(downBuffers.begin()+i, downBuffers.begin()+i+tempLNG);
				}
			}
		}
	}
	
	//Send response packet to crossbar switch
	if(upBuffers.size() > 0) {
		//Make sure that buffer[0] is not virtual tail packet.
		if(upBuffers[0] == NULL) {
			ERROR(header<<"  == Error - Vault controller up buffer[0] is NULL (It could be one of virtual tail packet occupying packet length  (CurrentClock : "<<currentClockCycle<<")");
			exit(0);
		}
		else{
			if(upBufferDest->ReceiveUp(upBuffers[0])) {
				DEBUG(ALI(18)<<header<<ALI(15)<<*upBuffers[0]<<"Up)   SENDING packet to crossbar switch (CS)");
				upBuffers.erase(upBuffers.begin(), upBuffers.begin()+upBuffers[0]->LNG);
			}
			else {
				//DEBUG(ALI(18)<<header<<ALI(15)<<*upBuffers[0]<<"Up)   Crossbar switch buffer FULL");	
			}
		}
	}
	
	//Pop command from command queue
	if(commandQueue->CmdPop(&poppedCMD)) {
		//Write data command will be issued after countdown
		if(poppedCMD->commandType == WRITE || poppedCMD->commandType == WRITE_P) {
			DRAMCommand *writeData = new DRAMCommand(*poppedCMD);
			writeData->commandType = WRITE_DATA;
			writeDataToSend.push_back(writeData);
			writeDataCountdown.push_back(WL);
		}
		
		if(poppedCMD->lastCMD == true) {
			if(!poppedCMD->posted) {
				if(poppedCMD->commandType == WRITE || poppedCMD->commandType == WRITE_P) {
					if(!poppedCMD->atomic) {
						pendingDataSize += 1;
						//DEBUG(ALI(18)<<header<<ALI(15)<<*poppedCMD<<"Down) pendingDataSize 1 increased   (current pendingDataSize : "<<pendingDataSize<<")");
					}
				}
				else if(poppedCMD->commandType == READ || poppedCMD->commandType == READ_P) {
					if(!poppedCMD->atomic) {
						pendingDataSize += (poppedCMD->dataSize/16)+1;
						//DEBUG(ALI(18)<<header<<ALI(15)<<*poppedCMD<<"Down) pendingDataSize "<<(poppedCMD->dataSize/16)+1<<" increased   (current pendingDataSize : "<<pendingDataSize<<")");
					}
					else {
						if(poppedCMD->packetCMD == _2ADD8 || poppedCMD->packetCMD == ADD16 || poppedCMD->packetCMD == INC8
						|| poppedCMD->packetCMD == EQ8 || poppedCMD->packetCMD == EQ16 || poppedCMD->packetCMD == BWR) {
							pendingDataSize += 1;
						}
						else {
							pendingDataSize += 2;
						}
					}
				}
			}
		}
		
		//Check for collision on bus
		if(cmdBus != NULL) {
			ERROR(header<<"  == Error - Command bus collision  (cmdBus:"<<*cmdBus<<", poppedCMD:"<<*poppedCMD<<")  (CurrentClock : "<<currentClockCycle<<")");
			exit(0);
		}
		cmdBus = poppedCMD;
		cmdCyclesLeft = tCMD;
		poppedCMD = NULL;
	}
	
	//Atomic command operation (assume that all operations consume one clock cycle)
	if(atomicCMD != NULL) {
		if(atomicOperLeft == 0) {
			//The results are written back to DRAM, overwriting the original memory operands
			if(atomicCMD->packetCMD != EQ16 && atomicCMD->packetCMD != EQ8) {
				DRAMCommand *atmRstCMD = new DRAMCommand(*atomicCMD);
				atmRstCMD->commandType = (OPEN_PAGE ? WRITE : WRITE_P);
				atmRstCMD->dataSize = 16;
				atmRstCMD->lastCMD = true;
				if(!atmRstCMD->posted) {
					atmRstCMD->trace = NULL;
				}
				if(QUE_PER_BANK) {
					commandQueue->queue[atomicCMD->bank].insert(commandQueue->queue[atomicCMD->bank].begin(), atmRstCMD);
					classID.str( string() );	classID.clear();
					classID << atomicCMD->bank;
					DE_CR(ALI(18)<<(commandQueue->header+"-"+classID.str()+")")<<ALI(15)<<*atmRstCMD<<"Down) PUSHING atomic result command into command queue");
				}
				else {
					commandQueue->queue[0].insert(commandQueue->queue[0].begin(), atmRstCMD);
					DE_CR(ALI(18)<<(commandQueue->header+")")<<ALI(15)<<*atmRstCMD<<"Down) PUSHING atomic result command into command queue");
				}
			}
			
			if(!atomicCMD->posted) {
				MakeRespondPacket(atomicCMD);
			}
			delete atomicCMD;
			atomicCMD = NULL;
		}
		else {
			DEBUG(ALI(18)<<(commandQueue->header+")")<<ALI(15)<<*atomicCMD<<"Down) Atomic command is now operating ["<<atomicOperLeft<<" clk]");
			atomicOperLeft--;
		}
	}

	//Power-down mode setting
	EnablePowerdown();

	commandQueue->Update();
	Step();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
callq 0x2f0a0
cmpl $0x0, 0x200(%rbx)
jne 0x2e42b
movq 0x1d0(%rbx), %rax
cmpq %rax, 0x1d8(%rbx)
je 0x2e42b
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %rbx, 0x90(%rsp)
movq (%rax,%r12), %rsi
testq %rsi, %rsi
je 0x2e402
movq %rbx, %rdi
callq 0x2f678
testb %al, %al
je 0x2e402
movq 0x1d0(%rbx), %rax
movq (%rax,%r12), %rdi
movslq 0x430(%rdi), %rbp
testq %rdi, %rdi
je 0x2e38f
movq (%rdi), %rax
callq *0x8(%rax)
testl %ebp, %ebp
je 0x2e402
movq %rbx, %rcx
movq 0x1d0(%rbx), %rbx
leaq (%rbx,%r12), %r14
leaq (%r12,%rbp,8), %rax
addq %rbx, %rax
movq 0x1d8(%rcx), %rdx
cmpq %rdx, %rax
je 0x2e3d1
leaq (%r14,%rbp,8), %rsi
subq %rbx, %rdx
leaq (,%rbp,8), %rax
subq %rax, %rdx
addq %r15, %rdx
movq %r14, %rdi
callq 0x4480
movq 0x90(%rsp), %rdx
movq 0x1d8(%rdx), %rax
movq %rax, %rcx
subq %rbx, %rcx
movq %rdx, %rbx
shlq $0x3, %rbp
subq %rbp, %rcx
addq %r15, %rcx
addq %rcx, %r14
cmpq %r14, %rax
je 0x2e402
movq %r14, 0x1d8(%rbx)
incq %r13
movq 0x1d0(%rbx), %rax
movq 0x1d8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
addq $0x8, %r12
addq $-0x8, %r15
cmpq %r13, %rcx
ja 0x2e355
movq 0x1e8(%rbx), %rax
cmpq %rax, 0x1f0(%rbx)
je 0x2e5c6
movq (%rax), %rsi
testq %rsi, %rsi
je 0x2ee90
movq 0x250(%rbx), %rdi
callq 0x3024a
testb %al, %al
je 0x2e5c6
leaq 0xe022(%rip), %rax      # 0x3c488
cmpb $0x1, (%rax)
jne 0x2e57a
leaq 0xe013(%rip), %rax      # 0x3c489
cmpb $0x0, (%rax)
jne 0x2e57a
movq 0xdb4a(%rip), %rax      # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x2e4c4
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0xdaf5(%rip), %rdi      # 0x3bfd0
callq 0x4340
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x2e522
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x1e8(%rbx), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x28bbe
movq %rax, %r14
leaq 0x6864(%rip), %rsi      # 0x34daa
movl $0x2c, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x1e8(%rbx), %r14
movq (%r14), %rax
movl 0x430(%rax), %eax
testq %rax, %rax
je 0x2e5c6
leaq (%r14,%rax,8), %r15
movq 0x1f0(%rbx), %rdx
subq %r15, %rdx
je 0x2e5aa
movq %r14, %rdi
movq %r15, %rsi
callq 0x4480
movq 0x1f0(%rbx), %rax
movq %rax, %rcx
subq %r15, %rcx
addq %rcx, %r14
cmpq %r14, %rax
je 0x2e5c6
movq %r14, 0x1f0(%rbx)
movq 0x218(%rbx), %rdi
leaq 0x220(%rbx), %r14
movq %r14, %rsi
callq 0x15568
testb %al, %al
je 0x2e734
movq (%r14), %r12
movl 0x10(%r12), %eax
addl $-0x3, %eax
cmpl $0x1, %eax
ja 0x2e691
movl $0x38, %edi
callq 0x42f0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x1ca58
movq %r15, 0x8(%rsp)
movl $0x6, 0x10(%r15)
movq 0x280(%rbx), %rsi
cmpq 0x288(%rbx), %rsi
je 0x2e63a
movq %r15, (%rsi)
addq $0x8, 0x280(%rbx)
jmp 0x2e64b
leaq 0x278(%rbx), %rdi
leaq 0x8(%rsp), %rdx
callq 0x18056
leaq 0xdf5e(%rip), %rcx      # 0x3c5b0
leaq 0xdf4f(%rip), %rax      # 0x3c5a8
movl (%rax), %eax
addl (%rcx), %eax
movl %eax, 0x30(%rsp)
movq 0x298(%rbx), %rsi
cmpq 0x2a0(%rbx), %rsi
je 0x2e680
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x298(%rbx)
jmp 0x2e691
leaq 0x290(%rbx), %rdi
leaq 0x30(%rsp), %rdx
callq 0x14060
movq (%r14), %rax
cmpb $0x1, 0x29(%rax)
jne 0x2e705
cmpb $0x0, 0x28(%rax)
jne 0x2e705
movl 0x10(%rax), %ecx
leal -0x1(%rcx), %edx
cmpl $0x2, %edx
jb 0x2e6bb
addl $-0x3, %ecx
cmpl $0x1, %ecx
ja 0x2e705
cmpb $0x0, 0x30(%rax)
je 0x2e6ff
jmp 0x2e705
cmpb $0x0, 0x30(%rax)
je 0x2e6dd
movl 0x2c(%rax), %ecx
leal -0x50(%rcx), %edx
cmpl $0x19, %edx
jbe 0x2e6f5
addl $-0x11, %ecx
cmpl $0x3, %ecx
jb 0x2e6ff
addl $0x2, 0x234(%rbx)
jmp 0x2e705
movl 0x24(%rax), %ecx
shrl $0x4, %ecx
movl 0x234(%rbx), %edx
addl %edx, %ecx
incl %ecx
movl %ecx, 0x234(%rbx)
jmp 0x2e705
movl $0x3000001, %esi        # imm = 0x3000001
btl %edx, %esi
jae 0x2e6cc
incl 0x234(%rbx)
cmpq $0x0, 0x258(%rbx)
jne 0x2eef5
movq %rax, 0x258(%rbx)
leaq 0xdecb(%rip), %rax      # 0x3c5ec
movl (%rax), %eax
movl %eax, 0x260(%rbx)
movq $0x0, 0x220(%rbx)
movq 0x228(%rbx), %r15
testq %r15, %r15
je 0x2ee4f
cmpl $0x0, 0x230(%rbx)
je 0x2e8ec
leaq 0xdd30(%rip), %rax      # 0x3c488
cmpb $0x1, (%rax)
jne 0x2e8e1
leaq 0xdd21(%rip), %rax      # 0x3c489
cmpb $0x0, (%rax)
jne 0x2e8e1
movq 0xd858(%rip), %rax      # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x2e7b6
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x218(%rbx), %rax
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1430e
leaq 0x5c73(%rip), %rsi      # 0x34461
movq %r14, %rdi
callq 0x4580
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0xd7c9(%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, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x2e850
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x228(%rbx), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x65d7(%rip), %rsi      # 0x34e48
movl $0x27, %edx
movq %rax, %rdi
callq 0x4340
movl 0x230(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
movq %rax, %r14
leaq 0x4730(%rip), %rsi      # 0x32fc6
movl $0x5, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e8e1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
decl 0x230(%rbx)
jmp 0x2ee4f
movl 0x2c(%r15), %eax
andl $-0x2, %eax
cmpl $0x68, %eax
je 0x2ee1d
movl $0x38, %edi
callq 0x42f0
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x1ca58
movq %r14, 0x28(%rsp)
leaq 0xdc71(%rip), %rax      # 0x3c591
movzbl (%rax), %eax
movl $0x4, %ecx
subl %eax, %ecx
movl %ecx, 0x10(%r14)
movl $0x10, 0x24(%r14)
movb $0x1, 0x29(%r14)
cmpb $0x0, 0x28(%r14)
jne 0x2e94a
movq $0x0, 0x8(%r14)
leaq 0xdc3f(%rip), %rcx      # 0x3c590
movq 0x218(%rbx), %rax
cmpb $0x1, (%rcx)
jne 0x2eaef
movq 0x228(%rbx), %rcx
movl 0x18(%rcx), %ecx
movq 0x238(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
movq (%rdi), %rsi
leaq 0x28(%rsp), %rdx
callq 0x30320
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0x58(%rbx), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4400
leaq 0x40(%rbx), %r15
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x2e9c9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x40(%rbx), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x44e0
leaq 0x50(%rbx), %rdi
movq 0x228(%rbx), %rax
movl 0x18(%rax), %esi
callq 0x41e0
leaq 0xda93(%rip), %rax      # 0x3c488
cmpb $0x1, (%rax)
jne 0x2ee1d
movq 0xd5cb(%rip), %rax      # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r15
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x2ea43
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x218(%rbx), %rax
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
callq 0x1430e
leaq 0x2ebc(%rip), %rsi      # 0x31937
movq %r15, %rdi
callq 0x4580
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x4450
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0x78(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x2eab2
movq 0x60(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x2eadb
leaq 0x80(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x2ead2
movq 0x80(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x2ec5d
movq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x4110
jmp 0x2ec6b
movq 0x238(%rax), %rdi
movq (%rdi), %rsi
leaq 0x28(%rsp), %rdx
callq 0x30320
leaq 0xd97e(%rip), %rax      # 0x3c488
cmpb $0x1, (%rax)
jne 0x2ee1d
movq 0xd4b6(%rip), %rax      # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x2eb58
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x218(%rbx), %rax
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1430e
leaq 0x58d1(%rip), %rsi      # 0x34461
movq %r14, %rdi
callq 0x4580
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0xd427(%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, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x2ebf2
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x6200(%rip), %rsi      # 0x34e11
movl $0x36, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2ee1d
movq 0x18(%rsp), %rsi
jmp 0x2ee15
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4320
leaq 0x40(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x2ec8f
movq %rsi, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2ec95
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x57a8(%rip), %rsi      # 0x34461
leaq 0x30(%rsp), %rdi
callq 0x4580
movq %r13, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2ece6
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x2ecee
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0xd2b9(%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, %r15
addq %rax, %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x2ed60
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x6092(%rip), %rsi      # 0x34e11
movl $0x36, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x2edca
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ede5
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ee06
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x2ee1d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x228(%rbx), %rsi
cmpb $0x0, 0x28(%rsi)
jne 0x2ee32
movq %rbx, %rdi
callq 0x2dfdc
movq 0x228(%rbx), %rdi
testq %rdi, %rdi
je 0x2ee44
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x228(%rbx)
movq %rbx, %rdi
callq 0x2fcf6
movq 0x218(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
incq 0x8(%rbx)
movl 0x200(%rbx), %eax
leal -0x1(%rax), %ecx
xorl %edx, %edx
testl %eax, %eax
cmovgl %ecx, %edx
movl %edx, 0x200(%rbx)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd159(%rip), %rdi      # 0x3bff0
leaq 0x2184(%rip), %rsi      # 0x31022
callq 0x42e0
leaq 0x5ce6(%rip), %rsi      # 0x34b90
movq %rax, %rdi
callq 0x42e0
leaq 0x297e(%rip), %rsi      # 0x31837
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movl $0xbd, %esi
callq 0x4500
leaq 0x216c(%rip), %rsi      # 0x31041
movq %rax, %rdi
callq 0x42e0
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x4290
leaq 0x5e35(%rip), %rsi      # 0x34d25
jmp 0x2ef91
movq 0xd0f4(%rip), %rdi      # 0x3bff0
leaq 0x211f(%rip), %rsi      # 0x31022
callq 0x42e0
leaq 0x5c81(%rip), %rsi      # 0x34b90
movq %rax, %rdi
callq 0x42e0
leaq 0x2919(%rip), %rsi      # 0x31837
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movl $0xf1, %esi
callq 0x4500
leaq 0x2107(%rip), %rsi      # 0x31041
movq %rax, %rdi
callq 0x42e0
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x4290
leaq 0x5e82(%rip), %rsi      # 0x34dd7
movq %rax, %rdi
callq 0x42e0
movq 0x258(%rbx), %rsi
movq %rax, %rdi
callq 0x1caba
leaq 0x5e91(%rip), %rsi      # 0x34e04
movq %rax, %rdi
callq 0x42e0
movq 0x220(%rbx), %rsi
movq %rax, %rdi
callq 0x1caba
leaq 0x5cf9(%rip), %rsi      # 0x34c8a
movq %rax, %rdi
callq 0x42e0
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x54b5(%rip), %rsi      # 0x34461
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
movq %rax, %rbx
jmp 0x2f021
movq %rax, %rbx
jmp 0x2f03c
jmp 0x2efcf
movq %rax, %rbx
jmp 0x2f05d
jmp 0x2f07d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
jne 0x2f08a
jmp 0x2f097
jmp 0x2f07d
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
jmp 0x2f092
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x2f021
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f03c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f05d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x2f097
movq 0x60(%rsp), %rsi
jmp 0x2f08f
jmp 0x2f07d
movq %rax, %rbx
movl $0x38, %esi
movq %r15, %rdi
jmp 0x2f092
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2f097
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x4540
nop