// File: /workspace/github_cpp_makefile_star2_O1/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 0x25e2d
cmpl $0x0, 0x200(%rbx)
leaq 0x16910(%rip), %r13     # 0x3c48a
movb (%r13), %al
je 0x25bee
testb %al, %al
je 0x25cc3
movq 0x16441(%rip), %rax     # 0x3bfd0
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 0x25bcd
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x163ec(%rip), %rdi     # 0x3bfd0
callq 0x4340
jmp 0x25cc3
testb %al, %al
je 0x25cc3
movq 0x163d3(%rip), %rax     # 0x3bfd0
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 0x25c3b
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x1637e(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq %rax, %r14
leaq 0xdfec(%rip), %rsi      # 0x33c4d
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 0x25cad
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movl 0x208(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
cmpb $0x1, (%r13)
jne 0x25cf4
leaq 0xd23b(%rip), %rax      # 0x32f0c
leaq 0xd23a(%rip), %rsi      # 0x32f12
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movq 0x162e6(%rip), %rdi     # 0x3bfd0
movl $0x5, %edx
callq 0x4340
cmpl $0x0, 0x1c8(%rbx)
jle 0x25df8
xorl %ebp, %ebp
movq 0x162c6(%rip), %r14     # 0x3bfd0
leaq 0xcd56(%rip), %r15      # 0x32a67
xorl %r12d, %r12d
testq %rbp, %rbp
sete %al
testb $0x7, %bpl
setne %cl
orb %al, %cl
jne 0x25d63
cmpb $0x1, (%r13)
jne 0x25d63
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), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbp, %rcx
jbe 0x25d9e
cmpq $0x0, (%rax,%rbp,8)
cmovnel %ebp, %r12d
cmpb $0x1, (%r13)
jne 0x25dc7
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x28bbe
jmp 0x25dc7
movl 0x1c8(%rbx), %ecx
decl %ecx
movb (%r13), %al
cmpq %rcx, %rbp
jne 0x25ddc
testb %al, %al
je 0x25dc7
movl $0x5, %edx
movq %r14, %rdi
leaq 0xccbc(%rip), %rsi      # 0x32a7e
callq 0x4340
incq %rbp
movslq 0x1c8(%rbx), %rax
cmpq %rax, %rbp
jl 0x25d14
jmp 0x25df8
testb %al, %al
je 0x25df8
movq 0x161e9(%rip), %rdi     # 0x3bfd0
leaq 0xcc96(%rip), %rsi      # 0x32a84
movl $0x8, %edx
callq 0x4340
cmpb $0x1, (%r13)
jne 0x25e2d
movq 0x161ca(%rip), %r14     # 0x3bfd0
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 0x25fbe
leaq 0x16642(%rip), %r12     # 0x3c48a
cmpb $0x1, (%r12)
jne 0x25eb0
movq 0x1617a(%rip), %rax     # 0x3bfd0
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 0x25e94
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x16125(%rip), %rdi     # 0x3bfd0
callq 0x4340
cmpb $0x1, (%r12)
jne 0x25ecf
movq 0x16112(%rip), %rdi     # 0x3bfd0
leaq 0xdd8c(%rip), %rsi      # 0x33c51
movl $0x5, %edx
callq 0x4340
movq 0x1f0(%rbx), %rax
cmpq 0x1e8(%rbx), %rax
je 0x25f89
xorl %r13d, %r13d
movq 0x160e3(%rip), %r14     # 0x3bfd0
leaq 0xcb73(%rip), %r15      # 0x32a67
xorl %ebp, %ebp
testq %r13, %r13
sete %al
testb $0x7, %r13b
setne %cl
orb %al, %cl
jne 0x25f45
cmpb $0x1, (%r12)
jne 0x25f45
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), %rax
cmpq $0x0, (%rax,%r13,8)
cmovnel %r13d, %ebp
cmpb $0x1, (%r12)
jne 0x25f6b
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x28bbe
incq %r13
movq 0x1f0(%rbx), %rax
subq 0x1e8(%rbx), %rax
sarq $0x3, %rax
cmpq %r13, %rax
ja 0x25ef6
cmpb $0x0, (%r12)
je 0x25fbe
movq 0x16039(%rip), %r14     # 0x3bfd0
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 0x26194
leaq 0x164b3(%rip), %r15     # 0x3c48a
cmpb $0x1, (%r15)
jne 0x2603e
movq 0x15fec(%rip), %rax     # 0x3bfd0
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 0x26022
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x15f97(%rip), %rdi     # 0x3bfd0
callq 0x4340
cmpb $0x1, (%r15)
jne 0x2605c
movq 0x15f85(%rip), %rdi     # 0x3bfd0
leaq 0xdc05(%rip), %rsi      # 0x33c57
movl $0x5, %edx
callq 0x4340
movl 0x25c(%rbx), %r13d
cmpl 0x260(%rbx), %r13d
je 0x26160
movq 0x15f59(%rip), %r14     # 0x3bfd0
xorl %r12d, %r12d
movl %r13d, %ebp
testl %r12d, %r12d
sete %al
testb $0x7, %r12b
setne %cl
orb %al, %cl
jne 0x260cf
cmpb $0x1, (%r15)
jne 0x260cf
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 0xc99d(%rip), %rsi      # 0x32a67
callq 0x4340
movslq %ebp, %rax
movq 0x270(%rbx), %rcx
cmpq $0x0, (%rcx,%rax,8)
je 0x2611e
cmpb $0x1, (%r15)
movl %ebp, %r13d
jne 0x2611e
movl $0x1, %edx
movq %r14, %rdi
leaq 0xd828(%rip), %rsi      # 0x33920
callq 0x4340
movq %r14, %rdi
movl %ebp, %esi
callq 0x4500
movl $0x1, %edx
movq %rax, %rdi
leaq 0xe34b(%rip), %rsi      # 0x34461
callq 0x4340
movl %ebp, %r13d
cmpb $0x1, (%r15)
jne 0x2613a
movslq %r13d, %rax
movq 0x270(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
callq 0x28bbe
incl %ebp
leaq 0x16379(%rip), %rax     # 0x3c4bc
movl (%rax), %eax
cmpl %eax, %ebp
movl $0x0, %ecx
cmovll %ecx, %eax
subl %eax, %ebp
incl %r12d
cmpl 0x260(%rbx), %ebp
jne 0x2607d
cmpb $0x1, (%r15)
jne 0x26194
movq 0x15e63(%rip), %r14     # 0x3bfd0
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 0x26333
leaq 0x162db(%rip), %r12     # 0x3c48a
cmpb $0x1, (%r12)
jne 0x26217
movq 0x15e13(%rip), %rax     # 0x3bfd0
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 0x261fb
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r14)
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x15dbe(%rip), %rdi     # 0x3bfd0
callq 0x4340
cmpb $0x1, (%r12)
jne 0x26236
movq 0x15dab(%rip), %rdi     # 0x3bfd0
leaq 0xda31(%rip), %rsi      # 0x33c5d
movl $0x5, %edx
callq 0x4340
movq 0x228(%rbx), %rax
cmpq 0x220(%rbx), %rax
je 0x262f0
xorl %r13d, %r13d
movq 0x15d7c(%rip), %r14     # 0x3bfd0
leaq 0xc80c(%rip), %r15      # 0x32a67
xorl %ebp, %ebp
testq %r13, %r13
sete %al
testb $0x7, %r13b
setne %cl
orb %al, %cl
jne 0x262ac
cmpb $0x1, (%r12)
jne 0x262ac
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), %rax
cmpq $0x0, (%rax,%r13,8)
cmovnel %r13d, %ebp
cmpb $0x1, (%r12)
jne 0x262d2
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x28bbe
incq %r13
movq 0x228(%rbx), %rax
subq 0x220(%rbx), %rax
sarq $0x3, %rax
cmpq %r13, %rax
ja 0x2625d
cmpb $0x0, (%r12)
je 0x26333
movq 0x15cd2(%rip), %rbx     # 0x3bfd0
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