// File: /workspace/github_c_makefile_star2_O3/pwelke[P]GraphMiningTools/localEasySubtreeIsomorphism.c
// Function: blockConverter
struct Graph* blockConverter(struct ShallowGraph* edgeList, struct GraphPool* gp) {

	int n = 0;

	/* clear all ->lowPoint s */
	for (struct VertexList* e=edgeList->edges; e; e=e->next) {
		e->startPoint->lowPoint = 0;
		e->endPoint->lowPoint = 0;
	}

	/* count number of distinct vertices and number vertices accordingly. */
	for (struct VertexList* e=edgeList->edges; e; e=e->next) {
		if (e->startPoint->lowPoint == 0) {
			++n;
			e->startPoint->lowPoint = n;
		}
		if (e->endPoint->lowPoint == 0) {
			++n;
			e->endPoint->lowPoint = n;
		}
	}

	/* set vertex number of new Graph to n, initialize stuff*/
	struct Graph* g = createGraph(n, gp);
	g->m = edgeList->m;


	for (struct VertexList* e=edgeList->edges; e; e=e->next) {
		/* add copies of edges and labels of vertices */
		struct VertexList* f = getVertexList(gp->listPool);
		f->startPoint = g->vertices[e->startPoint->lowPoint - 1];
		f->endPoint = g->vertices[e->endPoint->lowPoint - 1];
		f->label = e->label;
		f->startPoint->label = e->startPoint->label;
		f->endPoint->label = e->endPoint->label;

		addEdge(g->vertices[e->startPoint->lowPoint - 1], f);
		addEdge(g->vertices[e->endPoint->lowPoint - 1], inverseEdge(f, gp->listPool));

		/* the vertices in the original graph (on which edgeList is based upon) have their ->visited values
		 * set to -1 if they are not roots and to the index of the root in sptTree->root, if they are a root.
		 * Transfer this information to the resulting graph. */
		f->startPoint->d = e->startPoint->visited;
		f->endPoint->d = e->endPoint->visited;
	}

	return g;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
testq %rax, %rax
je 0xea34
xorl %ecx, %ecx
movq %rax, %rdx
movq 0x10(%rdx), %rsi
movl %ecx, 0x20(%rsi)
movq 0x18(%rdx), %rsi
movl %ecx, 0x20(%rsi)
movq 0x8(%rdx), %rdx
testq %rdx, %rdx
jne 0xe9ed
testq %rax, %rax
je 0xea34
xorl %edi, %edi
movq 0x10(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0xea1a
incl %edi
movl %edi, 0x20(%rcx)
movq 0x18(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0xea29
incl %edi
movl %edi, 0x20(%rcx)
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xea0b
jmp 0xea36
xorl %edi, %edi
movq %rbx, %rsi
callq 0x85e3
movq %rax, %r15
movl 0x10(%r14), %eax
movl %eax, 0x4(%r15)
movq (%r14), %r13
testq %r13, %r13
je 0xeb00
movq 0x18(%rbx), %rdi
callq 0x141f1
movq %rax, %r14
movq 0x10(%r15), %rax
movq 0x10(%r13), %rcx
movslq 0x20(%rcx), %rcx
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, 0x10(%r14)
movq 0x18(%r13), %rdx
movslq 0x20(%rdx), %rdx
movq -0x8(%rax,%rdx,8), %rdx
movq %rdx, 0x18(%r14)
movq (%r13), %rsi
movq %rsi, (%r14)
movq 0x10(%r13), %rsi
movq (%rsi), %rdi
movq %rdi, (%rcx)
movq 0x18(%r13), %rcx
movq (%rcx), %rcx
movq %rcx, (%rdx)
movslq 0x20(%rsi), %rcx
movq -0x8(%rax,%rcx,8), %rdi
movq %r14, %rsi
callq 0x7cfe
movq 0x10(%r15), %rax
movq 0x18(%r13), %rcx
movslq 0x20(%rcx), %rcx
movq -0x8(%rax,%rcx,8), %r12
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x7c08
movq %r12, %rdi
movq %rax, %rsi
callq 0x7cfe
movq 0x10(%r13), %rax
movl 0x1c(%rax), %eax
movq 0x10(%r14), %rcx
movl %eax, 0x28(%rcx)
movq 0x18(%r13), %rax
movl 0x1c(%rax), %eax
movq 0x18(%r14), %rcx
movl %eax, 0x28(%rcx)
movq 0x8(%r13), %r13
jmp 0xea4c
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq