// File: estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::CallbackReceiveUp(CasHMC::Packet*, bool)
void VaultController::CallbackReceiveUp(Packet *upEle, bool chkReceive)
{
	if(chkReceive) {
		switch(upEle->CMD) {
			case RD_RS:	DE_CR(ALI(18)<<header<<ALI(15)<<*upEle<<"Up)   RETURNING read data response packet");	break;
			case WR_RS:	DE_CR(ALI(18)<<header<<ALI(15)<<*upEle<<"Up)   RETURNING write response packet");		break;
			default:
				ERROR(header<<"  == Error - WRONG response packet command type  "<<*upEle<<"  (CurrentClock : "<<currentClockCycle<<")");
				exit(0);
				break;
		}
	}
	else {
		ERROR(header<<"  == Error - Vault controller upstream packet buffer FULL  "<<*upEle<<"  (CurrentClock : "<<currentClockCycle<<")");
		ERROR(header<<"             Vault buffer max size : "<<upBufferMax<<", current size : "<<upBuffers.size()<<", "<<*upEle<<" size : "<<upEle->LNG);
		exit(0);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
testb $0x1, -0x11(%rbp)
je 0x4c40a
movq -0x10(%rbp), %rax
movl 0x434(%rax), %eax
movl %eax, -0x44(%rbp)
subl $0x38, %eax
je 0x4c1c1
jmp 0x4c1b0
movl -0x44(%rbp), %eax
subl $0x39, %eax
je 0x4c285
jmp 0x4c349
leaq 0x1a360(%rip), %rax     # 0x66528
testb $0x1, (%rax)
je 0x4c280
movl $0x12, %edi
callq 0x177b0
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
movq 0x19de8(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0x60(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x60(%rbp), %rdi
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %esi
callq 0x4550
movq -0x40(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, -0x58(%rbp)
movl $0xf, %edi
callq 0x177b0
movq -0x58(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0x4440
movq %rax, -0x50(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x50(%rbp), %rdi
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x44960
movq %rax, %rdi
leaq 0x87f4(%rip), %rsi      # 0x54a60
callq 0x4380
movq %rax, %rdi
movq 0x19d35(%rip), %rsi     # 0x65fb0
callq 0x43c0
jmp 0x4c405
leaq 0x1a29c(%rip), %rax     # 0x66528
testb $0x1, (%rax)
je 0x4c344
movl $0x12, %edi
callq 0x177b0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %esi
movq 0x19d24(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0x78(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x78(%rbp), %rdi
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %esi
callq 0x4550
movq -0x40(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, -0x70(%rbp)
movl $0xf, %edi
callq 0x177b0
movq -0x70(%rbp), %rdi
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %esi
callq 0x4440
movq %rax, -0x68(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x68(%rbp), %rdi
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x44960
movq %rax, %rdi
leaq 0x875a(%rip), %rsi      # 0x54a8a
callq 0x4380
movq %rax, %rdi
movq 0x19c71(%rip), %rsi     # 0x65fb0
callq 0x43c0
jmp 0x4c405
movq 0x19ca0(%rip), %rdi     # 0x65ff0
leaq 0x4ce3(%rip), %rsi      # 0x5103a
callq 0x4380
movq %rax, %rdi
leaq 0x874a(%rip), %rsi      # 0x54ab0
callq 0x4380
movq %rax, %rdi
leaq 0x54c0(%rip), %rsi      # 0x51835
callq 0x4380
movq %rax, %rdi
movl $0x45, %esi
callq 0x4610
movq %rax, %rdi
leaq 0x4cc8(%rip), %rsi      # 0x51059
callq 0x4380
movq -0x40(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, %rdi
leaq 0x871c(%rip), %rsi      # 0x54acc
callq 0x4380
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x44960
movq %rax, %rdi
leaq 0x87e0(%rip), %rsi      # 0x54bab
callq 0x4380
movq %rax, %rdi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x40f0
movq %rax, %rdi
leaq 0x7f8f(%rip), %rsi      # 0x54379
callq 0x4380
movq %rax, %rdi
movq 0x19bb7(%rip), %rsi     # 0x65fb0
callq 0x43c0
xorl %edi, %edi
callq 0x4460
jmp 0x4c5be
movq 0x19bdf(%rip), %rdi     # 0x65ff0
leaq 0x4c22(%rip), %rsi      # 0x5103a
callq 0x4380
movq %rax, %rdi
leaq 0x8689(%rip), %rsi      # 0x54ab0
callq 0x4380
movq %rax, %rdi
leaq 0x53ff(%rip), %rsi      # 0x51835
callq 0x4380
movq %rax, %rdi
movl $0x4b, %esi
callq 0x4610
movq %rax, %rdi
leaq 0x4c07(%rip), %rsi      # 0x51059
callq 0x4380
movq -0x40(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, %rdi
leaq 0x868d(%rip), %rsi      # 0x54afe
callq 0x4380
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x44960
movq %rax, %rdi
leaq 0x871f(%rip), %rsi      # 0x54bab
callq 0x4380
movq %rax, %rdi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x40f0
movq %rax, %rdi
leaq 0x7ece(%rip), %rsi      # 0x54379
callq 0x4380
movq %rax, %rdi
movq 0x19af6(%rip), %rsi     # 0x65fb0
callq 0x43c0
movq 0x19b2a(%rip), %rdi     # 0x65ff0
leaq 0x4b6d(%rip), %rsi      # 0x5103a
callq 0x4380
movq %rax, %rdi
leaq 0x85d4(%rip), %rsi      # 0x54ab0
callq 0x4380
movq %rax, %rdi
leaq 0x534a(%rip), %rsi      # 0x51835
callq 0x4380
movq %rax, %rdi
movl $0x4c, %esi
callq 0x4610
movq %rax, %rdi
leaq 0x4b52(%rip), %rsi      # 0x51059
callq 0x4380
movq -0x40(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, %rdi
leaq 0x8614(%rip), %rsi      # 0x54b3a
callq 0x4380
movq %rax, %rdi
movq -0x40(%rbp), %rax
movl 0x1cc(%rax), %esi
callq 0x4610
movq %rax, %rdi
leaq 0x8619(%rip), %rsi      # 0x54b60
callq 0x4380
movq -0x40(%rbp), %rdi
movq %rax, -0x80(%rbp)
addq $0x1e8, %rdi            # imm = 0x1E8
callq 0x22d60
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x40f0
movq %rax, %rdi
leaq 0x85fc(%rip), %rsi      # 0x54b72
callq 0x4380
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x44960
movq %rax, %rdi
leaq 0x6fb4(%rip), %rsi      # 0x53545
callq 0x4380
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x430(%rax), %esi
callq 0x44c0
movq %rax, %rdi
movq 0x199fe(%rip), %rsi     # 0x65fb0
callq 0x43c0
xorl %edi, %edi
callq 0x4460
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)