// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movl %r9d, %ebx
movq %r8, %r14
movq %rcx, %r12
movl %esi, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x18(%rdi), %rcx
movl 0x8(%rcx), %eax
movq 0x48(%rcx), %r13
movq 0x40(%rcx), %rbp
leaq 0x50(%rsp), %r15
movl %esi, -0x8(%r15)
movq %rdx, (%r15)
movq %r15, %rdi
movl $0x8, %esi
movl %eax, %edx
callq 0xf7c8
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x2360
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0xe152
testq %rax, %rax
je 0x52ab
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0xe1ae
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0xe484
testq %rax, %rax
je 0x52ab
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0xe1ae
leaq 0x30(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0xe912
movl (%r13), %esi
movq 0x8(%r13), %rdx
leaq 0x48(%rsp), %r13
movq %r13, %rdi
callq 0x52d3
movq 0x18(%r13), %r13
cmpq %r15, %r13
je 0x50ad
leaq 0x10(%rsp), %rbp
leaq 0x20(%r13), %rsi
movq %r14, 0x10(%rsp)
movq %r14, %rdi
movq %rbp, %rdx
callq 0xd012
movq %r13, %rdi
callq 0x2290
movq %rax, %r13
cmpq %r15, %rax
jne 0x5089
leaq 0x48(%rsp), %rdi
callq 0xc756
testb %bl, %bl
je 0x52ab
movl 0x30(%rsp), %esi
movq 0x38(%rsp), %rdx
movq 0x18(%rsp), %rdi
callq 0x2eaa
movq %rax, %r13
leaq 0x8(%rsp), %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0xe1ae
subq %r13, 0x38(%rax)
movq %r12, %rdi
movq %rbp, %rsi
callq 0xe1ae
movq 0x10(%rax), %rbx
testq %rbx, %rbx
movq %r12, 0x20(%rsp)
je 0x51dc
leaq 0x10(%rsp), %rbp
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movq 0x18(%rsp), %rdi
callq 0x2eaa
movq %rax, %r13
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0xe1ae
cmpq 0x38(%rax), %r13
jbe 0x51d0
movl 0x8(%rbx), %eax
movl %eax, 0x2c(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x40(%rsp)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0xe1ae
movq 0x38(%rax), %r12
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x2eaa
subq %rax, %r12
movq %r13, %rdi
movl 0x2c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq %r12, %rcx
callq 0x4f64
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
leaq 0x48(%rsp), %rdi
callq 0x52d3
movq 0x60(%rsp), %r13
cmpq %r15, %r13
je 0x51c1
leaq 0x20(%r13), %rsi
movq %r14, 0x10(%rsp)
movq %r14, %rdi
movq %rbp, %rdx
callq 0xd012
movq %r13, %rdi
callq 0x2290
movq %rax, %r13
cmpq %r15, %rax
jne 0x519d
leaq 0x48(%rsp), %rdi
callq 0xc756
movq 0x20(%rsp), %r12
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x510b
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0xe1ae
movq 0x10(%rax), %r12
xorl %ebx, %ebx
testq %r12, %r12
je 0x5217
movq 0x18(%rsp), %r13
movl 0x8(%r12), %esi
movq 0x10(%r12), %rdx
movq %r13, %rdi
callq 0x2eaa
addq %rax, %rbx
movq (%r12), %r12
testq %r12, %r12
jne 0x51f9
leaq 0x8(%rsp), %rsi
movq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0xe1ae
cmpq %rbx, 0x38(%rax)
jne 0x52ab
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0xe1ae
movq 0x10(%rax), %rbx
testq %rbx, %rbx
je 0x529c
leaq 0x48(%rsp), %r12
leaq 0x10(%rsp), %r13
movl 0x8(%rbx), %esi
movq 0x10(%rbx), %rdx
movq %r12, %rdi
callq 0x52d3
movq 0x60(%rsp), %rbp
cmpq %r15, %rbp
je 0x528c
leaq 0x20(%rbp), %rsi
movq %r14, 0x10(%rsp)
movq %r14, %rdi
movq %r13, %rdx
callq 0xd012
movq %rbp, %rdi
callq 0x2290
movq %rax, %rbp
cmpq %r15, %rax
jne 0x5268
movq %r12, %rdi
callq 0xc756
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x524f
leaq 0x8(%rsp), %rsi
movq 0x20(%rsp), %rdi
callq 0xe9ec
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x52be
jmp 0x52be
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xc756
movq %rbx, %rdi
callq 0x23b0