// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b8f3
leaq 0x173ef(%rip), %rcx     # 0x31fd0
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)
movl $0x0, 0x38(%rsi)
movl 0x20(%rbx), %edx
movl %edx, 0x8(%rsi)
movq 0x8(%r14), %rdx
leaq 0x209a9(%rip), %rdi     # 0x3b5c0
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 0x2097e(%rip), %rdi     # 0x3b5b4
movl (%rdi), %edi
addq %rdx, %rdi
movq 0x28(%rsi), %r8
cmpq %r8, %rdi
cmovbeq %r8, %rdi
movq %rdi, 0x28(%rsi)
leaq 0x20967(%rip), %rdi     # 0x3b5b8
movl (%rdi), %edi
leaq 0x20956(%rip), %r8      # 0x3b5b0
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 0x208ff(%rip), %rsi     # 0x3b580
movslq (%rsi), %rsi
testq %rsi, %rsi
jle 0x1acb7
leaq 0x2092c(%rip), %rdi     # 0x3b5bc
movl (%rdi), %edi
addq %rdi, %rdx
xorl %edi, %edi
cmpq %rdi, %rax
je 0x1acaf
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 0x1ac97
leaq 0x207ca(%rip), %rax     # 0x3b488
cmpb $0x0, (%rax)
je 0x1b45d
leaq 0x207bb(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x1b45d
movq 0x202f2(%rip), %rax     # 0x3afd0
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 0x1ad15
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0x202a4(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x1ad6d
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c32a
movq %rax, %r15
leaq 0x17285(%rip), %rsi     # 0x32010
movl $0x20, %edx
movq %rax, %rdi
callq 0x4340
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x18(%rax), %rsi
jmp 0x1b832
movq 0x8(%r14), %rsi
movq 0x1d8(%r14), %rax
leaq 0x207ef(%rip), %rcx     # 0x3b5b0
leaq 0x207e0(%rip), %r13     # 0x3b5a8
movl (%r13), %edi
addl (%rcx), %edi
leaq 0x207b7(%rip), %rbp     # 0x3b58c
movl (%rbp), %ecx
movl %ecx, %edx
shrl $0x6, %edx
addl %edi, %edx
leaq 0x207ee(%rip), %rdi     # 0x3b5d4
movl (%rdi), %edi
addl %edx, %edi
addq %rsi, %rdi
movl 0x18(%rbx), %r8d
movq (%rax,%r8,8), %r8
movq 0x28(%r8), %r9
cmpq %r9, %rdi
cmovbeq %r9, %rdi
movq %rdi, 0x28(%r8)
movl $0x3, 0x38(%r8)
leaq 0x2076d(%rip), %rdi     # 0x3b580
movslq (%rdi), %rdi
testq %rdi, %rdi
jle 0x1ae6b
shrl $0x5, %ecx
leaq 0x207a3(%rip), %r8      # 0x3b5c8
movl (%r8), %r8d
cmpl %r8d, %ecx
cmovbel %r8d, %ecx
addq %rsi, %rcx
leaq 0x20797(%rip), %r8      # 0x3b5d0
addl (%r8), %edx
addq %rsi, %rdx
xorl %esi, %esi
movq (%rax,%rsi,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 %rsi
cmpq %rsi, %rdi
jne 0x1ae41
leaq 0x20616(%rip), %rax     # 0x3b488
cmpb $0x0, (%rax)
je 0x1b45d
leaq 0x20607(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x1b45d
movq 0x2013e(%rip), %rax     # 0x3afd0
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 0x1aec9
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0x200f0(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x1af21
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c32a
movq %rax, %r15
leaq 0x1714f(%rip), %rsi     # 0x3208e
movl $0x18, %edx
movq %rax, %rdi
callq 0x4340
movl (%r13), %eax
leaq 0x20659(%rip), %rcx     # 0x3b5b0
addl (%rcx), %eax
addq 0x8(%r14), %rax
movl (%rbp), %esi
shrl $0x5, %esi
addq %rax, %rsi
movq %r15, %rdi
callq 0x41e0
movq %rax, %r12
leaq 0x170b9(%rip), %r15     # 0x32031
movl $0xa, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4340
leaq 0x170cc(%rip), %rsi     # 0x3205b
movl $0x19, %edx
movq %r12, %rdi
callq 0x4340
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x28(%rax), %rsi
jmp 0x1b1cc
movq 0x8(%r14), %rdi
leaq 0x205f2(%rip), %rax     # 0x3b5b0
leaq 0x205e3(%rip), %r13     # 0x3b5a8
movl (%r13), %esi
addl (%rax), %esi
movq 0x1d8(%r14), %rax
leaq 0x205b3(%rip), %rbp     # 0x3b58c
movl (%rbp), %ecx
movl %ecx, %edx
shrl $0x6, %edx
addl %esi, %edx
leaq 0x205ea(%rip), %rsi     # 0x3b5d4
movl (%rsi), %r9d
addl %edx, %r9d
leaq 0x205cd(%rip), %rsi     # 0x3b5c4
movl (%rsi), %esi
addl %r9d, %esi
addq %rdi, %rsi
movl 0x18(%rbx), %r8d
movq (%rax,%r8,8), %r8
movq 0x10(%r8), %r10
cmpq %r10, %rsi
cmovbeq %r10, %rsi
movq %rsi, 0x10(%r8)
movl $0x4, 0x38(%r8)
movl %r9d, 0x3c(%r8)
leaq 0x20557(%rip), %r9      # 0x3b580
movslq (%r9), %r9
testq %r9, %r9
jle 0x1b081
shrl $0x5, %ecx
leaq 0x2058d(%rip), %r10     # 0x3b5c8
movl (%r10), %r10d
cmpl %r10d, %ecx
cmovbel %r10d, %ecx
addq %rdi, %rcx
leaq 0x20581(%rip), %r10     # 0x3b5d0
addl (%r10), %edx
addq %rdi, %rdx
xorl %edi, %edi
movq (%rax,%rdi,8), %r10
movq 0x18(%r10), %r11
movq 0x20(%r10), %r15
cmpq %r15, %rcx
cmovaq %rcx, %r15
cmpq %r11, %rdx
cmovaq %rdx, %r11
movq %r15, 0x20(%r10)
movq %r11, 0x18(%r10)
incq %rdi
cmpq %rdi, %r9
jne 0x1b057
movq %rsi, 0x18(%r8)
movq %rsi, 0x20(%r8)
leaq 0x203f8(%rip), %rax     # 0x3b488
cmpb $0x0, (%rax)
je 0x1b45d
leaq 0x203e9(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x1b45d
movq 0x1ff20(%rip), %rax     # 0x3afd0
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 0x1b0e7
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0x1fed2(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x1b13f
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c32a
movq %rax, %r15
leaq 0x16f31(%rip), %rsi     # 0x3208e
movl $0x18, %edx
movq %rax, %rdi
callq 0x4340
movl (%r13), %eax
leaq 0x2043b(%rip), %rcx     # 0x3b5b0
addl (%rcx), %eax
addq 0x8(%r14), %rax
movl (%rbp), %esi
shrl $0x5, %esi
addq %rax, %rsi
movq %r15, %rdi
callq 0x41e0
movq %rax, %r12
leaq 0x16e9b(%rip), %r15     # 0x32031
movl $0xa, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4340
leaq 0x16ec8(%rip), %rsi     # 0x32075
movl $0x18, %edx
movq %r12, %rdi
callq 0x4340
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x41e0
movq %rax, %r14
movl $0xa, %edx
movq %rax, %rdi
movq %r15, %rsi
jmp 0x1b84c
movq 0x8(%r14), %rsi
leaq 0x203be(%rip), %r13     # 0x3b5b0
leaq 0x20393(%rip), %rbp     # 0x3b58c
movl (%rbp), %eax
movl %eax, %edi
shrl $0x6, %edi
addl (%r13), %edi
leaq 0x203c0(%rip), %rcx     # 0x3b5cc
movl (%rcx), %r8d
leaq 0x203b2(%rip), %rcx     # 0x3b5c8
movl (%rcx), %ecx
cmpl %ecx, %r8d
cmovbel %ecx, %r8d
movq 0x1d8(%r14), %rdx
subl %ecx, %edi
addl %r8d, %edi
addq %rsi, %rdi
movl 0x18(%rbx), %r8d
movq (%rdx,%r8,8), %r8
movq 0x28(%r8), %r9
cmpq %r9, %rdi
cmovbeq %r9, %rdi
movq %rdi, 0x28(%r8)
movl $0x1, 0x38(%r8)
leaq 0x2032c(%rip), %rdi     # 0x3b580
movslq (%rdi), %rdi
testq %rdi, %rdi
jle 0x1b2ad
shrl $0x5, %eax
cmpl %eax, %ecx
cmoval %ecx, %eax
leaq 0x20341(%rip), %r8      # 0x3b5ac
leaq 0x20336(%rip), %r9      # 0x3b5a8
addl (%r8), %ecx
subl (%r9), %ecx
addq %rsi, %rax
addl $0x2, %ecx
addq %rsi, %rcx
xorl %esi, %esi
movq (%rdx,%rsi,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 %rsi
cmpq %rsi, %rdi
jne 0x1b283
leaq 0x201d4(%rip), %rax     # 0x3b488
cmpb $0x0, (%rax)
je 0x1b6d8
leaq 0x201c5(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x1b6d8
movq 0x1fcfc(%rip), %rax     # 0x3afd0
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 0x1b30b
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0x1fcae(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x1b363
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c32a
movq %rax, %r15
leaq 0x16cbb(%rip), %rsi     # 0x3203c
movl $0x1e, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x20217(%rip), %rax     # 0x3b5ac
movl (%rax), %eax
addl (%r13), %eax
addq 0x8(%r14), %rax
movl (%rbp), %esi
shrl $0x5, %esi
addq %rax, %rsi
movq %r15, %rdi
callq 0x41e0
movq %rax, %r12
leaq 0x16c77(%rip), %r15     # 0x32031
movl $0xa, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4340
leaq 0x16c8a(%rip), %rsi     # 0x3205b
movl $0x19, %edx
movq %r12, %rdi
callq 0x4340
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x28(%rax), %rsi
jmp 0x1b695
leaq 0x20184(%rip), %rax     # 0x3b580
movslq (%rax), %rax
testq %rax, %rax
jle 0x1b441
leaq 0x201d1(%rip), %rcx     # 0x3b5dc
movl (%rcx), %ecx
movq %rcx, %rdx
addq 0x8(%r14), %rdx
movq 0x1d8(%r14), %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 0x1b41d
leaq 0x20040(%rip), %rax     # 0x3b488
cmpb $0x0, (%rax)
je 0x1b45d
leaq 0x20035(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
je 0x1b75f
testq %rbx, %rbx
jne 0x1b878
jmp 0x1b8e4
movq 0x8(%r14), %rsi
movq 0x1d8(%r14), %rax
leaq 0x20133(%rip), %r13     # 0x3b5b0
movl (%r13), %r8d
leaq 0x20144(%rip), %rcx     # 0x3b5cc
movl (%rcx), %r9d
leal (%r9,%r8), %ecx
leaq 0x2012e(%rip), %rdx     # 0x3b5c4
addl (%rdx), %ecx
addq %rsi, %rcx
movl 0x18(%rbx), %edx
movq (%rax,%rdx,8), %rdx
movq 0x10(%rdx), %rdi
cmpq %rdi, %rcx
cmovbeq %rdi, %rcx
movq %rcx, 0x10(%rdx)
movl $0x2, 0x38(%rdx)
leaq 0x200cd(%rip), %rbp     # 0x3b58c
movl (%rbp), %edi
movl %edi, %r10d
shrl $0x6, %r10d
addl %r8d, %r10d
leaq 0x200f5(%rip), %r8      # 0x3b5c8
movl (%r8), %r8d
cmpl %r8d, %r9d
cmovbel %r8d, %r9d
subl %r8d, %r10d
addl %r9d, %r10d
movl %r10d, 0x3c(%rdx)
leaq 0x20092(%rip), %r9      # 0x3b580
movslq (%r9), %r9
testq %r9, %r9
jle 0x1b54a
shrl $0x5, %edi
cmpl %edi, %r8d
cmoval %r8d, %edi
leaq 0x200a5(%rip), %r10     # 0x3b5ac
leaq 0x2009a(%rip), %r11     # 0x3b5a8
addl (%r10), %r8d
subl (%r11), %r8d
addq %rsi, %rdi
addl $0x2, %r8d
addq %rsi, %r8
xorl %esi, %esi
movq (%rax,%rsi,8), %r10
movq 0x18(%r10), %r11
movq 0x20(%r10), %r15
cmpq %r11, %rdi
cmovaq %rdi, %r11
cmpq %r15, %r8
cmovaq %r8, %r15
movq %r11, 0x18(%r10)
movq %r15, 0x20(%r10)
incq %rsi
cmpq %rsi, %r9
jne 0x1b520
movq %rcx, 0x18(%rdx)
movq %rcx, 0x20(%rdx)
leaq 0x1ff2f(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x1b6d8
leaq 0x1ff20(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x1b6d8
movq 0x1fa57(%rip), %rax     # 0x3afd0
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 0x1b5b0
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0x1fa09(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x1b608
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c32a
movq %rax, %r15
leaq 0x16a16(%rip), %rsi     # 0x3203c
movl $0x1e, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x1ff72(%rip), %rax     # 0x3b5ac
movl (%rax), %eax
addl (%r13), %eax
addq 0x8(%r14), %rax
movl (%rbp), %esi
shrl $0x5, %esi
addq %rax, %rsi
movq %r15, %rdi
callq 0x41e0
movq %rax, %r12
leaq 0x169d2(%rip), %r15     # 0x32031
movl $0xa, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4340
leaq 0x169ff(%rip), %rsi     # 0x32075
movl $0x18, %edx
movq %r12, %rdi
callq 0x4340
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x41e0
movq %rax, %r12
movl $0xa, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4340
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movl $0x5, 0x10(%rbx)
movq 0x220(%r14), %rsi
cmpq 0x228(%r14), %rsi
je 0x1b88f
movq %rbx, (%rsi)
addq $0x8, 0x220(%r14)
jmp 0x1b8a0
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq $0x2, 0x4(%rax)
movl $0x7, 0x38(%rax)
leaq 0x1fe9d(%rip), %rcx     # 0x3b5c4
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 0x1fd42(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x1b878
leaq 0x1fd33(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x1b878
movq 0x1f86a(%rip), %rax     # 0x3afd0
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 0x1b79d
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0x1f81c(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x1b7f5
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c32a
movq %rax, %r15
leaq 0x16894(%rip), %rsi     # 0x320a7
movl $0x1b, %edx
movq %rax, %rdi
callq 0x4340
movl 0x18(%rbx), %eax
movq 0x1d8(%r14), %rcx
movq (%rcx,%rax,8), %rax
movq 0x10(%rax), %rsi
movq %r15, %rdi
callq 0x41e0
movq %rax, %r14
leaq 0x167ed(%rip), %rsi     # 0x32031
movl $0xa, %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 (%rbx), %rax
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
leaq 0x218(%r14), %rdi
leaq 0x10(%rsp), %rdx
callq 0x17874
leaq 0x1fd05(%rip), %rax     # 0x3b5ac
movl (%rax), %eax
addl (%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x238(%r14), %rsi
cmpq 0x240(%r14), %rsi
je 0x1b8d0
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x238(%r14)
jmp 0x1b8e4
addq $0x230, %r14            # imm = 0x230
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x13c06
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1f6f6(%rip), %rdi     # 0x3aff0
leaq 0x14721(%rip), %rsi     # 0x30022
callq 0x42e0
leaq 0x167b6(%rip), %rsi     # 0x320c3
movq %rax, %rdi
callq 0x42e0
leaq 0x14f7b(%rip), %rsi     # 0x30897
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movl $0x97, %esi
callq 0x4500
leaq 0x14709(%rip), %rsi     # 0x30041
movq %rax, %rdi
callq 0x42e0
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x4290
leaq 0x16781(%rip), %rsi     # 0x320d4
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1c32a
leaq 0x1839e(%rip), %rsi     # 0x33d0b
movq %rax, %rdi
callq 0x42e0
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x17b59(%rip), %rsi     # 0x334e1
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
nop