// File: /workspace/github_c_makefile_star2_O3/pwelke[P]GraphMiningTools/treeKernels.c
// Function: recSubtreeEnum
void recSubtreeEnum(struct Graph* current, struct ShallowGraph* forbiddenEdges, struct ShallowGraph* allEdges, int* number, struct ShallowGraphPool* sgp) {
	struct VertexList* e;
	struct VertexList* startOfForbidden = forbiddenEdges->edges;

	for (e=allEdges->edges; e; e=e->next) {

		/* check if e is in forbiddenEdges */
		struct VertexList* idx;
		char allowed = 1;
		for (idx=forbiddenEdges->edges; idx; idx=idx->next) {
			/* if edge is forbidden */
			if (((e->startPoint == idx->startPoint) && (e->endPoint == idx->endPoint))
					|| ((e->startPoint == idx->endPoint) && (e->endPoint == idx->startPoint))) {
				allowed = 0;
				break;
			}
		}

		/* if its not, list current + e and continue recursively */
		if (allowed) {

			int v = e->startPoint->number;
			int w = e->endPoint->number;

			/* if adding e produces a tree, list that tree and continue recursively
			 * this assumes, that t is a tree */
			if ((current->m == 0)
					|| ((current->vertices[v]->neighborhood != NULL) && (current->vertices[w]->neighborhood == NULL))
					|| ((current->vertices[w]->neighborhood != NULL) && (current->vertices[v]->neighborhood == NULL))) {
				struct VertexList* tmp;

				addEdge(current->vertices[v], shallowCopyEdge(e, sgp->listPool));
				addEdge(current->vertices[w], inverseEdge(e, sgp->listPool));

				++current->m;

				/* here, output is produced */
				++(*number);

				/* recursive call for (T + e, F) */
				recSubtreeEnum(current, forbiddenEdges, allEdges, number, sgp);

				/* remove edge from current, add it to forbidden list */
				tmp = current->vertices[v]->neighborhood;
				current->vertices[v]->neighborhood = tmp->next;
				dumpVertexList(sgp->listPool, tmp);

				tmp = current->vertices[w]->neighborhood;
				current->vertices[w]->neighborhood = tmp->next;
				dumpVertexList(sgp->listPool, tmp);

				--current->m;

				pushEdge(forbiddenEdges, shallowCopyEdge(e, sgp->listPool));

				recSubtreeEnum(current, forbiddenEdges, allEdges, number, sgp);

				break;

			}
		}
	}

	/* reallow all edges that were forbidden in the current recursion */
	for (e=forbiddenEdges->edges; e!=startOfForbidden; e=forbiddenEdges->edges) {
		dumpVertexList(sgp->listPool, popEdge(forbiddenEdges));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x8(%rsp)
movq %rsi, (%rsp)
movq (%rdx), %rbp
testq %rbp, %rbp
je 0x1e201
movq %rdi, %r13
movq (%rsp), %rax
movq (%rax), %r12
movq 0x10(%rbp), %rax
testq %r12, %r12
je 0x1e0b3
movq %r12, %rdi
movq 0x10(%rdi), %r8
cmpq %r8, %rax
je 0x1e095
movq 0x18(%rdi), %rsi
jmp 0x1e09f
movq 0x18(%rdi), %rsi
cmpq %rsi, 0x18(%rbp)
je 0x1e0e8
cmpq %rsi, %rax
jne 0x1e0aa
cmpq %r8, 0x18(%rbp)
je 0x1e0e8
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
jne 0x1e086
movslq 0x18(%rax), %r14
movq 0x18(%rbp), %rax
movslq 0x18(%rax), %rbx
cmpl $0x0, 0x4(%r13)
movq 0x10(%r13), %rax
movq (%rax,%r14,8), %r15
je 0x1e0f6
cmpq $0x0, 0x8(%r15)
sete %sil
movq (%rax,%rbx,8), %rax
cmpq $0x0, 0x8(%rax)
sete %al
xorb %sil, %al
jne 0x1e0f6
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
jne 0x1e07a
jmp 0x1e201
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
movq %rbp, %rdi
movq %rcx, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
callq 0x7bec
movq %r15, %rdi
movq %rax, %rsi
callq 0x7cfe
movq 0x10(%r13), %rax
movq (%rax,%rbx,8), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %r15
movq 0x10(%r15), %rsi
movq %rbp, %rdi
callq 0x7c08
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x7cfe
incl 0x4(%r13)
movq 0x10(%rsp), %rcx
incl (%rcx)
movq %r13, %rdi
movq (%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r15, %r8
callq 0x1e04d
movq 0x10(%r13), %rax
movq (%rax,%r14,8), %rax
movq 0x8(%rax), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%r15), %rdi
callq 0x14250
movq 0x10(%r13), %rax
movq (%rax,%rbx,8), %rax
movq 0x8(%rax), %rsi
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%r15), %rdi
callq 0x14250
decl 0x4(%r13)
movq 0x10(%r15), %rsi
movq %rbp, %rdi
callq 0x7bec
movq (%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x848a
movq %r13, %rdi
movq %r14, %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r15, %r8
callq 0x1e04d
cmpq %r12, (%r14)
je 0x1e201
movq (%rsp), %rbx
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r15
movq %rbx, %rdi
callq 0x88ee
movq %r15, %rdi
movq %rax, %rsi
callq 0x14250
cmpq %r12, (%rbx)
jne 0x1e1e0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq