// File: /workspace/github_cpp_makefile_star2_O1/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, 0x7383(%rip)      # 0x131cb
jne 0xbe7a
movq %rdi, %rbx
movsd 0x21c3(%rip), %xmm1     # 0xe018
ucomisd %xmm0, %xmm1
jbe 0xbe89
movapd %xmm0, %xmm1
subsd 0x10(%rbx), %xmm1
andpd 0x2654(%rip), %xmm1     # 0xe4c0
movsd 0x2d9c(%rip), %xmm2     # 0xec10
ucomisd %xmm1, %xmm2
jbe 0xbe89
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd %xmm0, 0x10(%rbx)
xorl %edi, %edi
callq 0x2170
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
subsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x20(%rbx)
movsd 0x10(%rbx), %xmm1
movsd 0x2164(%rip), %xmm2     # 0xe018
subsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28(%rbx)
cmpb $0x1, 0x7300(%rip)      # 0x131cc
jne 0xbf15
movsd 0x2622(%rip), %xmm1     # 0xe4f8
callq 0x21f0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xbf15
jp 0xbf15
movslq 0x670(%rbx), %rax
cmpq $0x63, %rax
jg 0xbf15
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 0x70d4(%rip), %r14      # 0x12ff0
leaq 0x2d3a(%rip), %rsi      # 0xec5d
movl $0x2, %edx
movq %r14, %rdi
callq 0x21c0
movsd 0x10(%rbx), %xmm0
mulsd 0x2cdb(%rip), %xmm0     # 0xec18
cvttsd2si %xmm0, %esi
movq %r14, %rdi
callq 0x2280
leaq 0x2d02(%rip), %rsi      # 0xec52
movl $0x4, %edx
movq %rax, %rdi
callq 0x21c0
movl 0x8(%rbx), %eax
testl %eax, %eax
jle 0xbfb7
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x10(%rbx), %xmm0
cvttsd2si %xmm0, %ebp
xorl %r15d, %r15d
leaq 0x2ce0(%rip), %r13      # 0xec5e
leaq 0x2cd2(%rip), %r12      # 0xec57
movq 0x7064(%rip), %r14      # 0x12ff0
cmpl %r15d, %ebp
movq %r13, %rsi
leaq 0x2dee(%rip), %rax      # 0xed87
cmoveq %rax, %rsi
cmovgq %r12, %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x21c0
incl %r15d
cmpl 0x8(%rbx), %r15d
jl 0xbf8c
movq 0x7032(%rip), %rdi      # 0x12ff0
leaq 0x2c94(%rip), %rsi      # 0xec59
movl $0x2, %edx
callq 0x21c0
movsd 0x10(%rbx), %xmm0
ucomisd 0x2c44(%rip), %xmm0     # 0xec20
ja 0xbfed
movsd 0x20(%rbx), %xmm0
ucomisd 0x2c3d(%rip), %xmm0     # 0xec28
jbe 0xc012
cvttsd2si 0x28(%rbx), %esi
movq 0x6ff7(%rip), %rdi      # 0x12ff0
callq 0x2280
leaq 0x2c57(%rip), %rsi      # 0xec5c
movl $0x3, %edx
movq %rax, %rdi
callq 0x21c0
movq 0x6fd7(%rip), %rbx      # 0x12ff0
leaq 0x2c40(%rip), %rsi      # 0xec60
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
nop