// File: /workspace/github_c_makefile_star2_O2/pwelke[P]GraphMiningTools/localEasySubtreeIsomorphism.c
// Function: subtreeCheckForSpanningtreeTree
char subtreeCheckForSpanningtreeTree(struct SpanningtreeTree* sptTree, struct Graph* h, struct GraphPool* gp) {

	// for each root, process each spanning tree of the v rooted components and compute characteristics
	for (int v=sptTree->nRoots-1; v>=0; --v) {
		// we need to compute characteristics for the global root, which is a special case.
		int blockDoesNotContainGlobalRoot = v==0 ? 0 : 1;

		struct Graph* localTree = NULL;
		struct PostorderList* localPostorder = NULL;
		for (localTree=sptTree->localSpanningTrees[v], localPostorder=sptTree->localPostorders[v];
				localTree!=NULL;
				localTree=localTree->next, localPostorder=localPostorder->next) {

			struct SubtreeIsoDataStore info = {0,0,0,0,0};
			info.g = localTree;
			info.h = h;
//			info.postorder = getPostorder(localTree, 0); // 0 is the root v of localTree
			info.postorder = localPostorder->postorder;
			info.S = createNewCube(info.g->n, info.h->n);

			subtreeCheckForOneBlockSpanningTree(&info, sptTree, blockDoesNotContainGlobalRoot, gp);
			appendSupportSetData(sptTree->characteristics[v], info);

//			free(info.postorder);
//			info.postorder = NULL;

			if (info.foundIso) {
				return 1;
			}
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdi, 0x28(%rsp)
movl 0x30(%rdi), %ecx
testl %ecx, %ecx
jle 0xd222
movq %rcx, %rdx
decq %rdx
movq %rdx, %rax
negq %rax
movl $0x0, %eax
sbbl %eax, %eax
movl %eax, 0x3c(%rsp)
movq %rdx, 0x70(%rsp)
leaq (,%rdx,8), %rdx
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rsi
addq %rdx, %rsi
addq 0x28(%rax), %rdx
movq %rcx, 0x90(%rsp)
movq (%rdx), %rdx
movq (%rsi), %rsi
testq %rsi, %rsi
je 0xd218
andq $0x0, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x88(%rsp), %rcx
movq %rcx, 0x50(%rsp)
movq %rdx, 0xa0(%rsp)
movq (%rdx), %rax
movq %rax, 0x40(%rsp)
movq %rsi, 0x98(%rsp)
movslq (%rsi), %rdi
movslq (%rcx), %rsi
callq 0x1336c
movq %rax, 0x58(%rsp)
movq 0x48(%rsp), %rbx
movq 0x50(%rsp), %r12
movl (%r12), %esi
movq 0x30(%rsp), %rdi
callq 0x1f1c
movq %rax, %r13
andl $0x0, 0x60(%rsp)
xorl %ecx, %ecx
movq %rbx, 0x78(%rsp)
movl (%rbx), %eax
addl 0x3c(%rsp), %eax
cltq
movq %rcx, 0x80(%rsp)
cmpq %rax, %rcx
jge 0xd1b0
movq 0x78(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rsp), %rcx
movq 0x80(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rbp
xorl %ebx, %ebx
movslq (%r12), %rax
cmpq %rax, %rbx
jge 0xd19b
movq 0x10(%r12), %rax
movq (%rax,%rbx,8), %r14
movq (%r14), %rdi
movq (%rbp), %rsi
callq 0x19340
testl %eax, %eax
jne 0xd193
movslq 0x28(%rbp), %rax
cmpq $-0x1, %rax
je 0xd16b
cmpl $0x0, 0x18(%rbp)
je 0xd16b
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rcx
movq (%rcx,%rax,8), %r15
movq (%r15), %r15
testq %r15, %r15
je 0xd193
movq 0x8(%r15), %rax
movq 0x10(%rax), %rax
movq (%rax), %r9
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %rbp, %r8
callq 0xcc9b
addq $0x28, %r15
cmpl $0x0, 0x60(%rsp)
je 0xd12c
jmp 0xd1b0
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0xcc9b
cmpl $0x0, 0x60(%rsp)
jne 0xd1b0
incq %rbx
jmp 0xd0e5
movq 0x80(%rsp), %rcx
incq %rcx
movq 0x78(%rsp), %rbx
jmp 0xd0ac
movq %r13, %rdi
callq 0x2032
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x70(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1a223
cmpl $0x0, 0x60(%rsp)
movq 0x90(%rsp), %rcx
jne 0xd222
movq 0x98(%rsp), %rsi
addq $0x18, %rsi
movq 0xa0(%rsp), %rdx
addq $0x8, %rdx
jmp 0xd029
movq 0x70(%rsp), %rcx
jmp 0xcfe5
testl %ecx, %ecx
setg %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq