// File: /workspace/github_cpp_makefile_star2_O1/estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::LinkMaster::ReturnRetryPointer(CasHMC::Packet*)
void LinkMaster::ReturnRetryPointer(Packet *packet)
{
	lastestRRP = packet->FRP;
	if(Buffers.size() != 0) {
		Buffers[0]->RRP = lastestRRP;
		DEBUG(ALI(18)<<header<<ALI(15)<<*Buffers[0]<<(downstream ? "Down) " : "Up)   ")<<"RRP ("<<lastestRRP<<") is embedded in this packet");
	}
	else {
		//packet, cmd, addr, cub, lng, *lat
		Packet *packetPRET = new Packet(FLOW, PRET, 0, 0, 1, NULL);
		packetPRET->TAG = packet->TAG;
		packetPRET->RRP = lastestRRP;
		if(downstream)	packetPRET->bufPopDelay = 0;
		linkRxTx.push_back(packetPRET);
		DEBUG(ALI(18)<<header<<ALI(15)<<*packetPRET<<(downstream ? "Down) " : "Up)   ")<<"MAKING PRET packet to be embedded RRP ("<<lastestRRP<<")");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x448(%rsi), %eax
movl %eax, 0x20c(%rdi)
movq 0x1d0(%rdi), %rcx
cmpq %rcx, 0x1d8(%rdi)
je 0x23270
movq (%rcx), %rcx
movl %eax, 0x44c(%rcx)
leaq 0x19380(%rip), %rax     # 0x3c488
cmpb $0x1, (%rax)
jne 0x23465
leaq 0x19371(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x23465
movq 0x18ea8(%rip), %rax     # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x23166
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 0x18e53(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x231c4
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x1d0(%rbx), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x28bbe
movq %rax, %r14
leaq 0x10508(%rip), %rax     # 0x336f0
leaq 0x10508(%rip), %rsi     # 0x336f7
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r14, %rdi
callq 0x4340
leaq 0x10634(%rip), %rsi     # 0x33842
movl $0x5, %edx
movq %r14, %rdi
callq 0x4340
movl 0x20c(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
movq %rax, %rbx
leaq 0x105d0(%rip), %rsi     # 0x33803
movl $0x1c, %edx
movq %rax, %rdi
callq 0x4340
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 $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x41f0
movq %rsi, %r15
movl $0x468, %edi            # imm = 0x468
callq 0x42f0
movq %rax, %r14
movq $0x0, (%rsp)
movq %rax, %rdi
movl $0x2, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x284bc
movq %r14, 0x8(%rsp)
movl 0x42c(%r15), %eax
movl %eax, 0x42c(%r14)
movl 0x20c(%rbx), %eax
movl %eax, 0x44c(%r14)
cmpb $0x1, 0x1cc(%rbx)
jne 0x232d6
movl $0x0, 0x14(%r14)
movq 0x1f0(%rbx), %rsi
cmpq 0x1f8(%rbx), %rsi
je 0x232f3
movq %r14, (%rsi)
addq $0x8, 0x1f0(%rbx)
jmp 0x23304
leaq 0x1e8(%rbx), %rdi
leaq 0x8(%rsp), %rdx
callq 0x1ac5a
leaq 0x1917d(%rip), %rax     # 0x3c488
cmpb $0x1, (%rax)
jne 0x23465
leaq 0x1916e(%rip), %rax     # 0x3c489
cmpb $0x0, (%rax)
jne 0x23465
movq 0x18ca5(%rip), %rax     # 0x3bfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x23369
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 0x18c50(%rip), %rdi     # 0x3bfd0
callq 0x4340
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x233c7
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x28bbe
movq %rax, %r14
leaq 0x1030a(%rip), %rax     # 0x336f0
leaq 0x1030a(%rip), %rsi     # 0x336f7
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r14, %rdi
callq 0x4340
leaq 0x10414(%rip), %rsi     # 0x33820
movl $0x27, %edx
movq %r14, %rdi
callq 0x4340
movl 0x20c(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
movq %rax, %rbx
leaq 0x11030(%rip), %rsi     # 0x34461
movl $0x1, %edx
movq %rax, %rdi
callq 0x4340
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
callq 0x41f0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x468, %esi            # imm = 0x468
movq %r14, %rdi
callq 0x4300
movq %rbx, %rdi
callq 0x4540
nop