// File: /workspace/github_cpp_makefile_star2_O2/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 0x1c187
cmpl $0x0, 0x200(%rbx)
leaq 0x154ae(%rip), %r13     # 0x3148a
movb (%r13), %al
je 0x1c017
testb %al, %al
je 0x1c07f
movq 0x14fdf(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x11, 0x10(%rdi,%rax)
pushq $0x20
popq %rsi
callq 0x4440
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x42b0
jmp 0x1c07f
testb %al, %al
je 0x1c07f
movq 0x14fae(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0xb, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x42b0
leaq 0xac6a(%rip), %rsi      # 0x26cb9
movq %rax, %rdi
callq 0x4300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x3, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movl 0x208(%rbx), %esi
movq %rax, %rdi
callq 0x4210
cmpb $0x1, (%r13)
jne 0x1c0ab
leaq 0x9ed0(%rip), %rax      # 0x25f5d
leaq 0x9ecf(%rip), %rsi      # 0x25f63
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movq 0x14f2a(%rip), %rdi     # 0x30fd0
callq 0x4300
xorl %ebp, %ebp
movq 0x14f1c(%rip), %r14     # 0x30fd0
leaq 0x9984(%rip), %r15      # 0x25a3f
xorl %r12d, %r12d
movslq 0x1c8(%rbx), %rax
cmpq %rax, %rbp
jge 0x1c174
testq %rbp, %rbp
sete %al
testb $0x7, %bpl
setne %cl
orb %al, %cl
jne 0x1c0f9
cmpb $0x1, (%r13)
jne 0x1c0f9
movq %r14, %rdi
callq 0x4180
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
movq 0x1d0(%rbx), %rax
movq 0x1d8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movb (%r13), %cl
cmpq %rbp, %rdx
jbe 0x1c135
cmpq $0x0, (%rax,%rbp,8)
cmovnel %ebp, %r12d
testb %cl, %cl
je 0x1c155
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x1e2c8
jmp 0x1c155
movl 0x1c8(%rbx), %eax
decl %eax
cmpq %rax, %rbp
jne 0x1c15d
testb %cl, %cl
je 0x1c155
movq %r14, %rdi
leaq 0x9906(%rip), %rsi      # 0x25a56
callq 0x4300
incq %rbp
jmp 0x1c0be
testb %cl, %cl
je 0x1c174
movq 0x14e68(%rip), %rdi     # 0x30fd0
leaq 0x98ed(%rip), %rsi      # 0x25a5c
callq 0x4300
cmpb $0x1, (%r13)
jne 0x1c187
movq 0x14e4e(%rip), %rdi     # 0x30fd0
callq 0x4180
movq 0x1f0(%rbx), %rax
cmpq 0x1e8(%rbx), %rax
je 0x1c28c
leaq 0x152e8(%rip), %r12     # 0x3148a
movb (%r12), %al
cmpb $0x1, %al
jne 0x1c1d9
movq 0x14e1f(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x11, 0x10(%rdi,%rax)
pushq $0x20
popq %rsi
callq 0x4440
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x42b0
movb (%r12), %al
testb $0x1, %al
je 0x1c1f0
movq 0x14dec(%rip), %rdi     # 0x30fd0
leaq 0xaad2(%rip), %rsi      # 0x26cbd
callq 0x4300
xorl %r13d, %r13d
movq 0x14dd6(%rip), %r14     # 0x30fd0
leaq 0x983e(%rip), %r15      # 0x25a3f
xorl %ebp, %ebp
movq 0x1e8(%rbx), %rax
movq 0x1f0(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
jbe 0x1c279
testq %r13, %r13
sete %dl
testb $0x7, %r13b
setne %sil
movb (%r12), %cl
orb %dl, %sil
jne 0x1c257
testb $0x1, %cl
je 0x1c257
movq %r14, %rdi
callq 0x4180
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
movq 0x1e8(%rbx), %rax
movb (%r12), %cl
cmpq $0x0, (%rax,%r13,8)
cmovnel %r13d, %ebp
testb $0x1, %cl
je 0x1c274
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x1e2c8
incq %r13
jmp 0x1c203
cmpb $0x0, (%r12)
je 0x1c28c
movq 0x14d49(%rip), %rdi     # 0x30fd0
callq 0x4180
movl 0x260(%rbx), %eax
cmpl 0x25c(%rbx), %eax
je 0x1c3d3
leaq 0x151e5(%rip), %r15     # 0x3148a
movb (%r15), %al
cmpb $0x1, %al
jne 0x1c2da
movq 0x14d1d(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x11, 0x10(%rdi,%rax)
pushq $0x20
popq %rsi
callq 0x4440
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x42b0
movb (%r15), %al
testb $0x1, %al
je 0x1c2f1
movq 0x14ceb(%rip), %rdi     # 0x30fd0
leaq 0xa9d7(%rip), %rsi      # 0x26cc3
callq 0x4300
movl 0x25c(%rbx), %ebp
movq 0x14cd2(%rip), %r14     # 0x30fd0
movl %ebp, %r13d
xorl %r12d, %r12d
cmpl 0x260(%rbx), %ebp
je 0x1c3c1
testl %r12d, %r12d
sete %cl
testb $0x7, %r12b
setne %dl
movb (%r15), %al
orb %cl, %dl
jne 0x1c342
testb $0x1, %al
je 0x1c342
movq %r14, %rdi
callq 0x4180
movq %rax, %rdi
leaq 0x9705(%rip), %rsi      # 0x25a3f
callq 0x4300
movb (%r15), %al
movslq %ebp, %rcx
movq 0x270(%rbx), %rdx
cmpq $0x0, (%rdx,%rcx,8)
je 0x1c388
movl %ebp, %r13d
testb $0x1, %al
je 0x1c388
movq %r14, %rdi
leaq 0xa628(%rip), %rsi      # 0x2698c
callq 0x4300
movq %rax, %rdi
movl %ebp, %esi
callq 0x44f0
movq %rax, %rdi
leaq 0xb154(%rip), %rsi      # 0x274d1
callq 0x4300
movb (%r15), %al
movl %ebp, %r13d
testb $0x1, %al
je 0x1c3a2
movslq %r13d, %rax
movq 0x270(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
callq 0x1e2c8
incl %ebp
leaq 0x15111(%rip), %rax     # 0x314bc
movl (%rax), %eax
cmpl %eax, %ebp
movl $0x0, %ecx
cmovll %ecx, %eax
subl %eax, %ebp
incl %r12d
jmp 0x1c304
cmpb $0x1, (%r15)
jne 0x1c3d3
movq 0x14c02(%rip), %rdi     # 0x30fd0
callq 0x4180
movq 0x228(%rbx), %rax
cmpq 0x220(%rbx), %rax
je 0x1c4e6
leaq 0x1509c(%rip), %r12     # 0x3148a
movb (%r12), %al
cmpb $0x1, %al
jne 0x1c425
movq 0x14bd3(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x11, 0x10(%rdi,%rax)
pushq $0x20
popq %rsi
callq 0x4440
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x42b0
movb (%r12), %al
testb $0x1, %al
je 0x1c43c
movq 0x14ba0(%rip), %rdi     # 0x30fd0
leaq 0xa892(%rip), %rsi      # 0x26cc9
callq 0x4300
xorl %r13d, %r13d
movq 0x14b8a(%rip), %r14     # 0x30fd0
leaq 0x95f2(%rip), %r15      # 0x25a3f
xorl %ebp, %ebp
movq 0x220(%rbx), %rax
movq 0x228(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r13, %rcx
jbe 0x1c4c5
testq %r13, %r13
sete %dl
testb $0x7, %r13b
setne %sil
movb (%r12), %cl
orb %dl, %sil
jne 0x1c4a3
testb $0x1, %cl
je 0x1c4a3
movq %r14, %rdi
callq 0x4180
movq %rax, %rdi
movq %r15, %rsi
callq 0x4300
movq 0x220(%rbx), %rax
movb (%r12), %cl
cmpq $0x0, (%rax,%r13,8)
cmovnel %r13d, %ebp
testb $0x1, %cl
je 0x1c4c0
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x1e2c8
incq %r13
jmp 0x1c44f
cmpb $0x0, (%r12)
je 0x1c4e6
movq 0x14afd(%rip), %rdi     # 0x30fd0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4180
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq