// File: /workspace/github_c_makefile_star2_O2/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
movq (%rax), %rax
testq %rax, %rax
je 0xc0c3
movq 0x10(%rax), %rcx
andl $0x0, 0x20(%rcx)
movq 0x18(%rax), %rcx
andl $0x0, 0x20(%rcx)
addq $0x8, %rax
jmp 0xc0a5
xorl %edi, %edi
movq %r14, %rax
movq (%rax), %rax
testq %rax, %rax
je 0xc0f4
movq 0x10(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0xc0df
incl %edi
movl %edi, 0x20(%rcx)
movq 0x18(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0xc0ee
incl %edi
movl %edi, 0x20(%rcx)
addq $0x8, %rax
jmp 0xc0c8
movq %rbx, %rsi
callq 0x630e
movq %rax, %r15
movl 0x10(%r14), %eax
movl %eax, 0x4(%r15)
movq (%r14), %r14
testq %r14, %r14
je 0xc1c2
movq 0x18(%rbx), %rdi
callq 0x11307
movq %rax, %r12
movq 0x10(%r15), %rax
movq 0x10(%r14), %rcx
movslq 0x20(%rcx), %rcx
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, 0x10(%r12)
movq 0x18(%r14), %rdx
movslq 0x20(%rdx), %rdx
movq -0x8(%rax,%rdx,8), %rdx
movq %rdx, 0x18(%r12)
movq (%r14), %rsi
movq %rsi, (%r12)
movq 0x10(%r14), %rsi
movq (%rsi), %rdi
movq %rdi, (%rcx)
movq 0x18(%r14), %rcx
movq (%rcx), %rcx
movq %rcx, (%rdx)
movslq 0x20(%rsi), %rcx
movq -0x8(%rax,%rcx,8), %rdi
movq %r12, %rsi
callq 0x5b2c
movq 0x10(%r15), %rax
movq 0x18(%r14), %rcx
movslq 0x20(%rcx), %rcx
movq -0x8(%rax,%rcx,8), %r13
movq 0x18(%rbx), %rsi
movq %r12, %rdi
callq 0x5a44
movq %r13, %rdi
movq %rax, %rsi
callq 0x5b2c
movq 0x10(%r14), %rax
movl 0x1c(%rax), %eax
movq 0x10(%r12), %rcx
movl %eax, 0x28(%rcx)
movq 0x18(%r14), %rax
movl 0x1c(%rax), %eax
movq 0x18(%r12), %rcx
movl %eax, 0x28(%rcx)
addq $0x8, %r14
jmp 0xc107
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq