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

	std::vector < std::string > args;
	std::string queryfile="";
	std::string profilefile="";

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

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

		if (arg=="-h" || arg=="--help"){
			typeHelp();
			return 0;
		}
		else if (arg == "-q"){
			i++;
			if (i<argc){
				queryfile = argv[i];
			}
			else {
				std::cerr << std::endl << "Expecting file name after -q flag" << std::endl << std::endl;
				return 1;
			}
		}
		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 == "-p"){
			i++;
			if (i<argc){
				profilefile = argv[i];
			}
			else {
				std::cerr << std::endl << "Expecting file name after -p 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;
		typeHelp();
		return 1;
	}

	if (queryfile==""){
		std::cerr << std::endl << "Query kmer file is required" << std::endl;
		typeHelp();
		return 1;
	}

	if (typeKmerFile(queryfile, profilefile, args)){return 1;}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0x3753(%rip), %rsi      # 0x262c2
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x77c0
leaq 0x373d(%rip), %rsi      # 0x262c2
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x77c0
pushq $0x2
popq %r12
leaq 0x68(%rsp), %r14
leaq 0x88(%rsp), %r15
cmpl %ebp, %r12d
jge 0x22db2
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x77c0
movq %r14, %rdi
leaq 0x4429(%rip), %rsi      # 0x26ff3
callq 0x132f3
testb %al, %al
jne 0x22be6
movq %r14, %rdi
leaq 0x4419(%rip), %rsi      # 0x26ff6
callq 0x132f3
testb %al, %al
je 0x22c0e
xorl %r13d, %r13d
callq 0x22a7f
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x5778
incl %r12d
testb %r15b, %r15b
leaq 0x88(%rsp), %r15
jne 0x22ba5
jmp 0x22e33
movq %r14, %rdi
leaq 0x4ad8(%rip), %rsi      # 0x276f0
callq 0x132f3
testb %al, %al
je 0x22c3f
incl %r12d
cmpl %ebp, %r12d
jge 0x22c8f
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
movb $0x1, %r15b
leaq 0x48(%rsp), %rdi
callq 0x5730
jmp 0x22bf1
movq %r14, %rdi
leaq 0x442a(%rip), %rsi      # 0x27073
callq 0x132f3
testb %al, %al
je 0x22cbf
incl %r12d
cmpl %ebp, %r12d
jge 0x22cf7
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x77c0
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7529
movq %r15, %rdi
callq 0x5778
movb $0x1, %r15b
jmp 0x22bf1
movq 0x1335a(%rip), %rdi     # 0x35ff0
callq 0x51c0
movq %rax, %rdi
leaq 0x4a4e(%rip), %rsi      # 0x276f3
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
movq %rax, %rdi
callq 0x51c0
jmp 0x22d91
movq %r14, %rdi
leaq 0x4656(%rip), %rsi      # 0x2731f
callq 0x132f3
testb %al, %al
je 0x22d24
incl %r12d
cmpl %ebp, %r12d
jge 0x22d66
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
movb $0x1, %r15b
leaq 0x28(%rsp), %rdi
callq 0x5730
jmp 0x22bf1
movq 0x132f2(%rip), %rdi     # 0x35ff0
callq 0x51c0
movq %rax, %rdi
leaq 0x4369(%rip), %rsi      # 0x27076
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
movq %rax, %rdi
callq 0x51c0
jmp 0x22d91
movq 0x68(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x22d9d
movq 0x132bb(%rip), %rdi     # 0x35ff0
callq 0x51c0
movq %rax, %rdi
leaq 0x4354(%rip), %rsi      # 0x27098
callq 0x53f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x53a0
movq %rax, %rdi
callq 0x51c0
movq %rax, %rdi
callq 0x51c0
jmp 0x22d91
movq 0x13283(%rip), %rdi     # 0x35ff0
callq 0x51c0
movq %rax, %rdi
leaq 0x5c8e(%rip), %rsi      # 0x28a0a
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
movq %rax, %rdi
callq 0x51c0
xorl %r15d, %r15d
pushq $0x1
popq %r13
jmp 0x22bf1
movb $0x1, %r15b
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x77fc
jmp 0x22bf1
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x22de8
leaq 0x34fd(%rip), %rsi      # 0x262c2
leaq 0x48(%rsp), %rdi
callq 0x132f3
testb %al, %al
je 0x22e16
movq 0x13216(%rip), %rdi     # 0x35ff0
callq 0x51c0
leaq 0x492f(%rip), %rsi      # 0x27715
jmp 0x22dfb
movq 0x13201(%rip), %rdi     # 0x35ff0
callq 0x51c0
leaq 0x42b0(%rip), %rsi      # 0x270ab
movq %rax, %rdi
callq 0x53f0
movq %rax, %rdi
callq 0x51c0
callq 0x22a7f
pushq $0x1
popq %r13
jmp 0x22e33
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x188dc
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
leaq 0x28(%rsp), %rdi
callq 0x5778
leaq 0x48(%rsp), %rdi
callq 0x5778
leaq 0x10(%rsp), %rdi
callq 0x911e
movl %r13d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x5778
jmp 0x22e8e
jmp 0x22e8b
movq %rax, %rbx
jmp 0x22ea2
movq %rax, %rbx
jmp 0x22eac
jmp 0x22e86
movq %rax, %rbx
jmp 0x22e98
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x5778
leaq 0x28(%rsp), %rdi
callq 0x5778
leaq 0x48(%rsp), %rdi
callq 0x5778
leaq 0x10(%rsp), %rdi
callq 0x911e
movq %rbx, %rdi
callq 0x56c0