// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x1fa40
movq %rax, 0x20(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0xb24a
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movl $0x0, 0x20(%rax)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movl $0x0, 0x20(%rax)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0xb212
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0xb2c5
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x20(%rax)
jne 0xb289
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %ecx
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movl %ecx, 0x20(%rax)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
cmpl $0x0, 0x20(%rax)
jne 0xb2b3
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %ecx
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movl %ecx, 0x20(%rax)
jmp 0xb2b5
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0xb257
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0xaa00
movq 0x30(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x4(%rax)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0xb33e
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1f6a0
movq %rax, %rdx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x10(%rsp), %ecx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x10(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x18(%rax)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xb2eb
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0xb478
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1f310
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %rcx
movl 0x20(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x18(%rcx), %rcx
movl 0x20(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %rcx
movl 0x20(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
movq 0x8(%rsp), %rsi
callq 0xa660
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rcx
movq 0x18(%rcx), %rcx
movl 0x20(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0xa370
movq (%rsp), %rdi
movq %rax, %rsi
callq 0xa660
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0xb34b
movq 0x20(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)