// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/localEasySubtreeIsomorphism.c
// Function: getFullSpanningtreeTree
struct SpanningtreeTree getFullSpanningtreeTree(struct BlockTree blockTree, struct GraphPool* gp, struct ShallowGraphPool* sgp) {
	struct SpanningtreeTree sptTree = {0,0,0,0,0,0,0};
	sptTree.g = blockTree.g;
	sptTree.nRoots = blockTree.nRoots;
	sptTree.roots = blockTree.roots;
	sptTree.parents = blockTree.parents;
	sptTree.localSpanningTrees = malloc(sptTree.nRoots * sizeof(struct Graph*));
	sptTree.localPostorders = malloc(sptTree.nRoots * sizeof(struct PostorderList*));

	for (int v=0; v<sptTree.nRoots; ++v) {
		struct ShallowGraph* mergedEdges = mergeShallowGraphs(blockTree.vRootedBlocks[v], sgp);
		// TODO make destructive. shallowGraphs are not used afterwards.
		struct Graph* mergedGraph = blockConverter(mergedEdges, gp);

		struct ShallowGraph* shallowSpanningtrees = listSpanningTrees(mergedGraph, sgp, gp);
		sptTree.localSpanningTrees[v] = spanningTreeConverter(shallowSpanningtrees, mergedGraph, gp, sgp);

		sptTree.localPostorders[v] = NULL;
		struct PostorderList* tail = NULL;
		for (struct Graph* localSpanningTree=sptTree.localSpanningTrees[v]; localSpanningTree!=NULL; localSpanningTree=localSpanningTree->next) {
			struct PostorderList* tmp = __getPOL();
			tmp->postorder = getPostorder(localSpanningTree, 0);
			if (sptTree.localPostorders[v] == NULL) {
				sptTree.localPostorders[v] = tail = tmp;
			} else {
				// append at the end of the list
				tail->next = tmp;
				tail = tmp;
			}
		}

		// garbage collection
		dumpShallowGraph(sgp, mergedEdges);
		dumpGraph(gp, mergedGraph);
	}

	initCharacteristicsArrayForLocalEasy(&sptTree);

	//garbage collection
	free(blockTree.vRootedBlocks);

	return sptTree;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x30(%rdi)
movslq 0x20(%rax), %r13
movl %r13d, 0x30(%rdi)
movaps (%rax), %xmm0
movups %xmm0, (%rdi)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rdi)
leaq (,%r13,8), %rbx
movq %rbx, %rdi
callq 0x1190
movq %rax, 0x30(%rsp)
movq %rax, 0x18(%r14)
movq %rbx, %rdi
callq 0x1190
movq %r14, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq %rax, 0x28(%r14)
movq %r13, 0x38(%rsp)
testq %r13, %r13
jle 0xf453
leaq 0x80(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
xorl %r14d, %r14d
movq %r15, 0x28(%rsp)
movq %r12, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq (%rax,%r14,8), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf237
movq %rbx, 0x40(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xea87
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xc6e6
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0xebbc
movq %rax, %r12
movq 0x30(%rsp), %rax
movq %r12, (%rax,%r14,8)
movq 0x8(%rsp), %rax
movq $0x0, (%rax,%r14,8)
testq %r12, %r12
je 0xf423
movq 0x8(%rsp), %rax
leaq (%rax,%r14,8), %r15
xorl %r13d, %r13d
movl $0x10, %edi
callq 0x1190
movq %rax, %rbp
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r12, %rdi
xorl %esi, %esi
callq 0x1bd4a
movq %rax, (%rbp)
addq $0x8, %r13
cmpq $0x0, (%r15)
cmoveq %r15, %r13
movq %rbp, (%r13)
movq 0x18(%r12), %r12
movq %rbp, %r13
testq %r12, %r12
jne 0xf3e5
movq 0x28(%rsp), %r15
movq %r15, %rdi
movq 0x40(%rsp), %rsi
callq 0x14b19
movq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x14832
incq %r14
cmpq 0x38(%rsp), %r14
jne 0xf375
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xecdc
leaq 0x80(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1030
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq