// File: /workspace/github_cpp_makefile_star2_O3/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, 0x7707(%rip)      # 0x131cb
jne 0xbaf6
movq %rdi, %rbx
movsd 0x2547(%rip), %xmm1     # 0xe018
ucomisd %xmm0, %xmm1
jbe 0xbb05
movapd %xmm0, %xmm1
subsd 0x10(%rbx), %xmm1
andpd 0x29d8(%rip), %xmm1     # 0xe4c0
movsd 0x3120(%rip), %xmm2     # 0xec10
ucomisd %xmm1, %xmm2
jbe 0xbb05
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 0x24e8(%rip), %xmm2     # 0xe018
subsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28(%rbx)
cmpb $0x1, 0x7684(%rip)      # 0x131cc
jne 0xbb91
movsd 0x29a6(%rip), %xmm1     # 0xe4f8
callq 0x21f0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xbb91
jp 0xbb91
movslq 0x670(%rbx), %rax
cmpq $0x63, %rax
jg 0xbb91
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 0x7458(%rip), %r14      # 0x12ff0
leaq 0x30be(%rip), %rsi      # 0xec5d
movl $0x2, %edx
movq %r14, %rdi
callq 0x21c0
movsd 0x10(%rbx), %xmm0
mulsd 0x305f(%rip), %xmm0     # 0xec18
cvttsd2si %xmm0, %esi
movq %r14, %rdi
callq 0x2280
leaq 0x3086(%rip), %rsi      # 0xec52
movl $0x4, %edx
movq %rax, %rdi
callq 0x21c0
movl 0x8(%rbx), %eax
testl %eax, %eax
jle 0xbc33
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x10(%rbx), %xmm0
cvttsd2si %xmm0, %ebp
xorl %r15d, %r15d
leaq 0x3064(%rip), %r13      # 0xec5e
leaq 0x3056(%rip), %r12      # 0xec57
movq 0x73e8(%rip), %r14      # 0x12ff0
cmpl %r15d, %ebp
movq %r13, %rsi
leaq 0x3172(%rip), %rax      # 0xed87
cmoveq %rax, %rsi
cmovgq %r12, %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x21c0
incl %r15d
cmpl 0x8(%rbx), %r15d
jl 0xbc08
movq 0x73b6(%rip), %rdi      # 0x12ff0
leaq 0x3018(%rip), %rsi      # 0xec59
movl $0x2, %edx
callq 0x21c0
movsd 0x10(%rbx), %xmm0
ucomisd 0x2fc8(%rip), %xmm0     # 0xec20
ja 0xbc69
movsd 0x20(%rbx), %xmm0
ucomisd 0x2fc1(%rip), %xmm0     # 0xec28
jbe 0xbc8e
cvttsd2si 0x28(%rbx), %esi
movq 0x737b(%rip), %rdi      # 0x12ff0
callq 0x2280
leaq 0x2fdb(%rip), %rsi      # 0xec5c
movl $0x3, %edx
movq %rax, %rdi
callq 0x21c0
movq 0x735b(%rip), %rbx      # 0x12ff0
leaq 0x2fc4(%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