// File: estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::VaultController(std::basic_ofstream<char, std::char_traits<char>>&, std::basic_ofstream<char, std::char_traits<char>>&, unsigned int)
VaultController::VaultController(ofstream &debugOut_, ofstream &stateOut_, unsigned id):
	DualVectorObject<Packet, Packet>(debugOut_, stateOut_, MAX_VLT_BUF, MAX_VLT_BUF),
	vaultContID(id)
{	
	classID << vaultContID;
	header = "        (VC_" + classID.str() + ")";
	
	refreshCountdown = 0;
	powerDown = false;
	poppedCMD = NULL;
	atomicCMD = NULL;
	atomicOperLeft = 0;
	pendingDataSize = 0;
	
	cmdBus = NULL;
	cmdCyclesLeft = 0;
	dataBus = NULL;
	dataCyclesLeft = 0;
	
	//Make class objects
	commandQueue = new CommandQueue(debugOut, stateOut, vaultContID, this);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x98(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x1a75c(%rip), %rax     # 0x66560
movl (%rax), %r8d
movl %r8d, %ecx
callq 0x29490
movq -0x98(%rbp), %rdi
leaq 0x19f3b(%rip), %rax     # 0x65d58
movq %rax, (%rdi)
movl -0x1c(%rbp), %eax
movl %eax, 0x204(%rdi)
addq $0x238, %rdi            # imm = 0x238
movq %rdi, -0xb0(%rbp)
callq 0x18070
movq -0x98(%rbp), %rdi
addq $0x278, %rdi            # imm = 0x278
movq %rdi, -0xa8(%rbp)
callq 0x22480
movq -0x98(%rbp), %rdi
addq $0x290, %rdi            # imm = 0x290
movq %rdi, -0xa0(%rbp)
callq 0x18070
movq -0x98(%rbp), %rax
movq %rax, %rdi
addq $0x50, %rdi
movl 0x204(%rax), %esi
callq 0x44c0
jmp 0x4be8b
movq -0x98(%rbp), %rsi
addq $0x40, %rsi
leaq -0x90(%rbp), %rdi
callq 0x4370
jmp 0x4bea4
leaq 0x8ba8(%rip), %rsi      # 0x54a53
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x179c0
jmp 0x4bebd
leaq 0x84b5(%rip), %rdx      # 0x54379
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x18020
jmp 0x4bed3
movq -0x98(%rbp), %rdi
addq $0x20, %rdi
leaq -0x50(%rbp), %rsi
movq %rsi, -0xc0(%rbp)
callq 0x4470
movq -0xc0(%rbp), %rdi
callq 0x46e8
leaq -0x70(%rbp), %rdi
callq 0x46e8
leaq -0x90(%rbp), %rdi
callq 0x46e8
movq -0x98(%rbp), %rax
movl $0x0, 0x208(%rax)
movb $0x0, 0x20c(%rax)
movq $0x0, 0x220(%rax)
movq $0x0, 0x228(%rax)
movl $0x0, 0x230(%rax)
movl $0x0, 0x234(%rax)
movq $0x0, 0x258(%rax)
movl $0x0, 0x260(%rax)
movq $0x0, 0x268(%rax)
movl $0x0, 0x270(%rax)
movl $0x280, %edi            # imm = 0x280
callq 0x4390
movq %rax, -0xb8(%rbp)
jmp 0x4bf8e
movq -0x98(%rbp), %r8
movq -0xb8(%rbp), %rdi
movq 0x10(%r8), %rsi
movq 0x18(%r8), %rdx
movl 0x204(%r8), %ecx
callq 0x1c3d0
jmp 0x4bfb2
movq -0x98(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, 0x218(%rax)
addq $0xc0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4c02c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4c001
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x46e8
leaq -0x90(%rbp), %rdi
callq 0x46e8
jmp 0x4c02c
movq -0xb8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x280, %esi            # imm = 0x280
callq 0x43a0
movq -0xa0(%rbp), %rdi
callq 0x18160
movq -0xa8(%rbp), %rdi
callq 0x225f0
movq -0xb0(%rbp), %rdi
callq 0x18160
movq -0x98(%rbp), %rdi
callq 0x2a2f0
movq -0x28(%rbp), %rdi
callq 0x4630
nopw %cs:(%rax,%rax)