// File: /workspace/github_c_makefile_star2_O3/pwelke[P]GraphMiningTools/iterativeSubtreeIsomorphism.c
// Function: noniterativeRootedSubtreeCheck_intern
static struct Vertex* noniterativeRootedSubtreeCheck_intern(struct SubtreeIsoDataStore* current, struct Vertex* hRoot, struct GraphPool* gp) {

	struct Graph* g = current->g;
	struct Graph* h = current->h;

	struct CachedGraph* cachedB = initCachedGraph(gp, h->n);

	current->foundIso = 0;
	for (int vi=0; vi<g->n; ++vi) {
		struct Vertex* v = g->vertices[current->postorder[vi]];

		for (int ui=0; ui<h->n; ++ui) {
			struct Vertex* u = h->vertices[ui];

			// check if vertex labels match
			if (labelCmp(u->label, v->label) != 0) { continue; }

			// compute maximum matching
			struct Graph* B = makeBipartiteInstanceFromVerticesCached(*current, cachedB, u, u, v, gp);
			int sizeofMatching = bipartiteMatchingEvenMoreDirty(B);
			int nNeighbors = B->number;

			// is there a subgraph iso here?
			if (sizeofMatching == nNeighbors) {
				addCharacteristic(current, u, u, v);

				if (u == hRoot) {
					current->foundIso = 1;

					returnCachedGraph(cachedB);
					dumpCachedGraph(cachedB);
					return v; // early termination when subtree iso is found
				}
			}

			// compute partial subgraph isomorphisms
			if (sizeofMatching == nNeighbors - 1) {
				addNoncriticalVertexCharacteristics(current, B, u, v);
			}

			returnCachedGraph(cachedB);
		}
	}

	dumpCachedGraph(cachedB);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, 0x50(%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %r15
movq 0x10(%rdi), %r12
movl (%r12), %esi
movq %rdx, 0x60(%rsp)
movq %rdx, %rdi
callq 0x3c50
movq %rax, %rbx
movl $0x0, 0x20(%r14)
movl (%r15), %ecx
testl %ecx, %ecx
jle 0xae69
movl (%r12), %eax
xorl %esi, %esi
movq %rbx, 0x38(%rsp)
movq %r15, 0x40(%rsp)
movq %r12, 0x58(%rsp)
testl %eax, %eax
jle 0xae5a
movq 0x10(%r15), %rax
movq (%r14), %rcx
movq %rsi, 0x48(%rsp)
movslq (%rcx,%rsi,4), %rcx
movq (%rax,%rcx,8), %r13
xorl %r15d, %r15d
movq %r13, 0x30(%rsp)
movq 0x10(%r12), %rax
movq (%rax,%r15,8), %rbp
movq (%rbp), %rdi
movq (%r13), %rsi
callq 0x1bb34
testl %eax, %eax
jne 0xae3d
movq 0x20(%r14), %rax
movq %rax, 0x20(%rsp)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq %rbp, %rdx
movq %r13, %rcx
movq 0x60(%rsp), %r8
callq 0xa053
movq %rax, %r12
movq %rax, %rdi
callq 0x3762
movq %r14, %r13
movl %eax, %r14d
movl 0x8(%r12), %ebx
cmpl %ebx, %eax
jne 0xae0b
movq %r13, %rdi
movq %rbp, %rsi
movq %rbp, %rdx
movq 0x30(%rsp), %rcx
callq 0x16234
cmpq 0x50(%rsp), %rbp
je 0xae6e
decl %ebx
cmpl %ebx, %r14d
movq %r13, %r14
movq 0x30(%rsp), %r13
jne 0xae2b
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0xa976
movq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x3cf6
movq 0x58(%rsp), %r12
incq %r15
movslq (%r12), %rax
cmpq %rax, %r15
jl 0xad88
movq 0x40(%rsp), %r15
movl (%r15), %ecx
movq 0x48(%rsp), %rsi
incq %rsi
movslq %ecx, %rdx
cmpq %rdx, %rsi
jl 0xad64
xorl %r14d, %r14d
jmp 0xae88
movl $0x1, 0x20(%r13)
movq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x3cf6
movq 0x30(%rsp), %r14
movq %rbx, %rdi
callq 0x3d51
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq