// File: /workspace/github_cpp_makefile_star2_O2/simonrharris[P]SKA/src/kmers.cpp
// Function: reverseVectorBoolKmerMap(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<bool, std::allocator<bool>>, 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::vector<bool, std::allocator<bool>>>>>&, std::unordered_map<std::vector<bool, std::allocator<bool>>, 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>>>>, std::hash<std::vector<bool, std::allocator<bool>>>, std::equal_to<std::vector<bool, std::allocator<bool>>>, std::allocator<std::pair<std::vector<bool, std::allocator<bool>> 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>>>>>>>&)
void reverseVectorBoolKmerMap(std::unordered_map < std::string, std::vector < bool > > & kmerMap, std::unordered_map < std::vector < bool >, std::vector < std::string > > & revKmerMap){

	std::unordered_map < std::string, std::vector < bool > >::iterator it = kmerMap.begin();
	std::unordered_map < std::string, std::vector < bool > >::iterator endIter = kmerMap.end();

	for (; it!=endIter; ){
		std::unordered_map < std::vector < bool >, std::vector < std::string > >::iterator it2 = revKmerMap.find(it->second);//check if the bitset is in the map
		if ( it2 != revKmerMap.end() ){//if the bitset is in the map
			it2->second.push_back(it->first); //add the kmer
		}
		else {//if the bitset isn't in the map
			revKmerMap.insert(std::make_pair(it->second, std::vector < std::string > {it->first})); //insert the vector into the map
		}
		kmerMap.erase(it++); //remove kmer from kmerMap to save space
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x10(%rdi), %rbp
leaq 0x40(%rsp), %r13
leaq 0x58(%rsp), %rbx
testq %rbp, %rbp
je 0x8d74
leaq 0x8(%rbp), %r12
leaq 0x28(%rbp), %r15
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xa6e2
testq %rax, %rax
je 0x8cfd
addq $0x30, %rax
movq %rax, %rdi
movq %r12, %rsi
callq 0x77fc
jmp 0x8d5b
movq %r13, %r14
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x5540
movq %r14, %rdi
movq %r13, %rsi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x90ce
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x92b4
movq %r14, %r13
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xa9b8
movq %rbx, %rdi
callq 0x9108
movq %r13, %rdi
callq 0x911e
leaq 0x20(%rsp), %rdi
callq 0x5778
movq (%rbp), %r15
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0xad92
movq %r15, %rbp
jmp 0x8cc9
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x8d9d
movq %rax, %rbx
jmp 0x8da7
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x9108
leaq 0x40(%rsp), %rdi
callq 0x911e
leaq 0x20(%rsp), %rdi
callq 0x5778
movq %rbx, %rdi
callq 0x56c0