// File: simonrharris[P]SKA/src/ska.cpp
// Function: main
int main(int argc, char *argv[])
{
	
	if (argc<2){
		skaHelp();
		return 0;
	}

	std::string subcommand=(argv[1]);

	if (subcommand == "alleles"){
			if(allelesSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "align"){
			if(alignSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "compare"){
			if(compareSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "distance"){
			if(distanceSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "fasta"){
			if(fastaSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "fastq"){
			if(fastqSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "annotate"){
			if(annotateSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "humanise"){
			if(humaniseSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "info"){
			if(infoSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "map"){
			if(mapSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "merge"){
			if(mergeSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "summary"){
			if(summarySubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "type"){
			if(typeSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "unique"){
			if(uniqueSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "weed"){
			if(weedSubcommand(argc, argv)){return 1;}
		}
	else if (subcommand == "-v" || subcommand == "--version" || subcommand == "version"){
			if(skaVersion()){return 1;}
		}
	else if (subcommand == "-h" || subcommand == "--help"){
			if(skaHelp()){return 1;}
		}
	else if (subcommand[0]=='-'){
			std::cerr << std::endl << "Unrecognised flag: " << subcommand << std::endl << std::endl;
			return 1;
		}
	else {
		std::cerr << std::endl << "Unrecognised subcommand: " << subcommand << std::endl;
		skaHelp();
		return 1;
	}
	
	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x58660
callq 0x4c150
movl $0x0, -0x4(%rbp)
jmp 0x58e68
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x6910
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0xab20
jmp 0x5868c
leaq -0x31(%rbp), %rdi
callq 0x65a0
leaq 0x495c(%rip), %rsi      # 0x5cff8
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x59(%rbp)
jmp 0x586aa
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x586b3
jmp 0x58718
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x4c6d0
movl %eax, -0x60(%rbp)
jmp 0x586c4
movl -0x60(%rbp), %eax
cmpl $0x0, %eax
je 0x58713
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x65a0
jmp 0x58e74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x6a08
jmp 0x58e74
jmp 0x58e51
leaq 0x1cdd(%rip), %rsi      # 0x5a3fc
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x61(%rbp)
jmp 0x5872d
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x58736
jmp 0x58767
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x4d120
movl %eax, -0x68(%rbp)
jmp 0x58747
movl -0x68(%rbp), %eax
cmpl $0x0, %eax
je 0x58762
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e4f
leaq 0x4892(%rip), %rsi      # 0x5d000
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x69(%rbp)
jmp 0x5877c
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x58785
jmp 0x587b6
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x4ecf0
movl %eax, -0x70(%rbp)
jmp 0x58796
movl -0x70(%rbp), %eax
cmpl $0x0, %eax
je 0x587b1
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e4d
leaq 0x12c1(%rip), %rsi      # 0x59a7e
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x71(%rbp)
jmp 0x587cb
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x587d4
jmp 0x58805
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x4f4e0
movl %eax, -0x78(%rbp)
jmp 0x587e5
movl -0x78(%rbp), %eax
cmpl $0x0, %eax
je 0x58800
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e4b
leaq 0x47fc(%rip), %rsi      # 0x5d008
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x79(%rbp)
jmp 0x5881a
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x58823
jmp 0x58854
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x50540
movl %eax, -0x80(%rbp)
jmp 0x58834
movl -0x80(%rbp), %eax
cmpl $0x0, %eax
je 0x5884f
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e49
leaq 0x378c(%rip), %rsi      # 0x5bfe7
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x81(%rbp)
jmp 0x5886c
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x58878
jmp 0x588af
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x512b0
movl %eax, -0x88(%rbp)
jmp 0x5888c
movl -0x88(%rbp), %eax
cmpl $0x0, %eax
je 0x588aa
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e47
leaq 0x4758(%rip), %rsi      # 0x5d00e
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x89(%rbp)
jmp 0x588c7
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x588d3
jmp 0x5890a
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x4dfa0
movl %eax, -0x90(%rbp)
jmp 0x588e7
movl -0x90(%rbp), %eax
cmpl $0x0, %eax
je 0x58905
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e45
leaq 0x4706(%rip), %rsi      # 0x5d017
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x91(%rbp)
jmp 0x58922
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x5892e
jmp 0x58965
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x52a30
movl %eax, -0x98(%rbp)
jmp 0x58942
movl -0x98(%rbp), %eax
cmpl $0x0, %eax
je 0x58960
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e43
leaq 0x46b4(%rip), %rsi      # 0x5d020
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x99(%rbp)
jmp 0x5897d
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x58989
jmp 0x589c0
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x53210
movl %eax, -0xa0(%rbp)
jmp 0x5899d
movl -0xa0(%rbp), %eax
cmpl $0x0, %eax
je 0x589bb
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e41
leaq 0xdfe(%rip), %rsi       # 0x597c5
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xa1(%rbp)
jmp 0x589d8
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x589e4
jmp 0x58a1b
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x538c0
movl %eax, -0xa8(%rbp)
jmp 0x589f8
movl -0xa8(%rbp), %eax
cmpl $0x0, %eax
je 0x58a16
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e3f
leaq 0x3e50(%rip), %rsi      # 0x5c872
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xa9(%rbp)
jmp 0x58a33
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x58a3f
jmp 0x58a76
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x54c10
movl %eax, -0xb0(%rbp)
jmp 0x58a53
movl -0xb0(%rbp), %eax
cmpl $0x0, %eax
je 0x58a71
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e3d
leaq 0x45a8(%rip), %rsi      # 0x5d025
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xb1(%rbp)
jmp 0x58a8e
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0x58a9a
jmp 0x58ad1
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x55700
movl %eax, -0xb8(%rbp)
jmp 0x58aae
movl -0xb8(%rbp), %eax
cmpl $0x0, %eax
je 0x58acc
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e3b
leaq 0x4555(%rip), %rsi      # 0x5d02d
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xb9(%rbp)
jmp 0x58ae9
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x58af5
jmp 0x58b2c
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x55c90
movl %eax, -0xc0(%rbp)
jmp 0x58b09
movl -0xc0(%rbp), %eax
cmpl $0x0, %eax
je 0x58b27
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e39
leaq 0x44ff(%rip), %rsi      # 0x5d032
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xc1(%rbp)
jmp 0x58b44
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x58b50
jmp 0x58b87
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x565e0
movl %eax, -0xc8(%rbp)
jmp 0x58b64
movl -0xc8(%rbp), %eax
cmpl $0x0, %eax
je 0x58b82
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e37
leaq 0x44ab(%rip), %rsi      # 0x5d039
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xc9(%rbp)
jmp 0x58b9f
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x58bab
jmp 0x58be2
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x57370
movl %eax, -0xd0(%rbp)
jmp 0x58bbf
movl -0xd0(%rbp), %eax
cmpl $0x0, %eax
je 0x58bdd
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e35
leaq 0x27ab(%rip), %rsi      # 0x5b394
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xd1(%rbp)
jmp 0x58bfa
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x58c4e
jmp 0x58c06
leaq 0x4431(%rip), %rsi      # 0x5d03e
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xd2(%rbp)
jmp 0x58c1e
movb -0xd2(%rbp), %al
testb $0x1, %al
jne 0x58c4e
jmp 0x58c2a
leaq 0x440f(%rip), %rsi      # 0x5d040
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xd3(%rbp)
jmp 0x58c42
movb -0xd3(%rbp), %al
testb $0x1, %al
jne 0x58c4e
jmp 0x58c7e
callq 0x4c460
movl %eax, -0xd8(%rbp)
jmp 0x58c5b
movl -0xd8(%rbp), %eax
cmpl $0x0, %eax
je 0x58c79
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e33
leaq 0x2362(%rip), %rsi      # 0x5afe7
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xd9(%rbp)
jmp 0x58c96
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x58cc6
jmp 0x58ca2
leaq 0x2341(%rip), %rsi      # 0x5afea
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0xda(%rbp)
jmp 0x58cba
movb -0xda(%rbp), %al
testb $0x1, %al
jne 0x58cc6
jmp 0x58cf6
callq 0x4c150
movl %eax, -0xe0(%rbp)
jmp 0x58cd3
movl -0xe0(%rbp), %eax
cmpl $0x0, %eax
je 0x58cf1
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e31
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x69e0
movq %rax, -0xe8(%rbp)
jmp 0x58d0c
movq -0xe8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x58db4
movq 0x202ca(%rip), %rdi     # 0x78ff0
movq 0x20263(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0xf0(%rbp)
jmp 0x58d3b
movq -0xf0(%rbp), %rdi
leaq 0x42ff(%rip), %rsi      # 0x5d048
callq 0x6520
movq %rax, -0xf8(%rbp)
jmp 0x58d57
movq -0xf8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x64d0
movq %rax, -0x100(%rbp)
jmp 0x58d70
movq -0x100(%rbp), %rdi
movq 0x20212(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x108(%rbp)
jmp 0x58d8c
movq -0x108(%rbp), %rdi
movq 0x201f6(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x58da1
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
movq 0x20235(%rip), %rdi     # 0x78ff0
movq 0x201ce(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x110(%rbp)
jmp 0x58dd0
movq -0x110(%rbp), %rdi
leaq 0x427e(%rip), %rsi      # 0x5d05c
callq 0x6520
movq %rax, -0x118(%rbp)
jmp 0x58dec
movq -0x118(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x64d0
movq %rax, -0x120(%rbp)
jmp 0x58e05
movq -0x120(%rbp), %rdi
movq 0x2017d(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x58e1a
callq 0x4c150
jmp 0x58e21
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x58e5f
jmp 0x58e33
jmp 0x58e35
jmp 0x58e37
jmp 0x58e39
jmp 0x58e3b
jmp 0x58e3d
jmp 0x58e3f
jmp 0x58e41
jmp 0x58e43
jmp 0x58e45
jmp 0x58e47
jmp 0x58e49
jmp 0x58e4b
jmp 0x58e4d
jmp 0x58e4f
jmp 0x58e51
movl $0x0, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x6a08
movl -0x4(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x6900