// File: /workspace/github_cpp_makefile_star2_O1/estwings57[P]CasHMC/sources/DRAM.cpp
// Function: CasHMC::DRAM::DRAM(std::basic_ofstream<char, std::char_traits<char>>&, std::basic_ofstream<char, std::char_traits<char>>&, unsigned int, CasHMC::VaultController*)
DRAM::DRAM(ofstream &debugOut_, ofstream &stateOut_, unsigned id, VaultController *contP):
	SimulatorObject(debugOut_, stateOut_),
	DRAMID(id),
	vaultContP(contP)
{
	classID << DRAMID;
	header = "        (DR_" + classID.str() + ")";
	
	readData = NULL;
	dataCyclesLeft = 0;

	bankStates.reserve(NUM_BANKS);
	for(int b=0; b<NUM_BANKS; b++) {
		bankStates.push_back(new BankState(b));
	}
	previousBankState = vector<BankStateType>(NUM_BANKS, IDLE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %r14
movl %ecx, %ebp
movq %rdi, %rbx
callq 0x17976
leaq 0x20b4e(%rip), %rax     # 0x3ba80
movq %rax, (%rbx)
movl %ebp, 0x1c8(%rbx)
movq %r14, 0x1d0(%rbx)
leaq 0x1d8(%rbx), %r14
leaq 0x1f0(%rbx), %rax
movq %rax, (%rsp)
leaq 0x50(%rbx), %rdi
movl %ebp, %esi
xorps %xmm0, %xmm0
movups %xmm0, 0x1d8(%rbx)
movups %xmm0, 0x1e8(%rbx)
movups %xmm0, 0x1f8(%rbx)
movups %xmm0, 0x218(%rbx)
movups %xmm0, 0x228(%rbx)
movups %xmm0, 0x238(%rbx)
callq 0x41e0
leaq 0x58(%rbx), %rsi
leaq 0x48(%rsp), %rdi
callq 0x4450
leaq 0x17ff2(%rip), %rcx     # 0x32f93
leaq 0x48(%rsp), %rdi
movl $0xc, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x4320
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1afdc
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x1afe4
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1945a(%rip), %rsi     # 0x34461
callq 0x4580
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b033
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1b03a
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %r12
movq %rdx, 0x8(%r12)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x4370
movq (%r12), %rdi
cmpq %r15, %rdi
je 0x1b079
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1b090
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b0ab
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4300
movq $0x0, 0x208(%rbx)
movl $0x0, 0x210(%rbx)
leaq 0x214b9(%rip), %r15     # 0x3c580
movslq (%r15), %rsi
movq %r14, %rdi
callq 0x1c712
movl (%r15), %eax
testl %eax, %eax
jle 0x1b110
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movl $0x40, %edi
callq 0x42f0
movq %rax, %r13
movq %rax, %rdi
movl %ebp, %esi
callq 0x63bc
movq %r13, 0x8(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1c842
incl %ebp
movl (%r15), %eax
cmpl %eax, %ebp
jl 0x1b0e0
movslq %eax, %rsi
leaq 0x28(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rcx
callq 0x1c7a8
leaq 0x8(%rsp), %rbx
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x1c9ae
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1b153
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1b1b1
movq %rax, %r12
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1b183
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x1b183
movq %rax, %r12
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b1b4
movq 0x58(%rsp), %rsi
incq %rsi
jmp 0x1b1aa
jmp 0x1b1b1
jmp 0x1b1b1
movq %rax, %r12
movl $0x40, %esi
movq %r13, %rdi
callq 0x4300
jmp 0x1b1b4
movq %rax, %r12
leaq 0x218(%rbx), %r15
movq 0x230(%rbx), %rdi
testq %rdi, %rdi
je 0x1b1d6
movq 0x240(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%r15), %rdi
testq %rdi, %rdi
je 0x1b1ed
movq 0x228(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1b208
movq 0x200(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1b21f
movq 0x1e8(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x17d50
movq %r12, %rdi
callq 0x4540
nop