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

	std::string outfile="unique.skf";
	std::vector < std::string > ingroup;
	float minproportion=0.9;
	std::vector < std::string > args;
	bool allowNs = false;

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

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

		if (arg=="-h" || arg=="--help"){
			uniqueHelp();
			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 == "-o"){
			i++;
			if (i<argc){
				outfile = std::string(argv[i])+".skf";
			}
			else {
				std::cerr << std::endl << "Expecting file name after -o flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-i"){
			i++;
			if (i<argc){
				fileToVector(argv[i], ingroup);
			}
			else {
				std::cerr << std::endl << "Expecting file name after -i flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-n"){
			allowNs = true;
		}
		else if (arg == "-p"){
			i++;
			if (i<argc){
				try {
					minproportion = getfloat(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting float between 0 and 1 after -p flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting float between 0 and 1 after -p flag" << std::endl << std::endl;
				return 1;
			}
			if (minproportion < 0 || minproportion > 1){
				std::cerr << std::endl << "Minimum proportion must be between 0 and 1" << std::endl << std::endl;
				return 1;
			}
		}
		else {
			args.push_back(arg);
		}
	}

	if (ingroup.size()<1){
		std::cerr << std::endl << "At least one ingroup kmer file must be specified" << std::endl;
		uniqueHelp();
		return 1;
	}

	if (args.size()<1){
		std::cerr << std::endl << "At least one kmer file must be specified" << std::endl;
		uniqueHelp();
		return 1;
	}

	skaVersion();

	std::cout << "Finding unique kmers in at least " << minproportion*100 << "% of ";
	for (std::vector < std::string >::iterator it = ingroup.begin(); it != ingroup.end(); ++it){
		std::cout << *it << " ";
	}

	std::cout << std::endl;

	std::cout << "Output will be written to " << outfile << std::endl;

	std::cout << std::endl;

	if (uniqueKmers(ingroup, args, minproportion, outfile, allowNs)){return 1;}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, 0x10(%rsp)
movl %edi, %ebx
leaq 0x70(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x64c4(%rip), %rsi      # 0x36bb8
leaq 0x64c7(%rip), %rdx      # 0x36bc2
leaq 0x60(%rsp), %rdi
callq 0x862a
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movl $0x3f666666, 0x8(%rsp)  # imm = 0x3F666666
movq %rax, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
cmpl $0x3, %ebx
setge %r12b
jl 0x30d92
movl %ebx, 0x4(%rsp)
leaq 0x28(%rsp), %rbx
movl $0x2, %r15d
movq $0x0, 0x38(%rsp)
leaq 0xb8(%rsp), %r14
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
leaq 0x18(%rsp), %rdx
callq 0x184a2
movq %r14, %rdi
leaq 0x48b3(%rip), %rsi      # 0x3502f
callq 0x50f0
testl %eax, %eax
je 0x3082a
movq %r14, %rdi
leaq 0x489f(%rip), %rsi      # 0x35032
callq 0x50f0
testl %eax, %eax
je 0x3082a
movq %r14, %rdi
leaq 0x4905(%rip), %rsi      # 0x350af
callq 0x50f0
testl %eax, %eax
je 0x30839
movq %r14, %rdi
leaq 0x4b78(%rip), %rsi      # 0x35339
callq 0x50f0
testl %eax, %eax
je 0x3087d
movq %r14, %rdi
leaq 0x4da9(%rip), %rsi      # 0x35581
callq 0x50f0
testl %eax, %eax
je 0x30985
movq %r14, %rdi
leaq 0x63d4(%rip), %rsi      # 0x36bc3
callq 0x50f0
movb $0x1, %bl
testl %eax, %eax
je 0x30a79
movq %r14, %rdi
leaq 0x4b53(%rip), %rsi      # 0x3535b
callq 0x50f0
testl %eax, %eax
je 0x30b25
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x855c
jmp 0x30cff
xorl %ebx, %ebx
callq 0x30426
xorl %r13d, %r13d
jmp 0x30cff
incl %r15d
cmpl 0x4(%rsp), %r15d
jge 0x308e5
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
leaq 0x98(%rsp), %rdx
callq 0x184a2
movq %rbp, %rdi
leaq 0x80(%rsp), %rsi
callq 0x817c
jmp 0x309c1
incl %r15d
cmpl 0x4(%rsp), %r15d
jge 0x309d9
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x98(%rsp), %rbp
movq %rbp, %rdi
leaq 0xf(%rsp), %rdx
callq 0x184a2
movq %rbp, %rdi
leaq 0x54a8(%rip), %rsi      # 0x35d5e
callq 0x5710
movq %rbx, 0x18(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x30bec
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x30bf2
movq 0x10704(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x106e6(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x4789(%rip), %rsi      # 0x350b2
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 0x30cf7
incl %r15d
cmpl 0x4(%rsp), %r15d
jge 0x30a85
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
leaq 0x98(%rsp), %rdx
callq 0x184a2
movq %rbp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x817c
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x30c55
movq 0x28(%rsp), %rsi
jmp 0x30c4d
movq 0x10610(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x105f2(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x4b67(%rip), %rsi      # 0x35584
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 0x30cf7
movb $0x1, %al
movq %rax, 0x38(%rsp)
jmp 0x30cff
movq 0x10564(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x10546(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x21, %edx
movq %rax, %rdi
leaq 0x5859(%rip), %rsi      # 0x36322
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 0x30cf7
incl %r15d
cmpl 0x4(%rsp), %r15d
jge 0x30c5c
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x26159
movss %xmm0, 0x8(%rsp)
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x30b5f
ucomiss 0x24ab(%rip), %xmm0     # 0x33004
jbe 0x30cff
movq 0x1048a(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1046c(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x2a, %edx
movq %rax, %rdi
leaq 0x47e9(%rip), %rsi      # 0x3538c
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
jmp 0x30ce4
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x60(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x5470
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x30c30
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x30c55
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
movb $0x1, %bl
jmp 0x30cff
movq 0x1038d(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1036f(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r13
movl $0x2d, %edx
movq %rax, %rdi
leaq 0x46be(%rip), %rsi      # 0x3535e
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 %ebx, %ebx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x30d24
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x53c0
testb %bl, %bl
leaq 0x28(%rsp), %rbx
je 0x30d9d
incl %r15d
cmpl 0x4(%rsp), %r15d
setl %r12b
jl 0x30759
jmp 0x30d9d
movq %rax, %r13
cmpl $0x1, %edx
jne 0x310d6
movq %r13, %rdi
callq 0x5160
movq 0x10294(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r13
movl $0x2d, %edx
movq %rax, %rdi
leaq 0x45eb(%rip), %rsi      # 0x3535e
callq 0x5420
movq %r13, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x30cf7
movq $0x0, 0x38(%rsp)
jmp 0x30da2
leaq 0x70(%rsp), %r15
testb $0x1, %r12b
jne 0x31028
movq 0x48(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x30f54
movq 0x88(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0x30fb0
callq 0x26746
movq 0x101e2(%rip), %rdi     # 0x40fc0
leaq 0x5e3b(%rip), %rsi      # 0x36c20
movl $0x21, %edx
callq 0x5420
movss 0x8(%rsp), %xmm0
mulss 0x287f(%rip), %xmm0     # 0x3367c
cvtss2sd %xmm0, %xmm0
movq 0x101b8(%rip), %rbx     # 0x40fc0
movq %rbx, %rdi
callq 0x5610
leaq 0x5e2b(%rip), %rsi      # 0x36c42
movl $0x5, %edx
movq %rax, %rdi
callq 0x5420
movq 0x40(%rsp), %r12
cmpq 0x48(%rsp), %r12
je 0x30e6a
movq 0x10189(%rip), %r14     # 0x40fc0
leaq 0x355a(%rip), %r15      # 0x34398
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r14, %rdi
callq 0x5420
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5420
addq $0x20, %r12
cmpq 0x48(%rsp), %r12
jne 0x30e3e
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
leaq 0x70(%rsp), %r15
callq 0x53a0
movsbl %al, %esi
movq 0x10133(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x1011f(%rip), %rdi     # 0x40fc0
leaq 0x45ac(%rip), %rsi      # 0x35454
movl $0x1a, %edx
callq 0x5420
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x100fd(%rip), %rbx     # 0x40fc0
movq %rbx, %rdi
callq 0x5420
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x100ad(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movzbl 0x38(%rsp), %r8d
andl $0x1, %r8d
leaq 0x40(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x60(%rsp), %rcx
callq 0x230bc
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
jmp 0x31028
movq 0x10095(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1007a(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x5c39(%rip), %rsi      # 0x36bc6
movl $0x30, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
jmp 0x3100a
movq 0x10039(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1001e(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x5c0e(%rip), %rsi      # 0x36bf7
movl $0x28, %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 0x30426
leaq 0x80(%rsp), %rdi
callq 0xabee
leaq 0x40(%rsp), %rdi
callq 0xabee
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x31056
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53c0
movl %r13d, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x310d3
movq %rax, %r13
callq 0x5630
jmp 0x310d6
movq %rax, %rdi
callq 0x7d6a
jmp 0x310a7
jmp 0x310d3
movq %rax, %r13
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x310d6
movq 0xa8(%rsp), %rsi
jmp 0x310b9
jmp 0x310d3
movq %rax, %r13
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x310d6
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x310d6
jmp 0x310d3
movq %rax, %r13
jmp 0x3112e
jmp 0x310ce
jmp 0x310ce
movq %rax, %r13
jmp 0x310fb
movq %rax, %r13
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x310fb
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x80(%rsp), %rdi
callq 0xabee
leaq 0x40(%rsp), %rdi
callq 0xabee
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3112e
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %r13, %rdi
callq 0x56a0