// File: /workspace/github_c_makefile_star2_O3/pwelke[P]GraphMiningTools/minhashing.c
// Function: bfsEmbeddingForTrees
struct IntSet* bfsEmbeddingForTrees(struct Graph* g, struct EvaluationPlan p, struct GraphPool* gp, struct ShallowGraphPool* sgp) {
	int nEvaluations = 0;
	cleanEvaluationPlan(p);

	// add minimal elements to border
	struct ShallowGraph* border = getShallowGraph(sgp);
	for (struct VertexList* e=p.poset->vertices[0]->neighborhood; e!=NULL; e=e->next) {
		addToVertexQueue(e->endPoint, border, sgp);
		e->endPoint->d = 1;
	}

	for (struct Vertex* v=popFromVertexQueue(border, sgp); v!=NULL; v=popFromVertexQueue(border, sgp)) {
		v->d = 0;

		char match = 0;
		if (!embeddingValueKnown(v)) {
			struct Graph* pattern = (struct Graph*)(v->label);
			match = isSubtree(g, pattern, gp);
			++nEvaluations;
			updateEvaluationPlan(p, v->number, match);
		} else {
			match = getMatch(v);
		}

		// add extensions of pattern to border
		if (match) {
			for (struct VertexList* e=v->neighborhood; e!=NULL; e=e->next) {
				if (e->endPoint->d == 0) {
					addToVertexQueue(e->endPoint, border, sgp);
					e->endPoint->d = 1;
				}
			}
		}
	}

	fprintf(stderr, "%i\n", nEvaluations);
	return patternPosetInfoToFeatureSet(p);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rsi, 0x50(%rsp)
movq %rdi, 0x48(%rsp)
leaq 0x90(%rsp), %r15
movq (%r15), %r14
movslq (%r14), %rax
testq %rax, %rax
jle 0x1568
movq 0x8(%r15), %rdx
movq 0x10(%r14), %rcx
movq 0x10(%rdx), %rdx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
andl $0x0, 0x1c(%rdi)
movq (%rdx,%rsi,8), %rdi
andl $0x0, 0x1c(%rdi)
incq %rsi
cmpq %rsi, %rax
jne 0x1550
movq %rbx, %rdi
callq 0x1498d
movq %rax, %r12
movq 0x10(%r14), %rax
movq (%rax), %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x15a3
movq 0x18(%r14), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x1e6f0
movq 0x18(%r14), %rax
movl $0x1, 0x28(%rax)
movq 0x8(%r14), %r14
jmp 0x157e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1e719
xorl %ebp, %ebp
testq %rax, %rax
je 0x16af
movq %rax, %r13
movq (%r15), %rax
movq %rax, 0x38(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x40(%rsp)
xorl %ebp, %ebp
andl $0x0, 0x28(%r13)
movl 0x1c(%r13), %eax
testl %eax, %eax
je 0x15e5
cmpl $0x1, %eax
sete %r14b
jmp 0x1664
movq (%r13), %rsi
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rdx
callq 0xabef
movl %eax, %r14d
incl %ebp
movslq 0x18(%r13), %rax
testb %r14b, %r14b
je 0x1636
movq 0x40(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx,%rax,8), %rdi
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x15312
jmp 0x1664
movq 0x38(%rsp), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx,%rax,8), %rdi
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1537f
testb %r14b, %r14b
je 0x1698
movq 0x8(%r13), %r14
testq %r14, %r14
je 0x1698
movq 0x18(%r14), %rdi
cmpl $0x0, 0x28(%rdi)
jne 0x1692
movq %r12, %rsi
movq %rbx, %rdx
callq 0x1e6f0
movq 0x18(%r14), %rax
movl $0x1, 0x28(%rax)
movq 0x8(%r14), %r14
jmp 0x166d
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1e719
movq %rax, %r13
testq %rax, %rax
jne 0x15cf
movq 0x2b942(%rip), %rax     # 0x2cff8
movq (%rax), %rdi
leaq 0x1e976(%rip), %rsi     # 0x20036
movl %ebp, %edx
xorl %eax, %eax
callq 0x1160
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1543e