// File: /workspace/github_cpp_makefile_star2_O3/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 0x22b3e
movq (%rcx), %rcx
movl %eax, 0x44c(%rcx)
leaq 0x18aa4(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x22d25
leaq 0x18a95(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x22d25
movq 0x185cc(%rip), %rax     # 0x3afd0
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 0x22a3b
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x1857e(%rip), %rdi     # 0x3afd0
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 0x22a92
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x1d0(%rbx), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x28270
movq %rax, %r14
leaq 0xfcc2(%rip), %rax      # 0x32778
leaq 0xfcc2(%rip), %rsi      # 0x3277f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r14, %rdi
callq 0x4340
leaq 0xfde2(%rip), %rsi      # 0x328be
movl $0x5, %edx
movq %r14, %rdi
callq 0x4340
movl 0x20c(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
movq %rax, %rbx
leaq 0xfd7e(%rip), %rsi      # 0x3287f
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 0x27c44
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 0x22ba4
movl $0x0, 0x14(%r14)
movq 0x1f0(%rbx), %rsi
cmpq 0x1f8(%rbx), %rsi
je 0x22bc1
movq %r14, (%rsi)
addq $0x8, 0x1f0(%rbx)
jmp 0x22bd2
leaq 0x1e8(%rbx), %rdi
leaq 0x8(%rsp), %rdx
callq 0x1a462
leaq 0x188af(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x22d25
leaq 0x188a0(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x22d25
movq 0x183d7(%rip), %rax     # 0x3afd0
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 0x22c30
movq %r14, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r14)
movb $0x20, 0xe0(%r14)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x18389(%rip), %rdi     # 0x3afd0
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 0x22c87
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x28270
movq %rax, %r14
leaq 0xfad2(%rip), %rax      # 0x32778
leaq 0xfad2(%rip), %rsi      # 0x3277f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r14, %rdi
callq 0x4340
leaq 0xfbd0(%rip), %rsi      # 0x3289c
movl $0x27, %edx
movq %r14, %rdi
callq 0x4340
movl 0x20c(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
movq %rax, %rbx
leaq 0x107f0(%rip), %rsi     # 0x334e1
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