// File: estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::LinkMaster::UpdateRetryPointer(CasHMC::Packet*)
void LinkMaster::UpdateRetryPointer(Packet *packet)
{
	if(retBufReadP != packet->RRP) {
		do {
			if(retryBuffers[retBufReadP] != NULL) {
				delete retryBuffers[retBufReadP];
			}
			retryBuffers[retBufReadP] = NULL;
			retBufReadP++;
			retBufReadP = (retBufReadP < MAX_RETRY_BUF) ? retBufReadP : retBufReadP - MAX_RETRY_BUF;
		} while(retBufReadP != packet->RRP);
		DEBUG(ALI(18)<<header<<ALI(15)<<*packet<<(downstream ? "Down) " : "Up)   ")<<"Retry buffer READ POINTER is updated ("<<retBufReadP<<")");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl 0x25c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x44c(%rcx), %eax
je 0x3c897
jmp 0x3c680
movq -0x28(%rbp), %rax
movq %rax, %rdi
addq $0x270, %rdi            # imm = 0x270
movl 0x25c(%rax), %eax
movl %eax, %esi
callq 0x29940
cmpq $0x0, (%rax)
je 0x3c6d5
movq -0x28(%rbp), %rax
movq %rax, %rdi
addq $0x270, %rdi            # imm = 0x270
movl 0x25c(%rax), %eax
movl %eax, %esi
callq 0x29940
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x3c6d3
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x3c6d5
movq -0x28(%rbp), %rax
movq %rax, %rdi
addq $0x270, %rdi            # imm = 0x270
movl 0x25c(%rax), %eax
movl %eax, %esi
callq 0x29940
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq $0x0, (%rcx)
movl 0x25c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x25c(%rax)
movl 0x25c(%rax), %eax
leaq 0x29e42(%rip), %rcx     # 0x6655c
cmpl (%rcx), %eax
jae 0x3c72d
movq -0x28(%rbp), %rax
movl 0x25c(%rax), %eax
movl %eax, -0x34(%rbp)
jmp 0x3c743
movq -0x28(%rbp), %rax
movl 0x25c(%rax), %eax
leaq 0x29e1e(%rip), %rcx     # 0x6655c
subl (%rcx), %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, 0x25c(%rax)
movq -0x28(%rbp), %rax
movl 0x25c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x44c(%rcx), %eax
jne 0x3c680
leaq 0x29db7(%rip), %rax     # 0x66528
testb $0x1, (%rax)
je 0x3c895
leaq 0x29da8(%rip), %rax     # 0x66529
testb $0x1, (%rax)
jne 0x3c895
movl $0x12, %edi
callq 0x177b0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
movq 0x2982f(%rip), %rdi     # 0x65fd0
callq 0x4440
movq %rax, -0x58(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x58(%rbp), %rdi
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %esi
callq 0x4550
movq -0x28(%rbp), %rsi
movq %rax, %rdi
addq $0x20, %rsi
callq 0x4320
movq %rax, -0x50(%rbp)
movl $0xf, %edi
callq 0x177b0
movq -0x50(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0x4440
movq %rax, -0x48(%rbp)
movl $0x20, %edi
callq 0x177d0
movq -0x48(%rbp), %rdi
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %esi
callq 0x4550
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x44960
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, -0x40(%rbp)
testb $0x1, 0x1cc(%rax)
je 0x3c83c
leaq 0x16e12(%rip), %rax     # 0x53648
movq %rax, -0x60(%rbp)
jmp 0x3c849
leaq 0x16e0c(%rip), %rax     # 0x5364f
movq %rax, -0x60(%rbp)
jmp 0x3c849
movq -0x40(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x4380
movq %rax, %rdi
leaq 0x16eb3(%rip), %rsi     # 0x53713
callq 0x4380
movq %rax, %rdi
movq -0x28(%rbp), %rax
movl 0x25c(%rax), %esi
callq 0x44c0
movq %rax, %rdi
leaq 0x17af8(%rip), %rsi     # 0x54379
callq 0x4380
movq %rax, %rdi
movq 0x29720(%rip), %rsi     # 0x65fb0
callq 0x43c0
jmp 0x3c897
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)