// File: /workspace/github_cpp_makefile_star2_O3/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 0x16fc6
leaq 0x2033e(%rip), %rax     # 0x3aa80
movq %rax, (%rbx)
movl %ebp, 0x1c8(%rbx)
movq %r14, 0x1d0(%rbx)
leaq 0x1d8(%rbx), %r14
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 0x1785d(%rip), %rcx     # 0x32003
leaq 0x48(%rsp), %rdi
movl $0xc, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x4320
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1a7e2
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x1a7ea
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x18cd4(%rip), %rsi     # 0x334e1
callq 0x4580
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1a838
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x1a840
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rsp, %r15
movq %rdx, 0x8(%r15)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x4370
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x1a87b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a892
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a8ad
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4300
movq $0x0, 0x208(%rbx)
movl $0x0, 0x210(%rbx)
leaq 0x20cb7(%rip), %r13     # 0x3b580
movslq (%r13), %rsi
movq %r14, %rdi
callq 0x1beca
movl (%r13), %eax
testl %eax, %eax
jle 0x1a912
xorl %ebp, %ebp
movq %rsp, %r15
movl $0x40, %edi
callq 0x42f0
movq %rax, %r12
movq %rax, %rdi
movl %ebp, %esi
callq 0x639c
movq %r12, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1c0fe
incl %ebp
movl (%r13), %eax
cmpl %eax, %ebp
jl 0x1a8e2
movslq %eax, %rsi
leaq 0x28(%rsp), %rdx
movl $0x0, (%rdx)
movq %rsp, %rdi
leaq 0x48(%rsp), %rcx
callq 0x1bf66
movq 0x1f0(%rbx), %rdi
movq 0x200(%rbx), %rsi
movaps (%rsp), %xmm0
movups %xmm0, 0x1f0(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x200(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
testq %rdi, %rdi
je 0x1a985
subq %rdi, %rsi
callq 0x4300
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1a985
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a9e3
movq %rax, %r15
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x1a9b5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x1a9b5
movq %rax, %r15
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1a9e6
movq 0x58(%rsp), %rsi
incq %rsi
jmp 0x1a9dc
jmp 0x1a9e3
jmp 0x1a9e3
movq %rax, %r15
movl $0x40, %esi
movq %r12, %rdi
callq 0x4300
jmp 0x1a9e6
movq %rax, %r15
leaq 0x218(%rbx), %r12
movq 0x230(%rbx), %rdi
testq %rdi, %rdi
je 0x1aa08
movq 0x240(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%r12), %rdi
testq %rdi, %rdi
je 0x1aa20
movq 0x228(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x1f0(%rbx), %rdi
testq %rdi, %rdi
je 0x1aa3b
movq 0x200(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1aa52
movq 0x1e8(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x175ae
movq %r15, %rdi
callq 0x4540