// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/CommandQueue.cpp
// Function: CasHMC::CommandQueue::CommandQueue(std::basic_ofstream<char, std::char_traits<char>>&, std::basic_ofstream<char, std::char_traits<char>>&, unsigned int, CasHMC::VaultController*)
CommandQueue::CommandQueue(ofstream &debugOut_, ofstream &stateOut_, unsigned id, VaultController *parent):
	SimulatorObject(debugOut_, stateOut_),
	cmdQueID(id),
	vaultContP(parent)
{
	classID << cmdQueID;
	header = "        (CQ_" + classID.str();
	
	refreshWaiting = false;
	issuedBank = 0;
	
	atomicLock = vector<bool>(NUM_BANKS,false);
	atomicLockTag = vector<unsigned>(NUM_BANKS,0);
	tFAWCountdown.reserve(4);
	rowAccessCounter = vector<unsigned>(NUM_BANKS,0);
	if(QUE_PER_BANK) {
		bufPopDelayPerBank = vector<int>(NUM_BANKS, 0);
		queue = vector< vector<DRAMCommand *> >(NUM_BANKS, vector<DRAMCommand *>());
		for(int b=0; b<NUM_BANKS; b++) {
			queue[b].reserve(MAX_CMD_QUE);
		}
	}
	else {
		bufPopDelayPerBank = vector<int>(1, 0);
		queue = vector< vector<DRAMCommand *> >(1, vector<DRAMCommand *>());
		queue[0].reserve(MAX_CMD_QUE);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, %r14
movl %ecx, %r15d
movq %rdi, %rbx
callq 0x10de6
leaq 0x21d59(%rip), %rax     # 0x30980
movq %rax, (%rbx)
movl %r15d, 0x1c8(%rbx)
movq %r14, 0x1d8(%rbx)
andq $0x0, 0x1e0(%rbx)
andl $0x0, 0x1e8(%rbx)
andq $0x0, 0x1f0(%rbx)
leaq 0x1e0(%rbx), %rax
movq %rax, 0x70(%rsp)
andl $0x0, 0x1f8(%rbx)
leaq 0x208(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0x220(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x238(%rbx), %r13
leaq 0x250(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x268(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0x50(%rbx), %rdi
movl %r15d, %esi
xorps %xmm0, %xmm0
movups %xmm0, 0x200(%rbx)
movups %xmm0, 0x210(%rbx)
movups %xmm0, 0x220(%rbx)
movups %xmm0, 0x230(%rbx)
movups %xmm0, 0x240(%rbx)
movups %xmm0, 0x250(%rbx)
movups %xmm0, 0x260(%rbx)
movups %xmm0, 0x270(%rbx)
callq 0x4210
leaq 0x58(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x4450
leaq 0x16c8f(%rip), %rsi     # 0x25984
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xdcaa
leaq 0x20(%rbx), %rdi
leaq 0x30(%rsp), %r15
movq %r15, %rsi
callq 0x4380
movq %r15, %rdi
callq 0x4598
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x4598
xorl %eax, %eax
movb %al, 0x1d0(%rbx)
andl $0x0, 0x1cc(%rbx)
leaq 0x22840(%rip), %r12     # 0x31580
movslq (%r12), %rsi
movb %al, (%r15)
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x7(%rsp), %rcx
callq 0x10e3e
leaq 0x30(%rsp), %r15
movq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x10ea2
movq %r15, %rdi
callq 0x10ef4
movslq (%r12), %rsi
leaq 0x10(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0xdf0a
leaq 0x30(%rsp), %r15
movq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0xe1fc
movq %r15, %rdi
callq 0xe140
pushq $0x4
popq %rsi
movq 0x60(%rsp), %rdi
callq 0x10f04
movslq (%r12), %rsi
leaq 0x10(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0xdf0a
leaq 0x30(%rsp), %r15
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0xe1fc
movq %r15, %rdi
callq 0xe140
leaq 0x2279d(%rip), %rax     # 0x31590
cmpb $0x1, (%rax)
jne 0xeea9
movslq (%r12), %rsi
leaq 0x10(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0x10f9a
leaq 0x30(%rsp), %r15
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x114a8
movq %r15, %rdi
callq 0x1129c
movslq (%r12), %rsi
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0x10ff0
leaq 0x30(%rsp), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x116ec
movq %r15, %rdi
callq 0x11046
leaq 0x10(%rsp), %rdi
callq 0x114fa
xorl %r15d, %r15d
leaq 0x22648(%rip), %rbp     # 0x314c8
xorl %r14d, %r14d
movslq (%r12), %rax
cmpq %rax, %r14
jge 0xef34
movq (%r13), %rdi
addq %r15, %rdi
movslq (%rbp), %rsi
callq 0x11068
incq %r14
addq $0x18, %r15
jmp 0xee83
leaq 0x10(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x7(%rsp), %rcx
callq 0x10f9a
leaq 0x30(%rsp), %r15
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x114a8
movq %r15, %rdi
callq 0x1129c
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0x30(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x7(%rsp), %rcx
callq 0x10ff0
leaq 0x30(%rsp), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x116ec
movq %r15, %rdi
callq 0x11046
leaq 0x10(%rsp), %rdi
callq 0x114fa
movq (%r13), %rdi
leaq 0x2259c(%rip), %rax     # 0x314c8
movslq (%rax), %rsi
callq 0x11068
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xef45
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x114fa
jmp 0xef74
jmp 0xef71
jmp 0xef71
jmp 0xef71
jmp 0xef71
jmp 0xef71
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x4598
jmp 0xef74
jmp 0xef71
jmp 0xef71
movq %rax, %r14
movq 0x58(%rsp), %rdi
callq 0xe140
movq 0x60(%rsp), %rdi
callq 0xe140
movq %r13, %rdi
callq 0x11046
movq 0x8(%rsp), %rdi
callq 0x1129c
movq 0x68(%rsp), %rdi
callq 0xe140
movq 0x70(%rsp), %rdi
callq 0x10ef4
movq %rbx, %rdi
callq 0x11246
movq %r14, %rdi
callq 0x4520