// File: estwings57[P]CasHMC/sources/LinkSlave.cpp
// Function: CasHMC::LinkSlave::CheckNoError(CasHMC::Packet*)
bool LinkSlave::CheckNoError(Packet *chkPacket)
{
	unsigned tempSEQ = (slaveSEQ<7) ? slaveSEQ++ : 0;
	if(CRC_CHECK) {
		unsigned tempCRC = chkPacket->GetCRC();
		if(chkPacket->CRC == tempCRC) {
			if(chkPacket->SEQ == tempSEQ) {
				DEBUG(ALI(18)<<header<<ALI(15)<<*chkPacket<<(downstream ? "Down) " : "Up)   ")
							<<"CRC(0x"<<hex<<setw(9)<<setfill('0')<<tempCRC<<dec<<"), SEQ("<<tempSEQ<<") are checked (NO error)");
				return true;
			}
			else {
				DE_CR(ALI(18)<<header<<ALI(15)<<*chkPacket<<(downstream ? "Down) " : "Up)   ")
							<<"= Error abort mode =  (packet SEQ : "<<chkPacket->SEQ<<" / Slave SEQ : "<<tempSEQ<<")");
				cout<<ALI(18)<<header<<ALI(15)<<*chkPacket<<(downstream ? "Down) " : "Up)   ")
							<<"= Error abort mode =  (packet SEQ : "<<chkPacket->SEQ<<" / Slave SEQ : "<<tempSEQ<<")"<<endl;
				return false;
			}
		}
		else {
			DE_CR(ALI(18)<<header<<ALI(15)<<*chkPacket<<(downstream ? "Down) " : "Up)   ")
						<<"= Error abort mode =  (packet CRC : 0x"<<hex<<setw(9)<<setfill('0')<<chkPacket->CRC<<dec
						<<" / Slave CRC : 0x"<<hex<<setw(9)<<setfill('0')<<tempCRC<<dec<<")");
			return false;
		}
	}
	else {
		if(chkPacket->SEQ == tempSEQ) {
			DEBUG(ALI(18)<<header<<ALI(15)<<*chkPacket<<(downstream ? "Down) " : "Up)   ")
						<<"SEQ("<<tempSEQ<<") is checked (NO error)");
			return true;
		}
		else {
			DE_CR("    (LS_"<<linkSlaveID<<ALI(7)<<")"<<*chkPacket<<(downstream ? "Down) " : "Up)   ")
						<<"= Error abort mode =  (packet SEQ : "<<chkPacket->SEQ<<" / Slave SEQ : "<<tempSEQ<<")");
			return false;
		}
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpl $0x7, 0x220(%rax)
jge 0x42b07
movq -0x98(%rbp), %rcx
movl 0x220(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x220(%rcx)
movl %eax, -0x9c(%rbp)
jmp 0x42b11
xorl %eax, %eax
movl %eax, -0x9c(%rbp)
jmp 0x42b11
movl -0x9c(%rbp), %eax
movl %eax, -0x1c(%rbp)
leaq 0x23a4b(%rip), %rax     # 0x6656c
testb $0x1, (%rax)
je 0x4320f
movq -0x18(%rbp), %rdi
callq 0x44270
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl 0x438(%rax), %eax
cmpl -0x20(%rbp), %eax
jne 0x42fe0
movq -0x18(%rbp), %rax
movl 0x444(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x42d2f
leaq 0x239c5(%rip), %rax     # 0x66528
testb $0x1, (%rax)
je 0x42d26
leaq 0x239b6(%rip), %rax     # 0x66529
testb $0x1, (%rax)
jne 0x42d26
movl $0x12, %edi
callq 0x177b0
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
movq 0x2343d(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0xc0(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0xc0(%rbp), %rdi
movb %al, -0x25(%rbp)
movzbl -0x25(%rbp), %esi
callq 0x4550
movq -0x98(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, -0xb8(%rbp)
movl $0xf, %edi
callq 0x177b0
movq -0xb8(%rbp), %rdi
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %esi
callq 0x4440
movq %rax, -0xb0(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0xb0(%rbp), %rdi
movb %al, -0x2d(%rbp)
movzbl -0x2d(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x44960
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0xa8(%rbp)
testb $0x1, 0x1cc(%rax)
je 0x42c4c
leaq 0x10a05(%rip), %rax     # 0x53648
movq %rax, -0xc8(%rbp)
jmp 0x42c5c
leaq 0x109fc(%rip), %rax     # 0x5364f
movq %rax, -0xc8(%rbp)
jmp 0x42c5c
movq -0xa8(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x4380
movq %rax, %rdi
leaq 0x11114(%rip), %rsi     # 0x53d8d
callq 0x4380
movq %rax, %rdi
leaq 0xce8(%rip), %rsi       # 0x43970
callq 0x4150
movq %rax, -0xd8(%rbp)
movl $0x9, %edi
callq 0x177b0
movq -0xd8(%rbp), %rdi
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %esi
callq 0x4440
movq %rax, -0xd0(%rbp)
movl $0x30, %edi
callq 0x177d0
movq -0xd0(%rbp), %rdi
movb %al, -0x35(%rbp)
movzbl -0x35(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movl -0x20(%rbp), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0xcb7(%rip), %rsi       # 0x439a0
callq 0x4150
movq %rax, %rdi
leaq 0x1109c(%rip), %rsi     # 0x53d94
callq 0x4380
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x1108a(%rip), %rsi     # 0x53d9c
callq 0x4380
movq %rax, %rdi
movq 0x2328f(%rip), %rsi     # 0x65fb0
callq 0x43c0
movb $0x1, -0x1(%rbp)
jmp 0x434d2
leaq 0x237f2(%rip), %rax     # 0x66528
testb $0x1, (%rax)
je 0x42e8b
movl $0x12, %edi
callq 0x177b0
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %esi
movq 0x2327a(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0xf8(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0xf8(%rbp), %rdi
movb %al, -0x3d(%rbp)
movzbl -0x3d(%rbp), %esi
callq 0x4550
movq -0x98(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, -0xf0(%rbp)
movl $0xf, %edi
callq 0x177b0
movq -0xf0(%rbp), %rdi
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
callq 0x4440
movq %rax, -0xe8(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0xe8(%rbp), %rdi
movb %al, -0x45(%rbp)
movzbl -0x45(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x44960
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0xe0(%rbp)
testb $0x1, 0x1cc(%rax)
je 0x42e0f
leaq 0x10842(%rip), %rax     # 0x53648
movq %rax, -0x100(%rbp)
jmp 0x42e1f
leaq 0x10839(%rip), %rax     # 0x5364f
movq %rax, -0x100(%rbp)
jmp 0x42e1f
movq -0xe0(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x4380
movq %rax, %rdi
leaq 0x10f79(%rip), %rsi     # 0x53db5
callq 0x4380
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x444(%rax), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x10f7d(%rip), %rsi     # 0x53dda
callq 0x4380
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x11502(%rip), %rsi     # 0x54379
callq 0x4380
movq %rax, %rdi
movq 0x2312a(%rip), %rsi     # 0x65fb0
callq 0x43c0
movl $0x12, %edi
callq 0x177b0
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %esi
movq 0x2312e(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0x120(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x120(%rbp), %rdi
movb %al, -0x4d(%rbp)
movzbl -0x4d(%rbp), %esi
callq 0x4550
movq -0x98(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, -0x118(%rbp)
movl $0xf, %edi
callq 0x177b0
movq -0x118(%rbp), %rdi
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %esi
callq 0x4440
movq %rax, -0x110(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x110(%rbp), %rdi
movb %al, -0x55(%rbp)
movzbl -0x55(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x44960
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x108(%rbp)
testb $0x1, 0x1cc(%rax)
je 0x42f5b
leaq 0x106f6(%rip), %rax     # 0x53648
movq %rax, -0x128(%rbp)
jmp 0x42f6b
leaq 0x106ed(%rip), %rax     # 0x5364f
movq %rax, -0x128(%rbp)
jmp 0x42f6b
movq -0x108(%rbp), %rdi
movq -0x128(%rbp), %rsi
callq 0x4380
movq %rax, %rdi
leaq 0x10e2d(%rip), %rsi     # 0x53db5
callq 0x4380
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x444(%rax), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x10e31(%rip), %rsi     # 0x53dda
callq 0x4380
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x113b6(%rip), %rsi     # 0x54379
callq 0x4380
movq %rax, %rdi
movq 0x22fde(%rip), %rsi     # 0x65fb0
callq 0x43c0
movb $0x0, -0x1(%rbp)
jmp 0x434d2
leaq 0x23541(%rip), %rax     # 0x66528
testb $0x1, (%rax)
je 0x43206
movl $0x12, %edi
callq 0x177b0
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %esi
movq 0x22fc9(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0x148(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x148(%rbp), %rdi
movb %al, -0x5d(%rbp)
movzbl -0x5d(%rbp), %esi
callq 0x4550
movq -0x98(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, -0x140(%rbp)
movl $0xf, %edi
callq 0x177b0
movq -0x140(%rbp), %rdi
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %esi
callq 0x4440
movq %rax, -0x138(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x138(%rbp), %rdi
movb %al, -0x65(%rbp)
movzbl -0x65(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x44960
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x130(%rbp)
testb $0x1, 0x1cc(%rax)
je 0x430c0
leaq 0x10591(%rip), %rax     # 0x53648
movq %rax, -0x150(%rbp)
jmp 0x430d0
leaq 0x10588(%rip), %rax     # 0x5364f
movq %rax, -0x150(%rbp)
jmp 0x430d0
movq -0x130(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x4380
movq %rax, %rdi
leaq 0x10cfd(%rip), %rsi     # 0x53dea
callq 0x4380
movq %rax, %rdi
leaq 0x874(%rip), %rsi       # 0x43970
callq 0x4150
movq %rax, -0x170(%rbp)
movl $0x9, %edi
callq 0x177b0
movq -0x170(%rbp), %rdi
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %esi
callq 0x4440
movq %rax, -0x168(%rbp)
movl $0x30, %edi
callq 0x177d0
movq -0x168(%rbp), %rdi
movb %al, -0x6d(%rbp)
movzbl -0x6d(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x438(%rax), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x83c(%rip), %rsi       # 0x439a0
callq 0x4150
movq %rax, %rdi
leaq 0x10c9e(%rip), %rsi     # 0x53e11
callq 0x4380
movq %rax, %rdi
leaq 0x7ee(%rip), %rsi       # 0x43970
callq 0x4150
movq %rax, -0x160(%rbp)
movl $0x9, %edi
callq 0x177b0
movq -0x160(%rbp), %rdi
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %esi
callq 0x4440
movq %rax, -0x158(%rbp)
movl $0x30, %edi
callq 0x177d0
movq -0x158(%rbp), %rdi
movb %al, -0x75(%rbp)
movzbl -0x75(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movl -0x20(%rbp), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x7bd(%rip), %rsi       # 0x439a0
callq 0x4150
movq %rax, %rdi
leaq 0x11187(%rip), %rsi     # 0x54379
callq 0x4380
movq %rax, %rdi
movq 0x22daf(%rip), %rsi     # 0x65fb0
callq 0x43c0
movb $0x0, -0x1(%rbp)
jmp 0x434d2
movq -0x18(%rbp), %rax
movl 0x444(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x43382
leaq 0x232ff(%rip), %rax     # 0x66528
testb $0x1, (%rax)
je 0x43379
leaq 0x232f0(%rip), %rax     # 0x66529
testb $0x1, (%rax)
jne 0x43379
movl $0x12, %edi
callq 0x177b0
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %esi
movq 0x22d77(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0x190(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x190(%rbp), %rdi
movb %al, -0x7d(%rbp)
movzbl -0x7d(%rbp), %esi
callq 0x4550
movq -0x98(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, -0x188(%rbp)
movl $0xf, %edi
callq 0x177b0
movq -0x188(%rbp), %rdi
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %esi
callq 0x4440
movq %rax, -0x180(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x180(%rbp), %rdi
movb %al, -0x85(%rbp)
movzbl -0x85(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x44960
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x178(%rbp)
testb $0x1, 0x1cc(%rax)
je 0x4331e
leaq 0x10333(%rip), %rax     # 0x53648
movq %rax, -0x198(%rbp)
jmp 0x4332e
leaq 0x1032a(%rip), %rax     # 0x5364f
movq %rax, -0x198(%rbp)
jmp 0x4332e
movq -0x178(%rbp), %rdi
movq -0x198(%rbp), %rsi
callq 0x4380
movq %rax, %rdi
leaq 0x10a4c(%rip), %rsi     # 0x53d97
callq 0x4380
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x10abe(%rip), %rsi     # 0x53e23
callq 0x4380
movq %rax, %rdi
movq 0x22c3c(%rip), %rsi     # 0x65fb0
callq 0x43c0
movb $0x1, -0x1(%rbp)
jmp 0x434d2
leaq 0x2319f(%rip), %rax     # 0x66528
testb $0x1, (%rax)
je 0x434ce
movq 0x22c37(%rip), %rdi     # 0x65fd0
leaq 0x10a9b(%rip), %rsi     # 0x53e3b
callq 0x4380
movq %rax, %rdi
movq -0x98(%rbp), %rax
movl 0x204(%rax), %esi
callq 0x44c0
movq %rax, -0x1b0(%rbp)
movl $0x7, %edi
callq 0x177b0
movq -0x1b0(%rbp), %rdi
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %esi
callq 0x4440
movq %rax, -0x1a8(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x1a8(%rbp), %rdi
movb %al, -0x8d(%rbp)
movzbl -0x8d(%rbp), %esi
callq 0x4550
movq %rax, %rdi
leaq 0x10f62(%rip), %rsi     # 0x54379
callq 0x4380
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x44960
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x1a0(%rbp)
testb $0x1, 0x1cc(%rax)
je 0x43452
leaq 0x101ff(%rip), %rax     # 0x53648
movq %rax, -0x1b8(%rbp)
jmp 0x43462
leaq 0x101f6(%rip), %rax     # 0x5364f
movq %rax, -0x1b8(%rbp)
jmp 0x43462
movq -0x1a0(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
callq 0x4380
movq %rax, %rdi
leaq 0x10936(%rip), %rsi     # 0x53db5
callq 0x4380
movq %rax, %rdi
movq -0x18(%rbp), %rax
movl 0x444(%rax), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x1093a(%rip), %rsi     # 0x53dda
callq 0x4380
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x10ebf(%rip), %rsi     # 0x54379
callq 0x4380
movq %rax, %rdi
movq 0x22ae7(%rip), %rsi     # 0x65fb0
callq 0x43c0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq