// File: /workspace/github_cpp_makefile_star2_O1/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 0x9cce
movq %rdi, %rbx
cmpq 0x8(%rdi), %r15
je 0x9c7d
leaq 0x48(%rsp), %r12
movq 0x373ef(%rip), %r13     # 0x40ff0
movq %r12, %rdi
movq %r15, %rsi
callq 0xb4ec
testb $0x1, %dl
jne 0x9c73
movl $0x8, %edx
movq %r13, %rdi
leaq 0x2989d(%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 0x29880(%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 0x9c01
movq 0x70(%rsp), %rsi
movq 0x37337(%rip), %rdi     # 0x40fc0
callq 0x5240
movq %rax, %rbx
leaq 0x29855(%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 0x9cf1
movq (%r14), %rbx
cmpq 0x8(%r14), %rbx
je 0x9cf1
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb4ec
addq $0x20, %rbx
cmpq 0x8(%r14), %rbx
jne 0x9cdc
movq 0x70(%rsp), %rsi
leaq 0xf(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rcx
callq 0xac4a
movq (%r14), %r15
cmpq 0x8(%r14), %r15
je 0x9ec3
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0x3f(%rax), %r12
movq %r14, 0x38(%rsp)
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0xb694
movq %rax, %rbp
leaq 0x50(%rsp), %rax
cmpq %rax, %rbp
je 0x9eb5
movq 0x60(%rsp), %rbx
xorl %r13d, %r13d
cmpq %rbp, %rbx
je 0x9d6b
movq %rbx, %rax
movq %rax, %rdi
callq 0x5430
incq %r13
cmpq %rbp, %rax
jne 0x9d5b
movq 0x10(%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 0x9e19
movl $0x8, %edx
movq 0x3723e(%rip), %rdi     # 0x40ff0
leaq 0x29704(%rip), %rsi     # 0x334bd
callq 0x5420
movq 0x38(%rsp), %r14
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x3721f(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
movl $0x4e, %edx
movq %rax, %rdi
leaq 0x29734(%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 0x9eb5
xorl %r13d, %r13d
cmpq %rbp, %rbx
je 0x9e34
movq %rbx, %rdi
callq 0x5430
movq %rax, %rbx
incq %r13
cmpq %rbp, %rax
jne 0x9e21
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 0x38(%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 0x9d2d
movq 0x10(%rsp), %r13
cmpq 0x20(%rsp), %r13
jne 0x9eda
cmpl $0x0, 0x28(%rsp)
je 0x9fbd
xorl %ebp, %ebp
movq 0x3710d(%rip), %rbx     # 0x40ff0
xorl %eax, %eax
movl %eax, %r14d
movq (%r13), %rcx
btq %rax, %rcx
jb 0x9f93
movq 0x60(%rsp), %r12
movq %r13, %rax
subq 0x10(%rsp), %rax
leaq (%r14,%rax,8), %r15
testq %r15, %r15
jle 0x9f2c
movq %r12, %rdi
callq 0x5430
movq %rax, %r12
decq %r15
jne 0x9f0c
jmp 0x9f2e
movq %r12, %rdi
callq 0x5200
movq %rax, %r12
incq %r15
jne 0x9f1e
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x29580(%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 0x29605(%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
leal 0x1(%r14), %eax
xorl %ecx, %ecx
cmpq $0x3f, %r14
sete %cl
leaq (%r13,%rcx,8), %r13
cmovel %ebp, %eax
cmpq 0x20(%rsp), %r13
jne 0x9ee5
cmpl 0x28(%rsp), %eax
jne 0x9ee5
movq 0x36ffc(%rip), %rdi     # 0x40fc0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x36fe1(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa01c
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x53c0
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xacb2
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa041
jmp 0xa046
jmp 0xa041
jmp 0xa041
jmp 0xa046
movq %rax, %rbx
jmp 0xa079
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa079
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x53c0
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xacb2
movq %rbx, %rdi
callq 0x56a0