// File: /workspace/github_c_makefile_star2_O1/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 $0xb8, %rsp
movq %rdx, 0x48(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdi, 0x40(%rsp)
movslq 0x30(%rdi), %rcx
movq %rcx, 0x38(%rsp)
testq %rcx, %rcx
setg %al
jle 0xfdef
movb %al, 0x2b(%rsp)
movq 0x38(%rsp), %rax
movq %rax, %rdx
movl $0x0, 0x2c(%rsp)
decq %rax
movq %rax, 0x38(%rsp)
setne %al
movq 0x40(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq %rdx, 0x88(%rsp)
movq -0x8(%rcx,%rdx,8), %rdx
testq %rdx, %rdx
je 0xfdd7
movl 0x2c(%rsp), %ecx
movb %al, %cl
movl %ecx, 0x2c(%rsp)
movq 0x38(%rsp), %rax
leaq (,%rax,8), %rsi
movq 0x40(%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 0x162b8
movq %rax, 0x68(%rsp)
movq 0x58(%rsp), %rbx
movq 0x60(%rsp), %r12
movl (%r12), %esi
movq 0x48(%rsp), %rdi
callq 0x3c40
movq %rax, 0x30(%rsp)
movl $0x0, 0x70(%rsp)
movl 0x2c(%rsp), %eax
movq %rbx, 0x80(%rsp)
cmpl %eax, (%rbx)
jle 0xfd71
xorl %edx, %edx
movq %r12, 0xb0(%rsp)
cmpl $0x0, (%r12)
movq %rdx, 0xa8(%rsp)
jle 0xfd3a
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x50(%rsp), %rcx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rbx
xorl %r14d, %r14d
movq 0x10(%r12), %rax
movq (%rax,%r14,8), %r15
movq (%r15), %rdi
movq (%rbx), %rsi
callq 0x1bc18
movl $0x7, %ebp
testl %eax, %eax
jne 0xfd21
movslq 0x28(%rbx), %rax
cmpq $-0x1, %rax
je 0xfcc8
cmpl $0x0, 0x18(%rbx)
je 0xfcc8
movq 0x40(%rsp), %rcx
movq 0x20(%rcx), %rcx
movq (%rcx,%rax,8), %rax
movq (%rax), %r12
movl $0x8, %ebp
testq %r12, %r12
sete %r13b
je 0xfd12
movq 0x8(%r12), %rax
movq 0x10(%rax), %rax
movq (%rax), %r9
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
movq 0x30(%rsp), %rdx
movq %r15, %rcx
movq %rbx, %r8
callq 0xf794
cmpl $0x0, 0x70(%rsp)
jne 0xfd03
movq 0x28(%r12), %r12
jmp 0xfc80
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
movq 0x30(%rsp), %rdx
movq %r15, %rcx
movq %rbx, %r8
xorl %r9d, %r9d
callq 0xf794
cmpl $0x0, 0x70(%rsp)
je 0xfd1f
movq 0x30(%rsp), %rdi
callq 0x3d3f
movl $0x1, %ebp
jmp 0xfd21
movq 0x30(%rsp), %rdi
callq 0x3d3f
movl $0x1, %ebp
testb %r13b, %r13b
movq 0xb0(%rsp), %r12
je 0xfd21
xorl %ebp, %ebp
cmpl $0x7, %ebp
je 0xfd2a
testl %ebp, %ebp
jne 0xfd3f
incq %r14
movslq (%r12), %rax
cmpq %rax, %r14
jl 0xfc3a
movl $0x5, %ebp
cmpl $0x5, %ebp
je 0xfd48
testl %ebp, %ebp
jne 0xfd7b
movq 0xa8(%rsp), %rdx
incq %rdx
movq 0x80(%rsp), %rax
movslq (%rax), %rax
cmpq $0x1, 0x38(%rsp)
adcq $-0x1, %rax
cmpq %rax, %rdx
jl 0xfc0b
movq 0x30(%rsp), %rdi
callq 0x3d3f
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x38(%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 0x1cd7a
cmpl $0x0, 0x70(%rsp)
jne 0xfdeb
movq 0x98(%rsp), %rsi
addq $0x8, %rsi
movq 0xa0(%rsp), %rdx
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
jne 0xfb75
cmpq $0x2, 0x88(%rsp)
setge %al
jge 0xfb17
jmp 0xfdef
movb 0x2b(%rsp), %al
andb $0x1, %al
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq