// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/iterativeSubtreeIsomorphism.c
// Function: initIterativeSubtreeCheckForEdge
struct SubtreeIsoDataStore initIterativeSubtreeCheckForEdge(struct SubtreeIsoDataStore base, struct Graph* h) {
	struct SubtreeIsoDataStore info = {0};
	// copy stuff from below
	info.g = base.g;
	info.postorder = base.postorder;

	// create graph from edge
	info.h = h;
	char* edgeLabel = h->vertices[0]->neighborhood->label;

	// create cube
	createNewCubeForEdgePattern(&info);

	int* parents = getParentsFromPostorder(info.g, info.postorder);

	for (int vi=0; vi<(info.g)->n; ++vi) {
		struct Vertex* v = (info.g)->vertices[info.postorder[vi]];
		for (int ui=0; ui<2; ++ui) {
			struct Vertex* u = (info.h)->vertices[ui];
			struct Vertex* y = (info.h)->vertices[(ui + 1) % 2];
			if (labelCmp(v->label, u->label) == 0) {
				// if vertex labels match, there is a characteristic (H^y_u, v)
				addCharacteristic(&info, y, u, v);
				char foundIso = 0;
				// if there is at least one edge that matches and does not lead to the parent, then there is a characteristic (H^u_u, v)
				// we add this characteristic only once below
				for (struct VertexList* e=v->neighborhood; e!=NULL; e=e->next) {
					if (parents[v->number] != e->endPoint->number) {
						// check if edge labels match
						if (labelCmp(e->label, edgeLabel) == 0) {
							// if edge does not lead to parent, there is a characteristic (H^u_u, v) if vertex labels of endpoint match
							if (labelCmp(e->endPoint->label, y->label) == 0) {
								foundIso = 1;
							}
						}
					}
				}
				if (foundIso) {
					addCharacteristic(&info, u, u, v);
					info.foundIso = 1;
				}
			}
		}
	}
	free(parents);
	return info;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x20(%rdi)
movaps 0x60(%rsp), %xmm0
movups %xmm0, (%rdi)
movq %rsi, 0x10(%rdi)
movq 0x10(%rsi), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
callq 0x162db
movq (%rbx), %rsi
movq 0x8(%rbx), %rdi
callq 0xa1cb
movq %rbx, %rsi
movq %rax, %r15
movq 0x8(%rbx), %rax
cmpl $0x0, (%rax)
jle 0xa7fc
xorl %edx, %edx
movq %rsi, 0x8(%rsp)
movq 0x10(%rax), %rax
movq (%rsi), %rcx
movq %rdx, (%rsp)
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %r12
xorl %ebx, %ebx
movq 0x10(%rsi), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %r14
leaq 0x1(%rbx), %rcx
movq %rcx, 0x18(%rsp)
andl $0x1, %ecx
movq (%rax,%rcx,8), %rbp
movq %rsi, %r13
movq (%r12), %rdi
movq (%r14), %rsi
callq 0x1bc18
movq %r13, %rsi
testl %eax, %eax
je 0xa73f
testq %rbx, %rbx
movq 0x18(%rsp), %rbx
je 0xa6fe
jmp 0xa7e5
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x1635c
movq %r13, %rsi
movq 0x8(%r12), %r13
testq %r13, %r13
je 0xa730
movq %r14, 0x10(%rsp)
xorl %r14d, %r14d
movslq 0x18(%r12), %rax
movl (%r15,%rax,4), %eax
movq 0x18(%r13), %rcx
cmpl 0x18(%rcx), %eax
je 0xa7a8
movq (%r13), %rdi
movq 0x20(%rsp), %rsi
callq 0x1bc18
testl %eax, %eax
jne 0xa7a8
movq 0x18(%r13), %rax
movq (%rax), %rdi
movq (%rbp), %rsi
callq 0x1bc18
testl %eax, %eax
movzbl %r14b, %r14d
movl $0x1, %eax
cmovel %eax, %r14d
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0xa765
testb %r14b, %r14b
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
je 0xa730
movq %rsi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
movq %r12, %rcx
callq 0x1635c
movq %r14, %rsi
movl $0x1, 0x20(%r14)
jmp 0xa730
movq (%rsp), %rdx
incq %rdx
movq 0x8(%rsi), %rax
movslq (%rax), %rcx
cmpq %rcx, %rdx
jl 0xa6e9
movq %rsi, %rbx
movq %r15, %rdi
callq 0x1030
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq