// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/lwm_initAndCollect.c
// Function: initExactLocalEasyForGraphDB
size_t initExactLocalEasyForGraphDB(// input
		size_t threshold,
		double importance,
		// output
		struct Vertex** initialFrequentPatterns,
		struct SupportSet** supportSets,
		struct ShallowGraph** extensionEdgeList,
		void** dataStructures,
		// printing
		FILE* featureStream,
		FILE* patternStream,
		FILE* logStream,
		// pools
		struct GraphPool* gp,
		struct ShallowGraphPool* sgp) {

	(void)importance; // unused

	struct Graph** db = NULL;
	size_t nGraphs = getDB(&db);
	struct SpanningtreeTree* sptTrees = malloc(nGraphs * sizeof(struct SpanningtreeTree));
	for (size_t i=0; i<nGraphs; ++i) {
		struct BlockTree blockTree = getBlockTreeT(db[i], sgp);
		sptTrees[i] = getFullSpanningtreeTree(blockTree, gp, sgp);
	}

	struct Vertex* frequentVertices;
	struct Vertex* frequentEdges;
	getFrequentVerticesAndEdges(db, nGraphs, threshold, &frequentVertices, &frequentEdges, logStream, gp);

	/* convert frequentEdges to ShallowGraph of extension edges */
	struct Graph* extensionEdgesVertexStore = NULL;
	struct ShallowGraph* extensionEdges = edgeSearchTree2ShallowGraph(frequentEdges, &extensionEdgesVertexStore, gp, sgp);
	dumpSearchTree(gp, frequentEdges);
	free(db);

	// levelwise search for patterns with one vertex:
	struct SupportSet* frequentVerticesSupportSets = createSingletonPatternSupportSetsForLocalEasyDB(sptTrees, nGraphs, frequentVertices, gp, sgp);
	printStringsInSearchTree(frequentVertices, patternStream, sgp);
	printSupportSetsSparse(frequentVerticesSupportSets, featureStream);

	// store pointers for final garbage collection
	struct IterativeBfsForLocalEasyDataStructures* x = malloc(sizeof(struct IterativeBfsForLocalEasyDataStructures));
	x->nGraphs = nGraphs;
	x->extensionEdges = extensionEdges;
	x->extensionEdgesVertexStore = extensionEdgesVertexStore;
	x->initialFrequentPatterns = frequentVertices;
	x->sptTrees = sptTrees;

	// 'return'
	*initialFrequentPatterns = frequentVertices;
	*supportSets = frequentVerticesSupportSets;
	*extensionEdgeList = extensionEdges;
	*dataStructures = x;
	return 1; // returned patterns have 1 vertex
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq 0x138(%rsp), %rax
movq 0x130(%rsp), %rax
movq 0x128(%rsp), %rax
movq 0x120(%rsp), %rax
movq %rdi, 0x110(%rsp)
movsd %xmm0, 0x108(%rsp)
movq %rsi, 0x100(%rsp)
movq %rdx, 0xf8(%rsp)
movq %rcx, 0xf0(%rsp)
movq %r8, 0xe8(%rsp)
movq %r9, 0xe0(%rsp)
movq $0x0, 0xd8(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x1a080
cltq
movq %rax, 0xd0(%rsp)
imulq $0x38, 0xd0(%rsp), %rdi
callq 0x1170
movq %rax, 0xc8(%rsp)
movq $0x0, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
cmpq 0xd0(%rsp), %rax
jae 0x1b9aa
movq 0xd8(%rsp), %rax
movq 0xc0(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x138(%rsp), %rdx
leaq 0x98(%rsp), %rdi
callq 0x15fb0
movq 0xc8(%rsp), %rax
imulq $0x38, 0xc0(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
movq 0xb8(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0x60(%rsp), %rdi
callq 0x172c0
movq 0x28(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x38, %edx
callq 0x1150
movq 0xc0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xc0(%rsp)
jmp 0x1b8e5
movq 0xd8(%rsp), %rdi
movq 0xd0(%rsp), %rax
movl %eax, %esi
movq 0x110(%rsp), %rdx
movq 0x128(%rsp), %r9
movq 0x130(%rsp), %rax
leaq 0x58(%rsp), %rcx
leaq 0x50(%rsp), %r8
movq %rax, (%rsp)
callq 0x1acf0
movq $0x0, 0x48(%rsp)
movq 0x50(%rsp), %rdi
movq 0x130(%rsp), %rdx
movq 0x138(%rsp), %rcx
leaq 0x48(%rsp), %rsi
callq 0x1a730
movq %rax, 0x40(%rsp)
movq 0x130(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x2d3c0
movq 0xd8(%rsp), %rdi
callq 0x1030
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rax
movl %eax, %esi
movq 0x58(%rsp), %rdx
movq 0x130(%rsp), %rcx
movq 0x138(%rsp), %r8
callq 0x1bb40
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rdi
movq 0x120(%rsp), %rsi
movq 0x138(%rsp), %rdx
callq 0x2d770
movq 0x38(%rsp), %rdi
movq 0xe0(%rsp), %rsi
callq 0x2fce0
movl $0x28, %edi
callq 0x1170
movq %rax, 0x30(%rsp)
movq 0xd0(%rsp), %rax
movl %eax, %ecx
movq 0x30(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x40(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x48(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x58(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0xc8(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movq 0x58(%rsp), %rcx
movq 0x100(%rsp), %rax
movq %rcx, (%rax)
movq 0x38(%rsp), %rcx
movq 0xf8(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rcx
movq 0xf0(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rcx
movq 0xe8(%rsp), %rax
movq %rcx, (%rax)
movl $0x1, %eax
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax,%rax)