// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/minhashing.c
// Function: fullEmbeddingProjectionApproximationLocalEasy
int* fullEmbeddingProjectionApproximationLocalEasy(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);

	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);
			++nEvaluations;
			updateEvaluationPlan(p, currentGraphNumber, match);
		}
	}

	dumpSpanningtreeTree(sptTree, gp);

	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=1; i<p.poset->n; ++i) {
		approximateEmbedding[i-1] = p.poset->vertices[i]->visited; // init sketch values to 'infty'
	}

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

}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
leaq 0x110(%rsp), %rax
movq %rax, 0x40(%rsp)
movq %rdi, 0xf8(%rsp)
movq %rsi, 0xf0(%rsp)
movl %edx, 0xec(%rsp)
movl %ecx, 0xe8(%rsp)
movq %r8, 0xe0(%rsp)
movq %r9, 0xd8(%rsp)
movl $0x0, 0xd4(%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 0xf8(%rsp), %rsi
movq 0xd8(%rsp), %rdx
leaq 0xa8(%rsp), %rdi
callq 0x15fb0
movl 0xe8(%rsp), %esi
movq 0xe0(%rsp), %rcx
movq 0xd8(%rsp), %r8
movq 0xc8(%rsp), %rdx
movq %rsp, %rax
movq %rdx, 0x20(%rax)
movups 0xa8(%rsp), %xmm0
movups 0xb8(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x16fa0
movl $0x0, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
cmpl 0xec(%rsp), %eax
jge 0x22941
movq 0x40(%rsp), %rax
movq 0xf0(%rsp), %rcx
movslq 0x6c(%rsp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, 0x68(%rsp)
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x68(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x21090
cmpl $0x0, %eax
jne 0x2292f
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x68(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rsi
movq 0xe0(%rsp), %rdx
leaq 0x70(%rsp), %rdi
callq 0x18030
movb %al, 0x5f(%rsp)
movq 0xa0(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x30(%rax)
movups 0x70(%rsp), %xmm0
movups 0x80(%rsp), %xmm1
movups 0x90(%rsp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x174f0
movq 0x40(%rsp), %rcx
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
movl 0x68(%rsp), %edi
movb 0x5f(%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 0x22931
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x2283c
movq 0xe0(%rsp), %rdi
movq 0xa0(%rsp), %rcx
movq %rsp, %rax
movq %rcx, 0x30(%rax)
movups 0x70(%rsp), %xmm0
movups 0x80(%rsp), %xmm1
movups 0x90(%rsp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x175f0
movq 0x40(%rsp), %rax
movq (%rax), %rax
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1170
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x229c9
movq 0x1b64e(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
leaq 0x13260(%rip), %rsi     # 0x35c14
movb $0x0, %al
callq 0x1140
movq $0x0, 0x100(%rsp)
jmp 0x22a44
movl $0x1, 0x4c(%rsp)
movq 0x40(%rsp), %rcx
movl 0x4c(%rsp), %eax
movq (%rcx), %rcx
cmpl (%rcx), %eax
jge 0x22a18
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq 0x4c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1c(%rax), %edx
movq 0x50(%rsp), %rax
movl 0x4c(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x229d1
movq 0x1b5d9(%rip), %rax     # 0x3dff8
movq (%rax), %rdi
movl 0xd4(%rsp), %edx
leaq 0x12606(%rip), %rsi     # 0x35036
movb $0x0, %al
callq 0x1140
movq 0x50(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
retq
nopw %cs:(%rax,%rax)