// File: /workspace/github_cpp_makefile_star2_O2/ridgelab[P]Kmer-SSR/test/src/progressMeter.cpp
// Function: main
int main()
{
	const uint32_t DATA_SIZE = 100; // 10,000
	const uint32_t DATA_INTERVAL = 1;
	const uint32_t DISPLAY_INTERVAL = 4;
	const bool UPDATE_DISPLAY = true;
	const bool DO_NOT_UPDATE_DISPLAY = false;
	
	ProgressMeter pm = ProgressMeter(true); // true means we're going to not completely disable the progress bar from working at all

	pm.initialize(DATA_SIZE);
	pm.updateProgress(0, UPDATE_DISPLAY);
	cerr << endl;

	for (uint32_t i = 1; i <= DATA_SIZE; i += DATA_INTERVAL)
	{
		if (i % DISPLAY_INTERVAL)
		{
			pm.updateProgress(DATA_INTERVAL, DO_NOT_UPDATE_DISPLAY);
		}
		else
		{
			pm.updateProgress(DATA_INTERVAL, UPDATE_DISPLAY);
			cerr << endl;
		}
	}

	cout << "Do you see several lines of progress bars incrementing by 4% each time and\nending with 100%? (Yes or No [default: yes])\n" << endl << ">>> ";

	string response;
	getline(cin, response);
	
	cout << "\n\033[0;34mProgressBar Test: ";

	if (response.size())
	{
		for (uint32_t i = 0; i < response.size(); ++i)
		{
			if (isalpha(response[i]))
			{
				if (toupper(response[i]) == 'N')
				{
					cout << "\033[0;31mFAIL\033[0m" << endl;
					return 0;
				}
			}
		}
	}

	cout << "\033[0;32mOK\033[0m" << endl;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
leaq 0x28(%rsp), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x13fc
pushq $0x64
popq %rsi
movq %rbx, %rdi
callq 0x1422
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rbx
xorl %esi, %esi
movl %ebx, %edx
callq 0x146a
movq 0x2d55(%rip), %rdi      # 0x3ff0
callq 0x1050
leaq 0x28(%rsp), %r14
movq 0x2d44(%rip), %r15      # 0x3ff0
movl %ebx, %ebp
cmpl $0x65, %ebp
je 0x12df
testb $0x3, %bpl
je 0x12c7
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x146a
jmp 0x12db
movq %r14, %rdi
movl %ebx, %esi
movl %ebx, %edx
callq 0x146a
movq %r15, %rdi
callq 0x1050
incl %ebp
jmp 0x12ae
movq 0x2ce2(%rip), %rdi      # 0x3fc8
leaq 0xd17(%rip), %rsi       # 0x2004
callq 0x10b0
movq %rax, %rdi
callq 0x1050
leaq 0xd7c(%rip), %rsi       # 0x207d
movq %rax, %rdi
callq 0x10b0
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x2cb7(%rip), %rdi      # 0x3fd8
leaq 0x8(%rsp), %rsi
callq 0x1030
movq 0x2c96(%rip), %rdi      # 0x3fc8
leaq 0xd49(%rip), %rsi       # 0x2082
callq 0x10b0
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x1379
xorl %r15d, %r15d
movq 0x8(%rsp), %r12
movl %r15d, %r15d
cmpq %r15, %r14
jbe 0x1379
movsbl (%r12,%r15), %ebx
movl %ebx, %edi
callq 0x10d0
testl %eax, %eax
je 0x1374
movl %ebx, %edi
callq 0x1100
cmpl $0x4e, %eax
je 0x1396
incl %r15d
jmp 0x1350
movq 0x2c48(%rip), %rdi      # 0x3fc8
leaq 0xd26(%rip), %rsi       # 0x20ad
callq 0x10b0
movq %rax, %rdi
callq 0x1050
jmp 0x13b1
movq 0x2c2b(%rip), %rdi      # 0x3fc8
leaq 0xcf9(%rip), %rsi       # 0x209d
callq 0x10b0
movq %rax, %rdi
callq 0x1050
leaq 0x8(%rsp), %rdi
callq 0x1040
leaq 0x28(%rsp), %rdi
callq 0x1420
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13d6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1040
jmp 0x13ea
jmp 0x13e7
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1420
movq %rbx, %rdi
callq 0x10f0