// File: 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
movq %rsp, %rbp
subq $0xd0, %rsp
movl $0x0, -0x4(%rbp)
movl $0x64, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movl $0x4, -0x10(%rbp)
movb $0x1, -0x11(%rbp)
movb $0x0, -0x12(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x90(%rbp)
movl $0x1, %esi
callq 0x15d0
movq -0x90(%rbp), %rdi
movl $0x64, %esi
callq 0x1660
jmp 0x1317
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x16d0
jmp 0x1329
movq 0x2cc0(%rip), %rdi      # 0x3ff0
movq 0x2c81(%rip), %rsi      # 0x3fb8
callq 0x10b0
jmp 0x133e
movl $0x1, -0x60(%rbp)
cmpl $0x64, -0x60(%rbp)
ja 0x13b1
movl -0x60(%rbp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x137b
leaq -0x50(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x16d0
jmp 0x1368
jmp 0x13a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x15b3
leaq -0x50(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x16d0
jmp 0x138d
movq 0x2c5c(%rip), %rdi      # 0x3ff0
movq 0x2c1d(%rip), %rsi      # 0x3fb8
callq 0x10b0
jmp 0x13a2
jmp 0x13a4
jmp 0x13a6
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1345
movq 0x2c10(%rip), %rdi      # 0x3fc8
leaq 0xc45(%rip), %rsi       # 0x2004
callq 0x10a0
movq %rax, -0x98(%rbp)
jmp 0x13cd
movq -0x98(%rbp), %rdi
movq 0x2bdd(%rip), %rsi      # 0x3fb8
callq 0x10b0
movq %rax, -0xa0(%rbp)
jmp 0x13e9
movq -0xa0(%rbp), %rdi
leaq 0xc86(%rip), %rsi       # 0x207d
callq 0x10a0
jmp 0x13fe
leaq -0x80(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x10d0
movq -0xa8(%rbp), %rsi
movq 0x2bbc(%rip), %rdi      # 0x3fd8
callq 0x1030
jmp 0x1423
movq 0x2b9e(%rip), %rdi      # 0x3fc8
leaq 0xc51(%rip), %rsi       # 0x2082
callq 0x10a0
jmp 0x1438
leaq -0x80(%rbp), %rdi
callq 0x1070
cmpq $0x0, %rax
je 0x1553
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
movq %rax, -0xb0(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x1070
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jae 0x1551
movl -0x84(%rbp), %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x1130
movq %rax, -0xb8(%rbp)
jmp 0x1498
movq -0xb8(%rbp), %rax
movsbl (%rax), %edi
callq 0x10f0
cmpl $0x0, %eax
je 0x153b
movl -0x84(%rbp), %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0x1130
movq %rax, -0xc0(%rbp)
jmp 0x14ca
movq -0xc0(%rbp), %rax
movsbl (%rax), %edi
callq 0x1120
cmpl $0x4e, %eax
jne 0x1539
movq 0x2ae3(%rip), %rdi      # 0x3fc8
leaq 0xbb1(%rip), %rsi       # 0x209d
callq 0x10a0
movq %rax, -0xc8(%rbp)
jmp 0x14fa
movq -0xc8(%rbp), %rdi
movq 0x2ab0(%rip), %rsi      # 0x3fb8
callq 0x10b0
jmp 0x150f
movl $0x0, -0x4(%rbp)
movl $0x1, -0x88(%rbp)
jmp 0x1595
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x1050
jmp 0x15b3
jmp 0x153b
jmp 0x153d
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x1455
jmp 0x1553
movq 0x2a6e(%rip), %rdi      # 0x3fc8
leaq 0xb4c(%rip), %rsi       # 0x20ad
callq 0x10a0
movq %rax, -0xd0(%rbp)
jmp 0x156f
movq -0xd0(%rbp), %rdi
movq 0x2a3b(%rip), %rsi      # 0x3fb8
callq 0x10b0
jmp 0x1584
movl $0x0, -0x4(%rbp)
movl $0x1, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x1050
leaq -0x50(%rbp), %rdi
callq 0x1650
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x1650
movq -0x58(%rbp), %rdi
callq 0x1110
nopw %cs:(%rax,%rax)
nop