// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rbx, %rdi
movl $0x1, %esi
callq 0x151c
movq %rbx, %rdi
movl $0x64, %esi
callq 0x155a
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x15c8
movq 0x2d41(%rip), %rdi      # 0x3ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq 0x2d26(%rip), %rbx      # 0x3ff0
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
movl $0x1, %ebp
leaq 0x28(%rsp), %r14
testb $0x3, %bpl
je 0x12fb
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x15c8
jmp 0x1334
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x15c8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
incl %ebp
cmpl $0x65, %ebp
jne 0x12e4
movq 0x2c86(%rip), %rbx      # 0x3fc8
leaq 0xcbb(%rip), %rsi       # 0x2004
movl $0x78, %edx
movq %rbx, %rdi
callq 0x10b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq 0x2c54(%rip), %rdi      # 0x3fc8
callq 0x1030
movq %rax, %rdi
callq 0x1060
leaq 0xcf5(%rip), %rsi       # 0x207d
movl $0x4, %edx
movq %rax, %rdi
callq 0x10b0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
movq 0x2c27(%rip), %rdi      # 0x3fd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %edx
movq 0x2c0c(%rip), %rdi      # 0x3fd8
leaq 0x8(%rsp), %rsi
callq 0x1100
movq 0x2beb(%rip), %rdi      # 0x3fc8
leaq 0xc9e(%rip), %rsi       # 0x2082
movl $0x1a, %edx
callq 0x10b0
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0x1429
movl $0x1, %ebp
movq 0x8(%rsp), %r12
xorl %eax, %eax
movsbl (%r12,%rax), %ebx
movl %ebx, %edi
callq 0x10d0
testl %eax, %eax
je 0x1420
movl %ebx, %edi
callq 0x1110
cmpl $0x4e, %eax
je 0x1471
movl %ebp, %eax
incl %ebp
cmpq %rax, %r15
ja 0x1404
movq 0x2b98(%rip), %rbx      # 0x3fc8
leaq 0xc76(%rip), %rsi       # 0x20ad
movl $0xd, %edx
movq %rbx, %rdi
callq 0x10b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq 0x2b66(%rip), %rdi      # 0x3fc8
callq 0x1030
movq %rax, %rdi
callq 0x1060
jmp 0x14b7
movq 0x2b50(%rip), %rbx      # 0x3fc8
leaq 0xc1e(%rip), %rsi       # 0x209d
movl $0xf, %edx
movq %rbx, %rdi
callq 0x10b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq 0x2b1e(%rip), %rdi      # 0x3fc8
callq 0x1030
movq %rax, %rdi
callq 0x1060
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x14ce
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x10a0
leaq 0x28(%rsp), %rdi
callq 0x1558
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14e9
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x150a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x10a0
jmp 0x150a
jmp 0x1507
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1558
movq %rbx, %rdi
callq 0x10f0