LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/DRAM.cpp
// Function: CasHMC::DRAM::UpdateState()
void DRAM::UpdateState()
{
	if(readData != NULL) {
		dataCyclesLeft--;
		if(dataCyclesLeft == 0) {
			vaultContP->ReturnCommand(readData);
			readData = NULL;
		}
	}

	//Send back return command to vault controller
	if(readReturnCountdown.size() > 0 && readReturnCountdown[0] == 0) {
		readData = readReturnDATA[0];
		dataCyclesLeft = BL;
		readReturnDATA.erase(readReturnDATA.begin());
		readReturnCountdown.erase(readReturnCountdown.begin());
	}
	
	for(int i=0; i<readReturnCountdown.size(); i++) {
		readReturnCountdown[i]--;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x208(%rdi), %rsi
testq %rsi, %rsi
je 0x1bc01
decl 0x210(%rbx)
jne 0x1bc01
movq 0x1d0(%rbx), %rdi
callq 0x2d31e
movq $0x0, 0x208(%rbx)
movq 0x230(%rbx), %rdi
movq 0x238(%rbx), %rdx
cmpq %rdi, %rdx
je 0x1bcac
cmpl $0x0, (%rdi)
jne 0x1bcac
movq 0x218(%rbx), %rcx
movq 0x220(%rbx), %rax
movq (%rcx), %rsi
movq %rsi, 0x208(%rbx)
leaq 0x1f94c(%rip), %rsi     # 0x3b58c
movl (%rsi), %esi
shrl $0x5, %esi
movl %esi, 0x210(%rbx)
leaq 0x8(%rcx), %rsi
cmpq %rax, %rsi
je 0x1bc77
subq %rsi, %rax
movq %rcx, %rdi
movq %rax, %rdx
callq 0x4480
movq 0x220(%rbx), %rax
movq 0x230(%rbx), %rdi
movq 0x238(%rbx), %rdx
addq $-0x8, %rax
movq %rax, 0x220(%rbx)
leaq 0x4(%rdi), %rsi
cmpq %rdx, %rsi
je 0x1bca1
subq %rsi, %rdx
callq 0x4480
movq 0x230(%rbx), %rdi
movq 0x238(%rbx), %rdx
addq $-0x4, %rdx
movq %rdx, 0x238(%rbx)
subq %rdi, %rdx
je 0x1bcca
sarq $0x2, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %eax, %eax
decl (%rdi,%rax,4)
incq %rax
cmpq %rax, %rdx
jne 0x1bcbf
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/DRAM.cpp
// Function: CasHMC::DRAM::PrintState()
void DRAM::PrintState()
{
	bool printDR = false;
	for(int b=0; b<NUM_BANKS; b++) {
		if(previousBankState[b] != bankStates[b]->currentBankState) {
			printDR = true;
			break;
		}
	}
	
	if(printDR) {
		STATEN(ALI(17)<<header);
		STATEN("State");
		for(int b=0; b<NUM_BANKS; b++) {
			previousBankState[b] = bankStates[b]->currentBankState;
			STATEN("[");
			STATEN(*bankStates[b]);
			if(bankStates[b]->currentBankState == ROW_ACTIVE) {
				STATEN("-"<<bankStates[b]->openRowAddress);
			}
			STATEN("]");
		}
		STATEN(endl);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1f8a2(%rip), %rbp     # 0x3b580
movslq (%rbp), %rax
testq %rax, %rax
jle 0x1bebb
movq %rdi, %rbx
movq 0x1d8(%rdi), %rcx
movq 0x1f0(%rdi), %rdx
xorl %esi, %esi
movl (%rdx,%rsi,4), %edi
movq (%rcx,%rsi,8), %r8
cmpl 0x4(%r8), %edi
jne 0x1bd18
incq %rsi
cmpq %rsi, %rax
jne 0x1bcfe
jmp 0x1bebb
leaq 0x1f76b(%rip), %r12     # 0x3b48a
movb (%r12), %al
cmpb $0x1, %al
jne 0x1bd85
movq 0x1f2a2(%rip), %rax     # 0x3afd0
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 0x1bd65
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 0x1f254(%rip), %rdi     # 0x3afd0
callq 0x4340
movb (%r12), %al
testb $0x1, %al
je 0x1bda5
movq 0x1f240(%rip), %rdi     # 0x3afd0
leaq 0x163a9(%rip), %rsi     # 0x32140
movl $0x5, %edx
callq 0x4340
movb (%r12), %al
cmpl $0x0, (%rbp)
jle 0x1be7b
xorl %r15d, %r15d
movq 0x1f217(%rip), %r14     # 0x3afd0
leaq 0x15d32(%rip), %r13     # 0x31af2
movq 0x1d8(%rbx), %rcx
movq 0x1f0(%rbx), %rdx
movq (%rcx,%r15,8), %rsi
movl 0x4(%rsi), %esi
movl %esi, (%rdx,%r15,4)
testb $0x1, %al
je 0x1bdfc
movl $0x1, %edx
movq %r14, %rdi
leaq 0x1531a(%rip), %rsi     # 0x31106
callq 0x4340
movb (%r12), %al
movq 0x1d8(%rbx), %rcx
testb $0x1, %al
je 0x1be17
movq (%rcx,%r15,8), %rsi
movq %r14, %rdi
callq 0x63bd
movq 0x1d8(%rbx), %rcx
movb (%r12), %al
movq (%rcx,%r15,8), %rcx
cmpl $0x1, 0x4(%rcx)
jne 0x1be53
testb $0x1, %al
je 0x1be53
movl $0x1, %edx
movq %r14, %rdi
leaq 0x14b63(%rip), %rsi     # 0x30997
callq 0x4340
movq 0x1d8(%rbx), %rax
movq (%rax,%r15,8), %rax
movl 0x8(%rax), %esi
movq %r14, %rdi
callq 0x41e0
movb (%r12), %al
testb $0x1, %al
je 0x1be6b
movl $0x1, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x4340
movb (%r12), %al
incq %r15
movslq (%rbp), %rcx
cmpq %rcx, %r15
jl 0x1bdc0
testb $0x1, %al
je 0x1bebb
movq 0x1f14a(%rip), %rbx     # 0x3afd0
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
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/HMC.cpp
// Function: CasHMC::HMC::~HMC()
HMC::~HMC()
{
	for(int l=0; l<NUM_LINKS; l++) {
		delete downLinkSlaves[l];
		delete upLinkMasters[l];
	}
	downLinkSlaves.clear();
	upLinkMasters.clear();

	delete crossbarSwitch;
	crossbarSwitch = NULL;

	for(int v=0; v<NUM_VAULTS; v++) {
		delete vaultControllers[v];
		delete drams[v];
	}
	vaultControllers.clear();
	drams.clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1da91(%rip), %rax     # 0x3aaf0
movq %rax, (%rdi)
leaq 0x1e43f(%rip), %r14     # 0x3b4a8
cmpl $0x0, (%r14)
jle 0x1d0a9
xorl %r15d, %r15d
movq 0x1d0(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x1d088
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x1e8(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x1d09e
movq (%rdi), %rax
callq *0x8(%rax)
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1d072
movq 0x1d0(%rbx), %rax
cmpq %rax, 0x1d8(%rbx)
je 0x1d0c0
movq %rax, 0x1d8(%rbx)
movq 0x1e8(%rbx), %rax
cmpq %rax, 0x1f0(%rbx)
je 0x1d0d7
movq %rax, 0x1f0(%rbx)
movq 0x200(%rbx), %rdi
testq %rdi, %rdi
je 0x1d0e9
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x200(%rbx)
leaq 0x1e481(%rip), %r14     # 0x3b57c
cmpl $0x0, (%r14)
jle 0x1d13b
xorl %r15d, %r15d
movq 0x208(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x1d11a
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x220(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x1d130
movq (%rdi), %rax
callq *0x8(%rax)
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1d104
movq 0x208(%rbx), %rdi
cmpq %rdi, 0x210(%rbx)
je 0x1d152
movq %rdi, 0x210(%rbx)
movq 0x220(%rbx), %rax
cmpq %rax, 0x228(%rbx)
je 0x1d169
movq %rax, 0x228(%rbx)
testq %rax, %rax
je 0x1d187
movq 0x230(%rbx), %rsi
subq %rax, %rsi
movq %rax, %rdi
callq 0x4300
movq 0x208(%rbx), %rdi
testq %rdi, %rdi
je 0x1d19b
movq 0x218(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x1e8(%rbx), %rdi
testq %rdi, %rdi
je 0x1d1b6
movq 0x1f8(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x1d0(%rbx), %rdi
testq %rdi, %rdi
je 0x1d1d1
movq 0x1e0(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x175ae
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/HMC.cpp
// Function: CasHMC::HMC::Update()
void HMC::Update()
{	
	for(int l=0; l<NUM_LINKS; l++) {
		downLinkSlaves[l]->Update();
	}
	crossbarSwitch->Update();
	for(int v=0; v<NUM_VAULTS; v++) {
		vaultControllers[v]->Update();
	}
	for(int v=0; v<NUM_VAULTS; v++) {
		drams[v]->Update();
	}
	for(int l=0; l<NUM_LINKS; l++) {
		upLinkMasters[l]->Update();
	}
	clockTuner++;
	Step();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1e2a0(%rip), %r14     # 0x3b4a8
cmpl $0x0, (%r14)
jle 0x1d22d
xorl %r15d, %r15d
movq 0x1d0(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1d211
movq 0x200(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x1e33b(%rip), %r15     # 0x3b57c
cmpl $0x0, (%r15)
jle 0x1d289
xorl %r12d, %r12d
movq 0x208(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
incq %r12
movslq (%r15), %rax
cmpq %rax, %r12
jl 0x1d24a
testl %eax, %eax
jle 0x1d289
xorl %r12d, %r12d
movq 0x220(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
incq %r12
movslq (%r15), %rax
cmpq %rax, %r12
jl 0x1d26d
cmpl $0x0, (%r14)
jle 0x1d2ae
xorl %r15d, %r15d
movq 0x1e8(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1d292
incq 0x1c8(%rbx)
incq 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/HMC.cpp
// Function: CasHMC::HMC::PrintState()
void HMC::PrintState()
{
	for(int l=0; l<NUM_LINKS; l++) {
		downLinkSlaves[l]->PrintState();
	}
	crossbarSwitch->PrintState();
	for(int v=0; v<NUM_VAULTS; v++) {
		vaultControllers[v]->PrintState();
	}
	for(int v=0; v<NUM_VAULTS; v++) {
		drams[v]->PrintState();
	}
	for(int l=0; l<NUM_LINKS; l++) {
		upLinkMasters[l]->PrintState();
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1e1d0(%rip), %r14     # 0x3b4a8
cmpl $0x0, (%r14)
jle 0x1d2fc
xorl %r15d, %r15d
movq 0x1d0(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x277c8
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1d2e1
movq 0x200(%rbx), %rdi
callq 0x198d8
leaq 0x1e26d(%rip), %r15     # 0x3b57c
cmpl $0x0, (%r15)
jle 0x1d355
xorl %r12d, %r12d
movq 0x208(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x2f514
incq %r12
movslq (%r15), %rax
cmpq %rax, %r12
jl 0x1d318
testl %eax, %eax
jle 0x1d355
xorl %r12d, %r12d
movq 0x220(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x1bccc
incq %r12
movslq (%r15), %rax
cmpq %rax, %r12
jl 0x1d33a
cmpl $0x0, (%r14)
jle 0x1d379
xorl %r15d, %r15d
movq 0x1e8(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x2534a
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1d35e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/HMCController.cpp
// Function: CasHMC::HMCController::~HMCController()
HMCController::~HMCController()
{
	for(int l=0; l<NUM_LINKS; l++) {
		delete downLinkMasters[l];
		delete upLinkSlaves[l];
	}
	downLinkMasters.clear();
	upLinkSlaves.clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x1c895(%rip), %rax     # 0x3ab30
movq %rax, (%rdi)
leaq 0x1d203(%rip), %r14     # 0x3b4a8
cmpl $0x0, (%r14)
jle 0x1e2e5
xorl %r15d, %r15d
movq 0x208(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x1e2c4
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x220(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x1e2da
movq (%rdi), %rax
callq *0x8(%rax)
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x1e2ae
movq 0x208(%rbx), %rax
cmpq %rax, 0x210(%rbx)
je 0x1e2fc
movq %rax, 0x210(%rbx)
movq 0x220(%rbx), %rax
cmpq %rax, 0x228(%rbx)
je 0x1e313
movq %rax, 0x228(%rbx)
movq 0x338(%rbx), %rdi
testq %rdi, %rdi
je 0x1e32e
movq 0x348(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x320(%rbx), %rdi
testq %rdi, %rdi
je 0x1e349
movq 0x330(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
leaq 0x2f8(%rbx), %rdi
callq 0x175f4
leaq 0x2d0(%rbx), %rdi
callq 0x175f4
movq 0x2b8(%rbx), %rdi
testq %rdi, %rdi
je 0x1e37c
movq 0x2c8(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x2a0(%rbx), %rdi
testq %rdi, %rdi
je 0x1e397
movq 0x2b0(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x288(%rbx), %rdi
testq %rdi, %rdi
je 0x1e3b2
movq 0x298(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x220(%rbx), %rdi
testq %rdi, %rdi
je 0x1e3cd
movq 0x230(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x208(%rbx), %rdi
testq %rdi, %rdi
je 0x1e3e8
movq 0x218(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21788
jmp 0x1e3f7
movq %rax, %rdi
callq 0x13489
nop
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/HMCController.cpp
// Function: CasHMC::HMCController::CallbackReceiveDown(CasHMC::Transaction*, bool)
void HMCController::CallbackReceiveDown(Transaction *downEle, bool chkReceive)
{
	if(chkReceive) {
		//Check transaction address
		downEle->address &= ((uint64_t)NUM_VAULTS*NUM_BANKS*NUM_COLS*NUM_ROWS - 1);
		downEle->trace->tranTransmitTime = currentClockCycle;
		if(downEle->transactionType == DATA_WRITE)	downEle->trace->statis->hmcTransmitSize += downEle->dataSize;
		//DEBUG(ALI(18)<<header<<ALI(15)<<*downEle<<"Down) RECEIVING transaction");
	}
	else {
		//DEBUG(ALI(18)<<header<<ALI(15)<<*downEle<<"Down) Transaction buffer FULL");
	}
}

// Assembly:
testl %edx, %edx
je 0x1e484
leaq 0x1d149(%rip), %rax     # 0x3b57c
movslq (%rax), %rax
leaq 0x1d143(%rip), %rcx     # 0x3b580
movslq (%rcx), %rcx
imulq %rax, %rcx
leaq 0x1d13d(%rip), %rax     # 0x3b588
movslq (%rax), %rax
leaq 0x1d12f(%rip), %rdx     # 0x3b584
movslq (%rdx), %rdx
imulq %rax, %rdx
imulq %rcx, %rdx
decq %rdx
andq %rdx, 0x18(%rsi)
movl 0x8(%rdi), %ecx
movq 0x8(%rsi), %rax
movl %ecx, 0x8(%rax)
cmpl $0x1, 0x10(%rsi)
jne 0x1e484
movl 0x20(%rsi), %ecx
movq (%rax), %rax
addq %rcx, 0x128(%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/Link.cpp
// Function: CasHMC::Link::NoisePacket(CasHMC::Packet*)
void Link::NoisePacket(Packet *packet)
{
	for(int i=0; i<packet->LNG; i++) {
		unsigned ranNum1 = rand();
		unsigned ranNum2 = rand();	
		if(ranNum1%errorProba == 0 && ranNum2%errorProba == 0) {
			DE_CR(ALI(18)<<header<<ALI(15)<<*packet<<(downstream ? "Down) " : "Up)   ")<<"====> Link ERROR is occurred <====");
			packet->CRC = ~packet->CRC;
			break;
		}
	}
}

// Assembly:
cmpl $0x0, 0x430(%rsi)
je 0x2235f
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
callq 0x40e0
movl %eax, %ebp
callq 0x40e0
movl %eax, %ecx
movl 0x1d0(%r14), %esi
movl %ebp, %eax
xorl %edx, %edx
divl %esi
testl %edx, %edx
jne 0x22221
movl %ecx, %eax
xorl %edx, %edx
divl %esi
testl %edx, %edx
je 0x22232
incl %r15d
cmpl 0x430(%rbx), %r15d
jb 0x221f8
jmp 0x22357
leaq 0x1924f(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x22351
movq 0x18d87(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r15
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x22280
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0x18d39(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x222d8
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x28270
movq %rax, %r15
leaq 0x10482(%rip), %rax     # 0x32778
leaq 0x10482(%rip), %rsi     # 0x3277f
cmpb $0x0, 0x1cc(%r14)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r15, %rdi
callq 0x4340
leaq 0x104ec(%rip), %rsi     # 0x32809
movl $0x22, %edx
movq %r15, %rdi
callq 0x4340
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
notl 0x438(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/Link.cpp
// Function: CasHMC::Link::PrintState()
void Link::PrintState()
{
	if(inFlightPacket != NULL) {
		STATEN(ALI(17)<<header);
		STATEN((downstream ? "Down " : " Up  "));
		STATEN(*inFlightPacket);
		STATE("*"<<inFlightPacket->LNG);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x1f0(%rdi)
je 0x2248f
movq %rdi, %rbx
leaq 0x1910d(%rip), %r15     # 0x3b48a
movb (%r15), %al
cmpb $0x1, %al
jne 0x223e1
movq 0x18c45(%rip), %rax     # 0x3afd0
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 0x223c2
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 0x18bf7(%rip), %rdi     # 0x3afd0
callq 0x4340
movb (%r15), %al
testb $0x1, %al
je 0x22412
leaq 0xfb90(%rip), %rax      # 0x31f7c
leaq 0xfb8f(%rip), %rsi      # 0x31f82
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movq 0x18bcb(%rip), %rdi     # 0x3afd0
movl $0x5, %edx
callq 0x4340
movb (%r15), %al
testb $0x1, %al
je 0x2242c
movq 0x1f0(%rbx), %rsi
movq 0x18bac(%rip), %rdi     # 0x3afd0
callq 0x28270
movb (%r15), %al
testb $0x1, %al
je 0x2248f
movq 0x18b99(%rip), %r14     # 0x3afd0
leaq 0xdf0b(%rip), %rsi      # 0x30349
movl $0x1, %edx
movq %r14, %rdi
callq 0x4340
movq 0x1f0(%rbx), %rax
movl 0x430(%rax), %esi
movq %r14, %rdi
callq 0x41e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x41f0
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x25c(%rdi), %ecx
movl 0x44c(%rsi), %eax
cmpl %eax, %ecx
je 0x22863
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18cbf(%rip), %r15     # 0x3b4bc
xorl %ebp, %ebp
movl %ecx, %edx
movq 0x270(%rbx), %rsi
movq (%rsi,%rdx,8), %rdi
testq %rdi, %rdi
je 0x2282d
movq (%rdi), %rax
callq *0x8(%rax)
movl 0x25c(%rbx), %edx
movq 0x270(%rbx), %rsi
movl 0x44c(%r14), %eax
movl %edx, %ecx
movq $0x0, (%rsi,%rdx,8)
incl %ecx
movl (%r15), %edx
cmpl %edx, %ecx
cmovbl %ebp, %edx
subl %edx, %ecx
movl %ecx, 0x25c(%rbx)
cmpl %eax, %ecx
jne 0x227ff
leaq 0x18c36(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x22863
leaq 0x18c2b(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
je 0x2286c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x1875d(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r15
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x228aa
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x1870f(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x22902
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x28270
movq %rax, %r14
leaq 0xfe58(%rip), %rax      # 0x32778
leaq 0xfe58(%rip), %rsi      # 0x3277f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r14, %rdi
callq 0x4340
leaq 0xff12(%rip), %rsi      # 0x32858
movl $0x26, %edx
movq %r14, %rdi
callq 0x4340
movl 0x25c(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
movq %rax, %rbx
leaq 0x10b76(%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
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x41f0
nop
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::LinkMaster::UpdateToken(CasHMC::Packet*)
void LinkMaster::UpdateToken(Packet *packet)
{
	if(packet->RTC != 0) {
		tokenCount += packet->RTC;
		DEBUG(ALI(18)<<header<<ALI(15)<<*packet<<(downstream ? "Down) " : "Up)   ")<<"Extracted RTC : "<<packet->RTC<<"  TOKEN COUNT register : "<<tokenCount);
		if(tokenCount > MAX_LINK_BUF) {
			ERROR(header<<"  == Error - TOKEN COUNT register is over the maximum  (CurrentClock : "<<currentClockCycle<<")");
			exit(0);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x43c(%rsi), %eax
testl %eax, %eax
je 0x22ee6
movq %rdi, %rbx
addl 0x208(%rdi), %eax
movl %eax, 0x208(%rdi)
leaq 0x18714(%rip), %rcx     # 0x3b488
cmpb $0x1, (%rcx)
jne 0x22edb
leaq 0x18705(%rip), %rcx     # 0x3b489
cmpb $0x0, (%rcx)
jne 0x22edb
movq %rsi, %r14
movq 0x18239(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r15
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x22dce
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x181eb(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x22e26
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x28270
movq %rax, %r15
leaq 0xf934(%rip), %rax      # 0x32778
leaq 0xf934(%rip), %rsi      # 0x3277f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r15, %rdi
callq 0x4340
leaq 0xfa5a(%rip), %rsi      # 0x328c4
movl $0x10, %edx
movq %r15, %rdi
callq 0x4340
movl 0x43c(%r14), %esi
movq %r15, %rdi
callq 0x41e0
movq %rax, %r14
leaq 0xfa45(%rip), %rsi      # 0x328d5
movl $0x19, %edx
movq %rax, %rdi
callq 0x4340
movl 0x208(%rbx), %esi
movq %r14, %rdi
callq 0x41e0
movq %rax, %r14
movq (%rax), %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 0x208(%rbx), %eax
leaq 0x185d6(%rip), %rcx     # 0x3b4b8
cmpl (%rcx), %eax
ja 0x22ef2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x180f7(%rip), %rdi     # 0x3aff0
leaq 0xd122(%rip), %rsi      # 0x30022
callq 0x42e0
leaq 0xf9e3(%rip), %rsi      # 0x328ef
movq %rax, %rdi
callq 0x42e0
leaq 0xd97c(%rip), %rsi      # 0x30897
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movl $0x71, %esi
callq 0x4500
leaq 0xd10a(%rip), %rsi      # 0x30041
movq %rax, %rdi
callq 0x42e0
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x4290
leaq 0xf9b4(%rip), %rsi      # 0x32906
movq %rax, %rdi
callq 0x42e0
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0x10574(%rip), %rsi     # 0x334e1
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::LinkMaster::FinishRetry()
void LinkMaster::FinishRetry()
{
	DEBUG(ALI(33)<<header<<(downstream ? "Down) " : "Up)   ")<<"RETRY sequence is finished");
	currentState = ACTIVE;
	header.erase(header.find(")"));
	header += ")";
	delete retryStartPacket;
	retryStartPacket = NULL;
	retryAttempts = 1;
	startRetryTimer = false;
	uint64_t retryTime;
	if(downstream) {
		retryTime = retryTimer;
	}
	else {
		retryTime = ceil(retryTimer * (double)tCK/CPU_CLK_PERIOD);
	}
	linkP->statis->errorRetryLat.push_back(retryTime);
	retryTimer = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1769e(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x23ec1
leaq 0x1768f(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x23ec1
movq 0x171c6(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x21, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r14
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x23e41
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 0x17178(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r14
leaq 0xe911(%rip), %rax      # 0x32778
leaq 0xe911(%rip), %rsi      # 0x3277f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r14, %rdi
callq 0x4340
leaq 0xec60(%rip), %rsi      # 0x32aed
movl $0x1a, %edx
movq %r14, %rdi
callq 0x4340
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 $0x0, 0x200(%rbx)
leaq 0x20(%rbx), %r14
leaq 0xf60b(%rip), %rsi      # 0x334e1
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4510
movq 0x28(%rbx), %rcx
cmpq %rax, %rcx
jb 0x23fd1
movq %rax, 0x28(%rbx)
movq 0x20(%rbx), %rcx
movb $0x0, (%rcx,%rax)
leaq 0xf5dc(%rip), %rsi      # 0x334e1
movq %r14, %rdi
callq 0x4580
movq 0x248(%rbx), %rdi
testq %rdi, %rdi
je 0x23f1f
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x248(%rbx)
movl $0x1, 0x258(%rbx)
movb $0x0, 0x251(%rbx)
movl 0x254(%rbx), %eax
cmpb $0x0, 0x1cc(%rbx)
jne 0x23f89
movl %eax, %eax
cvtsi2sd %rax, %xmm0
leaq 0x17648(%rip), %rax     # 0x3b5a0
mulsd (%rax), %xmm0
leaq 0x17535(%rip), %rax     # 0x3b498
divsd (%rax), %xmm0
callq 0x4090
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0xe2d8(%rip), %xmm0     # 0x32258
cvttsd2si %xmm0, %rdx
andl %ecx, %edx
orl %edx, %eax
movq 0x210(%rbx), %rcx
movq 0x1e0(%rcx), %rdi
movl %eax, 0x4(%rsp)
movq 0x58(%rdi), %rsi
cmpq 0x60(%rdi), %rsi
je 0x23fb1
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rdi)
jmp 0x23fbf
addq $0x50, %rdi
leaq 0x4(%rsp), %rdx
callq 0x13c06
movl $0x0, 0x254(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xd967(%rip), %rdi      # 0x3193f
leaq 0xd9a7(%rip), %rsi      # 0x31986
movq %rax, %rdx
xorl %eax, %eax
callq 0x4410
nop
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::LinkMaster::CRCCountdown(int, CasHMC::Packet*)
void LinkMaster::CRCCountdown(int writeP, Packet *packet)
{
	if(CRC_CHECK && !startCRC) {
		startCRC = true;
		countdownCRC = ceil((double)CRC_CAL_CYCLE * packet->LNG);
	}
	
	if(CRC_CHECK && countdownCRC > 0) {
		DEBUG(ALI(18)<<header<<ALI(15)<<*packet<<(downstream ? "Down) " : "Up)   ")
				<<"WAITING CRC calculation ("<<countdownCRC<<"/"<<ceil((double)CRC_CAL_CYCLE*packet->LNG)<<")");
	}
	else {
		UpdateField(writeP, packet);
	}
	countdownCRC = (countdownCRC>0) ? countdownCRC-1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x16ce3(%rip), %rax     # 0x3b4cc
cmpb $0x1, (%rax)
jne 0x249cb
cmpb $0x1, 0x240(%rbx)
jne 0x24803
movl 0x23c(%rbx), %eax
jmp 0x24830
movb $0x1, 0x240(%rbx)
leaq 0x16cbf(%rip), %rax     # 0x3b4d0
movl 0x430(%r14), %ecx
cvtsi2sd %rcx, %xmm0
mulsd (%rax), %xmm0
callq 0x4090
cvttsd2si %xmm0, %eax
movl %eax, 0x23c(%rbx)
testl %eax, %eax
jle 0x249cb
leaq 0x16c49(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x249d8
leaq 0x16c3a(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x249d8
movq 0x16771(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r15
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x24896
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x16723(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x248ee
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x28270
movq %rax, %r15
leaq 0xde6c(%rip), %rax      # 0x32778
leaq 0xde6c(%rip), %rsi      # 0x3277f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r15, %rdi
callq 0x4340
leaq 0xe2b4(%rip), %rsi      # 0x32be6
movl $0x19, %edx
movq %r15, %rdi
callq 0x4340
movl 0x23c(%rbx), %esi
movq %r15, %rdi
callq 0x4500
movq %rax, %r15
leaq 0xb9a3(%rip), %rsi      # 0x302fa
movl $0x1, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x16b65(%rip), %rax     # 0x3b4d0
movl 0x430(%r14), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
mulsd (%rax), %xmm0
callq 0x4090
movq %r15, %rdi
callq 0x4460
movq %rax, %r14
leaq 0xeb4c(%rip), %rsi      # 0x334e1
movl $0x1, %edx
movq %rax, %rdi
callq 0x4340
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
jmp 0x249d8
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x249f8
movl 0x23c(%rbx), %eax
leal -0x1(%rax), %ecx
xorl %edx, %edx
testl %eax, %eax
cmovgl %ecx, %edx
movl %edx, 0x23c(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::LinkMaster::QuitePacket()
void LinkMaster::QuitePacket()
{
	//packet, cmd, addr, cub, lng, *lat
	Packet *packetQUIET = new Packet(FLOW, QUIET, 0, 0, 1, NULL);
	packetQUIET->RRP = lastestRRP;
	DEBUG(ALI(18)<<header<<ALI(15)<<*packetQUIET<<(downstream ? "Down) " : "Up)   ")<<"sending QUITE packet");
	linkRxTx.push_back(packetQUIET);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x468, %edi            # imm = 0x468
callq 0x42f0
movq %rax, %r14
movq $0x0, (%rsp)
movq %rax, %rdi
movl $0x2, %esi
movl $0x4, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x27c44
movq %r14, 0x10(%rsp)
movl 0x20c(%rbx), %eax
movl %eax, 0x44c(%r14)
leaq 0x1649f(%rip), %rax     # 0x3b488
cmpb $0x1, (%rax)
jne 0x25110
leaq 0x16490(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x25110
movq 0x15fc7(%rip), %rax     # 0x3afd0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0x12, 0x10(%rax,%rdx)
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %r15
cmpb $0x0, 0xe1(%rax,%rcx)
jne 0x25040
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x15f79(%rip), %rdi     # 0x3afd0
callq 0x4340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x10(%r15,%rcx)
movq -0x18(%rax), %rax
leaq (%r15,%rax), %r12
cmpb $0x0, 0xe1(%r15,%rax)
jne 0x25098
movq %r12, %rdi
movl $0x20, %esi
callq 0x42d0
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x28270
movq %rax, %r15
leaq 0xd6c2(%rip), %rax      # 0x32778
leaq 0xd6c2(%rip), %rsi      # 0x3277f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r15, %rdi
callq 0x4340
leaq 0xdb99(%rip), %rsi      # 0x32c75
movl $0x14, %edx
movq %r15, %rdi
callq 0x4340
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movq 0x1f0(%rbx), %rsi
cmpq 0x1f8(%rbx), %rsi
je 0x2512d
movq %r14, (%rsi)
addq $0x8, 0x1f0(%rbx)
jmp 0x25141
addq $0x1e8, %rbx            # imm = 0x1E8
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x1a462
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x468, %esi            # imm = 0x468
movq %r14, %rdi
callq 0x4300
movq %rbx, %rdi
callq 0x4540
nop
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::LinkMaster::FinishRetrain()
void LinkMaster::FinishRetrain()
{
	currentState = ACTIVE;
	//The requester must send a minimum of 32 NULL FLITs before sending the first nonNULL flow packet
	Packet *packetNULL = NULL;
	for(int i=0; i<32; i++) {
		packetNULL = new Packet(FLOW, NULL_, 0, 0, 1, NULL);
		linkRxTx.push_back(packetNULL);
	}
	DEBUG(ALI(18)<<header<<ALI(15)<<*packetNULL<<(downstream ? "Down) " : "Up)   ")
			<<"sending a minimum of 32 NULL FLITs before entering ACTIVE mode");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x0, 0x200(%rdi)
leaq 0x8(%rsp), %r14
movq $0x0, (%r14)
leaq 0x1e8(%rdi), %r15
movl $0x20, %ebp
movl $0x468, %edi            # imm = 0x468
callq 0x42f0
movq %rax, %r12
movq $0x0, (%rsp)
movq %rax, %rdi
movl $0x2, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x27c44
movq %r12, 0x8(%rsp)
movq 0x1f0(%rbx), %rsi
cmpq 0x1f8(%rbx), %rsi
je 0x251e8
movq %r12, (%rsi)
addq $0x8, 0x1f0(%rbx)
jmp 0x251f3
movq %r15, %rdi
movq %r14, %rdx
callq 0x1a462
decl %ebp
jne 0x25197
leaq 0x1628a(%rip), %rax     # 0x3b488
cmpb $0x0, (%rax)
je 0x25325
leaq 0x1627b(%rip), %rax     # 0x3b489
cmpb $0x0, (%rax)
jne 0x25325
movq 0x15db2(%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 0x25255
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 0x15d64(%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 0x252ac
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 0xd4ad(%rip), %rax      # 0x32778
leaq 0xd4ad(%rip), %rsi      # 0x3277f
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movl $0x6, %edx
movq %r14, %rdi
callq 0x4340
leaq 0xd999(%rip), %rsi      # 0x32c8a
movl $0x3e, %edx
movq %r14, %rdi
callq 0x4340
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
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x468, %esi            # imm = 0x468
movq %r12, %rdi
callq 0x4300
movq %rbx, %rdi
callq 0x4540
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkMaster.cpp
// Function: CasHMC::FindAvailableLink(int&, std::vector<CasHMC::LinkMaster*, std::allocator<CasHMC::LinkMaster*>>&)
int FindAvailableLink(int &link, vector<LinkMaster *> &LM)
{
	switch(LINK_PRIORITY) {
		case ROUND_ROBIN:
			if(++link >= NUM_LINKS)
				link=0;
			return link;
			break;
		case BUFFER_AWARE:
			unsigned minBufferSize = MAX_LINK_BUF;
			unsigned minBufferLink = 0;
			for(int l=0; l<NUM_LINKS; l++) {
				if(LM[l]->currentState != ACTIVE && LM[l]->currentState != LINK_RETRY) {
					continue;
				}
				else {
					int bufSizeTemp = LM[l]->Buffers.size();
					for(int i=0; i<LM[l]->linkRxTx.size(); i++) {
						if(LM[l]->linkRxTx[i] != NULL) {
							bufSizeTemp += LM[l]->linkRxTx[i]->LNG;
						}
					}
					if(bufSizeTemp < minBufferSize) {
						minBufferSize = bufSizeTemp;
						minBufferLink = l;
					}
				}
			}
			return minBufferLink;
			break;
	}
	return -1;
}

// Assembly:
pushq %rbx
leaq 0x1598e(%rip), %rax     # 0x3b4e4
movl (%rax), %ecx
cmpl $0x1, %ecx
je 0x25b85
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x25c20
movl (%rdi), %ecx
incl %ecx
movl %ecx, (%rdi)
leaq 0x15931(%rip), %rdx     # 0x3b4a8
xorl %eax, %eax
cmpl (%rdx), %ecx
cmovll %ecx, %eax
movl %eax, (%rdi)
jmp 0x25c20
leaq 0x1591c(%rip), %rax     # 0x3b4a8
movslq (%rax), %rcx
testq %rcx, %rcx
jle 0x25c1e
leaq 0x15919(%rip), %rax     # 0x3b4b8
movl (%rax), %edx
movq (%rsi), %rsi
xorl %edi, %edi
xorl %eax, %eax
movq (%rsi,%rdi,8), %r10
movl 0x200(%r10), %r8d
cmpl $0xb, %r8d
je 0x25bbe
testl %r8d, %r8d
jne 0x25c14
movq 0x1d8(%r10), %r8
subq 0x1d0(%r10), %r8
movq 0x1e8(%r10), %r9
shrq $0x3, %r8
movq 0x1f0(%r10), %r10
subq %r9, %r10
je 0x25c0a
sarq $0x3, %r10
cmpq $0x1, %r10
adcq $0x0, %r10
xorl %r11d, %r11d
movq (%r9,%r11,8), %rbx
testq %rbx, %rbx
je 0x25c02
addl 0x430(%rbx), %r8d
incq %r11
cmpq %r11, %r10
jne 0x25bf2
cmpl %edx, %r8d
cmovbl %r8d, %edx
cmovbl %edi, %eax
incq %rdi
cmpq %rcx, %rdi
jne 0x25ba8
jmp 0x25c20
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/SingleVectorObject.h
// Function: CasHMC::SingleVectorObject<CasHMC::Packet>::Step()
void Step() {
		currentClockCycle++;
		for(int i=0; i<Buffers.size(); i++) {
			if(Buffers[i] != NULL) {
				Buffers[i]->bufPopDelay = (Buffers[i]->bufPopDelay>0) ? Buffers[i]->bufPopDelay-1 : 0;
			}
		}
	}

// Assembly:
incq 0x8(%rdi)
movq 0x1d0(%rdi), %rax
movq 0x1d8(%rdi), %rcx
subq %rax, %rcx
je 0x25e41
sarq $0x3, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edx, %edx
xorl %esi, %esi
movq (%rax,%rsi,8), %rdi
testq %rdi, %rdi
je 0x25e39
movl 0x14(%rdi), %r8d
leal -0x1(%r8), %r9d
testl %r8d, %r8d
cmovlel %edx, %r9d
movl %r9d, 0x14(%rdi)
incq %rsi
cmpq %rsi, %rcx
jne 0x25e1d
retq
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkSlave.cpp
// Function: CasHMC::LinkSlave::LinkSlave(std::basic_ofstream<char, std::char_traits<char>>&, std::basic_ofstream<char, std::char_traits<char>>&, unsigned int, bool)
LinkSlave::LinkSlave(ofstream &debugOut_, ofstream &stateOut_, unsigned id, bool down):
	SingleVectorObject<Packet>(debugOut_, stateOut_, MAX_LINK_BUF, down),
	linkSlaveID(id)
{
	classID << linkSlaveID;
	header = "   (LS_";
	header += downstream ? "D" : "U";
	header += classID.str() + ")";
	
	slaveSEQ = 0;
	countdownCRC = 0;
	startCRC = false;
	downBufferDest = NULL;
	upBufferDest = NULL;
	localLinkMaster = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movq %rdi, %rbx
leaq 0x155e6(%rip), %rax     # 0x3b4b8
movl (%rax), %ecx
callq 0x25c22
leaq 0x14dc0(%rip), %rax     # 0x3aca0
movq %rax, (%rbx)
movl %ebp, 0x204(%rbx)
leaq 0x50(%rbx), %rdi
movl %ebp, %esi
callq 0x41e0
leaq 0x20(%rbx), %r14
movq 0x28(%rbx), %rdx
leaq 0xd07e(%rip), %rcx      # 0x32f81
movl $0x7, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0x4440
leaq 0xd6fb(%rip), %rax      # 0x33615
leaq 0xc059(%rip), %rsi      # 0x31f7a
cmpb $0x0, 0x1cc(%rbx)
cmovneq %rax, %rsi
movq %r14, %rdi
callq 0x4580
leaq 0x58(%rbx), %rsi
leaq 0x28(%rsp), %rdi
callq 0x4450
leaq 0xd598(%rip), %rsi      # 0x334e1
leaq 0x28(%rsp), %rdi
callq 0x4580
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x25f7a
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x25f84
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %r15, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x4110
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x25fbb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25fd6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
xorps %xmm0, %xmm0
movups %xmm0, 0x218(%rbx)
movups %xmm0, 0x208(%rbx)
movb $0x0, 0x228(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x26018
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x26018
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2603a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x2603a
jmp 0x26037
movq %rax, %r14
movq %rbx, %rdi
callq 0x25e42
movq %r14, %rdi
callq 0x4540
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/LinkSlave.cpp
// Function: CasHMC::LinkSlave::CallbackReceive(CasHMC::Packet*, bool)
void LinkSlave::CallbackReceive(Packet *packet, bool chkReceive)
{
/*	if(chkReceive) {
		DEBUG(ALI(18)<<header<<ALI(15)<<*packet<<(downstream ? "Down) " : "Up)   ")<<"RECEIVING packet");
	}
	else {
		DEBUG(ALI(18)<<header<<ALI(15)<<*packet<<(downstream ? "Down) " : "Up)   ")<<"packet buffer FULL");
	}*/
	
	if(packet->packetType == FLOW) {
		ERROR(header<<"  == Error - flow packet "<<*packet<<" is not meant to be here");
		exit(0);
	}
	else {
		if(!chkReceive) {
			ERROR(header<<"  == Error - packet "<<*packet<<" is missed, because link slave buffer is FULL (CurrentClock : "<<currentClockCycle<<")");
			exit(0);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x2, 0x10(%rsi)
je 0x260d0
testb %dl, %dl
je 0x26152
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x14f19(%rip), %rdi     # 0x3aff0
leaq 0x9f44(%rip), %rsi      # 0x30022
callq 0x42e0
leaq 0xcc36(%rip), %rsi      # 0x32d20
movq %rax, %rdi
callq 0x42e0
leaq 0xa79e(%rip), %rsi      # 0x30897
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movl $0x35, %esi
callq 0x4500
leaq 0x9f2c(%rip), %rsi      # 0x30041
movq %rax, %rdi
callq 0x42e0
addq $0x20, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x4290
leaq 0xcc03(%rip), %rsi      # 0x32d36
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x28270
leaq 0xcc03(%rip), %rsi      # 0x32d50
jmp 0x261e7
movq 0x14e97(%rip), %rdi     # 0x3aff0
leaq 0x9ec2(%rip), %rsi      # 0x30022
callq 0x42e0
leaq 0xcbb4(%rip), %rsi      # 0x32d20
movq %rax, %rdi
callq 0x42e0
leaq 0xa71c(%rip), %rsi      # 0x30897
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movl $0x3a, %esi
callq 0x4500
leaq 0x9eaa(%rip), %rsi      # 0x30041
movq %rax, %rdi
callq 0x42e0
leaq 0x20(%r14), %rsi
movq %rax, %rdi
callq 0x4290
leaq 0xcbb7(%rip), %rsi      # 0x32d69
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x28270
leaq 0xcbb2(%rip), %rsi      # 0x32d7e
movq %rax, %rdi
callq 0x42e0
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x40c0
leaq 0xd2fa(%rip), %rsi      # 0x334e1
movq %rax, %rdi
callq 0x42e0
movq %rax, %rdi
callq 0x4170
xorl %edi, %edi
callq 0x4360
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/DualVectorObject.h
// Function: CasHMC::DualVectorObject<CasHMC::Transaction, CasHMC::Packet>::ReceiveUp(CasHMC::Packet*)
bool ReceiveUp(UpT *upEle) {
		if(upBuffers.size() + upEle->LNG <= upBufferMax) {
			//Upstream buffer does not need upBufPopCycle (one cycle to pop one buffer data), 
			//	because upBufferDest (upstream buffer destination) is updated before buffer class.
			upBuffers.push_back(upEle);
			//If receiving packet is packet, add virtual tail packet in Buffers as long as packet length
			if(sizeof(*upEle) == sizeof(Packet)) {
				for(int i=1; i<upEle->LNG; i++) {
					upBuffers.push_back(NULL);
				}
			}
			CallbackReceiveUp(upEle, true);
			return true;
		}
		else {
			CallbackReceiveUp(upEle, false);
			return false;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movq 0x1f0(%rdi), %rax
movq %rax, %r12
subq 0x1e8(%rdi), %r12
sarq $0x3, %r12
movl 0x430(%rsi), %ecx
addq %rcx, %r12
movslq 0x1cc(%rdi), %r13
cmpq %r13, %r12
ja 0x27bc9
leaq 0x1e8(%rbx), %r14
cmpq 0x1f8(%rbx), %rax
je 0x27bd3
movq %rsi, (%rax)
addq $0x8, 0x1f0(%rbx)
jmp 0x27bef
movq (%rbx), %rax
movq %rbx, %rdi
xorl %edx, %edx
jmp 0x27c2c
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1a462
movq (%r15), %rsi
movl 0x430(%rsi), %ecx
cmpl $0x2, %ecx
jb 0x27c21
movl $0x1, %ebp
leaq 0x10(%rsp), %r15
movq $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1a6e8
incl %ebp
movq 0x8(%rsp), %rsi
cmpl 0x430(%rsi), %ebp
jb 0x27bfe
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x1, %edx
callq *0x20(%rax)
cmpq %r13, %r12
setbe %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/Packet.cpp
// Function: CasHMC::Packet::Packet(CasHMC::PacketType, CasHMC::PacketCommandType, unsigned long, unsigned int, unsigned int, CasHMC::TranTrace*)
Packet::Packet(PacketType packet, PacketCommandType cmd, uint64_t addr, unsigned cub, unsigned lng, TranTrace *lat):
	trace(lat),
	packetType(packet),
	CUB(cub),
	LNG(lng),
	CMD(cmd),
	ADRS(addr)
{
	bufPopDelay=1;
	CRCtable[256]=0;	
	Pb=0;
	CRC=0; RTC=0; SLID=0;
	SEQ=0; FRP=0; RRP=0;
	AF=0; ERRSTAT=0; DINV=0;
	chkCRC = false;
	chkRRP = false;
	segment = false;
	reqDataSize=16;	//The minimum size is 16-Byte
	
	if(packet != FLOW) {
		TAG = (packetGlobalTAG++)%2048;
	}
	else {
		TAG = 0;
	}
	
	ADRS = (ADRS<<30)>>30;	//Address length is 34 bits
	
	if(CRC_CHECK) {
		if(LNG>1) {
			DATA = new uint64_t[(LNG-1)*2];
			uint64_t tempData;
			for(int i=0; i<(LNG-1)*2; i++) {
				tempData = rand();
				tempData = (tempData<<32)|rand();
				DATA[i] = tempData;
			}
		}
		else {
			DATA = NULL;
		}
		MakeCRCtable(CRCtable, 0xEB31D82E);
	}
	else {
		DATA = NULL;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %r9d, %r14d
movq %rdi, %rbx
movq 0x20(%rsp), %rax
leaq 0x1308d(%rip), %rdi     # 0x3ace8
movq %rdi, (%rbx)
movq %rax, 0x8(%rbx)
movl %esi, 0x10(%rbx)
movl %r8d, 0x428(%rbx)
movl %r9d, 0x430(%rbx)
movl %edx, 0x434(%rbx)
movl $0x1, 0x14(%rbx)
movabsq $0x1000000000, %rax     # imm = 0x1000000000
movq %rax, 0x420(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x438(%rbx)
movq $0x0, 0x448(%rbx)
movups %xmm0, 0x458(%rbx)
xorl %eax, %eax
cmpl $0x2, %esi
je 0x27cc7
leaq 0x137bd(%rip), %rdx     # 0x3b478
movl (%rdx), %eax
leal 0x1(%rax), %esi
movl %esi, (%rdx)
andl $0x7ff, %eax            # imm = 0x7FF
movl %eax, 0x42c(%rbx)
movabsq $0x3ffffffff, %rax      # imm = 0x3FFFFFFFF
andq %rax, %rcx
movq %rcx, 0x450(%rbx)
leaq 0x137e4(%rip), %rax     # 0x3b4cc
cmpb $0x1, (%rax)
jne 0x27d4d
cmpl $0x2, %r14d
jb 0x27d57
leal -0x2(,%r14,2), %edi
shlq $0x3, %rdi
callq 0x4030
movq %rax, 0x18(%rbx)
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpl $0x1, %r14d
je 0x27d5f
xorl %r15d, %r15d
callq 0x40e0
movl %eax, %r14d
shlq $0x20, %r14
callq 0x40e0
cltq
orq %r14, %rax
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movl 0x430(%rbx), %eax
leal -0x2(,%rax,2), %eax
cmpq %rax, %r15
jb 0x27d18
jmp 0x27d5f
movq $0x0, 0x18(%rbx)
jmp 0x27d8c
movq $0x0, 0x18(%rbx)
xorl %eax, %eax
movl $0x8, %ecx
movl %eax, %edx
movl %edx, %esi
andl $0x1, %edx
negl %edx
shrl %esi
andl $0xeb31d82e, %edx       # imm = 0xEB31D82E
xorl %esi, %edx
decl %ecx
jne 0x27d68
movl %edx, 0x20(%rbx,%rax,4)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x27d61
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/Packet.cpp
// Function: CasHMC::Packet::MakeCRCtable(unsigned int*, unsigned int)
void Packet::MakeCRCtable(uint32_t *table, uint32_t id) 
{
	uint32_t k;
	for(int i=0; i<256; ++i){
		k = i;
		for(int j=0; j<8; ++j){
			if(k&1)	k = (k >> 1) ^ id;
			else	k >>= 1;
		}
		table[i] = k;
	}
}

// Assembly:
xorl %eax, %eax
movl $0x8, %ecx
movl %eax, %edi
movl %edi, %r8d
andl $0x1, %edi
negl %edi
shrl %r8d
andl %edx, %edi
xorl %r8d, %edi
decl %ecx
jne 0x27d9b
movl %edi, (%rsi,%rax,4)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x27d94
retq
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/Packet.cpp
// Function: CasHMC::Packet::Packet(CasHMC::PacketType, CasHMC::PacketCommandType, unsigned int, unsigned int, CasHMC::TranTrace*)
Packet::Packet(PacketType packet, PacketCommandType cmd, unsigned tag, unsigned lng, TranTrace *lat):
	trace(lat),
	packetType(packet),
	TAG(tag),
	LNG(lng),
	CMD(cmd)
{
	bufPopDelay=1;
	CRCtable[256]=0;	
	CUB=0; Pb=0;
	CRC=0; RTC=0; SLID=0;
	SEQ=0; FRP=0; RRP=0;
	AF=0; ERRSTAT=0; DINV=0;
	chkCRC = false;
	chkRRP = false;
	segment = false;
	reqDataSize=16;	//The minimum size is 16-Byte
	
	if(CRC_CHECK) {
		if(LNG>1) {
			DATA = new uint64_t[(LNG-1)*2];
			uint64_t tempData;
			for(int i=0; i<(LNG-1)*2; i++) {
				tempData = rand();
				tempData = (tempData<<32)|rand();
				DATA[i] = tempData;
			}
		}
		else {
			DATA = NULL;
		}
		MakeCRCtable(CRCtable, 0xEB31D82E);
	}
	else {
		DATA = NULL;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x12f1b(%rip), %rax     # 0x3ace8
movq %rax, (%rdi)
movq %r9, 0x8(%rdi)
movl %esi, 0x10(%rdi)
movl %ecx, 0x42c(%rdi)
movl %r8d, 0x430(%rdi)
movl %edx, 0x434(%rdi)
movl $0x1, 0x14(%rdi)
movl $0x0, 0x428(%rdi)
movabsq $0x1000000000, %rax     # imm = 0x1000000000
movq %rax, 0x420(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x438(%rdi)
movq $0x0, 0x448(%rdi)
movups %xmm0, 0x458(%rdi)
leaq 0x1369d(%rip), %rax     # 0x3b4cc
cmpb $0x1, (%rax)
jne 0x27e97
movl %r8d, %r14d
cmpl $0x2, %r8d
jb 0x27ea1
leal -0x2(,%r14,2), %edi
shlq $0x3, %rdi
callq 0x4030
movq %rax, 0x18(%rbx)
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpl $0x1, %r14d
je 0x27ea9
xorl %r15d, %r15d
callq 0x40e0
movl %eax, %r14d
shlq $0x20, %r14
callq 0x40e0
cltq
orq %r14, %rax
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movl 0x430(%rbx), %eax
leal -0x2(,%rax,2), %eax
cmpq %rax, %r15
jb 0x27e62
jmp 0x27ea9
movq $0x0, 0x18(%rbx)
jmp 0x27ed6
movq $0x0, 0x18(%rbx)
xorl %eax, %eax
movl $0x8, %ecx
movl %eax, %edx
movl %edx, %esi
andl $0x1, %edx
negl %edx
shrl %esi
andl $0xeb31d82e, %edx       # imm = 0xEB31D82E
xorl %esi, %edx
decl %ecx
jne 0x27eb2
movl %edx, 0x20(%rbx,%rax,4)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x27eab
popq %rbx
popq %r14
popq %r15
retq