// File: simonrharris[P]SKA/src/ska.cpp
// Function: summarySubcommand(int, char**)
int summarySubcommand(int argc, char *argv[]){

	std::vector < std::string > args;

	for (int i=2; i<argc; ++i){

		std::string arg=(argv[i]);

		if (arg=="-h" || arg=="--help"){
			summaryHelp();
			return 0;
		}
		else if (arg == "-f"){
			i++;
			if (i<argc){
				fileToVector(argv[i], args);
			}
			else {
				std::cerr << std::endl << "Expecting file name after -f flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg[0]=='-'){
			std::cerr << std::endl << "Unrecognised flag " << arg << std::endl << std::endl;
				return 1;
		}
		else {
			args.push_back(arg);
		}
	}

	if (args.size()<1){
		std::cerr << std::endl << "Too few arguments" << std::endl;
		summaryHelp();
		return 1;
	}

	if (summariseKmerFiles(args)){return 1;}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1ab40
movl $0x2, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x55a70
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xa0(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x6910
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0xab20
jmp 0x5576a
leaq -0x51(%rbp), %rdi
callq 0x65a0
leaq 0x586d(%rip), %rsi      # 0x5afe7
leaq -0x50(%rbp), %rdi
callq 0x2dce0
movb %al, -0xa1(%rbp)
jmp 0x5578b
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x557bb
jmp 0x55797
leaq 0x584c(%rip), %rsi      # 0x5afea
leaq -0x50(%rbp), %rdi
callq 0x2dce0
movb %al, -0xa2(%rbp)
jmp 0x557af
movb -0xa2(%rbp), %al
testb $0x1, %al
jne 0x557bb
jmp 0x55800
callq 0x55620
jmp 0x557c2
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x55a3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x65a0
jmp 0x55b40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x55a62
leaq 0x5860(%rip), %rsi      # 0x5b067
leaq -0x50(%rbp), %rdi
callq 0x2dce0
movb %al, -0xa3(%rbp)
jmp 0x55818
movb -0xa3(%rbp), %al
testb $0x1, %al
jne 0x55827
jmp 0x55965
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x558e4
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xb8(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x6910
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0xab20
jmp 0x5587e
leaq -0x88(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xa6a0
jmp 0x55890
leaq -0x88(%rbp), %rdi
callq 0x6a08
leaq -0x89(%rbp), %rdi
callq 0x65a0
jmp 0x55960
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x558d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x6a08
leaq -0x89(%rbp), %rdi
callq 0x65a0
jmp 0x55a62
movq 0x23705(%rip), %rdi     # 0x78ff0
movq 0x2369e(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0xc0(%rbp)
jmp 0x55900
movq -0xc0(%rbp), %rdi
leaq 0x575c(%rip), %rsi      # 0x5b06a
callq 0x6520
movq %rax, -0xc8(%rbp)
jmp 0x5591c
movq -0xc8(%rbp), %rdi
movq 0x23666(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0xd0(%rbp)
jmp 0x55938
movq -0xd0(%rbp), %rdi
movq 0x2364a(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x5594d
movl $0x1, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x55a3c
jmp 0x55a33
xorl %eax, %eax
movl %eax, %esi
leaq -0x50(%rbp), %rdi
callq 0x69e0
movq %rax, -0xd8(%rbp)
jmp 0x5597b
movq -0xd8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x55a20
movq 0x2365b(%rip), %rdi     # 0x78ff0
movq 0x235f4(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0xe0(%rbp)
jmp 0x559aa
movq -0xe0(%rbp), %rdi
leaq 0x56d4(%rip), %rsi      # 0x5b08c
callq 0x6520
movq %rax, -0xe8(%rbp)
jmp 0x559c6
movq -0xe8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x64d0
movq %rax, -0xf0(%rbp)
jmp 0x559df
movq -0xf0(%rbp), %rdi
movq 0x235a3(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0xf8(%rbp)
jmp 0x559fb
movq -0xf8(%rbp), %rdi
movq 0x23587(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x55a10
movl $0x1, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x55a3c
leaq -0x28(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xabd0
jmp 0x55a2f
jmp 0x55a31
jmp 0x55a33
jmp 0x55a35
movl $0x0, -0x68(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x6a08
movl -0x68(%rbp), %eax
testl %eax, %eax
jne 0x55b2b
jmp 0x55a52
jmp 0x55a54
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x55722
leaq -0x50(%rbp), %rdi
callq 0x6a08
jmp 0x55b40
leaq -0x28(%rbp), %rdi
callq 0xb670
cmpq $0x1, %rax
jae 0x55af1
movq 0x2356a(%rip), %rdi     # 0x78ff0
movq 0x23503(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x100(%rbp)
jmp 0x55a9b
movq -0x100(%rbp), %rdi
leaq 0x55f6(%rip), %rsi      # 0x5b09f
callq 0x6520
movq %rax, -0x108(%rbp)
jmp 0x55ab7
movq -0x108(%rbp), %rdi
movq 0x234cb(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x55acc
callq 0x55620
jmp 0x55ad3
movl $0x1, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x55b2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x55b40
leaq -0x28(%rbp), %rdi
callq 0x3a240
movl %eax, -0x10c(%rbp)
jmp 0x55b02
movl -0x10c(%rbp), %eax
cmpl $0x0, %eax
je 0x55b1d
movl $0x1, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x55b2b
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xfe90
movl -0x4(%rbp), %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0xfe90
movq -0x60(%rbp), %rdi
callq 0x6900
nopw %cs:(%rax,%rax)