// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/main.cpp
// Function: main
int main(int argc, char *argv[]) {

	if (argc < 2 || argc > 4) {
		cerr << "Usage: " << argv[0] << " <reads> [gt] [millions of iterations = 10]" << endl;
		return 1;
	}

	ifstream file;
	file.open(argv[1]);
	auto parsed = WIFInputReader::read(file); 

	if (argc > 3) {
		ifstream gtruth;
		gtruth.open(argv[2]);

		WIFInputReader::readGroundTruth(gtruth, parsed);
	}




	iteration_t iterations = argc == 4 ?  atoi(argv[3]) * META_ITER : 10 * META_ITER;
	
	try {
		Genome ge(parsed);
		ge.autoSchedule(iterations);
			try {
				ge.optimize(true);
				cout << ge;
			} catch (const char * e) {
				cerr << e << endl;
			}

	} catch (const char* e) {
		cout << e << endl;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4220, %rsp           # imm = 0x4220
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jl 0x1aa15
cmpl $0x4, -0x8(%rbp)
jle 0x1aa61
movq 0x105d4(%rip), %rdi     # 0x2aff0
leaq 0x1e40(%rip), %rsi      # 0x1c863
callq 0x2230
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x2230
movq %rax, %rdi
leaq 0x1e2a(%rip), %rsi      # 0x1c86b
callq 0x2230
movq %rax, %rdi
movq 0x10560(%rip), %rsi     # 0x2afb0
callq 0x2270
movl $0x1, -0x4(%rbp)
jmp 0x1ad9a
leaq -0x218(%rbp), %rdi
movq %rdi, -0x4208(%rbp)
callq 0x2280
movq -0x4208(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x8, %edx
callq 0x2160
jmp 0x1aa8f
leaq -0x2e0(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x15690
jmp 0x1aaa4
cmpl $0x3, -0x8(%rbp)
jle 0x1ab4b
leaq -0x4e8(%rbp), %rdi
callq 0x2280
jmp 0x1aabc
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x4e8(%rbp), %rdi
movl $0x8, %edx
callq 0x2160
jmp 0x1aad7
leaq -0x4e8(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x15fd0
jmp 0x1aaec
leaq -0x4e8(%rbp), %rdi
callq 0x2070
jmp 0x1ab4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x1ad8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x1ad80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x4e8(%rbp), %rdi
callq 0x2070
jmp 0x1ad80
cmpl $0x4, -0x8(%rbp)
jne 0x1ab6c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x23a0
imull $0x2710, %eax, %eax     # imm = 0x2710
movl %eax, -0x420c(%rbp)
jmp 0x1ab79
movl $0x186a0, %eax          # imm = 0x186A0
movl %eax, -0x420c(%rbp)
jmp 0x1ab79
movl -0x420c(%rbp), %eax
cltq
movq %rax, -0x4f0(%rbp)
leaq -0x41f0(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x1adc0
jmp 0x1ab9d
leaq -0x4138(%rbp), %rdi
leaq -0x41f0(%rbp), %rsi
callq 0x2770
jmp 0x1abb2
leaq -0x41f0(%rbp), %rdi
callq 0x5a80
movq -0x4f0(%rbp), %rsi
leaq -0x4138(%rbp), %rdi
callq 0x51b0
jmp 0x1abd3
leaq -0x4138(%rbp), %rdi
movl $0x1, %esi
callq 0x3cc0
jmp 0x1abe6
movq 0x103db(%rip), %rdi     # 0x2afc8
leaq -0x4138(%rbp), %rsi
callq 0x5450
jmp 0x1abfb
jmp 0x1acbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x1acec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x41f0(%rbp), %rdi
callq 0x5a80
jmp 0x1acec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x1ace0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
movl -0x224(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1ace0
movq -0x220(%rbp), %rdi
callq 0x20d0
movq %rax, -0x41f8(%rbp)
movq -0x41f8(%rbp), %rsi
movq 0x1035d(%rip), %rdi     # 0x2aff0
callq 0x2230
movq %rax, -0x4218(%rbp)
jmp 0x1aca1
movq -0x4218(%rbp), %rdi
movq 0x10301(%rip), %rsi     # 0x2afb0
callq 0x2270
jmp 0x1acb6
callq 0x23d0
leaq -0x4138(%rbp), %rdi
callq 0x2da0
jmp 0x1ad48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
callq 0x23d0
leaq -0x4138(%rbp), %rdi
callq 0x2da0
movl -0x224(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1ad80
movq -0x220(%rbp), %rdi
callq 0x20d0
movq %rax, -0x4200(%rbp)
movq -0x4200(%rbp), %rsi
movq 0x102a8(%rip), %rdi     # 0x2afc8
callq 0x2230
movq %rax, -0x4220(%rbp)
jmp 0x1ad2e
movq -0x4220(%rbp), %rdi
movq 0x10274(%rip), %rsi     # 0x2afb0
callq 0x2270
jmp 0x1ad43
callq 0x23d0
movl $0x0, -0x4(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x5a80
leaq -0x218(%rbp), %rdi
callq 0x2070
jmp 0x1ad9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
callq 0x23d0
leaq -0x2e0(%rbp), %rdi
callq 0x5a80
leaq -0x218(%rbp), %rdi
callq 0x2070
jmp 0x1ada6
movl -0x4(%rbp), %eax
addq $0x4220, %rsp           # imm = 0x4220
popq %rbp
retq
movq -0x220(%rbp), %rdi
callq 0x2410
nopw %cs:(%rax,%rax)
nopl (%rax)