// File: PeterDenton[P]Nu-Pert/src/Progress.cpp
// Function: Progress_Bar::~Progress_Bar()
Progress_Bar::~Progress_Bar()
{
	if (not Progress_Bar_visible)
		return;
	update(1);
	elapsed_time = time(NULL) - start_time;
	std::cerr << std::endl;
	std::cerr << "Elapsed time: " << elapsed_time << " ";
	if (Progress_Bar_statistics)
	{
		double sum = 0;
		double sumsq = 0;
		double res;
		for (int i = 0; i < N_stats; i++)
		{
			res = times[0][i] + times[1][i] - elapsed_time;
			sum += res;
			sumsq += pow(res, 2);
		}
		std::cerr << "Mean: " << sum / N_stats << " STD: " << sqrt(sumsq / N_stats - pow(sum / N_stats, 2)) << " N: " << N_stats;
	}
	std::cerr << std::endl;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x74f6(%rip), %rcx      # 0x16d80
addq $0x10, %rcx
movq %rcx, (%rax)
testb $0x1, 0x799b(%rip)      # 0x17233
jne 0xf89f
jmp 0xfaca
movq 0x48(%rsp), %rdi
movsd 0x276c(%rip), %xmm0     # 0x12018
callq 0xf5e0
jmp 0xf8b3
xorl %eax, %eax
movl %eax, %edi
callq 0x2130
movq %rax, %rcx
movq 0x48(%rsp), %rax
cvtsi2sd %rcx, %xmm0
movsd 0x18(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
movq 0x7712(%rip), %rdi      # 0x16ff0
movq 0x76e3(%rip), %rsi      # 0x16fc8
callq 0x2180
jmp 0xf8ec
movq 0x76fd(%rip), %rdi      # 0x16ff0
leaq 0x326e(%rip), %rsi      # 0x12b68
callq 0x2160
movq %rax, 0x40(%rsp)
jmp 0xf906
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rax
movsd 0x20(%rax), %xmm0
callq 0x22e0
movq %rax, 0x38(%rsp)
jmp 0xf921
movq 0x38(%rsp), %rdi
leaq 0x3269(%rip), %rsi      # 0x12b96
callq 0x2160
jmp 0xf934
testb $0x1, 0x78f9(%rip)      # 0x17234
je 0xfab5
xorps %xmm0, %xmm0
movsd %xmm0, 0x68(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x60(%rsp)
movl $0x0, 0x54(%rsp)
movq 0x48(%rsp), %rcx
movl 0x54(%rsp), %eax
cmpl 0x670(%rcx), %eax
jge 0xf9d3
movq 0x48(%rsp), %rax
movslq 0x54(%rsp), %rcx
movsd 0x30(%rax,%rcx,8), %xmm0
movslq 0x54(%rsp), %rcx
addsd 0x350(%rax,%rcx,8), %xmm0
subsd 0x20(%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x58(%rsp), %xmm0
addsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x58(%rsp), %xmm0
movsd 0x2653(%rip), %xmm1     # 0x12008
callq 0x22a0
addsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0xf95b
movq 0x7616(%rip), %rdi      # 0x16ff0
leaq 0x3196(%rip), %rsi      # 0x12b77
callq 0x2160
movq %rax, 0x30(%rsp)
jmp 0xf9ed
movq 0x30(%rsp), %rdi
movq 0x48(%rsp), %rax
movsd 0x68(%rsp), %xmm0
cvtsi2sdl 0x670(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x22e0
movq %rax, 0x28(%rsp)
jmp 0xfa15
movq 0x28(%rsp), %rdi
leaq 0x315d(%rip), %rsi      # 0x12b7e
callq 0x2160
movq %rax, 0x20(%rsp)
jmp 0xfa2d
movq 0x48(%rsp), %rax
movsd 0x60(%rsp), %xmm0
cvtsi2sdl 0x670(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x68(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd 0x25ac(%rip), %xmm1     # 0x12008
callq 0x22a0
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
callq 0x20f0
movq 0x20(%rsp), %rdi
callq 0x22e0
movq %rax, 0x18(%rsp)
jmp 0xfa84
movq 0x18(%rsp), %rdi
leaq 0x30f5(%rip), %rsi      # 0x12b85
callq 0x2160
movq %rax, 0x8(%rsp)
jmp 0xfa9c
movq 0x8(%rsp), %rdi
movq 0x48(%rsp), %rax
movl 0x670(%rax), %esi
callq 0x2290
jmp 0xfab3
jmp 0xfab5
movq 0x7534(%rip), %rdi      # 0x16ff0
movq 0x7505(%rip), %rsi      # 0x16fc8
callq 0x2180
jmp 0xfaca
addq $0x78, %rsp
retq
movq %rax, %rdi
callq 0xfbf0
nopw (%rax,%rax)