// File: /workspace/github_c_makefile_star2_O2/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 0x11619
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 0x5c80
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq (%r14), %rax
cmpq %rax, %r12
jge 0x5f08
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %rdi
testq %rdi, %rdi
je 0x5f03
movq 0x10(%r15), %rsi
callq 0x5a70
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incl %ebp
incq %r12
jmp 0x5edb
xorl %r12d, %r12d
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0x5f83
movq 0x10(%r14), %rcx
movq (%rcx,%r12,8), %r13
testq %r13, %r13
jne 0x5f72
jmp 0x5f7e
movq 0x18(%r15), %rdi
callq 0x11307
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
testq %r13, %r13
jne 0x5f22
movl (%r14), %eax
incq %r12
jmp 0x5f0b
movq 0x10(%rbx), %r15
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5c80
movl (%r14), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
xorl %edx, %edx
cmpq %rcx, %rax
je 0x5fce
movq (%r15,%rcx,8), %rsi
testq %rsi, %rsi
je 0x5fc9
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
jmp 0x5f9d
movq %r15, %rdi
callq 0x1030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq