// File: /workspace/github_c_makefile_star2_O3/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, 0x48(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdi, 0x38(%rsp)
movslq 0x30(%rdi), %rcx
movq %rcx, 0x30(%rsp)
testq %rcx, %rcx
jle 0xfd2d
movq 0x30(%rsp), %rax
movq %rax, %rdx
movl $0x0, 0x2c(%rsp)
decq %rax
movq %rax, 0x30(%rsp)
setne %al
movq 0x38(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq %rdx, 0x88(%rsp)
movq -0x8(%rcx,%rdx,8), %rdx
testq %rdx, %rdx
je 0xfd1e
movl 0x2c(%rsp), %ecx
movb %al, %cl
movl %ecx, 0x2c(%rsp)
movq 0x30(%rsp), %rax
leaq (,%rax,8), %rsi
movq 0x38(%rsp), %rax
addq 0x28(%rax), %rsi
movq (%rsi), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq %rdx, 0x58(%rsp)
movq 0x90(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq %rsi, 0x98(%rsp)
movq (%rsi), %rax
movq %rax, 0x50(%rsp)
movq %rdx, 0xa0(%rsp)
movslq (%rdx), %rdi
movslq (%rcx), %rsi
callq 0x16190
movq %rax, 0x68(%rsp)
movq 0x58(%rsp), %rbx
movq 0x60(%rsp), %r12
movl (%r12), %esi
movq 0x48(%rsp), %rdi
callq 0x3c50
movq %rax, %r13
movl $0x0, 0x70(%rsp)
movq %rbx, 0x80(%rsp)
movl (%rbx), %ecx
cmpl 0x2c(%rsp), %ecx
jle 0xfcba
movl (%r12), %eax
movq $0x0, 0x40(%rsp)
testl %eax, %eax
jle 0xfc9b
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x50(%rsp), %rcx
movq 0x40(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rbp
xorl %ebx, %ebx
movq 0x10(%r12), %rax
movq (%rax,%rbx,8), %r14
movq (%r14), %rdi
movq (%rbp), %rsi
callq 0x1bb34
testl %eax, %eax
jne 0xfc81
movslq 0x28(%rbp), %rax
cmpq $-0x1, %rax
je 0xfc59
cmpl $0x0, 0x18(%rbp)
je 0xfc59
movq 0x38(%rsp), %rcx
movq 0x20(%rcx), %rcx
movq (%rcx,%rax,8), %rax
movq (%rax), %r15
testq %r15, %r15
je 0xfc81
movq 0x8(%r15), %rax
movq 0x10(%rax), %rax
movq (%rax), %r9
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %rbp, %r8
callq 0xf747
cmpl $0x0, 0x70(%rsp)
jne 0xfcba
movq 0x28(%r15), %r15
jmp 0xfc1d
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0xf747
cmpl $0x0, 0x70(%rsp)
jne 0xfcba
incq %rbx
movslq (%r12), %rax
cmpq %rax, %rbx
jl 0xfbe0
movq 0x80(%rsp), %rcx
movl (%rcx), %ecx
movq 0x40(%rsp), %rdi
incq %rdi
movl %ecx, %edx
subl 0x2c(%rsp), %edx
movslq %edx, %rdx
movq %rdi, 0x40(%rsp)
cmpq %rdx, %rdi
jl 0xfbb8
movq %r13, %rdi
callq 0x3d51
movq 0x38(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x70(%rsp), %rax
movq %rax, 0x20(%rsp)
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1cc1f
cmpl $0x0, 0x70(%rsp)
jne 0xfd31
movq 0x98(%rsp), %rsi
addq $0x8, %rsi
movq 0xa0(%rsp), %rdx
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
jne 0xfb21
cmpq $0x2, 0x88(%rsp)
jge 0xfac7
xorl %eax, %eax
jmp 0xfd33
movb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq