// File: /workspace/github_cpp_makefile_star2_O2/simonrharris[P]SKA/src/kmers.cpp
// Function: addKmerToStringMap(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, std::vector<bool, std::allocator<bool>> const&, std::vector<int, std::allocator<int>> const&, int, int, int)
void addKmerToStringMap(std::unordered_map < std::string, std::string > & myKmerMap, const std::string & myKmer, const char myBase, const std::vector < bool > & myBits, const std::vector < int > & mySamples, int currentSampleNumber, int totalSamples, int maxMissing){
	std::unordered_map < std::string, std::string >::iterator kmit = myKmerMap.find(myKmer);//check if the kmer is in the map
	if ( kmit != myKmerMap.end() ){//if the kmer is in the map
		for (int i=0; i<mySamples.size(); ++i){ //add the base to all samples that are true in the bitset
			if (myBits[mySamples[i]]){
				kmit->second[i+currentSampleNumber]=myBase;
			}
		}
	}
	else {//if the kmer isn't in the map
		if ((currentSampleNumber)<=maxMissing){
			std::pair < std::unordered_map < std::string, std::string >::iterator, bool > ret = myKmerMap.insert(std::make_pair(myKmer, std::string (totalSamples,'-')));
			for (int i=0; i<mySamples.size(); ++i){
				if (myBits[mySamples[i]]){
					ret.first->second[i+currentSampleNumber]=myBase;
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r9d, 0x4(%rsp)
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %r15
callq 0x9c92
testq %rax, %rax
je 0x8936
movq %rax, %r12
movslq 0x4(%rsp), %r15
xorl %r13d, %r13d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x8943
movslq (%rax,%r13,4), %rsi
movq %r14, %rdi
callq 0x909a
testb %al, %al
je 0x8931
movq 0x28(%r12), %rax
addq %r15, %rax
movb %bpl, (%r13,%rax)
incq %r13
jmp 0x8901
movl 0x4(%rsp), %eax
cmpl 0xa8(%rsp), %eax
jle 0x8952
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %r12
movslq 0xa0(%rsp), %rsi
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %r13
pushq $0x2d
popq %rdx
movq %r13, %rdi
callq 0x5470
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x928e
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x9dfa
movq %rax, %r12
leaq 0x28(%rsp), %rdi
callq 0x90b8
leaq 0x8(%rsp), %rdi
callq 0x5778
movslq 0x4(%rsp), %r15
xorl %r13d, %r13d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x8943
movslq (%rax,%r13,4), %rsi
movq %r14, %rdi
callq 0x909a
testb %al, %al
je 0x89e6
movq 0x28(%r12), %rax
addq %r15, %rax
movb %bpl, (%r13,%rax)
incq %r13
jmp 0x89b2
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x90b8
jmp 0x89fd
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5778
movq %rbx, %rdi
callq 0x56c0