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

	copy->activity = g->activity;
	copy->m = g->m; // addEdgebetweenVertices adds plus 1 itself
	copy->n = g->n + 1;
	copy->number = g->number;

	copy->vertices = malloc(copy->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 new vertex and edge */
	copy->vertices[copy->n - 1] = shallowCopyVertex(newEdge->endPoint, gp->vertexPool);
	copy->vertices[copy->n - 1]->number = copy->n - 1;
	addEdgeBetweenVertices(v, copy->n - 1, newEdge->label, copy, gp);

	/* 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 $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x1fa40
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rax
movl 0xc(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x40(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x40(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x40(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x20(%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 0x40(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x30ae2
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x30ad3
movq 0x40(%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 0x30ad5
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x30a7c
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0xa3f0
movq %rax, %rdx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
movl (%rax), %ecx
subl $0x1, %ecx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rdx
movl (%rdx), %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x18(%rax)
movl 0x3c(%rsp), %edi
movq 0x20(%rsp), %rax
movl (%rax), %esi
subl $0x1, %esi
movq 0x30(%rsp), %rax
movq (%rax), %rdx
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
callq 0xb670
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x30c95
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x30c83
movq 0x40(%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 0x30c81
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 0x30baf
jmp 0x30c83
jmp 0x30c85
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x30b6a
movq 0x20(%rsp), %rax
addq $0x48, %rsp
retq
nop