// File: /workspace/github_c_makefile_star2_O3/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, 0x18(%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 0x161b3
movq (%rbx), %rsi
movq 0x8(%rbx), %rdi
callq 0xa223
movq %rbx, %rsi
movq %rax, %r15
movq 0x8(%rbx), %rax
cmpl $0x0, (%rax)
jle 0xa83c
xorl %edx, %edx
movq %rsi, 0x10(%rsp)
movq 0x10(%rax), %rax
movq (%rsi), %rcx
movq %rdx, 0x8(%rsp)
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %r12
movb $0x1, %bl
xorl %eax, %eax
movq 0x10(%rsi), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx,%rax,8), %r13
xorq $0x1, %rax
movq (%rcx,%rax,8), %rbp
movq %rsi, %r14
movq (%r12), %rdi
movq (%r13), %rsi
callq 0x1bb34
movq %r14, %rsi
testl %eax, %eax
je 0xa77f
movl $0x1, %eax
testb $0x1, %bl
movl $0x0, %ebx
jne 0xa740
jmp 0xa824
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x16234
movq %r14, %rsi
movq 0x8(%r12), %r14
testq %r14, %r14
je 0xa76b
movq %r13, 0x18(%rsp)
xorl %r13d, %r13d
movslq 0x18(%r12), %rax
movl (%r15,%rax,4), %eax
movq 0x18(%r14), %rcx
cmpl 0x18(%rcx), %eax
je 0xa7e7
movq (%r14), %rdi
movq 0x20(%rsp), %rsi
callq 0x1bb34
testl %eax, %eax
jne 0xa7e7
movq 0x18(%r14), %rax
movq (%rax), %rdi
movq (%rbp), %rsi
callq 0x1bb34
testl %eax, %eax
movzbl %r13b, %r13d
movl $0x1, %eax
cmovel %eax, %r13d
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0xa7a5
testb %r13b, %r13b
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
je 0xa76b
movq %rsi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
movq %r12, %rcx
callq 0x16234
movq %r14, %rsi
movl $0x1, 0x20(%r14)
jmp 0xa76b
movq 0x8(%rsp), %rdx
incq %rdx
movq 0x8(%rsi), %rax
movslq (%rax), %rcx
cmpq %rcx, %rdx
jl 0xa728
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