// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/DRAM.cpp
// Function: CasHMC::DRAM::receiveCMD(CasHMC::DRAMCommand*)
void DRAM::receiveCMD(DRAMCommand *recvCMD)
{
	switch(recvCMD->commandType) {
		case ACTIVATE:
			bankStates[recvCMD->bank]->currentBankState = ROW_ACTIVE;
			bankStates[recvCMD->bank]->lastCommand = ACTIVATE;
			bankStates[recvCMD->bank]->openRowAddress = recvCMD->row;
			bankStates[recvCMD->bank]->nextActivate = max(currentClockCycle + tRC, bankStates[recvCMD->bank]->nextActivate);
			bankStates[recvCMD->bank]->nextPrecharge = max(currentClockCycle + tRAS, bankStates[recvCMD->bank]->nextPrecharge);
			bankStates[recvCMD->bank]->nextRead = max(currentClockCycle + (tRCD-AL), bankStates[recvCMD->bank]->nextRead);
			bankStates[recvCMD->bank]->nextWrite = max(currentClockCycle + (tRCD-AL), bankStates[recvCMD->bank]->nextWrite);
			for(int b=0; b<NUM_BANKS; b++) {
				if(recvCMD->bank != b) {
					bankStates[b]->nextActivate = max(currentClockCycle + tRRD, bankStates[b]->nextActivate);
				}
			}
			DEBUG(ALI(18)<<header<<ALI(15)<<*recvCMD<<"      next READ or WRITE time : "<<bankStates[recvCMD->bank]->nextRead<<" [HMC clk]");
			delete recvCMD;
			break;
		case READ:
			bankStates[recvCMD->bank]->nextPrecharge = max(currentClockCycle + READ_TO_PRE_DELAY, bankStates[recvCMD->bank]->nextPrecharge);
			bankStates[recvCMD->bank]->lastCommand = READ;
			for(int b=0; b<NUM_BANKS; b++) {
				bankStates[b]->nextRead = max(currentClockCycle + max(tCCD, BL), bankStates[b]->nextRead);
				bankStates[b]->nextWrite = max(currentClockCycle + READ_TO_WRITE_DELAY, bankStates[b]->nextWrite);
			}
			DEBUG(ALI(18)<<header<<ALI(15)<<*recvCMD<<"      READ DATA return time : "<<currentClockCycle+RL+BL<<" [HMC clk]"
													<<" / next PRECHARGE time : "<<bankStates[recvCMD->bank]->nextPrecharge<<" [HMC clk]");
			recvCMD->commandType = READ_DATA;
			readReturnDATA.push_back(recvCMD);
			readReturnCountdown.push_back(RL);
			break;
		case READ_P:
			bankStates[recvCMD->bank]->nextActivate = max(currentClockCycle + READ_AUTOPRE_DELAY, bankStates[recvCMD->bank]->nextActivate);
			bankStates[recvCMD->bank]->lastCommand = READ_P;
			bankStates[recvCMD->bank]->stateChangeCountdown = READ_TO_PRE_DELAY;
			for(int b=0; b<NUM_BANKS; b++) {
				bankStates[b]->nextRead = max(currentClockCycle + max(tCCD, BL), bankStates[b]->nextRead);
				bankStates[b]->nextWrite = max(currentClockCycle + READ_TO_WRITE_DELAY, bankStates[b]->nextWrite);
			}
			if(recvCMD->commandType == READ_P) {
				bankStates[recvCMD->bank]->nextRead = bankStates[recvCMD->bank]->nextActivate;
				bankStates[recvCMD->bank]->nextWrite = bankStates[recvCMD->bank]->nextActivate;
			}	
			DEBUG(ALI(18)<<header<<ALI(15)<<*recvCMD<<"      READ DATA return time : "<<currentClockCycle+RL+BL<<" [HMC clk]"
													<<" / next ACTIVATE time : "<<bankStates[recvCMD->bank]->nextActivate<<" [HMC clk]");
			recvCMD->commandType = READ_DATA;
			readReturnDATA.push_back(recvCMD);
			readReturnCountdown.push_back(RL);
			break;
		case WRITE:
			bankStates[recvCMD->bank]->nextPrecharge = max(currentClockCycle + WRITE_TO_PRE_DELAY, bankStates[recvCMD->bank]->nextPrecharge);
			bankStates[recvCMD->bank]->lastCommand = WRITE;
			for(int b=0; b<NUM_BANKS; b++) {
				bankStates[b]->nextWrite = max(currentClockCycle + max(BL, tCCD), bankStates[b]->nextWrite);
				bankStates[b]->nextRead = max(currentClockCycle + WRITE_TO_READ_DELAY_B, bankStates[b]->nextRead);
			}
			DEBUG(ALI(18)<<header<<ALI(15)<<*recvCMD<<"      WRTIE DATA time : "<<currentClockCycle+WL+BL<<" [HMC clk]"
													<<" / next PRECHARGE time : "<<bankStates[recvCMD->bank]->nextPrecharge<<" [HMC clk]");
			delete recvCMD;
			break;
		case WRITE_P:
			bankStates[recvCMD->bank]->nextActivate = max(currentClockCycle + WRITE_AUTOPRE_DELAY, bankStates[recvCMD->bank]->nextActivate);
			bankStates[recvCMD->bank]->lastCommand = WRITE_P;
			bankStates[recvCMD->bank]->stateChangeCountdown = WRITE_TO_PRE_DELAY;
			for(int b=0; b<NUM_BANKS; b++) {
				bankStates[b]->nextWrite = max(currentClockCycle + max(BL, tCCD), bankStates[b]->nextWrite);
				bankStates[b]->nextRead = max(currentClockCycle + WRITE_TO_READ_DELAY_B, bankStates[b]->nextRead);
			}
			bankStates[recvCMD->bank]->nextRead = bankStates[recvCMD->bank]->nextActivate;
			bankStates[recvCMD->bank]->nextWrite = bankStates[recvCMD->bank]->nextActivate;
			DEBUG(ALI(18)<<header<<ALI(15)<<*recvCMD<<"      WRTIE DATA time : "<<currentClockCycle+WL+BL<<" [HMC clk]"
													<<" / next ACTIVATE time : "<<bankStates[recvCMD->bank]->nextActivate<<" [HMC clk]");
			delete recvCMD; 
			break;
		case WRITE_DATA:
			delete recvCMD;
			break;
		case PRECHARGE:
			bankStates[recvCMD->bank]->currentBankState = PRECHARGING;
			bankStates[recvCMD->bank]->lastCommand = PRECHARGE;
			bankStates[recvCMD->bank]->openRowAddress = 0;
			bankStates[recvCMD->bank]->stateChangeCountdown = tRP;
			bankStates[recvCMD->bank]->nextActivate = max(currentClockCycle + tRP, bankStates[recvCMD->bank]->nextActivate);
			DEBUG(ALI(18)<<header<<ALI(15)<<*recvCMD<<"      next ACTIVATE time : "<<bankStates[recvCMD->bank]->nextActivate<<" [HMC clk]");
			delete recvCMD;
			break;	
		case REFRESH:
			for(int b=0; b<NUM_BANKS; b++) {
				bankStates[b]->nextActivate = currentClockCycle + tRFC;
				bankStates[b]->currentBankState = REFRESHING;
				bankStates[b]->lastCommand = REFRESH;
				bankStates[b]->stateChangeCountdown = tRFC;
			}
			DEBUG(ALI(18)<<header<<ALI(15)<<*recvCMD<<"      next ACTIVATE time : "<<bankStates[recvCMD->bank]->nextActivate<<" [HMC clk]");
			delete recvCMD;
			break;
		default:
			ERROR(header<<"  (DR) == Error - Wrong command type    popped command : "<<*recvCMD<<"  (CurrentClock : "<<currentClockCycle<<")");
			exit(0);
			break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x10(%rsp)
movl 0x10(%rsi), %eax
cmpq $0x8, %rax
ja 0x14946
leaq 0x1205d(%rip), %rcx     # 0x25fb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rsi
movl $0x1, 0x4(%rsi)
andl $0x0, 0x38(%rsi)
movl 0x20(%rbx), %edx
movl %edx, 0x8(%rsi)
movq 0x8(%r14), %rdx
leaq 0x1d63a(%rip), %rdi     # 0x315c0
movl (%rdi), %edi
addq %rdx, %rdi
movq 0x10(%rsi), %r8
movq 0x18(%rsi), %r9
cmpq %r8, %rdi
cmovbeq %r8, %rdi
movq %rdi, 0x10(%rsi)
leaq 0x1d60f(%rip), %rdi     # 0x315b4
movl (%rdi), %edi
addq %rdx, %rdi
movq 0x28(%rsi), %r8
cmpq %r8, %rdi
cmovbeq %r8, %rdi
movq %rdi, 0x28(%rsi)
leaq 0x1d5f8(%rip), %rdi     # 0x315b8
movl (%rdi), %edi
leaq 0x1d5e7(%rip), %r8      # 0x315b0
subl (%r8), %edi
addq %rdx, %rdi
cmpq %r9, %rdi
cmovaq %rdi, %r9
movq %r9, 0x18(%rsi)
movq 0x20(%rsi), %r8
cmpq %r8, %rdi
cmovbeq %r8, %rdi
movq %rdi, 0x20(%rsi)
leaq 0x1d590(%rip), %rsi     # 0x31580
movl (%rsi), %esi
leaq 0x1d5c3(%rip), %rdi     # 0x315bc
movl (%rdi), %edi
addq %rdx, %rdi
xorl %edx, %edx
testl %esi, %esi
cmovlel %edx, %esi
cmpq %rdx, %rsi
je 0x14798
cmpq %rdx, %rax
je 0x14026
movq (%rcx,%rdx,8), %r8
movq 0x10(%r8), %r9
cmpq %r9, %rdi
cmovaq %rdi, %r9
movq %r9, 0x10(%r8)
incq %rdx
jmp 0x14005
leaq 0x1d57e(%rip), %r15     # 0x315b0
leaq 0x1d56f(%rip), %r13     # 0x315a8
movl (%r13), %edx
addl (%r15), %edx
leaq 0x1d545(%rip), %r12     # 0x3158c
movl (%r12), %eax
movl %eax, %ecx
shrl $0x6, %ecx
addl %edx, %ecx
leaq 0x1d57b(%rip), %rdx     # 0x315d4
movl (%rdx), %esi
addl %ecx, %esi
movq 0x8(%r14), %rdi
movq 0x1d8(%r14), %rdx
addq %rdi, %rsi
movl 0x18(%rbx), %r8d
movq (%rdx,%r8,8), %r8
movq 0x28(%r8), %r9
cmpq %r9, %rsi
cmovbeq %r9, %rsi
movq %rsi, 0x28(%r8)
movl $0x3, 0x38(%r8)
leaq 0x1d4ef(%rip), %rsi     # 0x31580
movl (%rsi), %esi
shrl $0x5, %eax
leaq 0x1d52b(%rip), %r8      # 0x315c8
movl (%r8), %r8d
cmpl %r8d, %eax
cmovbel %r8d, %eax
addq %rdi, %rax
leaq 0x1d51f(%rip), %r8      # 0x315d0
addl (%r8), %ecx
addq %rdi, %rcx
xorl %edi, %edi
testl %esi, %esi
cmovlel %edi, %esi
cmpq %rdi, %rsi
je 0x140ea
movq (%rdx,%rdi,8), %r8
movq 0x18(%r8), %r9
movq 0x20(%r8), %r10
cmpq %r10, %rax
cmovaq %rax, %r10
cmpq %r9, %rcx
cmovaq %rcx, %r9
movq %r10, 0x20(%r8)
movq %r9, 0x18(%r8)
incq %rdi
jmp 0x140be
leaq 0x1d397(%rip), %rax     # 0x31488
cmpb $0x0, (%rax)
je 0x147b4
leaq 0x1d388(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x147b4
movq 0x1cebf(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x15274
leaq 0x11f0b(%rip), %rsi     # 0x2606e
movq %rax, %rdi
callq 0x4300
movl (%r13), %ecx
addl (%r15), %ecx
addq 0x8(%r14), %rcx
movl (%r12), %esi
shrl $0x5, %esi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x4210
leaq 0x11e82(%rip), %r15     # 0x26011
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
leaq 0x11e9a(%rip), %rsi     # 0x2603b
movq %rax, %rdi
callq 0x4300
movl 0x18(%rbx), %ecx
movq 0x1d8(%r14), %rdx
movq (%rdx,%rcx,8), %rcx
movq 0x28(%rcx), %rsi
jmp 0x1436c
leaq 0x1d3e9(%rip), %r15     # 0x315b0
leaq 0x1d3da(%rip), %r13     # 0x315a8
movl (%r13), %edx
addl (%r15), %edx
leaq 0x1d3b0(%rip), %r12     # 0x3158c
movl (%r12), %eax
movl %eax, %ecx
shrl $0x6, %ecx
addl %edx, %ecx
leaq 0x1d3e6(%rip), %rdx     # 0x315d4
movl (%rdx), %r8d
addl %ecx, %r8d
leaq 0x1d3c9(%rip), %rdx     # 0x315c4
movl (%rdx), %edx
addl %r8d, %edx
movq 0x8(%r14), %r9
movq 0x1d8(%r14), %rsi
addq %r9, %rdx
movl 0x18(%rbx), %edi
movq (%rsi,%rdi,8), %rdi
movq 0x10(%rdi), %r10
cmpq %r10, %rdx
cmovbeq %r10, %rdx
movq %rdx, 0x10(%rdi)
movl $0x4, 0x38(%rdi)
movl %r8d, 0x3c(%rdi)
leaq 0x1d34a(%rip), %r8      # 0x31580
movl (%r8), %r8d
shrl $0x5, %eax
leaq 0x1d385(%rip), %r10     # 0x315c8
movl (%r10), %r10d
cmpl %r10d, %eax
cmovbel %r10d, %eax
addq %r9, %rax
leaq 0x1d379(%rip), %r10     # 0x315d0
addl (%r10), %ecx
addq %r9, %rcx
xorl %r9d, %r9d
testl %r8d, %r8d
cmovlel %r9d, %r8d
cmpq %r9, %r8
je 0x14293
movq (%rsi,%r9,8), %r10
movq 0x18(%r10), %r11
movq 0x20(%r10), %rbp
cmpq %rbp, %rax
cmovaq %rax, %rbp
cmpq %r11, %rcx
cmovaq %rcx, %r11
movq %rbp, 0x20(%r10)
movq %r11, 0x18(%r10)
incq %r9
jmp 0x14267
movq %rdx, 0x18(%rdi)
movq %rdx, 0x20(%rdi)
leaq 0x1d1e6(%rip), %rax     # 0x31488
cmpb $0x0, (%rax)
je 0x147b4
leaq 0x1d1d7(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x147b4
movq 0x1cd0e(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x15274
leaq 0x11d5a(%rip), %rsi     # 0x2606e
movq %rax, %rdi
callq 0x4300
movl (%r13), %ecx
addl (%r15), %ecx
addq 0x8(%r14), %rcx
movl (%r12), %esi
shrl $0x5, %esi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x4210
leaq 0x11cd1(%rip), %r15     # 0x26011
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
leaq 0x11d03(%rip), %rsi     # 0x26055
movq %rax, %rdi
callq 0x4300
movl 0x18(%rbx), %ecx
movq 0x1d8(%r14), %rdx
movq (%rdx,%rcx,8), %rcx
movq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x4210
movq %rax, %rdi
movq %r15, %rsi
jmp 0x14922
leaq 0x1d22a(%rip), %r12     # 0x315b0
leaq 0x1d1ff(%rip), %r15     # 0x3158c
movl (%r15), %eax
movl %eax, %esi
shrl $0x6, %esi
addl (%r12), %esi
leaq 0x1d22c(%rip), %rcx     # 0x315cc
movl (%rcx), %edx
leaq 0x1d21f(%rip), %rcx     # 0x315c8
movl (%rcx), %ecx
cmpl %ecx, %edx
cmovbel %ecx, %edx
subl %ecx, %esi
addl %edx, %esi
movq 0x8(%r14), %rdi
movq 0x1d8(%r14), %rdx
addq %rdi, %rsi
movl 0x18(%rbx), %r8d
movq (%rdx,%r8,8), %r8
movq 0x28(%r8), %r9
cmpq %r9, %rsi
cmovbeq %r9, %rsi
movq %rsi, 0x28(%r8)
movl $0x1, 0x38(%r8)
leaq 0x1d198(%rip), %rsi     # 0x31580
movl (%rsi), %esi
shrl $0x5, %eax
cmpl %eax, %ecx
cmoval %ecx, %eax
addq %rdi, %rax
leaq 0x1d1b0(%rip), %r13     # 0x315ac
leaq 0x1d1a5(%rip), %r8      # 0x315a8
addl (%r13), %ecx
subl (%r8), %ecx
addl $0x2, %ecx
addq %rdi, %rcx
xorl %edi, %edi
testl %esi, %esi
cmovlel %edi, %esi
cmpq %rdi, %rsi
je 0x14443
movq (%rdx,%rdi,8), %r8
movq 0x18(%r8), %r9
movq 0x20(%r8), %r10
cmpq %r9, %rax
cmovaq %rax, %r9
cmpq %r10, %rcx
cmovaq %rcx, %r10
movq %r9, 0x18(%r8)
movq %r10, 0x20(%r8)
incq %rdi
jmp 0x14417
leaq 0x1d03e(%rip), %rax     # 0x31488
cmpb $0x0, (%rax)
je 0x14760
leaq 0x1d02f(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x14760
movq 0x1cb66(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x15274
leaq 0x11b60(%rip), %rsi     # 0x2601c
movq %rax, %rdi
callq 0x4300
movl (%r13), %ecx
addl (%r12), %ecx
addq 0x8(%r14), %rcx
movl (%r15), %esi
shrl $0x5, %esi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x4210
leaq 0x11b29(%rip), %r15     # 0x26011
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
leaq 0x11b41(%rip), %rsi     # 0x2603b
movq %rax, %rdi
callq 0x4300
movl 0x18(%rbx), %ecx
movq 0x1d8(%r14), %rdx
movq (%rdx,%rcx,8), %rcx
movq 0x28(%rcx), %rsi
jmp 0x14745
leaq 0x1d060(%rip), %rax     # 0x31580
movl (%rax), %eax
leaq 0x1d0b3(%rip), %rcx     # 0x315dc
movl (%rcx), %ecx
movq %rcx, %rdx
addq 0x8(%r14), %rdx
movq 0x1d8(%r14), %rsi
xorl %edi, %edi
testl %eax, %eax
cmovlel %edi, %eax
cmpq %rdi, %rax
je 0x14566
movq (%rsi,%rdi,8), %r8
movq %rdx, 0x10(%r8)
movl $0x3, 0x4(%r8)
movl $0x8, 0x38(%r8)
movl %ecx, 0x3c(%r8)
incq %rdi
jmp 0x14540
leaq 0x1cf1b(%rip), %rax     # 0x31488
cmpb $0x0, (%rax)
je 0x147b4
leaq 0x1cf0c(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x147b4
jmp 0x14828
leaq 0x1d01e(%rip), %r12     # 0x315b0
movl (%r12), %edi
leaq 0x1d02f(%rip), %rax     # 0x315cc
movl (%rax), %r9d
leal (%r9,%rdi), %eax
leaq 0x1d019(%rip), %rcx     # 0x315c4
addl (%rcx), %eax
movq 0x8(%r14), %r8
movq 0x1d8(%r14), %rcx
addq %r8, %rax
movl 0x18(%rbx), %edx
movq (%rcx,%rdx,8), %rdx
movq 0x10(%rdx), %rsi
cmpq %rsi, %rax
cmovbeq %rsi, %rax
movq %rax, 0x10(%rdx)
movl $0x2, 0x38(%rdx)
leaq 0x1cfad(%rip), %r15     # 0x3158c
movl (%r15), %esi
movl %esi, %r10d
shrl $0x6, %r10d
addl %edi, %r10d
leaq 0x1cfd5(%rip), %rdi     # 0x315c8
movl (%rdi), %edi
cmpl %edi, %r9d
cmovbel %edi, %r9d
subl %edi, %r10d
addl %r9d, %r10d
movl %r10d, 0x3c(%rdx)
leaq 0x1cf73(%rip), %r9      # 0x31580
movl (%r9), %r9d
shrl $0x5, %esi
cmpl %esi, %edi
cmoval %edi, %esi
addq %r8, %rsi
leaq 0x1cf8a(%rip), %r13     # 0x315ac
leaq 0x1cf7f(%rip), %r10     # 0x315a8
addl (%r13), %edi
subl (%r10), %edi
addl $0x2, %edi
addq %r8, %rdi
xorl %r8d, %r8d
testl %r9d, %r9d
cmovlel %r8d, %r9d
cmpq %r8, %r9
je 0x1466c
movq (%rcx,%r8,8), %r10
movq 0x18(%r10), %r11
movq 0x20(%r10), %rbp
cmpq %r11, %rsi
cmovaq %rsi, %r11
cmpq %rbp, %rdi
cmovaq %rdi, %rbp
movq %r11, 0x18(%r10)
movq %rbp, 0x20(%r10)
incq %r8
jmp 0x14640
movq %rax, 0x18(%rdx)
movq %rax, 0x20(%rdx)
leaq 0x1ce0d(%rip), %rax     # 0x31488
cmpb $0x1, (%rax)
jne 0x14760
leaq 0x1cdfe(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x14760
movq 0x1c935(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x15274
leaq 0x1192f(%rip), %rsi     # 0x2601c
movq %rax, %rdi
callq 0x4300
movl (%r13), %ecx
addl (%r12), %ecx
addq 0x8(%r14), %rcx
movl (%r15), %esi
shrl $0x5, %esi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x4210
leaq 0x118f8(%rip), %r15     # 0x26011
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
leaq 0x1192a(%rip), %rsi     # 0x26055
movq %rax, %rdi
callq 0x4300
movl 0x18(%rbx), %ecx
movq 0x1d8(%r14), %rdx
movq (%rdx,%rcx,8), %rcx
movq 0x10(%rcx), %rsi
movq %rax, %rdi
callq 0x4210
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movl $0x5, 0x10(%rbx)
leaq 0x218(%r14), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1118a
addq $0x230, %r14            # imm = 0x230
movl (%r13), %eax
addl (%r12), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0xe3de
jmp 0x147bd
leaq 0x1cce9(%rip), %rax     # 0x31488
cmpb $0x0, (%rax)
je 0x147b4
leaq 0x1ccde(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
je 0x1489d
testq %rbx, %rbx
jne 0x1492f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq $0x2, 0x4(%rax)
movl $0x7, 0x38(%rax)
leaq 0x1cdd4(%rip), %rcx     # 0x315c4
movl (%rcx), %ecx
movl %ecx, 0x3c(%rax)
addq 0x8(%r14), %rcx
movq 0x10(%rax), %rdx
cmpq %rdx, %rcx
cmovbeq %rdx, %rcx
movq %rcx, 0x10(%rax)
leaq 0x1cc79(%rip), %rax     # 0x31488
cmpb $0x1, (%rax)
jne 0x1492f
leaq 0x1cc6a(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x1492f
movq 0x1c7a1(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x15274
leaq 0x11806(%rip), %rsi     # 0x26087
movq %rax, %rdi
callq 0x4300
movl 0x18(%rbx), %ecx
movq 0x1d8(%r14), %rdx
movq (%rdx,%rcx,8), %rcx
movq 0x10(%rcx), %rsi
jmp 0x14910
movq 0x1c72c(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x15274
leaq 0x116fa(%rip), %rsi     # 0x25ff0
movq %rax, %rdi
callq 0x4300
movl 0x18(%rbx), %ecx
movq 0x1d8(%r14), %rdx
movq (%rdx,%rcx,8), %rcx
movq 0x18(%rcx), %rsi
movq %rax, %rdi
callq 0x4210
leaq 0x116f2(%rip), %rsi     # 0x26011
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
movq 0x1c6a3(%rip), %rdi     # 0x30ff0
leaq 0xf6ce(%rip), %rsi      # 0x24022
callq 0x4300
leaq 0x11743(%rip), %rsi     # 0x260a3
movq %rax, %rdi
callq 0x4300
leaq 0xff08(%rip), %rsi      # 0x24877
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
movl $0x97, %esi
callq 0x44f0
leaq 0xf6b6(%rip), %rsi      # 0x24041
movq %rax, %rdi
callq 0x4300
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
leaq 0x1170e(%rip), %rsi     # 0x260b4
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
movq %rbx, %rsi
callq 0x15274
leaq 0x1333b(%rip), %rsi     # 0x27cfb
movq %rax, %rdi
callq 0x4300
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x40d0
leaq 0x12af6(%rip), %rsi     # 0x274d1
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
xorl %edi, %edi
callq 0x4370