// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x448(%rsi), %eax
movl %eax, 0x20c(%rdi)
movq 0x1d0(%rdi), %rcx
cmpq %rcx, 0x1d8(%rdi)
je 0x1a394
movq (%rcx), %rcx
movl %eax, 0x44c(%rcx)
leaq 0x171c5(%rip), %rax     # 0x31488
cmpb $0x1, (%rax)
jne 0x1a4c7
leaq 0x171b6(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x1a4c7
movq 0x16ced(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq 0x1d0(%rbx), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x1e2c8
leaq 0xc42c(%rip), %rcx      # 0x26768
leaq 0xc42c(%rip), %rsi      # 0x2676f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4300
leaq 0xc551(%rip), %rsi      # 0x268ae
movq %rax, %rdi
callq 0x4300
movl 0x20c(%rbx), %esi
movq %rax, %rdi
callq 0x4210
leaq 0xc4f5(%rip), %rsi      # 0x2686f
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4180
movq %rsi, %r15
movl $0x468, %edi            # imm = 0x468
callq 0x4310
movq %rax, %r14
andq $0x0, (%rsp)
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %edx, %r9d
callq 0x1dd04
movq %r14, 0x10(%rsp)
movl 0x42c(%r15), %eax
movl %eax, 0x42c(%r14)
movl 0x20c(%rbx), %eax
movl %eax, 0x44c(%r14)
cmpb $0x1, 0x1cc(%rbx)
jne 0x1a3ed
andl $0x0, 0x14(%r14)
leaq 0x1e8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x13442
leaq 0x17083(%rip), %rax     # 0x31488
cmpb $0x1, (%rax)
jne 0x1a4c7
leaq 0x17074(%rip), %rax     # 0x31489
cmpb $0x0, (%rax)
jne 0x1a4c7
movq 0x16bab(%rip), %rdi     # 0x30fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x12, 0x10(%rdi,%rax)
pushq $0x20
popq %rbp
movl %ebp, %esi
callq 0x4440
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x42b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xf, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebp, %esi
callq 0x4440
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x1e2c8
leaq 0xc2ef(%rip), %rcx      # 0x26768
leaq 0xc2ef(%rip), %rsi      # 0x2676f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x4300
leaq 0xc3f2(%rip), %rsi      # 0x2688c
movq %rax, %rdi
callq 0x4300
movl 0x20c(%rbx), %esi
movq %rax, %rdi
callq 0x4210
leaq 0xd01a(%rip), %rsi      # 0x274d1
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x468, %esi            # imm = 0x468
movq %r14, %rdi
callq 0x4320
movq %rbx, %rdi
callq 0x4520