// File: /workspace/github_c_makefile_star2_O2/pwelke[P]GraphMiningTools/graph.c
// Function: shallowGraphToGraph
struct Graph* shallowGraphToGraph(struct ShallowGraph* edgeList, struct GraphPool* gp) {
	struct Graph* g = getGraph(gp);
	struct VertexList* e;
	int n = 0;
	int i;

	/* clear all ->lowPoint s */
	for (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 (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*/
	setVertexNumber(g, n);
	g->m = edgeList->m;

	for (i=0; i<n; ++i) {
		g->vertices[i] = getVertex(gp->vertexPool);
		g->vertices[i]->number = i;
	}

	/* add copies of edges and labels of vertices */
	for (e=edgeList->edges; e; e=e->next) {
		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));
	}

	return g;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x11619
movq %rax, %r15
movq %r14, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x6023
movq 0x10(%rax), %rcx
andl $0x0, 0x20(%rcx)
movq 0x18(%rax), %rcx
andl $0x0, 0x20(%rcx)
addq $0x8, %rax
jmp 0x6005
xorl %r12d, %r12d
movq %r14, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x6059
movq 0x10(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0x6042
incl %r12d
movl %r12d, 0x20(%rcx)
movq 0x18(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0x6053
incl %r12d
movl %r12d, 0x20(%rcx)
addq $0x8, %rax
jmp 0x6029
movq %r15, %rdi
movl %r12d, %esi
callq 0x5c80
movl 0x10(%r14), %eax
movl %eax, 0x4(%r15)
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
cmpq %r13, %r12
je 0x6126
movq 0x10(%rbx), %rdi
callq 0x114a5
movq 0x10(%r15), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x10(%r15), %rax
movq (%rax,%r13,8), %rax
movl %r13d, 0x18(%rax)
incq %r13
jmp 0x6076
movq 0x18(%rbx), %rdi
callq 0x11307
movq 0x10(%r15), %rcx
movq 0x10(%r14), %rdx
movslq 0x20(%rdx), %rdx
movq -0x8(%rcx,%rdx,8), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%r14), %rsi
movslq 0x20(%rsi), %rsi
movq -0x8(%rcx,%rsi,8), %rsi
movq %rsi, 0x18(%rax)
movq (%r14), %rdi
movq %rdi, (%rax)
movq 0x10(%r14), %rdi
movq (%rdi), %r8
movq %r8, (%rdx)
movq 0x18(%r14), %rdx
movq (%rdx), %r8
movq %r8, (%rsi)
movslq 0x20(%rdi), %rsi
movq -0x8(%rcx,%rsi,8), %rsi
movq 0x8(%rsi), %rdi
movq %rdi, 0x8(%rax)
movq %rax, 0x8(%rsi)
movslq 0x20(%rdx), %rdx
movq -0x8(%rcx,%rdx,8), %r12
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x5a44
movq 0x8(%r12), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x8(%r12)
addq $0x8, %r14
movq (%r14), %r14
testq %r14, %r14
jne 0x60a1
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq