// File: ridgelab[P]Kmer-SSR/test/src/threads.cpp
// Function: main
int main()
{
	cout << '\n';
	
	int ret_val = 0; // also used to count the number of failed tests

	vector<bool (*)(string)> tests = {
		test1, test2, test3, test4, test5,
		test6, test7, test8, test9, test10,
		test11, test12
	};

	vector<string> threads = { "2", "3", "4", "5", "6", "7", "8" };

	for (uint32_t t = 0; t < threads.size(); ++t)
	{
		for (uint32_t i = 0; i < tests.size(); ++i)
		{
			cout << "Threads (" << threads[t] << ") Test #" <<  (i + 1) + (t * 12) << ":\t";
			//if (tests[i](threads))
			//if (tests[i]("1"))
			if (tests[i](threads[t]))
			{
				cout << "OK";
			}
			else
			{
				++ret_val;
				cout << "FAIL";
			}
			cout << '\n';

			optind = 1; // reset optind for next use of global getopt
		}
	}
	
	string pass_or_fail_color = ret_val ? "\033[0;31m" : "\033[0;32m";
	cout << "\033[0;34mThread Tests Passed:\t" << pass_or_fail_color << tests.size() * threads.size() - ret_val << " / " << tests.size() * threads.size() << "\033[0m" << endl;
	
	return ret_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movl $0x0, -0x4(%rbp)
movq 0x36487(%rip), %rdi     # 0x3afc0
movl $0xa, %esi
callq 0x4490
movl $0x0, -0x8(%rbp)
movups 0x36207(%rip), %xmm0    # 0x3ad58
movaps %xmm0, -0x40(%rbp)
movups 0x361ec(%rip), %xmm0    # 0x3ad48
movaps %xmm0, -0x50(%rbp)
movups 0x361d1(%rip), %xmm0    # 0x3ad38
movaps %xmm0, -0x60(%rbp)
movups 0x361b6(%rip), %xmm0    # 0x3ad28
movaps %xmm0, -0x70(%rbp)
movups 0x3619b(%rip), %xmm0    # 0x3ad18
movaps %xmm0, -0x80(%rbp)
movups 0x36180(%rip), %xmm0    # 0x3ad08
movaps %xmm0, -0x90(%rbp)
leaq -0x90(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0xc, -0x28(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x9660
movq -0x220(%rbp), %rcx
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x20(%rbp), %rdi
callq 0x9680
jmp 0x4bcf
leaq -0x91(%rbp), %rdi
callq 0x9700
movb $0x1, -0x1c0(%rbp)
leaq -0x1b0(%rbp), %rax
movq %rax, -0x230(%rbp)
movq %rax, -0x1b8(%rbp)
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x4720
movq -0x230(%rbp), %rdi
movq -0x228(%rbp), %rdx
leaq 0x227b2(%rip), %rsi     # 0x273d1
callq 0x9720
jmp 0x4c26
leaq -0x190(%rbp), %rax
movq %rax, -0x240(%rbp)
movq %rax, -0x1b8(%rbp)
leaq -0x1ba(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x4720
movq -0x240(%rbp), %rdi
movq -0x238(%rbp), %rdx
leaq 0x22481(%rip), %rsi     # 0x270e4
callq 0x9720
jmp 0x4c6a
leaq -0x170(%rbp), %rax
movq %rax, -0x250(%rbp)
movq %rax, -0x1b8(%rbp)
leaq -0x1bb(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x4720
movq -0x250(%rbp), %rdi
movq -0x248(%rbp), %rdx
leaq 0x224c2(%rip), %rsi     # 0x27169
callq 0x9720
jmp 0x4cae
leaq -0x150(%rbp), %rax
movq %rax, -0x260(%rbp)
movq %rax, -0x1b8(%rbp)
leaq -0x1bc(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x4720
movq -0x260(%rbp), %rdi
movq -0x258(%rbp), %rdx
leaq 0x224d6(%rip), %rsi     # 0x271c1
callq 0x9720
jmp 0x4cf2
leaq -0x130(%rbp), %rax
movq %rax, -0x270(%rbp)
movq %rax, -0x1b8(%rbp)
leaq -0x1bd(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x4720
movq -0x270(%rbp), %rdi
movq -0x268(%rbp), %rdx
leaq 0x237a1(%rip), %rsi     # 0x284d0
callq 0x9720
jmp 0x4d36
leaq -0x110(%rbp), %rax
movq %rax, -0x280(%rbp)
movq %rax, -0x1b8(%rbp)
leaq -0x1be(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x4720
movq -0x280(%rbp), %rdi
movq -0x278(%rbp), %rdx
leaq 0x22417(%rip), %rsi     # 0x2718a
callq 0x9720
jmp 0x4d7a
leaq -0xf0(%rbp), %rax
movq %rax, -0x290(%rbp)
movq %rax, -0x1b8(%rbp)
leaq -0x1bf(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x4720
movq -0x290(%rbp), %rdi
movq -0x288(%rbp), %rdx
leaq 0x23723(%rip), %rsi     # 0x284da
callq 0x9720
jmp 0x4dbe
movb $0x0, -0x1c0(%rbp)
leaq -0x1b0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq $0x7, -0xc8(%rbp)
leaq -0x1c1(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x97d0
movq -0x298(%rbp), %rcx
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x97f0
jmp 0x4e14
leaq -0x1c1(%rbp), %rdi
callq 0x9870
leaq -0x1b0(%rbp), %rax
movq %rax, -0x2a8(%rbp)
addq $0xe0, %rax
movq %rax, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x47a8
movq -0x2a8(%rbp), %rcx
movq -0x2b0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x2a0(%rbp)
jne 0x4e3b
leaq -0x1bf(%rbp), %rdi
callq 0x4430
leaq -0x1be(%rbp), %rdi
callq 0x4430
leaq -0x1bd(%rbp), %rdi
callq 0x4430
leaq -0x1bc(%rbp), %rdi
callq 0x4430
leaq -0x1bb(%rbp), %rdi
callq 0x4430
leaq -0x1ba(%rbp), %rdi
callq 0x4430
leaq -0x1b9(%rbp), %rdi
callq 0x4430
movl $0x0, -0x1c8(%rbp)
movl -0x1c8(%rbp), %eax
movq %rax, -0x2b8(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x9890
movq %rax, %rcx
movq -0x2b8(%rbp), %rax
cmpq %rcx, %rax
jae 0x52de
movl $0x0, -0x1cc(%rbp)
movl -0x1cc(%rbp), %eax
movq %rax, -0x2c0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x98b0
movq %rax, %rcx
movq -0x2c0(%rbp), %rax
cmpq %rcx, %rax
jae 0x52c8
movq 0x36090(%rip), %rdi     # 0x3afc0
leaq 0x220cd(%rip), %rsi     # 0x27004
callq 0x43b0
movq %rax, -0x2c8(%rbp)
jmp 0x4f45
movl -0x1c8(%rbp), %eax
movl %eax, %esi
leaq -0xc0(%rbp), %rdi
callq 0x98d0
movq -0x2c8(%rbp), %rdi
movq %rax, %rsi
callq 0x4360
movq %rax, -0x2d0(%rbp)
jmp 0x4f71
movq -0x2d0(%rbp), %rdi
leaq 0x2208f(%rip), %rsi     # 0x2700e
callq 0x43b0
movq %rax, -0x2d8(%rbp)
jmp 0x4f8d
movq -0x2d8(%rbp), %rdi
movl -0x1cc(%rbp), %ecx
movl -0x1c8(%rbp), %edx
movl %edx, %eax
leal (%rax,%rax,2), %edx
movl %ecx, %eax
movl %edx, %ecx
leal 0x1(%rax,%rcx,4), %esi
callq 0x4550
movq %rax, -0x2e0(%rbp)
jmp 0x4fbb
movq -0x2e0(%rbp), %rdi
leaq 0x22080(%rip), %rsi     # 0x27049
callq 0x43b0
jmp 0x4fd0
movl -0x1cc(%rbp), %eax
movl %eax, %esi
leaq -0x20(%rbp), %rdi
callq 0x98f0
movq (%rax), %rax
movq %rax, -0x2e8(%rbp)
movl -0x1c8(%rbp), %eax
movl %eax, %esi
leaq -0xc0(%rbp), %rdi
callq 0x98d0
movq %rax, %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x4190
jmp 0x5010
movq -0x2e8(%rbp), %rax
leaq -0x1f0(%rbp), %rdi
callq *%rax
movb %al, -0x2e9(%rbp)
jmp 0x5028
leaq -0x1f0(%rbp), %rdi
callq 0x47a8
movb -0x2e9(%rbp), %al
testb $0x1, %al
jne 0x5043
jmp 0x5275
movq 0x35f76(%rip), %rdi     # 0x3afc0
leaq 0x21fc6(%rip), %rsi     # 0x27017
callq 0x43b0
jmp 0x5058
jmp 0x5294
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x9700
jmp 0x54d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x51d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x51c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x51ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x51ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x51a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x5196
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x518a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x1c1(%rbp), %rdi
callq 0x9870
leaq -0x1b0(%rbp), %rax
movq %rax, -0x300(%rbp)
addq $0xe0, %rax
movq %rax, -0x2f8(%rbp)
movq -0x2f8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x308(%rbp)
callq 0x47a8
movq -0x300(%rbp), %rcx
movq -0x308(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x2f8(%rbp)
jne 0x5157
jmp 0x518a
leaq -0x1bf(%rbp), %rdi
callq 0x4430
leaq -0x1be(%rbp), %rdi
callq 0x4430
leaq -0x1bd(%rbp), %rdi
callq 0x4430
leaq -0x1bc(%rbp), %rdi
callq 0x4430
leaq -0x1bb(%rbp), %rdi
callq 0x4430
leaq -0x1ba(%rbp), %rdi
callq 0x4430
leaq -0x1b9(%rbp), %rdi
callq 0x4430
testb $0x1, -0x1c0(%rbp)
jne 0x51e9
jmp 0x5236
movq -0x1b8(%rbp), %rax
leaq -0x1b0(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x310(%rbp)
je 0x5234
movq -0x310(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x318(%rbp)
callq 0x47a8
movq -0x318(%rbp), %rax
leaq -0x1b0(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x310(%rbp)
jne 0x5203
jmp 0x5236
jmp 0x54ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x54c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x47a8
jmp 0x54c2
movl -0x8(%rbp), %eax
incl %eax
movl %eax, -0x8(%rbp)
movq 0x35d3c(%rip), %rdi     # 0x3afc0
leaq 0x21d8f(%rip), %rsi     # 0x2701a
callq 0x43b0
jmp 0x5292
jmp 0x5294
movq 0x35d25(%rip), %rdi     # 0x3afc0
movl $0xa, %esi
callq 0x4490
jmp 0x52a7
movq 0x35d22(%rip), %rax     # 0x3afd0
movl $0x1, (%rax)
movl -0x1cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1cc(%rbp)
jmp 0x4f00
jmp 0x52ca
movl -0x1c8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c8(%rbp)
jmp 0x4eca
cmpl $0x0, -0x8(%rbp)
je 0x52f4
leaq 0x21d34(%rip), %rax     # 0x2701f
movq %rax, -0x320(%rbp)
jmp 0x5304
leaq 0x21d2c(%rip), %rax     # 0x27027
movq %rax, -0x320(%rbp)
jmp 0x5304
movq -0x320(%rbp), %rax
movq %rax, -0x330(%rbp)
leaq -0x211(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x4720
movq -0x330(%rbp), %rsi
movq -0x328(%rbp), %rdx
leaq -0x210(%rbp), %rdi
callq 0x9720
jmp 0x5341
leaq -0x211(%rbp), %rdi
callq 0x4430
movq 0x35c6c(%rip), %rdi     # 0x3afc0
leaq 0x21cd4(%rip), %rsi     # 0x2702f
callq 0x43b0
movq %rax, -0x338(%rbp)
jmp 0x5369
movq -0x338(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x4360
movq %rax, -0x340(%rbp)
jmp 0x5385
leaq -0x20(%rbp), %rdi
callq 0x98b0
movq %rax, -0x350(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x9890
movq -0x350(%rbp), %rsi
movq -0x340(%rbp), %rdi
imulq %rax, %rsi
movslq -0x8(%rbp), %rax
subq %rax, %rsi
callq 0x40f0
movq %rax, -0x348(%rbp)
jmp 0x53c8
movq -0x348(%rbp), %rdi
leaq 0x21c76(%rip), %rsi     # 0x2704c
callq 0x43b0
movq %rax, -0x358(%rbp)
jmp 0x53e4
leaq -0x20(%rbp), %rdi
callq 0x98b0
movq %rax, -0x368(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x9890
movq -0x368(%rbp), %rsi
movq -0x358(%rbp), %rdi
imulq %rax, %rsi
callq 0x40f0
movq %rax, -0x360(%rbp)
jmp 0x5420
movq -0x360(%rbp), %rdi
leaq 0x23035(%rip), %rsi     # 0x28463
callq 0x43b0
movq %rax, -0x370(%rbp)
jmp 0x543c
movq -0x370(%rbp), %rdi
movq 0x35b46(%rip), %rsi     # 0x3af90
callq 0x4400
jmp 0x5451
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x47a8
leaq -0xc0(%rbp), %rdi
callq 0x9910
leaq -0x20(%rbp), %rdi
callq 0x9970
movl -0x4(%rbp), %eax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x211(%rbp), %rdi
callq 0x4430
jmp 0x54c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x47a8
leaq -0xc0(%rbp), %rdi
callq 0x9910
leaq -0x20(%rbp), %rdi
callq 0x9970
movq -0xa0(%rbp), %rdi
callq 0x4700
nopw %cs:(%rax,%rax)