// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::LinkMaster::PrintState()
void LinkMaster::PrintState()
{
	if(Buffers.size()>0) {
		if(currentState == ACTIVE) {
			STATEN(ALI(11)<<header<<"tk:"<<ALI(3)<<tokenCount);
		//	STATEN(ALI(17)<<header);
		}
		else {
			STATEN(ALI(17)<<header);
		}
		STATEN((downstream ? "Down " : " Up  "));
		int realInd = 0;
		for(int i=0; i<bufferMax; i++) {
			if(i>0 && i%8==0) {
				STATEN(endl<<"                      ");
			}
			if(i < Buffers.size()) {
				if(Buffers[i] != NULL)	realInd = i;
				STATEN(*Buffers[realInd]);
			}
			else if(i == bufferMax-1) {
				STATEN("[ - ]");
			}
			else {
				STATEN("[ - ]...");
				break;
			}
		}
		STATEN(endl);
	}

	//Print linkTx buffer
	if(linkRxTx.size()>0) {
		STATEN(ALI(17)<<header);
		STATEN("LKTX ");
		int realInd = 0;
		for(int i=0; i<linkRxTx.size(); i++) {
			if(i>0 && i%8==0) {
				STATEN(endl<<"                      ");
			}
			if(linkRxTx[i] != NULL)	realInd = i;
			STATEN(*linkRxTx[realInd]);
		}
		STATEN(endl);
	}

	//If retry buffer has something, print it
	if(retBufWriteP != retBufReadP) {
	//	STATEN(ALI(11)<<header<<"tk:"<<ALI(3)<<tokenCount);
		STATEN(ALI(17)<<header);
		STATEN("RTRY ");
		int retryInd = retBufReadP;
		int realInd = retBufReadP, i=0;
		while(retryInd != retBufWriteP) {
			if(i>0 && i%8==0) {
				STATEN(endl<<"                      ");
			}
			if(retryBuffers[retryInd] != NULL) {
				realInd = retryInd;
				STATEN("("<<retryInd<<")");
			}
			STATEN(*retryBuffers[realInd]);
			retryInd++;
			retryInd = (retryInd < MAX_RETRY_BUF) ? retryInd : retryInd - MAX_RETRY_BUF;
			i++;
		}
		STATEN(endl);
	}

	//Print backup buffer during LinkRetry state
	if(backupBuffers.size()>0) {
		STATEN(ALI(17)<<header);
		STATEN("BACK ");
		int realInd = 0;
		for(int i=0; i<backupBuffers.size(); i++) {
			if(i>0 && i%8==0) {
				STATEN(endl<<"                      ");
			}
			if(backupBuffers[i] != NULL)	realInd = i;
			STATEN(*backupBuffers[realInd]);
		}
		STATEN(endl);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1d8(%rdi), %rax
cmpq 0x1d0(%rdi), %rax
je 0x25615
cmpl $0x0, 0x200(%rbx)
leaq 0x16110(%rip), %r13     # 0x3b48a
movb (%r13), %al
je 0x253e7
testb %al, %al
je 0x254ae
movq 0x15c41(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x11, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x253c6
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x15bf3(%rip), %rdi     # 0x3afd0
callq 0x4340
jmp 0x254ae
testb %al, %al
je 0x254ae
movq 0x15bda(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0xb, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x2542d
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x15b8c(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r14
leaq 0xd876(%rip), %rsi      # 0x32cc9
movl $0x3, %edx
movq %rax, %rdi
callq 0x4340
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x3, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x25498
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movl 0x208(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
cmpb $0x1, (%r13)
jne 0x254df
leaq 0xcac0(%rip), %rax      # 0x31f7c
leaq 0xcabf(%rip), %rsi      # 0x31f82
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movq 0x15afb(%rip), %rdi     # 0x3afd0
movl $0x5, %edx
callq 0x4340
cmpl $0x0, 0x1c8(%rbx)
jle 0x255e0
xorl %ebp, %ebp
movq 0x15adb(%rip), %r14     # 0x3afd0
leaq 0xc5db(%rip), %r15      # 0x31ad7
xorl %r12d, %r12d
testq %rbp, %rbp
sete %al
testb $0x7, %bpl
setne %cl
orb %al, %cl
jne 0x2554e
cmpb $0x1, (%r13)
jne 0x2554e
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movl $0x16, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4340
movq 0x1d0(%rbx), %rax
movq 0x1d8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movb (%r13), %cl
cmpq %rbp, %rdx
jbe 0x2558a
cmpq $0x0, (%rax,%rbp,8)
cmovnel %ebp, %r12d
testb %cl, %cl
je 0x255af
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x28270
jmp 0x255af
movl 0x1c8(%rbx), %eax
decl %eax
cmpq %rax, %rbp
jne 0x255c4
testb %cl, %cl
je 0x255af
movl $0x5, %edx
movq %r14, %rdi
leaq 0xc544(%rip), %rsi      # 0x31aee
callq 0x4340
incq %rbp
movslq 0x1c8(%rbx), %rax
cmpq %rax, %rbp
jl 0x254ff
jmp 0x255e0
testb %cl, %cl
je 0x255e0
movq 0x15a01(%rip), %rdi     # 0x3afd0
leaq 0xc51e(%rip), %rsi      # 0x31af4
movl $0x8, %edx
callq 0x4340
cmpb $0x1, (%r13)
jne 0x25615
movq 0x159e2(%rip), %r14     # 0x3afd0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x1f0(%rbx), %rax
cmpq 0x1e8(%rbx), %rax
je 0x257a9
leaq 0x15e5a(%rip), %r12     # 0x3b48a
movb (%r12), %al
cmpb $0x1, %al
jne 0x25696
movq 0x15991(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x11, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x25676
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x15943(%rip), %rdi     # 0x3afd0
callq 0x4340
movb (%r12), %al
testb $0x1, %al
je 0x256b6
movq 0x1592f(%rip), %rdi     # 0x3afd0
leaq 0xd625(%rip), %rsi      # 0x32ccd
movl $0x5, %edx
callq 0x4340
movb (%r12), %al
movq 0x1e8(%rbx), %rcx
cmpq %rcx, 0x1f0(%rbx)
je 0x25777
xorl %r13d, %r13d
movq 0x158fc(%rip), %r14     # 0x3afd0
leaq 0xc3fc(%rip), %r15      # 0x31ad7
xorl %ebp, %ebp
testq %r13, %r13
sete %dl
testb $0x7, %r13b
setne %sil
orb %dl, %sil
jne 0x25736
testb $0x1, %al
je 0x25736
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movl $0x16, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4340
movq 0x1e8(%rbx), %rcx
movb (%r12), %al
cmpq $0x0, (%rcx,%r13,8)
cmovnel %r13d, %ebp
testb $0x1, %al
je 0x2575d
movslq %ebp, %rax
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
callq 0x28270
movq 0x1e8(%rbx), %rcx
movb (%r12), %al
incq %r13
movq 0x1f0(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r13, %rdx
ja 0x256dd
testb $0x1, %al
je 0x257a9
movq 0x1584e(%rip), %r14     # 0x3afd0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movl 0x260(%rbx), %eax
cmpl 0x25c(%rbx), %eax
je 0x2599d
leaq 0x15cc8(%rip), %rax     # 0x3b48a
movb (%rax), %al
cmpb $0x1, %al
jne 0x2582b
movq 0x15801(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x11, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x25806
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x157b3(%rip), %rdi     # 0x3afd0
callq 0x4340
leaq 0x15c61(%rip), %rax     # 0x3b48a
movb (%rax), %al
testb $0x1, %al
je 0x25850
movq 0x1579a(%rip), %rdi     # 0x3afd0
leaq 0xd496(%rip), %rsi      # 0x32cd3
movl $0x5, %edx
callq 0x4340
leaq 0x15c3c(%rip), %rax     # 0x3b48a
movb (%rax), %al
movl 0x25c(%rbx), %r12d
cmpl 0x260(%rbx), %r12d
je 0x2596b
movq 0x15765(%rip), %r14     # 0x3afd0
leaq 0x15c4a(%rip), %r13     # 0x3b4bc
xorl %r15d, %r15d
movl %r12d, %ebp
testl %r15d, %r15d
sete %cl
testb $0x7, %r15b
setne %dl
orb %cl, %dl
jne 0x258d1
testb $0x1, %al
je 0x258d1
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movl $0x16, %edx
movq %rax, %rdi
leaq 0xc214(%rip), %rsi      # 0x31ad7
callq 0x4340
leaq 0x15bbb(%rip), %rax     # 0x3b48a
movb (%rax), %al
movslq %ebp, %rcx
movq 0x270(%rbx), %rdx
cmpq $0x0, (%rdx,%rcx,8)
je 0x25927
movl %ebp, %r12d
testb $0x1, %al
je 0x25927
movl $0x1, %edx
movq %r14, %rdi
leaq 0xd0a4(%rip), %rsi      # 0x3299c
callq 0x4340
movq %r14, %rdi
movl %ebp, %esi
callq 0x4500
movl $0x1, %edx
movq %rax, %rdi
leaq 0xdbcb(%rip), %rsi      # 0x334e1
callq 0x4340
leaq 0x15b68(%rip), %rax     # 0x3b48a
movb (%rax), %al
movl %ebp, %r12d
testb $0x1, %al
je 0x2594a
movslq %r12d, %rax
movq 0x270(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
callq 0x28270
leaq 0x15b42(%rip), %rax     # 0x3b48a
movb (%rax), %al
incl %ebp
movl (%r13), %ecx
cmpl %ecx, %ebp
movl $0x0, %edx
cmovll %edx, %ecx
subl %ecx, %ebp
incl %r15d
cmpl 0x260(%rbx), %ebp
jne 0x25878
testb $0x1, %al
je 0x2599d
movq 0x1565a(%rip), %r14     # 0x3afd0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x228(%rbx), %rax
cmpq 0x220(%rbx), %rax
je 0x25b3f
leaq 0x15ad2(%rip), %r12     # 0x3b48a
movb (%r12), %al
cmpb $0x1, %al
jne 0x25a1e
movq 0x15609(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x11, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x259fe
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x155bb(%rip), %rdi     # 0x3afd0
callq 0x4340
movb (%r12), %al
testb $0x1, %al
je 0x25a3e
movq 0x155a7(%rip), %rdi     # 0x3afd0
leaq 0xd2a9(%rip), %rsi      # 0x32cd9
movl $0x5, %edx
callq 0x4340
movb (%r12), %al
movq 0x220(%rbx), %rcx
cmpq %rcx, 0x228(%rbx)
je 0x25aff
xorl %r13d, %r13d
movq 0x15574(%rip), %r14     # 0x3afd0
leaq 0xc074(%rip), %r15      # 0x31ad7
xorl %ebp, %ebp
testq %r13, %r13
sete %dl
testb $0x7, %r13b
setne %sil
orb %dl, %sil
jne 0x25abe
testb $0x1, %al
je 0x25abe
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movl $0x16, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4340
movq 0x220(%rbx), %rcx
movb (%r12), %al
cmpq $0x0, (%rcx,%r13,8)
cmovnel %r13d, %ebp
testb $0x1, %al
je 0x25ae5
movslq %ebp, %rax
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
callq 0x28270
movq 0x220(%rbx), %rcx
movb (%r12), %al
incq %r13
movq 0x228(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r13, %rdx
ja 0x25a65
testb $0x1, %al
je 0x25b3f
movq 0x154c6(%rip), %rbx     # 0x3afd0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x41f0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq