// File: /workspace/github_cpp_makefile_star2_O2/PeterDenton[P]Nu-Pert/src/Progress.cpp
// Function: Progress_Bar::update(double)
void Progress_Bar::update(double _progress)
{
	if (not Progress_Bar_visible)
		return;
	if (std::abs(_progress - progress) < 0.009 and _progress < 1)
		return;

	progress = _progress;
	elapsed_time = time(NULL) - start_time;
	remaining_time = elapsed_time * (1. - progress) / progress;

	if (Progress_Bar_statistics and fmod(elapsed_time, 5) == 0)
	{
		if (N_stats < 100)
		{
			times[0][N_stats] = elapsed_time;
			times[1][N_stats] = remaining_time;
			N_stats++;
		}
	}

	std::cerr << "  " << int(progress * 100.) << " % [";
	int position = bar_width * progress;
	for (int i = 0; i < bar_width; ++i)
	{
		if (i < position)
			std::cerr << "=";
		else if (i == position)
			std::cerr << ">";
		else
			std::cerr << " ";
	}
	std::cerr << "] ";
	if (progress > 0.15 or elapsed_time > 10)
		std::cerr << int(remaining_time) << "   ";
	std::cerr << "\r";
	std::cerr.flush();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, 0x7489(%rip)      # 0x111bb
jne 0x9d64
movq %rdi, %rbx
movsd 0x22d9(%rip), %xmm1     # 0xc018
ucomisd %xmm0, %xmm1
jbe 0x9d73
movapd %xmm0, %xmm1
subsd 0x10(%rbx), %xmm1
andpd 0x276a(%rip), %xmm1     # 0xc4c0
movsd 0x2e82(%rip), %xmm2     # 0xcbe0
ucomisd %xmm1, %xmm2
jbe 0x9d73
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd %xmm0, 0x10(%rbx)
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2160
cvtsi2sd %rax, %xmm0
subsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x20(%rbx)
movsd 0x10(%rbx), %xmm1
movsd 0x227a(%rip), %xmm2     # 0xc018
subsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28(%rbx)
cmpb $0x1, 0x7406(%rip)      # 0x111bc
jne 0x9dff
movsd 0x2738(%rip), %xmm1     # 0xc4f8
callq 0x21d0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x9dff
jp 0x9dff
movslq 0x670(%rbx), %rax
cmpq $0x63, %rax
jg 0x9dff
movsd 0x20(%rbx), %xmm0
movsd %xmm0, 0x30(%rbx,%rax,8)
movsd 0x28(%rbx), %xmm0
movsd %xmm0, 0x350(%rbx,%rax,8)
incl %eax
movl %eax, 0x670(%rbx)
movq 0x71ea(%rip), %rdi      # 0x10ff0
leaq 0x2e20(%rip), %rsi      # 0xcc2d
callq 0x2190
movsd 0x10(%rbx), %xmm0
mulsd 0x2dc9(%rip), %xmm0     # 0xcbe8
cvttsd2si %xmm0, %esi
movq %rax, %rdi
callq 0x2260
leaq 0x2df0(%rip), %rsi      # 0xcc22
movq %rax, %rdi
callq 0x2190
movl 0x8(%rbx), %eax
cvtsi2sd %eax, %xmm0
mulsd 0x10(%rbx), %xmm0
cvttsd2si %xmm0, %ebp
leaq 0x2f06(%rip), %r12      # 0xcd57
leaq 0x2dd6(%rip), %r13      # 0xcc2e
leaq 0x2dc8(%rip), %r14      # 0xcc27
cmpl %eax, %r15d
jge 0x9e86
cmpl %r15d, %ebp
movq %r13, %rsi
cmoveq %r12, %rsi
cmovgq %r14, %rsi
movq 0x7177(%rip), %rdi      # 0x10ff0
callq 0x2190
incl %r15d
movl 0x8(%rbx), %eax
jmp 0x9e5f
movq 0x7163(%rip), %rdi      # 0x10ff0
leaq 0x2d95(%rip), %rsi      # 0xcc29
callq 0x2190
movsd 0x10(%rbx), %xmm0
ucomisd 0x2d4a(%rip), %xmm0     # 0xcbf0
ja 0x9eb7
movsd 0x20(%rbx), %xmm0
ucomisd 0x2d43(%rip), %xmm0     # 0xcbf8
jbe 0x9ed7
cvttsd2si 0x28(%rbx), %esi
movq 0x712d(%rip), %rdi      # 0x10ff0
callq 0x2260
leaq 0x2d5d(%rip), %rsi      # 0xcc2c
movq %rax, %rdi
callq 0x2190
movq 0x7112(%rip), %rbx      # 0x10ff0
leaq 0x2d4b(%rip), %rsi      # 0xcc30
movq %rbx, %rdi
callq 0x2190
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110
nop