// File: /workspace/github_c_makefile_star2_O3/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 0x146a9
movq %rax, %r14
movq (%r15), %rax
testq %rax, %rax
je 0x82c0
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 0x8279
testq %rax, %rax
je 0x82c0
xorl %ebp, %ebp
movq 0x10(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0x82a6
incl %ebp
movl %ebp, 0x20(%rcx)
movq 0x18(%rax), %rcx
cmpl $0x0, 0x20(%rcx)
jne 0x82b5
incl %ebp
movl %ebp, 0x20(%rcx)
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x8297
jmp 0x82c2
xorl %ebp, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x7e6c
movl 0x10(%r15), %eax
movl %eax, 0x4(%r14)
testl %ebp, %ebp
jle 0x8303
movl %ebp, %r12d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdi
callq 0x1447e
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 0x82de
movq (%r15), %r12
testq %r12, %r12
je 0x83b3
movq 0x18(%rbx), %rdi
callq 0x141f1
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 0x141f1
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 0x8306
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq