// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x220(%rdi), %eax
xorl %r12d, %r12d
cmpl $0x6, %eax
jg 0x1d3fd
leal 0x1(%rax), %ecx
movl %ecx, 0x220(%r14)
movl %eax, %r12d
leaq 0x140c8(%rip), %rax     # 0x314cc
cmpb $0x1, (%rax)
jne 0x1d54c
movq %rbx, %rdi
callq 0x1e0c4
movq %rax, %r15
cmpl %r15d, 0x438(%rbx)
jne 0x1d622
leaq 0x1405c(%rip), %rax     # 0x31488
movb (%rax), %al
cmpl %r12d, 0x444(%rbx)
jne 0x1d830
movb $0x1, %bpl
testb %al, %al
je 0x1d9c6
leaq 0x1403c(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x1d9c6
movq 0x13b73(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1e2c8
leaq 0x92b9(%rip), %rcx      # 0x26768
leaq 0x92b9(%rip), %rsi      # 0x2676f
cmpb $0x0, 0x1cc(%r14)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x99f1(%rip), %rsi      # 0x26ec2
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl 0x18(%rax,%rdx), %esi
andl $-0x4b, %esi
orl $0x8, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x9, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x4440
movl %r15d, %esi
movq %rax, %rdi
callq 0x4210
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x999c(%rip), %rsi      # 0x26ec9
movq %rax, %rdi
callq 0x4300
movl %r12d, %esi
movq %rax, %rdi
callq 0x4210
leaq 0x998a(%rip), %rsi      # 0x26ed1
jmp 0x1d612
leaq 0x13f35(%rip), %rax     # 0x31488
movb (%rax), %al
cmpl %r12d, 0x444(%rbx)
jne 0x1d763
movb $0x1, %bpl
testb %al, %al
je 0x1d9c6
leaq 0x13f15(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x1d9c6
movq 0x13a4c(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1e2c8
leaq 0x9192(%rip), %rcx      # 0x26768
leaq 0x9192(%rip), %rsi      # 0x2676f
cmpb $0x0, 0x1cc(%r14)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x98d4(%rip), %rsi      # 0x26ecc
movq %rax, %rdi
callq 0x4300
movl %r12d, %esi
movq %rax, %rdi
callq 0x4210
leaq 0x9946(%rip), %rsi      # 0x26f58
movq %rax, %rdi
callq 0x4300
movb $0x1, %bpl
jmp 0x1d9be
leaq 0x13e5f(%rip), %rax     # 0x31488
cmpb $0x1, (%rax)
jne 0x1d829
movq 0x13997(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1e2c8
leaq 0x90dd(%rip), %rcx      # 0x26768
leaq 0x90dd(%rip), %rsi      # 0x2676f
cmpb $0x0, 0x1cc(%r14)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x9872(%rip), %rsi      # 0x26f1f
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl 0x18(%rax,%rdx), %esi
andl $-0x4b, %esi
orl $0x8, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
pushq $0x9
popq %r14
movq %r14, 0x10(%rax,%rcx)
pushq $0x30
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movl 0x438(%rbx), %esi
movq %rax, %rdi
callq 0x4210
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x9838(%rip), %rsi      # 0x26f46
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl 0x18(%rax,%rdx), %esi
andl $-0x4b, %esi
orl $0x8, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq %r14, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movl %r15d, %esi
movq %rax, %rdi
callq 0x4210
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
jmp 0x1d9ad
testb %al, %al
je 0x1d829
movq 0x1385e(%rip), %rdi     # 0x30fd0
leaq 0x97f7(%rip), %rsi      # 0x26f70
callq 0x4300
movl 0x204(%r14), %esi
movq %rax, %rdi
callq 0x4210
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x7, 0x10(%rax,%rcx)
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x4440
leaq 0x9d22(%rip), %r15      # 0x274d1
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1e2c8
leaq 0x8f9c(%rip), %rcx      # 0x26768
leaq 0x8f9c(%rip), %rsi      # 0x2676f
cmpb $0x0, 0x1cc(%r14)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x96fc(%rip), %rsi      # 0x26eea
movq %rax, %rdi
callq 0x4300
movl 0x444(%rbx), %esi
movq %rax, %rdi
callq 0x4210
leaq 0x9704(%rip), %rsi      # 0x26f0f
movq %rax, %rdi
callq 0x4300
movl %r12d, %esi
movq %rax, %rdi
callq 0x4210
movq %rax, %rdi
movq %r15, %rsi
jmp 0x1d9b7
xorl %ebp, %ebp
jmp 0x1d9c6
testb %al, %al
je 0x1d8ff
movq 0x13791(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1e2c8
leaq 0x8ed7(%rip), %rcx      # 0x26768
leaq 0x8ed7(%rip), %rsi      # 0x2676f
cmpb $0x0, 0x1cc(%r14)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x9637(%rip), %rsi      # 0x26eea
movq %rax, %rdi
callq 0x4300
movl 0x444(%rbx), %esi
movq %rax, %rdi
callq 0x4210
leaq 0x963f(%rip), %rsi      # 0x26f0f
movq %rax, %rdi
callq 0x4300
movl %r12d, %r15d
movq %rax, %rdi
movq %r15, %rsi
callq 0x4210
leaq 0x9be4(%rip), %rsi      # 0x274d1
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
jmp 0x1d902
movl %r12d, %r15d
movq 0x136c7(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1e2c8
leaq 0x8e0d(%rip), %rcx      # 0x26768
leaq 0x8e0d(%rip), %rsi      # 0x2676f
cmpb $0x0, 0x1cc(%r14)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x956d(%rip), %rsi      # 0x26eea
movq %rax, %rdi
callq 0x4300
movl 0x444(%rbx), %esi
movq %rax, %rdi
callq 0x4210
leaq 0x9575(%rip), %rsi      # 0x26f0f
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
movq %r15, %rsi
callq 0x4210
leaq 0x9b1d(%rip), %rsi      # 0x274d1
movq %rax, %rdi
callq 0x4300
xorl %ebp, %ebp
movq %rax, %rdi
callq 0x4180
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop