// File: /workspace/github_cpp_makefile_star2_O1/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 $0xa8, %rsp
movq %r8, %r14
movl %ecx, %r12d
movq %rdi, %rbx
callq 0x17976
leaq 0x2729e(%rip), %rax     # 0x3b968
movq %rax, (%rbx)
movl %r12d, 0x1c8(%rbx)
movq %r14, 0x1d8(%rbx)
leaq 0x1e0(%rbx), %rax
movq %rax, 0x68(%rsp)
xorl %eax, %eax
movq %rax, 0x1e0(%rbx)
movl %eax, 0x1e8(%rbx)
movq %rax, 0x1f0(%rbx)
movl %eax, 0x1f8(%rbx)
leaq 0x208(%rbx), %rax
movq %rax, 0xa0(%rsp)
leaq 0x220(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x238(%rbx), %r13
leaq 0x250(%rbx), %rax
movq %rax, 0x98(%rsp)
leaq 0x268(%rbx), %rax
movq %rax, 0x90(%rsp)
leaq 0x50(%rbx), %rdi
movl %r12d, %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 0x70(%rsp), %rdi
callq 0x4450
leaq 0x1e20d(%rip), %rcx     # 0x329ac
leaq 0x70(%rsp), %rdi
movl $0xc, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x4320
leaq 0x40(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x147da
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x147e1
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x68(%rsp), %r14
movq 0x8(%rax), %rdx
leaq 0x30(%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 %rbp, %rdi
je 0x14825
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14846
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4300
xorl %eax, %eax
movb %al, 0x1d0(%rbx)
movl $0x0, 0x1cc(%rbx)
leaq 0x27d21(%rip), %rbp     # 0x3c580
movslq (%rbp), %rsi
leaq 0x70(%rsp), %rdx
movb %al, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rcx
callq 0x179da
movq %r14, %rdi
callq 0x17d96
leaq 0x30(%rsp), %rdi
movq 0x20(%rdi), %rax
movq %rax, 0x20(%r14)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
xorl %eax, %eax
movl %eax, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movl %eax, 0x18(%rdi)
movslq (%rbp), %rsi
leaq 0x70(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x10(%rsp), %rcx
callq 0x17a42
leaq 0x30(%rsp), %r12
movq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0x13ee4
movq (%r12), %rdi
testq %rdi, %rdi
je 0x148ee
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movl $0x4, %esi
movq 0x98(%rsp), %rdi
callq 0x17ac0
movslq (%rbp), %rsi
leaq 0x70(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rcx
callq 0x17a42
leaq 0x30(%rsp), %r12
movq 0x90(%rsp), %rdi
movq %r12, %rsi
callq 0x13ee4
movq (%r12), %rdi
testq %rdi, %rdi
je 0x14949
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
leaq 0x27c40(%rip), %rax     # 0x3c590
cmpb $0x1, (%rax)
jne 0x14a8d
movslq (%rbp), %rsi
leaq 0x70(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rcx
callq 0x17b56
leaq 0x30(%rsp), %r12
movq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0x17e98
movq (%r12), %rdi
testq %rdi, %rdi
je 0x1499f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movslq (%rbp), %rsi
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x17bd4
leaq 0x30(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x238(%rbx), %rax
movups 0x240(%rbx), %xmm0
leaq 0x70(%rsp), %r12
movq (%r12), %rcx
movq %rcx, 0x238(%rbx)
movq 0x8(%r12), %rcx
movq %rcx, 0x240(%rbx)
movq 0x10(%r12), %rcx
movq %rcx, 0x248(%rbx)
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rsi
movq %rax, (%rdi)
movups %xmm0, 0x8(%rdi)
movq %rcx, (%r12)
movq %rdx, 0x8(%r12)
movq %rsi, 0x10(%r12)
callq 0x17c6c
movq %r12, %rdi
callq 0x17c6c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14a52
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
cmpl $0x0, (%rbp)
jle 0x14bb7
xorl %r12d, %r12d
leaq 0x27a62(%rip), %r15     # 0x3c4c8
xorl %r14d, %r14d
movq (%r13), %rdi
addq %r12, %rdi
movslq (%r15), %rsi
callq 0x17cba
incq %r14
movslq (%rbp), %rax
addq $0x18, %r12
cmpq %rax, %r14
jl 0x14a69
jmp 0x14bb7
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x4, %edi
callq 0x42f0
leaq 0x30(%rsp), %r12
movq %rax, (%r12)
movq %rax, 0x8(%r12)
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%r12)
movl $0x0, (%rax)
movq %rcx, 0x8(%r12)
movq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0x17e98
movq (%r12), %rdi
testq %rdi, %rdi
je 0x14af0
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x1, %esi
callq 0x17bd4
leaq 0x30(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x238(%rbx), %rax
movups 0x240(%rbx), %xmm0
leaq 0x70(%rsp), %r12
movq (%r12), %rcx
movq %rcx, 0x238(%rbx)
movq 0x8(%r12), %rcx
movq %rcx, 0x240(%rbx)
movq 0x10(%r12), %rcx
movq %rcx, 0x248(%rbx)
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rsi
movq %rax, (%rdi)
movups %xmm0, 0x8(%rdi)
movq %rcx, (%r12)
movq %rdx, 0x8(%r12)
movq %rsi, 0x10(%r12)
callq 0x17c6c
movq %r12, %rdi
callq 0x17c6c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14ba4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%r13), %rdi
leaq 0x27919(%rip), %rax     # 0x3c4c8
movslq (%rax), %rsi
callq 0x17cba
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14bcb
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14c1e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
jmp 0x14c10
jmp 0x14c1b
jmp 0x14c1b
jmp 0x14c1b
jmp 0x14c1b
jmp 0x14cb9
jmp 0x14c1b
movq %rax, %r14
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14c1e
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x14c1e
jmp 0x14c1b
jmp 0x14c1b
movq %rax, %r14
movq 0x90(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x14c3d
movq 0x278(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x98(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x14c5c
movq 0x260(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq %r13, %rdi
callq 0x17c6c
movq 0x60(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x14c80
movq 0x230(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x14c9f
movq 0x218(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x68(%rsp), %rdi
callq 0x17d96
movq %rbx, %rdi
callq 0x17d50
movq %r14, %rdi
callq 0x4540
movq %rax, %rdi
callq 0x13940
nop