// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %rsi, 0x70(%rsp)
xorl %esi, %esi
movl $0x28, %edx
callq 0x10b0
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rdi
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rdi)
movq (%rax), %rax
movq %rax, (%rdi)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rdi)
movq 0x70(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, 0x68(%rsp)
callq 0x22f40
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rax), %rsi
callq 0xecd0
movq %rax, 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
movq 0x20(%rsp), %rcx
movl 0x5c(%rsp), %eax
movq 0x8(%rcx), %rcx
cmpl (%rcx), %eax
jge 0xf610
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rax), %rax
movq (%rcx), %rcx
movslq 0x5c(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x50(%rsp)
movl $0x0, 0x4c(%rsp)
cmpl $0x2, 0x4c(%rsp)
jge 0xf5fe
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x10(%rcx), %rcx
movslq 0x4c(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, 0x40(%rsp)
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movq 0x8(%rsp), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
callq 0x2dcf0
cmpl $0x0, %eax
jne 0xf5ec
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x50(%rsp), %rcx
callq 0x23040
movb $0x0, 0x37(%rsp)
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0xf5be
movq 0x60(%rsp), %rax
movq 0x50(%rsp), %rcx
movslq 0x18(%rcx), %rcx
movl (%rax,%rcx,4), %eax
movq 0x28(%rsp), %rcx
movq 0x18(%rcx), %rcx
cmpl 0x18(%rcx), %eax
je 0xf5ac
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq 0x68(%rsp), %rsi
callq 0x2dcf0
cmpl $0x0, %eax
jne 0xf5aa
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rsi
callq 0x2dcf0
cmpl $0x0, %eax
jne 0xf5a8
movb $0x1, 0x37(%rsp)
jmp 0xf5aa
jmp 0xf5ac
jmp 0xf5ae
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0xf547
cmpb $0x0, 0x37(%rsp)
je 0xf5ea
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x50(%rsp), %rcx
callq 0x23040
movq 0x20(%rsp), %rax
movl $0x1, 0x20(%rax)
jmp 0xf5ec
jmp 0xf5ee
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0xf4aa
jmp 0xf600
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0xf46b
movq 0x60(%rsp), %rdi
callq 0x1030
movq 0x10(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)