// File: /workspace/github_cpp_makefile_star2_O3/simonrharris[P]SKA/src/kmers.cpp
// Function: getSubsample(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<bool, std::allocator<bool>>&)
int getSubsample(const std::vector < std::string > & sample, const std::vector < std::string > & names, std::vector < bool > & include){
	std::set < std::string > sampleSet;

	if (sample.size()>0){
		for (std::vector < std::string >::const_iterator it=sample.begin(); it!=sample.end(); ++it){
			std::pair < std::set < std::string >::iterator,bool> ret = sampleSet.insert(*it);
			if (not ret.second){
				std::cerr << "Warning " << *it << " is in your sample file more than once" << std::endl;
			}
		}
		std::cout << sampleSet.size() << " unique sample names found in your sample file" << std::endl;
	}
	else {
		for (std::vector < std::string >::const_iterator it=names.begin(); it!=names.end(); ++it){
			sampleSet.insert(*it);
		}
	}

	std::vector < bool > included(sampleSet.size());

	for (std::vector < std::string >::const_iterator it=names.begin(); it!=names.end(); ++it){
		std::set < std::string >::iterator it2 = sampleSet.find(*it);
		if (it2 != sampleSet.end()){
			if (included[distance(sampleSet.begin(), it2)]==true){
				std::cerr << "Warning " << *it << " is in your input files more than once. Only the first occurrence will be kept" << std::endl;
			}
			else{
				included[distance(sampleSet.begin(), it2)]=true;
				include[distance(names.begin(), it)]=true;		
			}
		}
	}

	for (std::vector < bool >::iterator it=included.begin(); it!=included.end(); ++it){
		if (not *it){
			std::set < std::string >::iterator it2 = sampleSet.begin();
			advance(it2, distance(included.begin(), it));
			std::cerr << "Warning " << *it2 << " is in your sample file but not in any of your input files" << std::endl;
		}
	}
	std::cout << std::endl;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, 0x40(%rsp)
movq %rsi, %r14
leaq 0x50(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq (%rdi), %r15
cmpq %r15, 0x8(%rdi)
je 0x9c55
movq %rdi, %rbx
leaq 0x48(%rsp), %r12
movq 0x37468(%rip), %r13     # 0x40ff0
movq %r12, %rdi
movq %r15, %rsi
callq 0xb4a0
testb $0x1, %dl
jne 0x9bfa
movl $0x8, %edx
movq %r13, %rdi
leaq 0x29916(%rip), %rsi     # 0x334bd
callq 0x5420
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r13, %rdi
callq 0x5420
movq %rax, %rbp
movl $0x26, %edx
movq %rax, %rdi
leaq 0x298f9(%rip), %rsi     # 0x334c6
callq 0x5420
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
addq $0x20, %r15
cmpq 0x8(%rbx), %r15
jne 0x9b88
movq 0x70(%rsp), %rsi
movq 0x373b0(%rip), %rdi     # 0x40fc0
callq 0x5240
movq %rax, %rbx
leaq 0x298ce(%rip), %rsi     # 0x334ed
movl $0x2e, %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
jmp 0x9c78
movq (%r14), %rbx
cmpq 0x8(%r14), %rbx
je 0x9c78
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb4a0
addq $0x20, %rbx
cmpq 0x8(%r14), %rbx
jne 0x9c63
movq 0x70(%rsp), %rsi
leaq 0xf(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0xe(%rsp), %rcx
callq 0xabec
movq (%r14), %r15
cmpq 0x8(%r14), %r15
je 0x9e4a
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0x3f(%rax), %r12
movq %r14, 0x10(%rsp)
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0xb648
movq %rax, %rbp
leaq 0x50(%rsp), %rax
cmpq %rax, %rbp
je 0x9e3c
movq 0x60(%rsp), %rbx
xorl %r13d, %r13d
cmpq %rbp, %rbx
je 0x9cf2
movq %rbx, %rax
movq %rax, %rdi
callq 0x5430
incq %r13
cmpq %rbp, %rax
jne 0x9ce2
movq 0x18(%rsp), %r14
leaq 0x3f(%r13), %rax
testq %r13, %r13
cmovnsq %r13, %rax
sarq $0x6, %rax
leaq (%r14,%rax,8), %rax
movq %r13, %rcx
andq %r12, %rcx
xorl %edx, %edx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
cmpq %rsi, %rcx
setbe %dl
movq -0x8(%rax,%rdx,8), %rax
btq %r13, %rax
jae 0x9da0
movl $0x8, %edx
movq 0x372b7(%rip), %rdi     # 0x40ff0
leaq 0x2977d(%rip), %rsi     # 0x334bd
callq 0x5420
movq 0x10(%rsp), %r14
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x37298(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
movl $0x4e, %edx
movq %rax, %rdi
leaq 0x297ad(%rip), %rsi     # 0x3351c
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
jmp 0x9e3c
xorl %r13d, %r13d
cmpq %rbp, %rbx
je 0x9dbb
movq %rbx, %rdi
callq 0x5430
movq %rax, %rbx
incq %r13
cmpq %rbp, %rax
jne 0x9da8
leaq 0x3f(%r13), %rax
testq %r13, %r13
cmovnsq %r13, %rax
sarq $0x6, %rax
movq %r13, %rcx
andq %r12, %rcx
xorl %edx, %edx
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
cmpq %rdi, %rcx
setbe %dl
movl $0x1, %esi
movl %r13d, %ecx
shlq %cl, %rsi
leaq (%r14,%rax,8), %rax
orq %rsi, -0x8(%rax,%rdx,8)
movq %r15, %rcx
movq 0x10(%rsp), %r14
subq (%r14), %rcx
sarq $0x5, %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
movq 0x40(%rsp), %rdx
addq (%rdx), %rax
movq %rcx, %rdx
andq %r12, %rdx
xorl %esi, %esi
cmpq %rdi, %rdx
setbe %sil
movl $0x1, %edx
shlq %cl, %rdx
orq %rdx, -0x8(%rax,%rsi,8)
addq $0x20, %r15
cmpq 0x8(%r14), %r15
jne 0x9cb4
movq 0x18(%rsp), %r13
movq 0x28(%rsp), %rax
movl 0x30(%rsp), %ecx
cmpq %rax, %r13
setne %dl
testl %ecx, %ecx
setne %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x9f5a
xorl %ebp, %ebp
movq 0x37176(%rip), %rbx     # 0x40ff0
xorl %edx, %edx
movl %edx, %r14d
movq (%r13), %rsi
btq %rdx, %rsi
jb 0x9f33
movq 0x60(%rsp), %r12
movq %r13, %rax
subq 0x18(%rsp), %rax
leaq (%r14,%rax,8), %r15
testq %r15, %r15
jle 0x9ec3
movq %r12, %rdi
callq 0x5430
movq %rax, %r12
decq %r15
jne 0x9ea3
jmp 0x9ec5
movq %r12, %rdi
callq 0x5200
movq %rax, %r12
incq %r15
jne 0x9eb5
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x295e9(%rip), %rsi     # 0x334bd
callq 0x5420
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
movq %rbx, %rdi
callq 0x5420
movq %rax, %r12
movl $0x3a, %edx
movq %rax, %rdi
leaq 0x2966e(%rip), %rsi     # 0x3356b
callq 0x5420
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x28(%rsp), %rax
movl 0x30(%rsp), %ecx
leal 0x1(%r14), %edx
xorl %esi, %esi
cmpq $0x3f, %r14
sete %sil
leaq (%r13,%rsi,8), %r13
cmovel %ebp, %edx
cmpq %rax, %r13
jne 0x9e7c
cmpl %ecx, %edx
jne 0x9e7c
movq 0x3705f(%rip), %rdi     # 0x40fc0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x37044(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x9fa0
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x53c0
leaq 0x48(%rsp), %rdi
callq 0xac54
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9ff5
jmp 0x9fc5
jmp 0x9ff5
jmp 0x9ff5
jmp 0x9fc5
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x9ff8
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x53c0
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movq %rax, 0x28(%rsp)
jmp 0x9ff8
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xac54
movq %rbx, %rdi
callq 0x56a0