// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/minhashing.c
// Function: randomProjectionEmbeddingLocalEasy
int* randomProjectionEmbeddingLocalEasy(struct Graph* g, struct EvaluationPlan p, int* projection, int projectionSize, int nLocalTrees, struct GraphPool* gp, struct ShallowGraphPool* sgp) {

	int nEvaluations = 0;
	cleanEvaluationPlan(p);

	struct BlockTree blockTree = getBlockTreeT(g, sgp);
	struct SpanningtreeTree sptTree = getSampledSpanningtreeTree(blockTree, nLocalTrees, 1, gp, sgp);

	// alloc output array
	int* approximateEmbedding = malloc((p.poset->n - 1) * sizeof(int));
	if (!approximateEmbedding) {
		fprintf(stderr, "Could not allocate memory for sketch. This is a bad thing.\n");
		return NULL;
	}

	for (int i=0; i<projectionSize; ++i) {

		// if we don't know the value we need to compute it.
		int currentGraphNumber = projection[i];
		if (!embeddingValueKnown(p.poset->vertices[currentGraphNumber])) {

			// evaluate the embedding operator
			struct Graph* pattern = (struct Graph*)(p.poset->vertices[currentGraphNumber]->label);
			char match = subtreeCheckForSpanningtreeTree(&sptTree, pattern, gp);
			wipeCharacteristicsForLocalEasy(sptTree);

			// update output
			approximateEmbedding[i] = match;

			// update evaluation plan
			++nEvaluations;
			updateEvaluationPlan(p, currentGraphNumber, match);
		}
	}

	dumpSpanningtreeTree(sptTree, gp);

	fprintf(stderr, "%i\n", nEvaluations);
	return approximateEmbedding;

}

// Assembly:
subq $0xf8, %rsp
leaq 0x100(%rsp), %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0xe8(%rsp)
movq %rsi, 0xe0(%rsp)
movl %edx, 0xdc(%rsp)
movl %ecx, 0xd8(%rsp)
movq %r8, 0xd0(%rsp)
movq %r9, 0xc8(%rsp)
movl $0x0, 0xc4(%rsp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x21020
movq 0xe8(%rsp), %rsi
movq 0xc8(%rsp), %rdx
leaq 0x98(%rsp), %rdi
callq 0x15fb0
movl 0xd8(%rsp), %esi
movq 0xd0(%rsp), %rcx
movq 0xc8(%rsp), %r8
movq 0xb8(%rsp), %rdx
movq %rsp, %rax
movq %rdx, 0x20(%rax)
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0x60(%rsp), %rdi
movl $0x1, %edx
callq 0x16fa0
movq 0x38(%rsp), %rax
movq (%rax), %rax
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1170
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0x22d33
movq 0x1b2e7(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x12ef9(%rip), %rsi     # 0x35c14
movb $0x0, %al
callq 0x1140
movq $0x0, 0xf0(%rsp)
jmp 0x22eb4
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jge 0x22e4f
movq 0x38(%rsp), %rax
movq 0xe0(%rsp), %rcx
movslq 0x54(%rsp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, 0x50(%rsp)
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x21090
cmpl $0x0, %eax
jne 0x22e3d
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x50(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rsi
movq 0xd0(%rsp), %rdx
leaq 0x60(%rsp), %rdi
callq 0x18030
movb %al, 0x47(%rsp)
movq 0x90(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x30(%rax)
movups 0x60(%rsp), %xmm0
movups 0x70(%rsp), %xmm1
movups 0x80(%rsp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x174f0
movq 0x38(%rsp), %rcx
movsbl 0x47(%rsp), %esi
movq 0x58(%rsp), %rax
movslq 0x54(%rsp), %rdx
movl %esi, (%rax,%rdx,4)
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
movl 0x50(%rsp), %edi
movb 0x47(%rsp), %al
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movq %rsp, %rcx
movups %xmm2, 0x20(%rcx)
movups %xmm1, 0x10(%rcx)
movups %xmm0, (%rcx)
movsbl %al, %esi
callq 0x210d0
jmp 0x22e3f
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x22d3b
movq 0xd0(%rsp), %rdi
movq 0x90(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x30(%rax)
movups 0x60(%rsp), %xmm0
movups 0x70(%rsp), %xmm1
movups 0x80(%rsp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x175f0
movq 0x1b169(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
movl 0xc4(%rsp), %edx
leaq 0x12196(%rip), %rsi     # 0x35036
movb $0x0, %al
callq 0x1140
movq 0x58(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
addq $0xf8, %rsp
retq
nopw %cs:(%rax,%rax)
nop