// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/lwm_initAndCollect.c
// Function: edgeSearchTree2ShallowGraph
struct ShallowGraph* edgeSearchTree2ShallowGraph(struct Vertex* frequentEdges, struct Graph** newVertices, struct GraphPool* gp, struct ShallowGraphPool* sgp) {
	struct ShallowGraph* result = getShallowGraph(sgp);
	struct VertexList* e;
	struct Vertex* createdVertices = NULL;
	int nVertices = 0;
	int i;
	struct Vertex* tmp;

	for (e=frequentEdges->neighborhood; e!=NULL; e=e->next) {
		struct Vertex* v = getVertex(gp->vertexPool);
		struct VertexList* f;
		v->label = e->label;
		/* store newly created vertex in a list */
		v->next = createdVertices;
		createdVertices = v;
		++nVertices;

		for (f=e->endPoint->neighborhood->endPoint->neighborhood; f!=NULL; f=f->next) {
			struct VertexList* g;
			for (g=f->endPoint->neighborhood; g!=NULL; g=g->next) {
				struct VertexList* new = getVertexList(sgp->listPool);
				new->startPoint = v;
				new->label = f->label;
				new->endPoint = getVertex(gp->vertexPool);
				new->endPoint->label = g->label;
				pushEdge(result, new);
				/* if the edge has not identical vertex labels at both vertices,
				add the reverse edge to the output */
				if (strcmp(v->label, new->endPoint->label) != 0) {
					pushEdge(result, inverseEdge(new, sgp->listPool));
				}
				/* store newly created vertex in a list */
				new->endPoint->next = createdVertices;
				createdVertices = new->endPoint;
				++nVertices;
			}
		}
	}

	/* to avoid memory leaks, make hardcopies of the labels */
	for (e=result->edges; e!=NULL; e=e->next) {
		if (!e->isStringMaster) {
			e->isStringMaster = 1;
			e->label = copyString(e->label);
		}
		if (!e->startPoint->isStringMaster) {
			e->startPoint->isStringMaster = 1;
			e->startPoint->label = copyString(e->startPoint->label);
		}
		if (!e->endPoint->isStringMaster) {
			e->endPoint->isStringMaster = 1;
			e->endPoint->label = copyString(e->endPoint->label);
		}
	}

	/* to avoid memory leaks, make a graph containing all newly created vertices and return it*/
	*newVertices = getGraph(gp);
	setVertexNumber(*newVertices, nVertices);
	for (i=0, tmp=createdVertices; i<nVertices; ++i, tmp=tmp->next) {
		(*newVertices)->vertices[i] = tmp;
	}

	return result;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq 0x58(%rsp), %rdi
callq 0x1fe70
movq %rax, 0x50(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
movq 0x70(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x1a92a
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1f6a0
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x1a915
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x1a900
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1f310
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1f6a0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq 0x50(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xb610
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
je 0x1a8c2
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0xa370
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xb610
movq 0x40(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x40(%rsp)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x1a800
jmp 0x1a902
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x1a7e2
jmp 0x1a917
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0x1a776
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x1aa05
movq 0x48(%rsp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x1a972
movq 0x48(%rsp), %rax
movl $0x1, 0x28(%rax)
movq 0x48(%rsp), %rax
movq (%rax), %rdi
callq 0x20090
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, 0x24(%rax)
jne 0x1a9b1
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movl $0x1, 0x24(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
callq 0x20090
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
cmpl $0x0, 0x24(%rax)
jne 0x1a9f0
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movl $0x1, 0x24(%rax)
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
callq 0x20090
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
jmp 0x1a9f2
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
jmp 0x1a937
movq 0x60(%rsp), %rdi
callq 0x1fa40
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movl 0x3c(%rsp), %esi
callq 0xaa00
movl $0x0, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x38(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jge 0x1aa7c
movq 0x30(%rsp), %rdx
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x38(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x30(%rsp)
jmp 0x1aa3d
movq 0x50(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)