// File: /workspace/github_cpp_makefile_star2_O1/estwings57[P]CasHMC/sources/CasHMCWrapper.cpp
// Function: CasHMC::CasHMCWrapper::MakePlotData()
void CasHMCWrapper::MakePlotData()
{
	double elapsedPlotTime = (double)(PLOT_SAMPLING*CPU_CLK_PERIOD*1E-9);
	
	//Effective link bandwidth
	vector<double> downLinkEffecPlotBandwidth = vector<double>(NUM_LINKS, 0);
	vector<double> upLinkEffecPlotBandwidth = vector<double>(NUM_LINKS, 0);
	vector<double> linkEffecPlotBandwidth = vector<double>(NUM_LINKS, 0);
	for(int i=0; i<NUM_LINKS; i++) {
		downLinkEffecPlotBandwidth[i] = (downLinkDataSize[i] - downLinkDataSizeTemp[i]) / elapsedPlotTime / (1<<30);
		upLinkEffecPlotBandwidth[i] = (upLinkDataSize[i] - upLinkDataSizeTemp[i]) / elapsedPlotTime / (1<<30);
		linkEffecPlotBandwidth[i] = downLinkEffecPlotBandwidth[i] + upLinkEffecPlotBandwidth[i];
		downLinkDataSizeTemp[i] = downLinkDataSize[i];
		upLinkDataSizeTemp[i] = upLinkDataSize[i];
	}
	
	//HMC bandwidth
	double hmcPlotBandwidth = (hmcTransmitSize - hmcTransmitSizeTemp)/elapsedPlotTime/(1<<30);
	hmcTransmitSizeTemp = hmcTransmitSize;
	
	plotDataOut<<setw(8)<<setfill(' ')<<currentClockCycle/PLOT_SAMPLING;
	for(int i=0; i<NUM_LINKS; i++) {
		plotDataOut<<setw(10)<<setfill(' ')<<linkEffecPlotBandwidth[i];
	}
	plotDataOut<<setw(10)<<setfill(' ')<<hmcPlotBandwidth<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x2a824(%rip), %r13     # 0x3c48c
cvtsi2sdl (%r13), %xmm0
leaq 0x2a823(%rip), %rax     # 0x3c498
mulsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x2a822(%rip), %r12     # 0x3c4a8
movslq (%r12), %rsi
xorl %r15d, %r15d
leaq 0x30(%rsp), %rdx
movq %r15, (%rdx)
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rcx
callq 0x13b2a
movslq (%r12), %rsi
movq %r15, (%r14)
leaq 0x30(%rsp), %rdi
leaq 0x18(%rsp), %rdx
leaq 0x48(%rsp), %rcx
callq 0x13b2a
movslq (%r12), %rsi
leaq 0x48(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x13b2a
movsd 0x10(%rsp), %xmm5
mulsd 0x1f3c9(%rip), %xmm5    # 0x310b8
movslq (%r12), %rax
testq %rax, %rax
jle 0x11dc7
movq 0x160(%rbx), %rcx
movq 0x178(%rbx), %rdx
movq 0x3e8(%rbx), %rsi
movq 0x50(%rsp), %rdi
movq 0x400(%rbx), %r8
movq 0x30(%rsp), %r9
movq 0x18(%rsp), %r10
xorl %r11d, %r11d
movq 0x1f3ce(%rip), %xmm0    # 0x31100
movapd 0x1f3b6(%rip), %xmm1    # 0x310f0
movsd 0x1f37e(%rip), %xmm2    # 0x310c0
movq (%rcx,%r11,8), %r14
movq %r14, %r15
subq (%rsi,%r11,8), %r15
movq %r15, %xmm3
punpckldq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
subpd %xmm1, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
divsd %xmm5, %xmm4
mulsd %xmm2, %xmm4
movsd %xmm4, (%rdi,%r11,8)
movq (%rdx,%r11,8), %r15
subq (%r8,%r11,8), %r15
movq %r15, %xmm3
punpckldq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
subpd %xmm1, %xmm3
movapd %xmm3, %xmm4
unpckhpd %xmm3, %xmm4            # xmm4 = xmm4[1],xmm3[1]
addsd %xmm3, %xmm4
divsd %xmm5, %xmm4
mulsd %xmm2, %xmm4
movsd %xmm4, (%r9,%r11,8)
addsd (%rdi,%r11,8), %xmm4
movsd %xmm4, (%r10,%r11,8)
movq %r14, (%rsi,%r11,8)
movq (%rdx,%r11,8), %r14
movq %r14, (%r8,%r11,8)
incq %r11
cmpq %r11, %rax
jne 0x11d42
movsd %xmm5, 0x10(%rsp)
movq 0x128(%rbx), %rax
movq %rax, %rbp
subq 0x3e0(%rbx), %rbp
movq %rax, 0x3e0(%rbx)
movq 0xa18(%rbx), %rax
movq -0x18(%rax), %rcx
movq $0x8, 0xa28(%rbx,%rcx)
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %r15
addq $0xa18, %r15            # imm = 0xA18
cmpb $0x0, 0xe1(%r15)
jne 0x11e31
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
leaq 0xa18(%rbx), %r14
movb $0x20, 0xe0(%r15)
movq 0x370(%rbx), %rax
movslq (%r13), %rcx
xorl %edx, %edx
divq %rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x41e0
cmpl $0x0, (%r12)
jle 0x11ed1
xorl %r13d, %r13d
movq 0xa18(%rbx), %rax
movq -0x18(%rax), %rcx
movq $0xa, 0xa28(%rbx,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %r15
cmpb $0x0, 0xaf9(%rbx,%rax)
jne 0x11eaa
movq %r15, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x20, 0xe0(%r15)
movq 0x18(%rsp), %rax
movsd (%rax,%r13,8), %xmm0
movq %r14, %rdi
callq 0x4460
incq %r13
movslq (%r12), %rax
cmpq %rax, %r13
jl 0x11e65
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0xa, 0x10(%r14,%rcx)
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rbx
cmpb $0x0, 0xe1(%r14,%rax)
jne 0x11f0e
movq %rbx, %rdi
movl $0x20, %esi
callq 0x42d0
movb %al, 0xe0(%rbx)
movb $0x1, 0xe1(%rbx)
movq %rbp, %xmm1
punpckldq 0x1f1e5(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1f1cd(%rip), %xmm1    # 0x310f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
mulsd 0x1f183(%rip), %xmm0    # 0x310c0
movb $0x20, 0xe0(%rbx)
movq %r14, %rdi
callq 0x4460
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
callq 0x41f0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x11f8d
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x11fa4
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x11fbb
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x11ff0
movq %rax, %rbx
jmp 0x12007
jmp 0x11fd6
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x11ff0
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x12007
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1201e
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x4540