// File: /workspace/github_cpp_makefile_star2_O3/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, 0x8(%rsp)
movl %edi, (%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4b09(%rip), %rdx      # 0x342a2
leaq 0x48(%rsp), %rdi
movq %rdx, %rsi
callq 0x85fc
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4aec(%rip), %rdx      # 0x342a2
leaq 0x68(%rsp), %rdi
movq %rdx, %rsi
callq 0x85fc
cmpl $0x3, (%rsp)
jl 0x2fc68
movl $0x2, %ebx
leaq 0x20(%rsp), %r12
leaq 0x10(%rsp), %rbp
movslq %ebx, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbp, %rdi
leaq 0x88(%rsp), %rdx
callq 0x182e0
movq %rbp, %rdi
leaq 0x581d(%rip), %rsi      # 0x3501f
callq 0x50f0
testl %eax, %eax
je 0x2f92d
movq %rbp, %rdi
leaq 0x5809(%rip), %rsi      # 0x35022
callq 0x50f0
testl %eax, %eax
je 0x2f92d
movq %rbp, %rdi
leaq 0x5eec(%rip), %rsi      # 0x3571c
callq 0x50f0
testl %eax, %eax
je 0x2f93c
movq %rbp, %rdi
leaq 0x5858(%rip), %rsi      # 0x3509f
callq 0x50f0
testl %eax, %eax
je 0x2f98d
movq %rbp, %rdi
leaq 0x5aed(%rip), %rsi      # 0x3534b
callq 0x50f0
testl %eax, %eax
je 0x2fa93
movq 0x10(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x2fade
movq 0x11770(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x11752(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x12, %edx
movq %rax, %rdi
leaq 0x5807(%rip), %rsi      # 0x350c4
callq 0x5420
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rdi
callq 0x5420
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2fc30
xorl %r13d, %r13d
callq 0x2f52f
xorl %ebp, %ebp
jmp 0x2fc38
incl %ebx
cmpl (%rsp), %ebx
jge 0x2f9f3
movslq %ebx, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r12
movq %r15, %r14
movq 0x50(%rsp), %r15
movq %r12, %rdi
callq 0x5180
movb $0x1, %bpl
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r14, %r15
leaq 0x78(%rsp), %r14
movq %r12, %rcx
leaq 0x20(%rsp), %r12
movq %rax, %r8
callq 0x55e0
jmp 0x2fc38
incl %ebx
cmpl (%rsp), %ebx
jge 0x2faf5
movslq %ebx, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x88(%rsp), %rbp
movq %rbp, %rdi
leaq 0x7(%rsp), %rdx
callq 0x182e0
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
callq 0x8148
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2f9eb
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x53c0
movb $0x1, %bpl
jmp 0x2fc38
movq 0x115f6(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x115d8(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x5ce8(%rip), %rsi      # 0x3571f
callq 0x5420
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2fc30
incl %ebx
cmpl (%rsp), %ebx
jge 0x2fb95
movslq %ebx, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r15
movq 0x70(%rsp), %r12
movq %r15, %rdi
callq 0x5180
movb $0x1, %bpl
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
leaq 0x20(%rsp), %r12
movq %r15, %rcx
leaq 0x58(%rsp), %r15
movq %rax, %r8
callq 0x55e0
jmp 0x2fc38
movb $0x1, %bpl
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x8528
jmp 0x2fc38
movq 0x114f4(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x114d6(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x5569(%rip), %rsi      # 0x350a2
callq 0x5420
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2fc30
movq 0x11454(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x11436(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x6e5d(%rip), %rsi      # 0x36a36
callq 0x5420
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r13d
xorl %ebp, %ebp
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x2fc4f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x53c0
testb %bpl, %bpl
je 0x2fd7f
incl %ebx
cmpl (%rsp), %ebx
leaq 0x10(%rsp), %rbp
jl 0x2f7dc
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x2fcab
leaq 0x4627(%rip), %rsi      # 0x342a2
leaq 0x48(%rsp), %rdi
callq 0x50f0
testl %eax, %eax
je 0x2fd07
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x1ee8e
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
jmp 0x2fd7f
movq 0x1133e(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x11323(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x53f3(%rip), %rsi      # 0x350d7
movl $0x11, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
jmp 0x2fd61
movq 0x112e2(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x112c7(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x5a01(%rip), %rsi      # 0x35741
movl $0x1b, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r13d
callq 0x2f52f
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x2fd96
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x2fdad
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x30(%rsp), %rdi
callq 0xab8e
movl %r13d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2fe0c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2fe0c
jmp 0x2fe09
movq %rax, %rbx
jmp 0x2fe3f
movq %rax, %rbx
jmp 0x2fe56
jmp 0x2fe04
movq %rax, %rbx
jmp 0x2fe28
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2fe28
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x2fe3f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x2fe56
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x30(%rsp), %rdi
callq 0xab8e
movq %rbx, %rdi
callq 0x56a0