// File: /workspace/github_cpp_makefile_star2_O3/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 $0x88, %rsp
movq %r8, %r14
movl %ecx, %ebp
movq %rdi, %rbx
callq 0x16fc6
leaq 0x26723(%rip), %rax     # 0x3a968
movq %rax, (%rbx)
movl %ebp, 0x1c8(%rbx)
movq %r14, 0x1d8(%rbx)
leaq 0x1e0(%rbx), %rax
movq %rax, 0x58(%rsp)
xorl %eax, %eax
movq %rax, 0x1e0(%rbx)
movl %eax, 0x1e8(%rbx)
movq %rax, 0x1f0(%rbx)
movl %eax, 0x1f8(%rbx)
leaq 0x238(%rbx), %r15
leaq 0x250(%rbx), %rax
movq %rax, 0x80(%rsp)
leaq 0x50(%rbx), %rdi
movl %ebp, %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 0x41e0
leaq 0x58(%rbx), %rsi
leaq 0x60(%rsp), %rdi
callq 0x4450
leaq 0x1d72e(%rip), %rcx     # 0x31a1c
leaq 0x60(%rsp), %rdi
movl $0xc, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x4320
leaq 0x20(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x14329
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x14330
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x58(%rsp), %r14
movq 0x8(%rax), %rdx
leaq 0x10(%rsp), %r13
movq %rdx, 0x8(%r13)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20(%rbx), %rdi
movq %r13, %rsi
callq 0x4370
movq (%r13), %rdi
cmpq %rbp, %rdi
je 0x14373
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1438e
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
xorl %eax, %eax
movb %al, 0x1d0(%rbx)
movl $0x0, 0x1cc(%rbx)
leaq 0x271d9(%rip), %rbp     # 0x3b580
movslq (%rbp), %rsi
leaq 0x60(%rsp), %rdx
movb %al, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rcx
callq 0x1702a
movq %r14, %rdi
callq 0x175f4
leaq 0x10(%rsp), %rdi
movq 0x20(%rdi), %rax
movq %rax, 0x20(%r14)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movslq (%rbp), %rsi
leaq 0x60(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x40(%rsp), %rcx
callq 0x17092
movq 0x208(%rbx), %rdi
movq 0x218(%rbx), %rsi
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x208(%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x218(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x1445a
subq %rdi, %rsi
callq 0x4300
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1445a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movl $0x4, %esi
movq 0x80(%rsp), %rdi
callq 0x1720e
movslq (%rbp), %rsi
leaq 0x60(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rcx
callq 0x17092
movq 0x268(%rbx), %rdi
movq 0x278(%rbx), %rsi
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x268(%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x278(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x144e5
subq %rdi, %rsi
callq 0x4300
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x144e5
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
leaq 0x270a4(%rip), %rax     # 0x3b590
cmpb $0x1, (%rax)
jne 0x14639
movslq (%rbp), %rsi
leaq 0x60(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rcx
callq 0x172aa
movq 0x220(%rbx), %rdi
movq 0x230(%rbx), %rsi
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x220(%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x230(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x1456e
subq %rdi, %rsi
callq 0x4300
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1456e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movslq (%rbp), %rsi
leaq 0x40(%rsp), %rdx
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x60(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x17426
movq 0x248(%rbx), %rax
leaq 0x60(%rsp), %r13
movaps (%r13), %xmm0
movq 0x10(%r13), %rcx
movq %rcx, 0x248(%rbx)
movups 0x238(%rbx), %xmm1
movups %xmm0, 0x238(%rbx)
leaq 0x10(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
movq $0x0, 0x10(%r13)
callq 0x174be
movq %r13, %rdi
callq 0x174be
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x145fe
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
cmpl $0x0, (%rbp)
jle 0x14723
xorl %r13d, %r13d
leaq 0x26eb6(%rip), %r12     # 0x3b4c8
xorl %r14d, %r14d
movq (%r15), %rdi
addq %r13, %rdi
movslq (%r12), %rsi
callq 0x17512
incq %r14
movslq (%rbp), %rax
addq $0x18, %r13
cmpq %rax, %r14
jl 0x14615
jmp 0x14723
movl $0x4, %edi
callq 0x42f0
movl $0x0, (%rax)
movq %rax, %rcx
addq $0x4, %rcx
movq 0x220(%rbx), %rdi
movq 0x230(%rbx), %rsi
movq %rax, 0x220(%rbx)
movq %rcx, 0x228(%rbx)
movq %rcx, 0x230(%rbx)
testq %rdi, %rdi
je 0x14680
subq %rdi, %rsi
callq 0x4300
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x60(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x1, %esi
callq 0x17426
movq 0x248(%rbx), %rax
leaq 0x60(%rsp), %r13
movaps (%r13), %xmm0
movq 0x10(%r13), %rcx
movq %rcx, 0x248(%rbx)
movups 0x238(%rbx), %xmm1
movups %xmm0, 0x238(%rbx)
leaq 0x10(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
movq $0x0, 0x10(%r13)
callq 0x174be
movq %r13, %rdi
callq 0x174be
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x14711
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%r15), %rdi
leaq 0x26dad(%rip), %rax     # 0x3b4c8
movslq (%rax), %rsi
callq 0x17512
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14737
movq %rax, %r13
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x14784
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
jmp 0x14776
jmp 0x14781
jmp 0x14781
jmp 0x14781
jmp 0x14781
jmp 0x14816
jmp 0x14781
movq %rax, %r13
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14784
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x14784
jmp 0x14781
jmp 0x14781
movq %rax, %r13
movq 0x268(%rbx), %rdi
testq %rdi, %rdi
je 0x1479f
movq 0x278(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x80(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x147be
movq 0x260(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq %r15, %rdi
callq 0x174be
movq 0x220(%rbx), %rdi
testq %rdi, %rdi
je 0x147e1
movq 0x230(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x208(%rbx), %rdi
testq %rdi, %rdi
je 0x147fc
movq 0x218(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x58(%rsp), %rdi
callq 0x175f4
movq %rbx, %rdi
callq 0x175ae
movq %r13, %rdi
callq 0x4540
movq %rax, %rdi
callq 0x13489