// File: estwings57[P]CasHMC/sources/DRAM.cpp
// Function: CasHMC::DRAM::PrintState()
void DRAM::PrintState()
{
	bool printDR = false;
	for(int b=0; b<NUM_BANKS; b++) {
		if(previousBankState[b] != bankStates[b]->currentBankState) {
			printDR = true;
			break;
		}
	}
	
	if(printDR) {
		STATEN(ALI(17)<<header);
		STATEN("State");
		for(int b=0; b<NUM_BANKS; b++) {
			previousBankState[b] = bankStates[b]->currentBankState;
			STATEN("[");
			STATEN(*bankStates[b]);
			if(bankStates[b]->currentBankState == ROW_ACTIVE) {
				STATEN("-"<<bankStates[b]->openRowAddress);
			}
			STATEN("]");
		}
		STATEN(endl);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movb $0x0, -0x9(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
leaq 0x37237(%rip), %rcx     # 0x66620
cmpl (%rcx), %eax
jge 0x2f43b
movq -0x28(%rbp), %rdi
addq $0x1f0, %rdi            # imm = 0x1F0
movslq -0x10(%rbp), %rsi
callq 0x2f960
movq -0x28(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
addq $0x1d8, %rdi            # imm = 0x1D8
movslq -0x10(%rbp), %rsi
callq 0x22c30
movq %rax, %rcx
movl -0x2c(%rbp), %eax
movq (%rcx), %rcx
cmpl 0x4(%rcx), %eax
je 0x2f42e
movb $0x1, -0x9(%rbp)
jmp 0x2f43b
jmp 0x2f430
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2f3df
testb $0x1, -0x9(%rbp)
je 0x2f60c
leaq 0x370de(%rip), %rax     # 0x6652a
testb $0x1, (%rax)
je 0x2f49b
movl $0x11, %edi
callq 0x177b0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
movq 0x36b68(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0x38(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x38(%rbp), %rdi
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %esi
callq 0x4550
movq -0x28(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
leaq 0x37088(%rip), %rax     # 0x6652a
testb $0x1, (%rax)
je 0x2f4ba
movq 0x36b22(%rip), %rdi     # 0x65fd0
leaq 0x23c2b(%rip), %rsi     # 0x530e0
callq 0x4380
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
leaq 0x37155(%rip), %rcx     # 0x66620
cmpl (%rcx), %eax
jge 0x2f5eb
movq -0x28(%rbp), %rdi
addq $0x1d8, %rdi            # imm = 0x1D8
movslq -0x1c(%rbp), %rsi
callq 0x22c30
movq -0x28(%rbp), %rdi
movq (%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
addq $0x1f0, %rdi            # imm = 0x1F0
movslq -0x1c(%rbp), %rsi
callq 0x2f960
movl -0x3c(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x3701a(%rip), %rax     # 0x6652a
testb $0x1, (%rax)
je 0x2f528
movq 0x36ab4(%rip), %rdi     # 0x65fd0
leaq 0x22b81(%rip), %rsi     # 0x520a4
callq 0x4380
leaq 0x36ffb(%rip), %rax     # 0x6652a
testb $0x1, (%rax)
je 0x2f557
movq -0x28(%rbp), %rdi
addq $0x1d8, %rdi            # imm = 0x1D8
movslq -0x1c(%rbp), %rsi
callq 0x22c30
movq (%rax), %rsi
movq 0x36a7e(%rip), %rdi     # 0x65fd0
callq 0x72d0
movq -0x28(%rbp), %rdi
addq $0x1d8, %rdi            # imm = 0x1D8
movslq -0x1c(%rbp), %rsi
callq 0x22c30
movq (%rax), %rax
cmpl $0x1, 0x4(%rax)
jne 0x2f5bc
leaq 0x36faf(%rip), %rax     # 0x6652a
testb $0x1, (%rax)
je 0x2f5ba
movq 0x36a49(%rip), %rdi     # 0x65fd0
leaq 0x223a7(%rip), %rsi     # 0x51935
callq 0x4380
movq -0x28(%rbp), %rdi
movq %rax, -0x48(%rbp)
addq $0x1d8, %rdi            # imm = 0x1D8
movslq -0x1c(%rbp), %rsi
callq 0x22c30
movq -0x48(%rbp), %rdi
movq (%rax), %rax
movl 0x8(%rax), %esi
callq 0x44c0
jmp 0x2f5bc
leaq 0x36f67(%rip), %rax     # 0x6652a
testb $0x1, (%rax)
je 0x2f5db
movq 0x36a01(%rip), %rdi     # 0x65fd0
leaq 0x23444(%rip), %rsi     # 0x52a1a
callq 0x4380
jmp 0x2f5dd
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2f4c1
leaq 0x36f38(%rip), %rax     # 0x6652a
testb $0x1, (%rax)
je 0x2f60a
movq 0x369d2(%rip), %rdi     # 0x65fd0
movq 0x369ab(%rip), %rsi     # 0x65fb0
callq 0x43c0
jmp 0x2f60c
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)