// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, %rbx
movq %rsi, 0x8(%rsp)
movl 0x10(%rsi), %eax
cmpq $0x8, %rax
ja 0x1c14b
leaq 0x17bae(%rip), %rcx     # 0x32f60
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movl 0x18(%rsi), %eax
movq 0x1d8(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
movl $0x1, 0x4(%rdi)
movl $0x0, 0x38(%rdi)
movl 0x20(%rsi), %edx
movl %edx, 0x8(%rdi)
movq 0x8(%rbx), %rdx
leaq 0x211d8(%rip), %rsi     # 0x3c5c0
movl (%rsi), %esi
addq %rdx, %rsi
movq 0x10(%rdi), %r8
movq 0x18(%rdi), %r9
cmpq %r8, %rsi
cmovbeq %r8, %rsi
movq %rsi, 0x10(%rdi)
leaq 0x211ad(%rip), %rsi     # 0x3c5b4
movl (%rsi), %esi
addq %rdx, %rsi
movq 0x28(%rdi), %r8
cmpq %r8, %rsi
cmovbeq %r8, %rsi
movq %rsi, 0x28(%rdi)
leaq 0x21196(%rip), %rsi     # 0x3c5b8
movl (%rsi), %esi
leaq 0x21185(%rip), %r8      # 0x3c5b0
subl (%r8), %esi
addq %rdx, %rsi
cmpq %r9, %rsi
cmovaq %rsi, %r9
movq %r9, 0x18(%rdi)
movq 0x20(%rdi), %r8
cmpq %r8, %rsi
cmovbeq %r8, %rsi
movq %rsi, 0x20(%rdi)
leaq 0x2112e(%rip), %rsi     # 0x3c580
movslq (%rsi), %rsi
testq %rsi, %rsi
jle 0x1b488
leaq 0x2115b(%rip), %rdi     # 0x3c5bc
movl (%rdi), %edi
addq %rdi, %rdx
xorl %edi, %edi
cmpq %rdi, %rax
je 0x1b480
movq (%rcx,%rdi,8), %r8
movq 0x10(%r8), %r9
cmpq %r9, %rdx
cmovaq %rdx, %r9
movq %r9, 0x10(%r8)
incq %rdi
cmpq %rdi, %rsi
jne 0x1b468
leaq 0x20ff9(%rip), %rax     # 0x3c488
cmpb $0x0, (%rax)
je 0x1c0c9
leaq 0x20fea(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x1c0c9
movq 0x20b21(%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 0x1b4ed
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 0x20acc(%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 0x1b54b
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x17a36(%rip), %rsi     # 0x32fa0
movl $0x20, %edx
movq %rax, %rdi
callq 0x4340
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movq 0x1d8(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq 0x18(%rax), %rsi
jmp 0x1c083
movq 0x8(%rbx), %r8
leaq 0x21012(%rip), %r12     # 0x3c5b0
leaq 0x21003(%rip), %rbp     # 0x3c5a8
movl (%rbp), %edi
addl (%r12), %edi
movq 0x1d8(%rbx), %rax
leaq 0x20fd2(%rip), %r13     # 0x3c58c
movl (%r13), %ecx
movl %ecx, %edx
shrl $0x6, %edx
addl %edi, %edx
leaq 0x21008(%rip), %rdi     # 0x3c5d4
movl (%rdi), %r9d
addl %edx, %r9d
leaq 0x20feb(%rip), %rdi     # 0x3c5c4
movl (%rdi), %edi
addl %r9d, %edi
addq %r8, %rdi
movl 0x18(%rsi), %esi
movq (%rax,%rsi,8), %rsi
movq 0x10(%rsi), %r10
cmpq %r10, %rdi
cmovbeq %r10, %rdi
movq %rdi, 0x10(%rsi)
movl $0x4, 0x38(%rsi)
movl %r9d, 0x3c(%rsi)
leaq 0x20f77(%rip), %r9      # 0x3c580
movslq (%r9), %r9
testq %r9, %r9
jle 0x1b662
shrl $0x5, %ecx
leaq 0x20fad(%rip), %r10     # 0x3c5c8
movl (%r10), %r10d
cmpl %r10d, %ecx
cmovbel %r10d, %ecx
addq %r8, %rcx
leaq 0x20fa1(%rip), %r10     # 0x3c5d0
addl (%r10), %edx
addq %r8, %rdx
xorl %r8d, %r8d
movq (%rax,%r8,8), %r10
movq 0x18(%r10), %r11
movq 0x20(%r10), %r14
cmpq %r14, %rcx
cmovaq %rcx, %r14
cmpq %r11, %rdx
cmovaq %rdx, %r11
movq %r14, 0x20(%r10)
movq %r11, 0x18(%r10)
incq %r8
cmpq %r8, %r9
jne 0x1b638
movq %rdi, 0x18(%rsi)
movq %rdi, 0x20(%rsi)
leaq 0x20e17(%rip), %rax     # 0x3c488
cmpb $0x0, (%rax)
je 0x1c0c9
leaq 0x20e08(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x1c0c9
movq 0x2093f(%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 0x1b6cf
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 0x208ea(%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 0x1b72d
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x178d2(%rip), %rsi     # 0x3301e
movl $0x18, %edx
movq %rax, %rdi
callq 0x4340
movl (%rbp), %eax
addl (%r12), %eax
addq 0x8(%rbx), %rax
movl (%r13), %esi
shrl $0x5, %esi
addq %rax, %rsi
movq %r14, %rdi
callq 0x41e0
movq %rax, %r15
leaq 0x17841(%rip), %r14     # 0x32fc1
movl $0xa, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x4340
leaq 0x1786e(%rip), %rsi     # 0x33005
movl $0x18, %edx
movq %r15, %rdi
callq 0x4340
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movq 0x1d8(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rsi
jmp 0x1bc95
testq %rsi, %rsi
je 0x1c13c
movq (%rsi), %rax
movq %rsi, %rdi
jmp 0x1c0d6
movq 0x8(%rbx), %rdi
movq 0x1d8(%rbx), %rcx
leaq 0x20dca(%rip), %r12     # 0x3c5b0
movl (%r12), %r9d
leaq 0x20ddb(%rip), %r10     # 0x3c5cc
movl (%r10), %r14d
leal (%r14,%r9), %edx
leaq 0x20dc5(%rip), %r8      # 0x3c5c4
addl (%r8), %edx
addq %rdi, %rdx
movl 0x18(%rsi), %esi
movq (%rcx,%rsi,8), %rsi
movq 0x10(%rsi), %r8
cmpq %r8, %rdx
cmovbeq %r8, %rdx
movq %rdx, 0x10(%rsi)
movl $0x2, 0x38(%rsi)
leaq 0x20d63(%rip), %r13     # 0x3c58c
movl (%r13), %r8d
movl %r8d, %r11d
shrl $0x6, %r11d
addl %r9d, %r11d
leaq 0x20d8a(%rip), %r9      # 0x3c5c8
movl (%r9), %r9d
movl %r9d, %ebp
cmpl %r9d, %r14d
jb 0x1b84c
movl (%r10), %ebp
subl %r9d, %r11d
addl %ebp, %r11d
movl %r11d, 0x3c(%rsi)
leaq 0x20d23(%rip), %r10     # 0x3c580
movslq (%r10), %r10
testq %r10, %r10
jle 0x1b8ba
shrl $0x5, %r8d
cmpl %r8d, %r9d
cmoval %r9d, %r8d
leaq 0x20d35(%rip), %r11     # 0x3c5ac
leaq 0x20d2a(%rip), %r14     # 0x3c5a8
addl (%r11), %r9d
subl (%r14), %r9d
addq %rdi, %r8
addl $0x2, %r9d
addq %rdi, %r9
xorl %edi, %edi
movq (%rcx,%rdi,8), %r11
movq 0x18(%r11), %r14
movq 0x20(%r11), %r15
cmpq %r14, %r8
cmovaq %r8, %r14
cmpq %r15, %r9
cmovaq %r9, %r15
movq %r14, 0x18(%r11)
movq %r15, 0x20(%r11)
incq %rdi
cmpq %rdi, %r10
jne 0x1b890
cmpl $0x2, %eax
jne 0x1b8c7
movq %rdx, 0x18(%rsi)
movq %rdx, 0x20(%rsi)
leaq 0x20bba(%rip), %rax     # 0x3c488
cmpb $0x1, (%rax)
jne 0x1bf11
leaq 0x20bab(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x1bf11
movq 0x206e2(%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 0x1b92c
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 0x2068d(%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 0x1b98a
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x17623(%rip), %rsi     # 0x32fcc
movl $0x1e, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x20bef(%rip), %rax     # 0x3c5ac
movl (%rax), %eax
addl (%r12), %eax
addq 0x8(%rbx), %rax
movl (%r13), %esi
shrl $0x5, %esi
addq %rax, %rsi
movq %r14, %rdi
callq 0x41e0
movq %rax, %r15
leaq 0x175de(%rip), %r14     # 0x32fc1
movl $0xa, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x4340
leaq 0x1760b(%rip), %rsi     # 0x33005
movl $0x18, %edx
movq %r15, %rdi
callq 0x4340
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movq 0x1d8(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rsi
jmp 0x1becf
leaq 0x20b56(%rip), %rax     # 0x3c580
movslq (%rax), %rax
testq %rax, %rax
jle 0x1ba6f
leaq 0x20ba3(%rip), %rcx     # 0x3c5dc
movl (%rcx), %ecx
movq %rcx, %rdx
addq 0x8(%rbx), %rdx
movq 0x1d8(%rbx), %rsi
xorl %edi, %edi
movq (%rsi,%rdi,8), %r8
movq %rdx, 0x10(%r8)
movl $0x3, 0x4(%r8)
movl $0x8, 0x38(%r8)
movl %ecx, 0x3c(%r8)
incq %rdi
cmpq %rdi, %rax
jne 0x1ba4b
leaq 0x20a12(%rip), %rax     # 0x3c488
cmpb $0x0, (%rax)
jne 0x1bf8d
jmp 0x1c0c9
movq 0x8(%rbx), %rdi
movq 0x1d8(%rbx), %rax
leaq 0x20b1a(%rip), %r12     # 0x3c5b0
leaq 0x20b0b(%rip), %rbp     # 0x3c5a8
movl (%rbp), %r8d
addl (%r12), %r8d
leaq 0x20ae0(%rip), %r13     # 0x3c58c
movl (%r13), %ecx
movl %ecx, %edx
shrl $0x6, %edx
addl %r8d, %edx
leaq 0x20b15(%rip), %r8      # 0x3c5d4
movl (%r8), %r8d
addl %edx, %r8d
addq %rdi, %r8
movl 0x18(%rsi), %esi
movq (%rax,%rsi,8), %rsi
movq 0x28(%rsi), %r9
cmpq %r9, %r8
cmovbeq %r9, %r8
movq %r8, 0x28(%rsi)
movl $0x3, 0x38(%rsi)
leaq 0x20a94(%rip), %rsi     # 0x3c580
movslq (%rsi), %rsi
testq %rsi, %rsi
jle 0x1bb44
shrl $0x5, %ecx
leaq 0x20aca(%rip), %r8      # 0x3c5c8
movl (%r8), %r8d
cmpl %r8d, %ecx
cmovbel %r8d, %ecx
addq %rdi, %rcx
leaq 0x20abe(%rip), %r8      # 0x3c5d0
addl (%r8), %edx
addq %rdi, %rdx
xorl %edi, %edi
movq (%rax,%rdi,8), %r8
movq 0x18(%r8), %r9
movq 0x20(%r8), %r10
cmpq %r10, %rcx
cmovaq %rcx, %r10
cmpq %r9, %rdx
cmovaq %rdx, %r9
movq %r10, 0x20(%r8)
movq %r9, 0x18(%r8)
incq %rdi
cmpq %rdi, %rsi
jne 0x1bb1a
leaq 0x2093d(%rip), %rax     # 0x3c488
cmpb $0x0, (%rax)
je 0x1c0c9
leaq 0x2092e(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x1c0c9
movq 0x20465(%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 0x1bba9
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 0x20410(%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 0x1bc07
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x173f8(%rip), %rsi     # 0x3301e
movl $0x18, %edx
movq %rax, %rdi
callq 0x4340
movl (%rbp), %eax
addl (%r12), %eax
addq 0x8(%rbx), %rax
movl (%r13), %esi
shrl $0x5, %esi
addq %rax, %rsi
movq %r14, %rdi
callq 0x41e0
movq %rax, %r15
leaq 0x17367(%rip), %r14     # 0x32fc1
movl $0xa, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x4340
leaq 0x1737a(%rip), %rsi     # 0x32feb
movl $0x19, %edx
movq %r15, %rdi
callq 0x4340
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movq 0x1d8(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq 0x28(%rax), %rsi
movq %r15, %rdi
callq 0x41e0
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
movq %r14, %rsi
jmp 0x1c09d
movq 0x8(%rbx), %rdi
leaq 0x208f5(%rip), %r12     # 0x3c5b0
leaq 0x208ca(%rip), %r13     # 0x3c58c
movl (%r13), %eax
movl %eax, %r8d
shrl $0x6, %r8d
addl (%r12), %r8d
leaq 0x208f4(%rip), %rcx     # 0x3c5cc
movl (%rcx), %r9d
leaq 0x208e6(%rip), %rcx     # 0x3c5c8
movl (%rcx), %ecx
cmpl %ecx, %r9d
cmovbel %ecx, %r9d
movq 0x1d8(%rbx), %rdx
subl %ecx, %r8d
addl %r9d, %r8d
addq %rdi, %r8
movl 0x18(%rsi), %esi
movq (%rdx,%rsi,8), %rsi
movq 0x28(%rsi), %r9
cmpq %r9, %r8
cmovbeq %r9, %r8
movq %r8, 0x28(%rsi)
movl $0x1, 0x38(%rsi)
leaq 0x20861(%rip), %rsi     # 0x3c580
movslq (%rsi), %rsi
testq %rsi, %rsi
jle 0x1bd78
shrl $0x5, %eax
cmpl %eax, %ecx
cmoval %ecx, %eax
leaq 0x20876(%rip), %r8      # 0x3c5ac
leaq 0x2086b(%rip), %r9      # 0x3c5a8
addl (%r8), %ecx
subl (%r9), %ecx
addq %rdi, %rax
addl $0x2, %ecx
addq %rdi, %rcx
xorl %edi, %edi
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
cmpq %rdi, %rsi
jne 0x1bd4e
leaq 0x20709(%rip), %rax     # 0x3c488
cmpb $0x0, (%rax)
je 0x1bf11
leaq 0x206fa(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x1bf11
movq 0x20231(%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 0x1bddd
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 0x201dc(%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 0x1be3b
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x17172(%rip), %rsi     # 0x32fcc
movl $0x1e, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x2073e(%rip), %rax     # 0x3c5ac
movl (%rax), %eax
addl (%r12), %eax
addq 0x8(%rbx), %rax
movl (%r13), %esi
shrl $0x5, %esi
addq %rax, %rsi
movq %r14, %rdi
callq 0x41e0
movq %rax, %r15
leaq 0x1712d(%rip), %r14     # 0x32fc1
movl $0xa, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x4340
leaq 0x17140(%rip), %rsi     # 0x32feb
movl $0x19, %edx
movq %r15, %rdi
callq 0x4340
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movq 0x1d8(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq 0x28(%rax), %rsi
movq %r15, %rdi
callq 0x41e0
movq %rax, %r15
movl $0xa, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x4340
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x8(%rsp), %rax
movl $0x5, 0x10(%rax)
movq 0x220(%rbx), %rsi
cmpq 0x228(%rbx), %rsi
je 0x1c0e7
movq %rax, (%rsi)
addq $0x8, 0x220(%rbx)
jmp 0x1c0f8
movl 0x18(%rsi), %eax
movq 0x1d8(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq $0x2, 0x4(%rax)
movl $0x7, 0x38(%rax)
leaq 0x2065f(%rip), %rcx     # 0x3c5c4
movl (%rcx), %ecx
movl %ecx, 0x3c(%rax)
addq 0x8(%rbx), %rcx
movq 0x10(%rax), %rdx
cmpq %rdx, %rcx
cmovbeq %rdx, %rcx
movq %rcx, 0x10(%rax)
leaq 0x20504(%rip), %rax     # 0x3c488
cmpb $0x1, (%rax)
jne 0x1c0c9
leaq 0x204f5(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x1c0c9
movq 0x2002c(%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 0x1bfe2
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 0x1ffd7(%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 0x1c040
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1caba
movq %rax, %r14
leaq 0x16fd8(%rip), %rsi     # 0x33037
movl $0x1b, %edx
movq %rax, %rdi
callq 0x4340
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movq 0x1d8(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0x41e0
movq %rax, %rbx
leaq 0x16f2c(%rip), %rsi     # 0x32fc1
movl $0xa, %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 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1c13c
movq (%rdi), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
leaq 0x218(%rbx), %rdi
leaq 0x8(%rsp), %rdx
callq 0x18056
leaq 0x204ad(%rip), %rax     # 0x3c5ac
movl (%rax), %eax
addl (%r12), %eax
movl %eax, 0x14(%rsp)
movq 0x238(%rbx), %rsi
cmpq 0x240(%rbx), %rsi
je 0x1c128
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x238(%rbx)
jmp 0x1c13c
addq $0x230, %rbx            # imm = 0x230
leaq 0x14(%rsp), %rdx
movq %rbx, %rdi
callq 0x14060
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1fe9e(%rip), %rdi     # 0x3bff0
leaq 0x14ec9(%rip), %rsi     # 0x31022
callq 0x42e0
leaq 0x16eee(%rip), %rsi     # 0x33053
movq %rax, %rdi
callq 0x42e0
leaq 0x156c3(%rip), %rsi     # 0x31837
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movl $0x97, %esi
callq 0x4500
leaq 0x14eb1(%rip), %rsi     # 0x31041
movq %rax, %rdi
callq 0x42e0
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x4290
leaq 0x16eb9(%rip), %rsi     # 0x33064
movq %rax, %rdi
callq 0x42e0
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x1caba
leaq 0x18ac4(%rip), %rsi     # 0x34c8b
movq %rax, %rdi
callq 0x42e0
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x1827f(%rip), %rsi     # 0x34461
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
nop