// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x147d7
movq %rax, %r14
movq (%r15), %rax
testq %rax, %rax
je 0x821d
xorl %ecx, %ecx
movq 0x10(%rax), %rdx
movl %ecx, 0x20(%rdx)
movq 0x18(%rax), %rdx
movl %ecx, 0x20(%rdx)
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x8206
movq (%r15), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0x824b
movq 0x10(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0x8236
incl %ebp
movl %ebp, 0x20(%rcx)
movq 0x18(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0x8245
incl %ebp
movl %ebp, 0x20(%rcx)
movq 0x8(%rax), %rax
jmp 0x8222
movq %r14, %rdi
movl %ebp, %esi
callq 0x7e30
movl 0x10(%r15), %eax
movl %eax, 0x4(%r14)
testl %ebp, %ebp
jle 0x828c
movl %ebp, %r12d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdi
callq 0x145b2
movq 0x10(%r14), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x10(%r14), %rax
movq (%rax,%r13,8), %rax
movl %r13d, 0x18(%rax)
incq %r13
cmpq %r13, %r12
jne 0x8267
movq (%r15), %r12
testq %r12, %r12
je 0x833c
movq 0x18(%rbx), %rdi
callq 0x1432b
movq %rax, %r15
movq 0x10(%r14), %rax
movq 0x10(%r12), %rcx
movslq 0x20(%rcx), %rcx
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, 0x10(%r15)
movq 0x18(%r12), %rdx
movslq 0x20(%rdx), %rdx
movq -0x8(%rax,%rdx,8), %rdx
movq %rdx, 0x18(%r15)
movq (%r12), %rsi
movq %rsi, (%r15)
movq 0x10(%r12), %rsi
movq (%rsi), %rdi
movq %rdi, (%rcx)
movq 0x18(%r12), %rcx
movq (%rcx), %rdi
movq %rdi, (%rdx)
movslq 0x20(%rsi), %rdx
movq -0x8(%rax,%rdx,8), %rdx
movq 0x8(%rdx), %rsi
movq %rsi, 0x8(%r15)
movq %r15, 0x8(%rdx)
movslq 0x20(%rcx), %rcx
movq -0x8(%rax,%rcx,8), %r13
movq 0x18(%rbx), %rdi
callq 0x1432b
movq 0x18(%r15), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%r15), %rcx
movq %rcx, 0x18(%rax)
movq (%r15), %rcx
movq %rcx, (%rax)
movq 0x8(%r13), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x8(%r13)
movq 0x8(%r12), %r12
jmp 0x828f
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq