// File: /workspace/github_cpp_makefile_star2_O2/splatlab[P]debgr/debruijn_graph.cc
// Function: dna::debruijn_graph::mark_edge_as_correct(dna::canonical_kmer, std::unordered_map<unsigned long, dna::debruijn_graph::unresolved_edge_set, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, dna::debruijn_graph::unresolved_edge_set>>>&, std::unordered_set<dna::canonical_kmer, std::hash<dna::canonical_kmer>, std::equal_to<dna::canonical_kmer>, std::allocator<dna::canonical_kmer>>&, bool)
void debruijn_graph::mark_edge_as_correct(edge e,
																						unresolved_edges_map &mbi,
																						unordered_set<edge> &work_queue,
																						bool can_use_hashing_rules) {
		uint64_t hash = occurences.get_hash(e);

		// If the edge is currently in mbi
		if (mbi.count(hash) > 0 && mbi[hash].count(e) > 0) {

			// Remove it, update the amount of unresolved count, and add its
			// nodes to the work-queue
			mbi[hash].erase(e);
			for (const auto & n : nodes(e))
				work_queue.insert(n);

			if (can_use_hashing_rules) {
				mbi[hash].unresolved_count -= abundance(e);

				// If any edge currently wants more count than is available,
				// then we know it wants too much
				for (const auto & o : mbi[hash]) {
					if (abundance(o) > mbi[hash].unresolved_count) {
						add_correction(o, mbi[hash].unresolved_count - abundance(o));
						for (const auto & n : nodes(o))
							work_queue.insert(n);
					}
				}
			
				// Figure out how much count the remaining edges currently want
				uint64_t current_total_edge_count = 0;
				for (const auto & o : mbi[hash])
					current_total_edge_count += abundance(o);

				// If the amount of total wanted count is the same as the amount
				// of available count, then we know all the remaining edges are
				// correct.
				if (mbi[hash].unresolved_count == current_total_edge_count) {
					for (const auto & o : mbi[hash])
						for (const auto & n : nodes(o))
							work_queue.insert(n);
					mbi.erase(hash);
				}
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r9d, %ebp
movq %r8, %r14
movq %rcx, %r15
movl %esi, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq %rdi, 0x10(%rsp)
addq $0x8, %rdi
callq 0x8120
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0xb946
testq %rax, %rax
je 0x4b4b
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0xb9d6
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0xbd16
testq %rax, %rax
je 0x4b4b
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0xb9d6
leaq 0x20(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0xc21c
movl (%r12), %esi
movq 0x8(%r12), %rdx
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0x4b73
movq 0x18(%r12), %r12
leaq 0x40(%rsp), %rbx
cmpq %rbx, %r12
je 0x4972
leaq 0x20(%r12), %rsi
movq %r14, %rdi
callq 0xa8e2
movq %r12, %rdi
callq 0x2260
movq %rax, %r12
jmp 0x4953
leaq 0x38(%rsp), %rdi
callq 0x9eb0
testb %bpl, %bpl
je 0x4b4b
movl 0x20(%rsp), %esi
movq 0x28(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x2bfe
movq %rax, %r13
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xb9d6
subq %r13, 0x38(%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0xb9d6
movq %rax, %r13
addq $0x10, %r13
movq %r15, 0x18(%rsp)
movq (%r13), %r13
testq %r13, %r13
je 0x4a8d
movl 0x8(%r13), %esi
movq 0x10(%r13), %rdx
movq 0x10(%rsp), %rdi
callq 0x2bfe
movq %rax, %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0xb9d6
cmpq 0x38(%rax), %rbp
jbe 0x49c6
movl 0x8(%r13), %ebp
movq 0x10(%r13), %rax
movq %rax, 0x30(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xb9d6
movq 0x38(%rax), %r15
movl 0x8(%r13), %esi
movq 0x10(%r13), %rdx
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x2bfe
subq %rax, %r15
movq %r12, %rdi
movl %ebp, %esi
movq 0x30(%rsp), %rdx
movq %r15, %rcx
callq 0x4862
movl 0x8(%r13), %esi
movq 0x10(%r13), %rdx
leaq 0x38(%rsp), %rdi
callq 0x4b73
movq 0x50(%rsp), %rbp
cmpq %rbx, %rbp
je 0x4a74
leaq 0x20(%rbp), %rsi
movq %r14, %rdi
callq 0xa8e2
movq %rbp, %rdi
callq 0x2260
movq %rax, %rbp
jmp 0x4a56
leaq 0x38(%rsp), %rdi
callq 0x9eb0
movq 0x18(%rsp), %r15
leaq 0x8(%rsp), %r12
jmp 0x49c6
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0xb9d6
movq %rax, %r12
addq $0x10, %r12
xorl %r15d, %r15d
movq (%r12), %r12
testq %r12, %r12
je 0x4ac6
movl 0x8(%r12), %esi
movq 0x10(%r12), %rdx
movq 0x10(%rsp), %rdi
callq 0x2bfe
addq %rax, %r15
jmp 0x4aa4
leaq 0x8(%rsp), %rsi
movq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0xb9d6
cmpq %r15, 0x38(%rax)
jne 0x4b4b
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0xb9d6
movq %rax, %r15
addq $0x10, %r15
leaq 0x38(%rsp), %r12
movq (%r15), %r15
testq %r15, %r15
je 0x4b3c
movl 0x8(%r15), %esi
movq 0x10(%r15), %rdx
movq %r12, %rdi
callq 0x4b73
movq 0x50(%rsp), %r13
cmpq %rbx, %r13
je 0x4b32
leaq 0x20(%r13), %rsi
movq %r14, %rdi
callq 0xa8e2
movq %r13, %rdi
callq 0x2260
movq %rax, %r13
jmp 0x4b14
movq %r12, %rdi
callq 0x9eb0
jmp 0x4af7
leaq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0xc31e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4b5e
jmp 0x4b5e
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x9eb0
movq %rbx, %rdi
callq 0x23b0