// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/lwm_initAndCollect.c
// Function: getFrequentVertices
int getFrequentVertices(struct Graph** db, int dbSize, struct Vertex* frequentVertices, struct GraphPool* gp) {
	int i = 0;
	struct compInfo* results = NULL;
	int resultSize = 0;

	/* iterate over all graphs in the database */
	for (i=0; i<dbSize; ++i) {
		struct Graph* g = db[i];

		int v;

		/* the vertices contained in g can be obtained from a single spanning tree, as all spanning trees contain
		the same vertex set. However, to omit multiplicity, we again resort to a temporary searchTree */
		struct Vertex* containedVertices = getVertex(gp->vertexPool);

		/* init temporary result storage if necessary */
		int neededResultSize = g->n;
		int resultPos = 0;
		if (neededResultSize > resultSize) {
			if (results) {
				free(results);
			}

			results = getResultVector(neededResultSize);
			resultSize = neededResultSize;
		}

		for (v=0; v<g->n; ++v) {
			/* See commented out how it would look if done by the book.
			However, this has to be fast and canonicalStringOfTree has
			too much overhead!
			    struct ShallowGraph* cString;
			    auxiliary->vertices[0]->label = patternGraph->vertices[v]->label;
			    cString = canonicalStringOfTree(auxiliary, sgp);
			    addToSearchTree(containedVertices, cString, gp, sgp); */
			struct VertexList* cString = getVertexList(gp->listPool);
			cString->label = g->vertices[v]->label;
			containedVertices->d += addStringToSearchTree(containedVertices, cString, gp);
			containedVertices->number += 1;
		}
		/* set multiplicity of patterns to 1 and add to global vertex pattern set, print to file */
		resetToUnique(containedVertices);
		mergeSearchTrees(frequentVertices, containedVertices, 1, results, &resultPos, frequentVertices, 0, gp);
		dumpSearchTree(gp, containedVertices);
	}
	if (results != NULL) {
		free(results);
	}
	return resultSize;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movl %esi, 0x6c(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movq $0x0, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
cmpl 0x6c(%rsp), %eax
jge 0x1a713
movq 0x70(%rsp), %rax
movslq 0x54(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1f6a0
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x44(%rsp), %eax
jle 0x1a631
cmpq $0x0, 0x48(%rsp)
je 0x1a61b
movq 0x48(%rsp), %rdi
callq 0x1030
movl 0x24(%rsp), %edi
callq 0x2c430
movq %rax, 0x48(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x1a6b3
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1f310
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x2bcf0
movsbl %al, %ecx
movq 0x28(%rsp), %rax
addl 0x28(%rax), %ecx
movl %ecx, 0x28(%rax)
movq 0x28(%rsp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1a639
movq 0x28(%rsp), %rdi
callq 0x2c920
movq 0x60(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x48(%rsp), %rcx
movq 0x60(%rsp), %r9
movq 0x58(%rsp), %rax
movl $0x1, %edx
leaq 0x20(%rsp), %r8
xorl %r10d, %r10d
movl $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2c650
movq 0x58(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x2d3c0
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x1a5b8
cmpq $0x0, 0x48(%rsp)
je 0x1a725
movq 0x48(%rsp), %rdi
callq 0x1030
movl 0x44(%rsp), %eax
addq $0x78, %rsp
retq
nop