// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/graph.c
// Function: cloneInducedGraph
struct Graph* cloneInducedGraph(struct Graph* g, struct GraphPool* gp) {
	struct Graph* copy = getGraph(gp);
	struct Vertex** tmp;
	int i, j;
	int actualVertices = 0;

	copy->activity = g->activity;
	copy->m = g->m;
	copy->number = g->number;

	setVertexNumber(copy, g->n);

	/* copy vertices */
	for (i=0; i<g->n; ++i) {
		if (g->vertices[i]) {
			copy->vertices[i] = shallowCopyVertex(g->vertices[i], gp->vertexPool);
			++actualVertices;
		}
	}

	/* copy edges */
	for (i=0; i<g->n; ++i) {
		if (g->vertices[i]) {
			for (struct VertexList* e=g->vertices[i]->neighborhood; e; e=e->next) {
				struct VertexList* f = getVertexList(gp->listPool);
				f->endPoint = copy->vertices[e->endPoint->number];
				f->startPoint = copy->vertices[e->startPoint->number];
				f->label = e->label;

				/* add the shallow copy to the new graph */
				f->next = copy->vertices[e->startPoint->number]->neighborhood;
				copy->vertices[e->startPoint->number]->neighborhood = f;
			}
		}
	}

	/* up to this point, there may be elements of copy->vertices, that are NULL */
	tmp = copy->vertices;

	/* set the number of vertices correctly */
	setVertexNumber(copy, actualVertices);

	/* shift the vertices that are there into the new array and
	 * assign new numbers */
	j = 0;
	for (i=0; i<g->n; ++i) {
		if (tmp[i]) {
			copy->vertices[j] = tmp[i];
			copy->vertices[j]->lowPoint = copy->vertices[j]->number;
			copy->vertices[j]->number = j;
			++j;
		}
	}

	free(tmp);

	return copy;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x147d7
movq %rax, %rbx
movl 0xc(%r14), %eax
movl %eax, 0xc(%rbx)
movq 0x4(%r14), %rax
movq %rax, 0x4(%rbx)
movl (%r14), %esi
movq %rbx, %rdi
callq 0x7e30
cmpl $0x0, (%r14)
jle 0x80fb
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %r13
testq %r13, %r13
je 0x80ee
movq 0x10(%r15), %rdi
callq 0x145b2
movl 0x18(%r13), %ecx
movl %ecx, 0x18(%rax)
movq (%r13), %rcx
movq %rcx, (%rax)
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incl %ebp
incq %r12
movslq (%r14), %rax
cmpq %rax, %r12
jl 0x80c0
jmp 0x80fd
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jle 0x817d
xorl %r12d, %r12d
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %rax
testq %rax, %rax
je 0x8172
movq 0x8(%rax), %r13
testq %r13, %r13
je 0x8172
movq 0x18(%r15), %rdi
callq 0x1432b
movq 0x10(%rbx), %rcx
movq 0x18(%r13), %rdx
movslq 0x18(%rdx), %rdx
movq (%rcx,%rdx,8), %rdx
movq %rdx, 0x18(%rax)
movq 0x10(%r13), %rdx
movslq 0x18(%rdx), %rdx
movq (%rcx,%rdx,8), %rdx
movq %rdx, 0x10(%rax)
movq (%r13), %rdx
movq %rdx, (%rax)
movq 0x10(%r13), %rdx
movslq 0x18(%rdx), %rdx
movq (%rcx,%rdx,8), %rsi
movq 0x8(%rsi), %rsi
movq %rsi, 0x8(%rax)
movq (%rcx,%rdx,8), %rcx
movq %rax, 0x8(%rcx)
movq 0x8(%r13), %r13
jmp 0x8117
incq %r12
movslq (%r14), %rax
cmpq %rax, %r12
jl 0x8106
movq 0x10(%rbx), %r15
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7e30
movslq (%r14), %rax
testq %rax, %rax
jle 0x81c6
xorl %ecx, %ecx
xorl %edx, %edx
movq (%r15,%rcx,8), %rsi
testq %rsi, %rsi
je 0x81be
movq 0x10(%rbx), %rdi
movslq %edx, %rdx
movq %rsi, (%rdi,%rdx,8)
movq 0x10(%rbx), %rsi
movq (%rsi,%rdx,8), %rsi
movl 0x18(%rsi), %edi
movl %edi, 0x20(%rsi)
movl %edx, 0x18(%rsi)
incl %edx
incq %rcx
cmpq %rcx, %rax
jne 0x8197
movq %r15, %rdi
callq 0x1030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq