// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/graph.c
// Function: cloneGraph
struct Graph* cloneGraph(struct Graph* g, struct GraphPool* gp) {
	struct Graph* copy = getGraph(gp);
	int i;

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

	copy->vertices = malloc(g->n * sizeof(struct Vertex*));

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

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

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

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x1fa40
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movl 0xc(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x30(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x30(%rsp), %rax
movl (%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x30(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x30(%rsp), %rax
movslq (%rax), %rdi
shlq $0x3, %rdi
callq 0x1170
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x30(%rsp), %rcx
cmpl (%rcx), %eax
jge 0xad96
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0xad87
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0xa3f0
movq %rax, %rdx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xad89
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xad30
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x30(%rsp), %rcx
cmpl (%rcx), %eax
jge 0xaec9
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0xaeb7
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0xaeb5
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1f310
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rcx
movslq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
movslq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
movslq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rdx
movq 0x10(%rdx), %rdx
movslq 0x18(%rdx), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xade3
jmp 0xaeb7
jmp 0xaeb9
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xad9e
movq 0x20(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)