LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: getVertexList
struct VertexList* getVertexList(struct ListPool* p){
	if (p->unused) {
		/* get first of the unused elements */
		p->tmp = p->unused;
		p->unused = p->tmp->next;
	} else {
		/* allocate memory for new struct */
		if (!(p->tmp = malloc(sizeof(struct VertexList)))) {
			/* malloc did not work */
			printf("Error allocating memory\n");
			return NULL;
		} 
	}
	
	/* The malloc worked or we had an element left. So we initialize the struct */
	wipeVertexList(p->tmp);

	return p->tmp;
		
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x14344
movq %rax, 0x8(%rbx)
movq 0x8(%rax), %rax
movq %rax, (%rbx)
jmp 0x14357
movl $0x30, %edi
callq 0x1190
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x1436f
movq 0x8(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x1c(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0x8(%rbx), %rax
popq %rbx
retq
leaq 0xc7b1(%rip), %rdi      # 0x20b27
callq 0x1070
xorl %eax, %eax
jmp 0x1436d
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: dumpVertexList
void dumpVertexList(struct ListPool* p, struct VertexList* l) {
	/* free the label string, if l manages it */
	if (l->isStringMaster) {
		free(l->label);
	}

	if (MEM_DEBUG) {
		free(l);
	} else {
		/* add l to the unused list */
		l->next = p->unused;
		p->unused = l;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x28(%rsi)
je 0x143a6
movq (%rbx), %rdi
callq 0x1030
movq (%r14), %rax
movq %rax, 0x8(%rbx)
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: dumpVertexListLinearly
void dumpVertexListLinearly(struct ListPool* p, struct VertexList* e) {
	struct VertexList* tmp;
	while (e) {
		tmp = e->next;
		dumpVertexList(p,e);
		e = tmp;
	}

}

// Assembly:
testq %rsi, %rsi
je 0x1442a
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%r14), %r15
cmpl $0x0, 0x28(%r14)
je 0x14413
movq (%r14), %rdi
callq 0x1030
movq (%rbx), %rax
movq %rax, 0x8(%r14)
movq %r14, (%rbx)
movq %r15, %r14
testq %r15, %r15
jne 0x14400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: createVertexPool
struct VertexPool* createVertexPool(unsigned int initNumberOfElements){
	struct VertexPool* newPool;

	if (MEM_DEBUG) {
		// this allows the dump methods to free everything that is dumped
		initNumberOfElements = 1;
	}

	if ((newPool = malloc(sizeof(struct VertexPool)))) {
		if ((newPool->unused = malloc(initNumberOfElements * sizeof(struct Vertex)))) {
			unsigned int i;
			/* we have allocated an array, but need a list, thus set ponters accordingly */
			for (i=0; i<initNumberOfElements-1; ++i) {
				(newPool->unused[i]).next = &(newPool->unused[i+1]);
			}
			(newPool->unused[initNumberOfElements-1]).next = NULL;
			newPool->poolPointer = newPool->unused;
			newPool->initNumberOfElements = initNumberOfElements;
		} else {
			printf("Error while initializing object pool for list elements\n");
			return NULL;
		}
	} else {
		printf("Error while initializing object pool for list elements\n");
		return NULL;
	}
	
	return newPool;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x20, %edi
callq 0x1190
testq %rax, %rax
je 0x14548
movq %rax, %rbx
movl %ebp, %eax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdi
callq 0x1190
movq %rax, (%rbx)
testq %rax, %rax
je 0x14548
movl %ebp, %ecx
decl %ecx
movl %ecx, %ecx
je 0x1452e
leaq 0x1(%rcx), %rdx
andq $-0x2, %rdx
leaq -0x1(%rcx), %rsi
movq %rsi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x40(%rax), %rsi
movdqa 0xc381(%rip), %xmm1     # 0x20810
movdqa 0xc389(%rip), %xmm2     # 0x20820
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0xc389(%rip), %xmm4     # 0x20830
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pand %xmm6, %xmm5
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
por %xmm5, %xmm6
movdqa %xmm1, %xmm5
psubq %xmm3, %xmm5
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x144f5
movq %xmm5, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rax, %rdi
movq %rdi, -0x30(%rsi)
pxor %xmm3, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x1451c
pshufd $0xee, %xmm5, %xmm5     # xmm5 = xmm5[2,3,2,3]
movq %xmm5, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rax, %rdi
movq %rdi, (%rsi)
paddq %xmm4, %xmm1
addq $0x60, %rsi
addq $-0x2, %rdx
jne 0x144a7
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq $0x0, 0x10(%rax,%rcx)
movq %rax, 0x18(%rbx)
movl %ebp, 0x10(%rbx)
jmp 0x14556
leaq 0xc5a1(%rip), %rdi      # 0x20af0
callq 0x1070
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: freeVertexPool
void freeVertexPool(struct VertexPool *p) {
	while (p->unused) {
		p->tmp = p->unused->next;
		if ((p->unused < p->poolPointer) || (p->unused > &(p->poolPointer[p->initNumberOfElements-1]))) {
			free(p->unused);
		}
		p->unused = p->tmp;
	}
	if (!MEM_DEBUG) {
		free(p->poolPointer);
	}
	free(p);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x145a0
movq 0x10(%rdi), %rax
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rax
cmpq %rax, %rdi
jb 0x14592
movl 0x10(%rbx), %ecx
decl %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq %rax, %rdi
jbe 0x14597
callq 0x1030
movq 0x8(%rbx), %rdi
movq %rdi, (%rbx)
jmp 0x14567
movq 0x18(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: getVertex
struct Vertex* getVertex(struct VertexPool* p){
		if (p->unused) {
		/* get first of the unused elements */
		p->tmp = p->unused;
		p->unused = p->tmp->next;
	} else {
		/* allocate memory for new struct */
		if (!(p->tmp = malloc(sizeof(struct Vertex)))) {
			/* malloc did not work */
			printf("Error allocating memory\n");
			return NULL;
		} 
	}
	
	/* The malloc worked or we had an element left. So we initialize the struct */
	wipeVertex(p->tmp);
	
	return p->tmp;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x145cb
movq %rax, 0x8(%rbx)
movq 0x10(%rax), %rax
movq %rax, (%rbx)
jmp 0x145de
movl $0x30, %edi
callq 0x1190
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x145f6
movq 0x8(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x1c(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0x8(%rbx), %rax
popq %rbx
retq
leaq 0xc52a(%rip), %rdi      # 0x20b27
callq 0x1070
xorl %eax, %eax
jmp 0x145f4
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: dumpVertex
void dumpVertex(struct VertexPool* p, struct Vertex* v){
	
	if (v->isStringMaster) {
		free(v->label);
	}

	if (MEM_DEBUG) {
		free(v);
	} else {
		/* add v to the unused list */
		v->next = p->unused;
		p->unused = v;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x24(%rsi)
je 0x14640
movq (%rbx), %rdi
callq 0x1030
movq (%r14), %rax
movq %rax, 0x10(%rbx)
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: createGraphPool
struct GraphPool* createGraphPool(unsigned int initNumberOfElements, struct VertexPool* vp, struct ListPool* lp) {
	struct GraphPool* newPool;

	if (MEM_DEBUG) {
		// this allows the dump methods to free everything that is dumped
		initNumberOfElements = 1;
	}

	if ((newPool = malloc(sizeof(struct GraphPool)))) {
		/* set the listpool and vertexpool of the graphpool according to the input. good for dumping actions */
		newPool->vertexPool = vp;
		newPool->listPool = lp;

		
		if ((newPool->unused = malloc(initNumberOfElements * sizeof(struct Graph)))) {
			unsigned int i;
			/* we have allocated an array, but need a list, thus set ponters accordingly */
			for (i=0; i<initNumberOfElements-1; ++i) {
				(newPool->unused[i]).next = &(newPool->unused[i+1]);
			}
			(newPool->unused[initNumberOfElements-1]).next = NULL;
			newPool->poolPointer = newPool->unused;
			newPool->initNumberOfElements = initNumberOfElements;
		} else {
			printf("Error while initializing object pool for list elements\n");
			return NULL;
		}
	} else {
		printf("Error while initializing object pool for list elements\n");
		return NULL;
	}
	
	return newPool;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movl $0x30, %edi
callq 0x1190
testq %rax, %rax
je 0x1476d
movq %rax, %rbx
movq %r15, 0x10(%rax)
movq %r14, 0x18(%rax)
movl %ebp, %edi
shlq $0x5, %rdi
callq 0x1190
movq %rax, (%rbx)
testq %rax, %rax
je 0x1476d
movl %ebp, %ecx
decl %ecx
movl %ecx, %ecx
je 0x14757
leaq 0x1(%rcx), %rdx
andq $-0x2, %rdx
leaq -0x1(%rcx), %rsi
movq %rsi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x38(%rax), %rsi
movdqa 0xc14c(%rip), %xmm1     # 0x20810
movdqa 0xc154(%rip), %xmm2     # 0x20820
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0xc154(%rip), %xmm4     # 0x20830
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pand %xmm6, %xmm5
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
por %xmm5, %xmm6
movdqa %xmm1, %xmm5
psubq %xmm3, %xmm5
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x14726
movq %xmm5, %rdi
shlq $0x5, %rdi
addq %rax, %rdi
movq %rdi, -0x20(%rsi)
pxor %xmm3, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x14749
pshufd $0xee, %xmm5, %xmm5     # xmm5 = xmm5[2,3,2,3]
movq %xmm5, %rdi
shlq $0x5, %rdi
addq %rax, %rdi
movq %rdi, (%rsi)
paddq %xmm4, %xmm1
addq $0x40, %rsi
addq $-0x2, %rdx
jne 0x146dc
shlq $0x5, %rcx
movq $0x0, 0x18(%rax,%rcx)
movq %rax, 0x28(%rbx)
movl %ebp, 0x20(%rbx)
jmp 0x1477b
leaq 0xc37c(%rip), %rdi      # 0x20af0
callq 0x1070
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: freeGraphPool
void freeGraphPool(struct GraphPool *p) {
	while (p->unused) {
		p->tmp = p->unused->next;
		if ((p->unused < p->poolPointer) || (p->unused > &(p->poolPointer[p->initNumberOfElements-1]))) {
			free(p->unused);
		}
		p->unused = p->tmp;
	}
	if (!MEM_DEBUG) {
		free(p->poolPointer);
	}
	free(p);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x147c5
movq 0x18(%rdi), %rax
movq %rax, 0x8(%rbx)
movq 0x28(%rbx), %rax
cmpq %rax, %rdi
jb 0x147b7
movl 0x20(%rbx), %ecx
decl %ecx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq %rax, %rdi
jbe 0x147bc
callq 0x1030
movq 0x8(%rbx), %rdi
movq %rdi, (%rbx)
jmp 0x14790
movq 0x28(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: getGraph
struct Graph* getGraph(struct GraphPool* p) {
	if (p->unused) {
		/* get first of the unused elements */
		p->tmp = p->unused;
		p->unused = p->tmp->next;
	} else {
		/* allocate memory for new struct */
		if (!(p->tmp = malloc(sizeof(struct Graph)))) {
			/* malloc did not work */
			printf("Error allocating memory\n");
			return NULL;
		} 
	}
	
	/* malloc worked or there was an unused element left, initialize stuff */
	wipeGraph(p->tmp);
	
	return p->tmp;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x147f0
movq %rax, 0x8(%rbx)
movq 0x18(%rax), %rax
movq %rax, (%rbx)
jmp 0x14803
movl $0x20, %edi
callq 0x1190
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x14817
movq 0x8(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0x8(%rbx), %rax
popq %rbx
retq
leaq 0xc309(%rip), %rdi      # 0x20b27
callq 0x1070
xorl %eax, %eax
jmp 0x14815
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: dumpGraph
void dumpGraph(struct GraphPool* p, struct Graph *g) {
	struct VertexList *tmp;
	int i;
	/* dump content */
	if (g->vertices) {
		for (i=0; i<g->n; ++i) {
			if (g->vertices[i]) {
				while (g->vertices[i]->neighborhood) {
					tmp = g->vertices[i]->neighborhood->next;
					dumpVertexList(p->listPool, g->vertices[i]->neighborhood);
					g->vertices[i]->neighborhood = tmp;
				}
				dumpVertex(p->vertexPool, g->vertices[i]);
			}
		}
	
		free(g->vertices);
	}
	
	if (MEM_DEBUG) {
		free(g);
	} else {
		/* append g to the unused list */
		g->next = p->unused;
		p->unused = g;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x10(%rsi)
je 0x148db
cmpl $0x0, (%rbx)
jle 0x148d2
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
cmpq $0x0, (%rax,%r15,8)
je 0x148c7
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %r13
movq 0x8(%r13), %r12
testq %r12, %r12
je 0x148a7
movq 0x8(%r12), %r13
movq 0x18(%r14), %rbp
cmpl $0x0, 0x28(%r12)
je 0x1488c
movq (%r12), %rdi
callq 0x1030
movq (%rbp), %rax
movq %rax, 0x8(%r12)
movq %r12, (%rbp)
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rcx
movq %r13, 0x8(%rcx)
jmp 0x14865
movq 0x10(%r14), %r12
cmpl $0x0, 0x24(%r13)
je 0x148bb
movq (%r13), %rdi
callq 0x1030
movq (%r12), %rax
movq %rax, 0x10(%r13)
movq %r13, (%r12)
incq %r15
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x14856
movq 0x10(%rbx), %rdi
callq 0x1030
movq (%r14), %rax
movq %rax, 0x18(%rbx)
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: createShallowGraphPool
struct ShallowGraphPool* createShallowGraphPool(unsigned int initNumberOfElements, struct ListPool* lp){
	struct ShallowGraphPool* newPool;
	
	if (MEM_DEBUG) {
		// this allows the dump methods to free everything that is dumped
		initNumberOfElements = 1;
	}

	if ((newPool = malloc(sizeof(struct ShallowGraphPool)))) {
		/* set the listpool of the graphpool according to the input. good for dumping actions */
		newPool->listPool = lp;
		if ((newPool->unused = malloc(initNumberOfElements * sizeof(struct ShallowGraph)))) {
			unsigned int i;
			/* we have allocated an array, but need a list, thus set ponters accordingly */
			for (i=0; i<initNumberOfElements-1; ++i) {
				(newPool->unused[i]).next = &(newPool->unused[i+1]);
			}
			(newPool->unused[initNumberOfElements-1]).next = NULL;
			newPool->poolPointer = newPool->unused;
			newPool->initNumberOfElements = initNumberOfElements;
		} else {
			printf("Error while initializing object pool for list elements\n");
			return NULL;
		}
	} else {
		printf("Error while initializing object pool for list elements\n");
		return NULL;
	}
	
	return newPool;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x28, %edi
callq 0x1190
testq %rax, %rax
je 0x14a46
movq %rax, %rbx
movq %r14, 0x10(%rax)
movl %ebp, %eax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdi
callq 0x1190
movq %rax, (%rbx)
testq %rax, %rax
je 0x14a46
movl %ebp, %ecx
decl %ecx
movl %ecx, %ecx
je 0x14a2c
leaq 0x1(%rcx), %rdx
andq $-0x2, %rdx
leaq -0x1(%rcx), %rsi
movq %rsi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0x48(%rax), %rsi
movdqa 0xbe83(%rip), %xmm1     # 0x20810
movdqa 0xbe8b(%rip), %xmm2     # 0x20820
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0xbe8b(%rip), %xmm4     # 0x20830
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pand %xmm6, %xmm5
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
por %xmm5, %xmm6
movdqa %xmm1, %xmm5
psubq %xmm3, %xmm5
movd %xmm6, %edi
notl %edi
testb $0x1, %dil
je 0x149f3
movq %xmm5, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rax, %rdi
movq %rdi, -0x30(%rsi)
pxor %xmm3, %xmm6
pextrw $0x4, %xmm6, %edi
testb $0x1, %dil
je 0x14a1a
pshufd $0xee, %xmm5, %xmm5     # xmm5 = xmm5[2,3,2,3]
movq %xmm5, %rdi
leaq (%rdi,%rdi,2), %rdi
shlq $0x4, %rdi
addq %rax, %rdi
movq %rdi, (%rsi)
paddq %xmm4, %xmm1
addq $0x60, %rsi
addq $-0x2, %rdx
jne 0x149a5
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq $0x0, 0x18(%rax,%rcx)
movq %rax, 0x20(%rbx)
movl %ebp, 0x18(%rbx)
jmp 0x14a54
leaq 0xc0a3(%rip), %rdi      # 0x20af0
callq 0x1070
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: freeShallowGraphPool
void freeShallowGraphPool(struct ShallowGraphPool *p) {
	while (p->unused) {
		p->tmp = p->unused->next;
		if ((p->unused < p->poolPointer) || (p->unused > &(p->poolPointer[p->initNumberOfElements-1]))) {
			free(p->unused);
		}
		p->unused = p->tmp;
	}
	if (!MEM_DEBUG) {
		free(p->poolPointer);
	}
	free(p);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x14a9c
movq 0x18(%rdi), %rax
movq %rax, 0x8(%rbx)
movq 0x20(%rbx), %rax
cmpq %rax, %rdi
jb 0x14a8e
movl 0x18(%rbx), %ecx
decl %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq %rax, %rdi
jbe 0x14a93
callq 0x1030
movq 0x8(%rbx), %rdi
movq %rdi, (%rbx)
jmp 0x14a63
movq 0x20(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: getShallowGraph
struct ShallowGraph* getShallowGraph(struct ShallowGraphPool *p) {
	
	if (p->unused) {
		/* get first of the unused elements */
		p->tmp = p->unused;
		p->unused = p->tmp->next;
	} else {
		/* allocate memory for new struct */
		if (!(p->tmp = malloc(sizeof(struct ShallowGraph)))) {
			/* malloc did not work */
			printf("Error allocating memory\n");
			return NULL;
		} 
	}
	
	/* The malloc worked or we had an element left. So we initialize the struct */
	wipeShallowGraph(p->tmp);
	
	return p->tmp;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x14ac7
movq %rax, 0x8(%rbx)
movq 0x18(%rax), %rax
movq %rax, (%rbx)
jmp 0x14ada
movl $0x30, %edi
callq 0x1190
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x14af6
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
movl %ecx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x18(%rax)
movl %ecx, 0x28(%rax)
movq 0x8(%rbx), %rax
popq %rbx
retq
leaq 0xc02a(%rip), %rdi      # 0x20b27
callq 0x1070
xorl %eax, %eax
jmp 0x14af4
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: dumpShallowGraph
void dumpShallowGraph(struct ShallowGraphPool *p, struct ShallowGraph* g) {

	/* dump edges */
	while (g->edges) {
		p->listPool->tmp = g->edges;
		g->edges = g->edges->next;
		dumpVertexList(p->listPool, p->listPool->tmp);
	}

	if (MEM_DEBUG) {
		free(g);
	} else {
		/* add g to the unused list */
		g->next = p->unused;
		p->unused = g;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r15
testq %r15, %r15
je 0x14b5f
movq 0x10(%r14), %r12
movq %r15, 0x8(%r12)
movq 0x8(%r15), %rax
movq %rax, (%rbx)
cmpl $0x0, 0x28(%r15)
je 0x14b4e
movq (%r15), %rdi
callq 0x1030
movq (%r12), %rax
movq %rax, 0x8(%r15)
movq %r15, (%r12)
movq (%rbx), %r15
jmp 0x14b2a
movq (%r14), %rax
movq %rax, 0x18(%rbx)
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/memoryManagement.c
// Function: copyString
char* copyString(char* string) {
	int i;
	char* copy;

	for (i=0; string[i] != 0; ++i);

	copy = malloc((i + 1) * sizeof(char));

	for (i=0; string[i] != 0; ++i) {
		copy[i] = string[i];
	}
	copy[i] = 0;

	return copy;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
cmpb $0x0, (%rbx,%rax)
leaq 0x1(%rax), %rax
jne 0x14bad
movl %eax, %edi
callq 0x1190
movb (%rbx), %dl
xorl %ecx, %ecx
testb %dl, %dl
je 0x14bd2
movb %dl, (%rax,%rcx)
movb 0x1(%rbx,%rcx), %dl
incq %rcx
jmp 0x14bc2
movb $0x0, (%rax,%rcx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: getRandomPermutation
int* getRandomPermutation(int n) {
	int* permutation = malloc(n * sizeof(int));
	if (permutation) {
		for (int i=0; i<n; ++i) {
			permutation[i] = i+1;
		}
		shuffleArray(permutation, n);
	} else {
		fprintf(stderr, "Error allocating memory for permutation\n");
	}
	return permutation;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %r14d
movslq %edi, %rdi
shlq $0x2, %rdi
callq 0x1190
movq %rax, %rbx
testq %rax, %rax
je 0x14cda
movl %r14d, %r15d
testl %r14d, %r14d
jle 0x14ca2
leal 0x1(%r14), %eax
leaq -0x1(%r15), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %eax
shlq $0x3, %rax
movdqa 0xbbec(%rip), %xmm1     # 0x20810
xorl %ecx, %ecx
movdqa 0xbbf2(%rip), %xmm2     # 0x20820
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0xbbf2(%rip), %xmm4     # 0x20830
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pand %xmm6, %xmm5
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
por %xmm5, %xmm6
movdqa %xmm1, %xmm5
psubq %xmm3, %xmm5
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x14c7c
movd %xmm5, (%rbx,%rcx)
pxor %xmm3, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x14c95
pshufd $0xee, %xmm5, %xmm5     # xmm5 = xmm5[2,3,2,3]
movd %xmm5, 0x4(%rbx,%rcx)
paddq %xmm4, %xmm1
addq $0x8, %rcx
cmpq %rcx, %rax
jne 0x14c3e
cmpl $0x2, %r14d
jl 0x14cd1
leaq -0x1(%r15), %r14
callq 0x1250
cltd
idivl %r15d
movslq %edx, %rax
movl (%rbx,%rax,4), %ecx
movl -0x4(%rbx,%r15,4), %edx
movl %edx, (%rbx,%rax,4)
movl %ecx, -0x4(%rbx,%r15,4)
cmpq $0x2, %r15
movq %r14, %r15
jg 0x14ca8
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x1d82
jmp 0x14cd1
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: posetPermutationMark
int posetPermutationMark(int* permutation, size_t n, struct Graph* F) {
	for (int v=0; v<F->n; ++v) {
		F->vertices[v]->visited = 0;
	}
	size_t shrunkSize = 0;
	for (size_t i=0; i<n; ++i) {
		struct Vertex* v = F->vertices[permutation[i]];
		if (v->visited == 0) {
			markConnectedComponent(v, 1);
			++shrunkSize;
		} else {
			permutation[i] = -1;
		}
	}
	return shrunkSize;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movslq (%rdx), %rax
testq %rax, %rax
jle 0x14d14
movq 0x10(%rbx), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movl $0x0, 0x1c(%rsi)
incq %rdx
cmpq %rdx, %rax
jne 0x14d01
testq %r14, %r14
je 0x14d52
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x10(%rbx), %rax
movslq (%r15,%r13,4), %rcx
movq (%rax,%rcx,8), %rdi
cmpl $0x0, 0x1c(%rdi)
je 0x14d3b
movl $0xffffffff, (%r15,%r13,4) # imm = 0xFFFFFFFF
jmp 0x14d48
movl $0x1, %esi
callq 0xb8fe
incq %r12
incq %r13
cmpq %r13, %r14
jne 0x14d1f
jmp 0x14d55
xorl %r12d, %r12d
movl %r12d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: posetPermutationShrink
int* posetPermutationShrink(int* permutation, size_t n, size_t shrunkSize) {
	int* condensedSequence = malloc(shrunkSize * sizeof(int));
	size_t posInCondensed = 0;
	for (size_t i=0; i<n; ++i) {
		if (permutation[i] != -1) {
			condensedSequence[posInCondensed] = permutation[i];
			++posInCondensed;
		}
	}
	free(permutation);
	return condensedSequence;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq (,%rdx,4), %rdi
callq 0x1190
movq %rax, %r15
testq %r14, %r14
je 0x14d9d
xorl %eax, %eax
xorl %ecx, %ecx
movl (%rbx,%rax,4), %edx
cmpl $-0x1, %edx
je 0x14d95
movl %edx, (%r15,%rcx,4)
incq %rcx
incq %rax
cmpq %rax, %r14
jne 0x14d86
movq %rbx, %rdi
callq 0x1030
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: posPairSorter
int posPairSorter(const void* a, const void* b, void* context) {
	struct PosPair one = *(struct PosPair*)a;
	struct PosPair two = *(struct PosPair*)b;
	struct EvaluationPlan p = *(struct EvaluationPlan*)context;

	int oneID = p.shrunkPermutations[one.permutation][one.level];
	int twoID = p.shrunkPermutations[two.permutation][two.level];

	return oneID - twoID;
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
movq 0x18(%rdx), %rdx
movq (%rdx,%rcx,8), %rcx
movl (%rcx,%rax,4), %eax
movq (%rdx,%rsi,8), %rcx
subl (%rcx,%rdi,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: reverseGraph
struct Graph* reverseGraph(struct Graph* g, struct GraphPool* gp) {
	struct Graph* reverse = emptyGraph(g, gp);
	for (int v=0; v<g->n; ++v) {
		for (struct VertexList* e=g->vertices[v]->neighborhood; e!=NULL; e=e->next) {
			struct VertexList* f = shallowCopyEdge(e, gp->listPool);
			f->startPoint = reverse->vertices[e->endPoint->number];
			f->endPoint = reverse->vertices[e->startPoint->number];
			addEdge(f->startPoint, f);
		}
	}
	reverse->m = g->m;
	return reverse;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x84f8
movq %rax, %r15
cmpl $0x0, (%rbx)
jle 0x14e4b
xorl %r13d, %r13d
movq 0x10(%rbx), %rax
movq (%rax,%r13,8), %rax
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x14e40
movq 0x18(%r14), %rsi
movq %r12, %rdi
callq 0x7bc0
movq 0x10(%r15), %rcx
movq 0x18(%r12), %rdx
movslq 0x18(%rdx), %rdx
movq (%rcx,%rdx,8), %rdi
movq %rdi, 0x10(%rax)
movq 0x10(%r12), %rdx
movslq 0x18(%rdx), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, 0x18(%rax)
movq %rax, %rsi
callq 0x7cd0
movq 0x8(%r12), %r12
jmp 0x14dfa
incq %r13
movslq (%rbx), %rax
cmpq %rax, %r13
jl 0x14dee
movl 0x4(%rbx), %eax
movl %eax, 0x4(%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: buildMinHashEvaluationPlan
struct EvaluationPlan buildMinHashEvaluationPlan(int** shrunkPermutations, size_t* permutationSizes, size_t K, struct Graph* F, struct GraphPool* gp) {
	struct EvaluationPlan p = {0};
	p.poset = F;
	p.reversePoset = reverseGraph(F, gp);
	p.sketchSize = K;
	p.shrunkPermutations = shrunkPermutations;

	size_t maxPermutationSize = 0;
	for (size_t i=0; i<K; ++i) {
		p.orderLength += permutationSizes[i];
		if (permutationSizes[i] > maxPermutationSize) {
			maxPermutationSize = permutationSizes[i];
		}
	}
	p.order = malloc(p.orderLength * sizeof(struct PosPair));
	if (p.order) {
		// fix some evaluation order.
		size_t position = 0;
		for (size_t level=0; level<maxPermutationSize; ++level) {
			size_t old_pos = position;
			for (size_t i=0; i<K; ++i) {
				if (level < permutationSizes[i]) {
					p.order[position].level = level;
					p.order[position].permutation = i;
					++position;
				}
			}
			// sort current level of the permutations based on the pattern id. This ensures that lower level
			// patterns come before higher level patterns in each level of the order.
			qsort_r(&(p.order[old_pos]), position - old_pos, sizeof(struct PosPair), &posPairSorter, &p);
		}

	} else {
		fprintf(stderr, "could not allocate space for evaluation plan. this program will break now.\n");
		p.poset = NULL;
		p.order = NULL;
		p.shrunkPermutations = NULL;
		p.orderLength = 0;
		p.sketchSize = 0;

	}

	free(permutationSizes); // we do not need this information any more
	return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movq %r8, (%rdi)
movq %r8, %rdi
movq %r9, %rsi
callq 0x14dcf
movq %rax, 0x8(%rbx)
movq %r15, 0x28(%rbx)
movq %r12, 0x18(%rbx)
testq %r15, %r15
je 0x14ec7
movq 0x20(%rbx), %rax
xorl %ebp, %ebp
xorl %ecx, %ecx
movq (%r14,%rcx,8), %rdx
addq %rdx, %rax
cmpq %rbp, %rdx
cmovaq %rdx, %rbp
incq %rcx
cmpq %rcx, %r15
jne 0x14eab
movq %rax, 0x20(%rbx)
jmp 0x14ec9
xorl %ebp, %ebp
movq 0x20(%rbx), %rdi
shlq $0x4, %rdi
callq 0x1190
leaq 0x10(%rbx), %rcx
movq %rcx, (%rsp)
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x14f71
testq %rbp, %rbp
je 0x14f57
xorl %r13d, %r13d
xorl %edi, %edi
movq %rdi, %r12
testq %r15, %r15
je 0x14f2a
movq (%rsp), %rax
movq (%rax), %rax
xorl %ecx, %ecx
movq %rdi, %r12
cmpq (%r14,%rcx,8), %r13
jae 0x14f22
movq %r12, %rdx
shlq $0x4, %rdx
movq %r13, (%rax,%rdx)
movq %rcx, 0x8(%rax,%rdx)
incq %r12
incq %rcx
cmpq %rcx, %r15
jne 0x14f09
movq %r12, %rsi
subq %rdi, %rsi
shlq $0x4, %rdi
addq 0x10(%rbx), %rdi
movl $0x10, %edx
leaq -0x196(%rip), %rcx      # 0x14dae
movq %rbx, %r8
callq 0x1180
incq %r13
movq %r12, %rdi
cmpq %rbp, %r13
jne 0x14ef8
movq %r14, %rdi
callq 0x1030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x1d9e
jmp 0x14f57
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: dumpEvaluationPlan
struct EvaluationPlan dumpEvaluationPlan(struct EvaluationPlan p, struct GraphPool* gp) {
	free(p.order);
	for (size_t i=0; i<p.sketchSize; ++i) {
		free(p.shrunkPermutations[i]);
	}
	free(p.shrunkPermutations);
	for (int v=1; v<p.poset->n; ++v) { // start from 1, as empty pattern has no graph attached
		dumpGraph(gp, (struct Graph*)(p.poset->vertices[v]->label));
		p.poset->vertices[v]->label = NULL;
	}
	dumpGraph(gp, p.reversePoset);
	dumpGraph(gp, p.poset);
	struct EvaluationPlan empty = {0};
	return empty;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x40(%rsp), %r12
movq 0x10(%r12), %rdi
callq 0x1030
movq 0x28(%r12), %r15
testq %r15, %r15
je 0x14fc2
movq 0x18(%r12), %r13
xorl %ebp, %ebp
movq (%r13,%rbp,8), %rdi
callq 0x1030
incq %rbp
cmpq %rbp, %r15
jne 0x14fb0
movq 0x18(%r12), %rdi
callq 0x1030
movq (%r12), %r15
cmpl $0x2, (%r15)
jl 0x15009
movl $0x1, %r13d
movq 0x10(%r15), %rax
movq (%rax,%r13,8), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x14832
movq 0x10(%r15), %rax
movq (%rax,%r13,8), %rax
movq $0x0, (%rax)
incq %r13
movslq (%r15), %rax
cmpq %rax, %r13
jl 0x14fdc
movq 0x8(%r12), %rsi
movq %r14, %rdi
callq 0x14832
movq %r14, %rdi
movq %r15, %rsi
callq 0x14832
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: updateEvaluationPlan
void updateEvaluationPlan(struct EvaluationPlan p, int patternId, char match) {
	if (match) {
		rayOfLight(p.reversePoset->vertices[patternId], p);
	} else {
		rayOfDoom(p.poset->vertices[patternId], p);
	}
}

// Assembly:
leaq 0x8(%rsp), %rax
testb %sil, %sil
je 0x15407
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movslq %edi, %rcx
movq (%rax,%rcx,8), %rdi
jmp 0x15417
movq (%rax), %rax
movq 0x10(%rax), %rax
movslq %edi, %rcx
movq (%rax,%rcx,8), %rdi
jmp 0x15484
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: rayOfLight
static void rayOfLight(struct Vertex* v, struct EvaluationPlan p) {

	/* mark vertex as visited */
	v->visited = 1;
	p.poset->vertices[v->number]->visited = 1;


	/*recursive call for all neighbors that are not visited so far */
	for (struct VertexList* index = v->neighborhood; index; index = index->next) {
		if (index->endPoint->visited != 1) {
			rayOfLight(index->endPoint, p);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl $0x1, %eax
movl %eax, 0x1c(%rdi)
movq 0x50(%rsp), %rcx
movq 0x10(%rcx), %rcx
movslq 0x18(%rdi), %rdx
movq (%rcx,%rdx,8), %rcx
movl %eax, 0x1c(%rcx)
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x1547c
leaq 0x50(%rsp), %r14
movq 0x18(%rbx), %rdi
cmpl $0x1, 0x1c(%rdi)
je 0x15473
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x15417
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x15448
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: rayOfDoom
static void rayOfDoom(struct Vertex* v, struct EvaluationPlan p) {

	/* mark vertex as visited */
	v->visited = -1;
	p.reversePoset->vertices[v->number]->visited = -1;


	/*recursive call for all neighbors that are not visited so far */
	for (struct VertexList* index = v->neighborhood; index; index = index->next) {
		if (index->endPoint->visited != -1) {
			rayOfDoom(index->endPoint, p);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x1c(%rdi)
movq 0x58(%rsp), %rcx
movq 0x10(%rcx), %rcx
movslq 0x18(%rdi), %rdx
movq (%rcx,%rdx,8), %rcx
movl %eax, 0x1c(%rcx)
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x154e9
leaq 0x50(%rsp), %r14
movq 0x18(%rbx), %rdi
cmpl $-0x1, 0x1c(%rdi)
je 0x154e0
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x15484
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x154b5
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: getPositiveBorderSize
int getPositiveBorderSize(struct EvaluationPlan p) {
	int borderSize = 0;
	for (int v=0; v<p.poset->n; ++v) {
		int inBorder = 1;
		for (struct VertexList* e=p.poset->vertices[v]->neighborhood; e!=NULL; e=e->next) {
			inBorder &= getMatch(e->endPoint);
		}
		borderSize += inBorder;
	}
	return borderSize;
}

// Assembly:
movq 0x8(%rsp), %rax
movslq (%rax), %rcx
testq %rcx, %rcx
jle 0x15540
movq 0x10(%rax), %rdx
xorl %esi, %esi
xorl %edi, %edi
xorl %eax, %eax
movq (%rdx,%rdi,8), %r8
movq 0x8(%r8), %r9
movl $0x1, %r8d
testq %r9, %r9
je 0x15534
movq 0x18(%r9), %r10
movq 0x8(%r9), %r11
cmpl $0x1, 0x1c(%r10)
cmovnel %esi, %r8d
movq %r11, %r9
testq %r11, %r11
jne 0x1551b
addl %r8d, %eax
incq %rdi
cmpq %rcx, %rdi
jne 0x15508
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: patternPosetInfoToFeatureSet
struct IntSet* patternPosetInfoToFeatureSet(struct EvaluationPlan p) {
	struct IntSet* features = getIntSet();
	for (int i=1; i<p.poset->n; ++i) {
		if (p.poset->vertices[i]->visited == 1) {
			addIntSortedNoDuplicates(features, i - 1);
		}
	}
	return features;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %eax, %eax
callq 0x99af
movq %rax, %rbx
movq 0x20(%rsp), %r14
cmpl $0x2, (%r14)
jl 0x15588
movl $0x1, %r15d
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x1557d
leal -0x1(%r15), %esi
movq %rbx, %rdi
callq 0x9bf0
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x15563
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: fullEmbeddingProjectionApproximationForTrees
int* fullEmbeddingProjectionApproximationForTrees(struct Graph* g, struct EvaluationPlan p, int* projection, int projectionSize, struct GraphPool* gp) {

	int nEvaluations = 0;
	cleanEvaluationPlan(p);

	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* currentGraph = (struct Graph*)(p.poset->vertices[currentGraphNumber]->label);
			char match = isSubtree(g, currentGraph, gp);
			++nEvaluations;
			updateEvaluationPlan(p, currentGraphNumber, match);
		}
	}

	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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x50(%rsp)
movq %rsi, %r15
movq %rdi, 0x48(%rsp)
leaq 0x90(%rsp), %rax
movq (%rax), %rbx
movslq (%rbx), %rax
testq %rax, %rax
jle 0x15b6e
leaq 0x90(%rsp), %rcx
movq 0x8(%rcx), %rsi
movq 0x10(%rbx), %rcx
movq 0x10(%rsi), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movq (%rcx,%r8,8), %r9
movl %edi, 0x1c(%r9)
movq (%rsi,%r8,8), %r9
movl %edi, 0x1c(%r9)
incq %r8
cmpq %r8, %rax
jne 0x15b56
xorl %ebp, %ebp
testl %edx, %edx
jle 0x15c3b
movl %edx, %r14d
leaq 0x90(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x38(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq (%r15,%r12,4), %r13
movq 0x10(%rbx), %rax
movq (%rax,%r13,8), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x15c2f
movq (%rax), %rsi
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rdx
callq 0xabfd
incl %ebp
testb %al, %al
je 0x15bfc
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rdi
leaq 0x90(%rsp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x15417
jmp 0x15c2f
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rdi
leaq 0x90(%rsp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x15484
incq %r12
cmpq %r12, %r14
jne 0x15b99
movslq (%rbx), %r15
leaq -0x4(,%r15,4), %rdi
callq 0x1190
testq %rax, %rax
jne 0x15c5a
callq 0x1f23
xorl %r14d, %r14d
jmp 0x15c6d
movq %rax, %r14
movq %rax, %rdi
movl %r15d, %esi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x1ee4
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/minhashing.c
// Function: randomProjectionEmbeddingForTrees
int* randomProjectionEmbeddingForTrees(struct Graph* g, struct EvaluationPlan p, int* projection, int projectionSize, struct GraphPool* gp) {

	int nEvaluations = 0;
	cleanEvaluationPlan(p);

	// alloc output array
	int* approximateEmbedding = malloc(projectionSize * 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* currentGraph = (struct Graph*)(p.poset->vertices[currentGraphNumber]->label);
			char match = isSubtree(g, currentGraph, gp);

			// update output
			approximateEmbedding[i] = match;

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

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

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, 0x50(%rsp)
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, 0x48(%rsp)
leaq 0x90(%rsp), %rax
movq (%rax), %rbx
movslq (%rbx), %rax
testq %rax, %rax
jle 0x15f1f
leaq 0x90(%rsp), %rcx
movq 0x8(%rcx), %rdx
movq 0x10(%rbx), %rcx
movq 0x10(%rdx), %rdx
xorl %esi, %esi
xorl %edi, %edi
movq (%rcx,%rdi,8), %r8
movl %esi, 0x1c(%r8)
movq (%rdx,%rdi,8), %r8
movl %esi, 0x1c(%r8)
incq %rdi
cmpq %rdi, %rax
jne 0x15f07
movslq %r15d, %rdi
shlq $0x2, %rdi
callq 0x1190
testq %rax, %rax
jne 0x15f3c
callq 0x1fa3
xorl %eax, %eax
jmp 0x1603a
movq %rax, 0x30(%rsp)
xorl %ebp, %ebp
testl %r15d, %r15d
jle 0x1601b
movl %r15d, %r15d
leaq 0x90(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x38(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq (%r14,%r12,4), %r13
movq 0x10(%rbx), %rax
movq (%rax,%r13,8), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x1600f
movq (%rax), %rsi
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rdx
callq 0xabfd
movsbl %al, %eax
movq 0x30(%rsp), %rcx
movl %eax, (%rcx,%r12,4)
incl %ebp
testb %al, %al
je 0x15fdc
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rdi
leaq 0x90(%rsp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x15417
jmp 0x1600f
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rdi
leaq 0x90(%rsp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x15484
incq %r12
cmpq %r12, %r15
jne 0x15f6d
movq 0x16fd6(%rip), %rax     # 0x2cff8
movq (%rax), %rdi
leaq 0xa00a(%rip), %rsi      # 0x20036
movl %ebp, %edx
xorl %eax, %eax
callq 0x1160
movq 0x30(%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/newCube.c
// Function: printNewCubeCondensed
void printNewCubeCondensed(uint8_t* S, int gn, int hn, FILE* out) {
	if (S == NULL) {
		fprintf(out, "(NULL)\n");
		return;
	}
	for (int v=0; v<gn; ++v) {
		for (int u=0; u<hn; ++u) {
			fprintf(out, "(%i, %i): ", v, u);
			for (int y=0; y<hn; ++y) {
				if (getBit(S, getCharacteristicPosition(y, u, v, hn))) {
					fprintf(out, " %i", y);
				}
			}
			if (getBit(S, getCharacteristicPosition(u,u,v,hn))) {
				fprintf(out, " <- !");
			}
			fprintf(out, "\n");
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movl %edx, 0x4(%rsp)
testq %rdi, %rdi
je 0x164fd
testl %esi, %esi
jle 0x164ee
movq %rdi, %r14
movslq 0x4(%rsp), %r15
movl %esi, %eax
movq %rax, 0x20(%rsp)
movl %r15d, %ebp
movq %r15, %rax
imulq %r15, %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq %r15, 0x28(%rsp)
cmpl $0x0, 0x4(%rsp)
jle 0x164c7
movq 0x8(%rsp), %rax
imulq %r15, %rax
movq %rax, 0x30(%rsp)
movq 0x10(%rsp), %r13
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0xa876(%rip), %rsi      # 0x20ca9
movq 0x8(%rsp), %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x1160
xorl %r15d, %r15d
leaq (%r15,%r13), %rsi
movq %r14, %rdi
callq 0x3a0b
testb %al, %al
je 0x16469
movq %rbx, %rdi
leaq 0xb14a(%rip), %rsi      # 0x215a9
movl %r15d, %edx
xorl %eax, %eax
callq 0x1160
incq %r15
cmpq %r15, %rbp
jne 0x16445
movq 0x30(%rsp), %rax
leaq (%rax,%r12), %rsi
movq 0x28(%rsp), %r15
imulq %r15, %rsi
addq %r12, %rsi
movq %r14, %rdi
callq 0x3a0b
testb %al, %al
je 0x164ab
movl $0x5, %esi
movl $0x1, %edx
leaq 0xa811(%rip), %rdi      # 0x20cb4
movq %rbx, %rcx
callq 0x1220
movl $0xa, %edi
movq %rbx, %rsi
callq 0x1110
incq %r12
addq %r15, %r13
cmpq %rbp, %r12
jne 0x16429
movq 0x8(%rsp), %rcx
incq %rcx
movq 0x10(%rsp), %rax
addq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
cmpq 0x20(%rsp), %rcx
jne 0x16408
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa79d(%rip), %rdi      # 0x20ca1
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1220
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/newCube.c
// Function: printNewCube
void printNewCube(uint8_t* S, int gn, int hn, FILE* out) {
	for (int v=0; v<gn; ++v) {
		for (int u=0; u<hn; ++u) {
			fprintf(out, "(%i, %i): ", v, u);
			for (int y=0; y<hn; ++y) {
				fprintf(out, "%i", getBit(S, getCharacteristicPosition(y, u, v, hn)));
			}
			fprintf(out, "\n");
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, 0xc(%rsp)
testl %esi, %esi
jle 0x16618
movq %rcx, %rbx
movq %rdi, %r14
movslq 0xc(%rsp), %rax
movl %esi, %ecx
movq %rcx, 0x28(%rsp)
movl %eax, %r13d
movq %rax, 0x38(%rsp)
imulq %rax, %rax
movq %rax, 0x20(%rsp)
leaq 0xb042(%rip), %r12      # 0x215aa
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %r13, 0x30(%rsp)
cmpl $0x0, 0xc(%rsp)
jle 0x165f1
movq 0x10(%rsp), %r15
xorl %ebp, %ebp
movq %rbx, %rdi
leaq 0xa712(%rip), %rsi      # 0x20ca9
movq 0x18(%rsp), %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1160
movq %r15, 0x40(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a0b
movzbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1160
incq %r15
decq %r13
jne 0x165aa
movl $0xa, %edi
movq %rbx, %rsi
callq 0x1110
incq %rbp
movq 0x40(%rsp), %r15
addq 0x38(%rsp), %r15
movq 0x30(%rsp), %r13
cmpq %r13, %rbp
jne 0x1658d
movq 0x18(%rsp), %rcx
incq %rcx
movq 0x10(%rsp), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
cmpq 0x28(%rsp), %rcx
jne 0x1657f
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/outerplanar.c
// Function: isPath
char isPath(struct 	Graph* tree) {
	if (tree->m != tree->n - 1) { return 0; }
	for (int v=0; v<tree->n; ++v) {
		if (degree(tree->vertices[v]) > 2) {
			return 0;
		}
	}
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl (%rdi), %eax
decl %eax
cmpl %eax, 0x4(%rdi)
jne 0x16dae
movq %rdi, %r14
cmpl $0x0, (%rdi)
setle %bl
jle 0x16db0
movq 0x10(%r14), %rax
movq (%rax), %rdi
callq 0x7c22
cmpl $0x2, %eax
jg 0x16db0
movl $0x1, %r15d
movslq (%r14), %rax
cmpq %rax, %r15
setge %bl
jge 0x16db0
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x7c22
incq %r15
cmpl $0x3, %eax
jl 0x16d8c
jmp 0x16db0
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/outerplanar.c
// Function: isCactus
char isCactus(struct Graph* g, struct ShallowGraphPool* sgp) {

	/* the empty graph and singleton vertices are cactus graphs */
	if (g->n <= 1) {
		return 1;
	}

	if (isConnected(g)) {
		struct ShallowGraph* biconnectedComponents = listBiconnectedComponents(g, sgp);
		struct ShallowGraph* comp;
		int compNumber = 0;
		for (comp = biconnectedComponents; comp!=NULL; comp=comp->next) {
			if (comp->m > 1) {
				++compNumber;
			}			
		}
		/* cleanup */
		dumpShallowGraphCycle(sgp, biconnectedComponents);
		return g->m - compNumber == g->n - 1 ? 1 : 0;
	} else {
		return 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movb $0x1, %bl
cmpl $0x2, (%rdi)
jl 0x16e36
movq %rsi, %r15
movq %rdi, %r14
callq 0x537c
xorl %ebx, %ebx
testb %al, %al
je 0x16e36
movq %r14, %rdi
movq %r15, %rsi
callq 0xb2bf
testq %rax, %rax
je 0x16e1b
xorl %ebx, %ebx
movq %rax, %rcx
xorl %edx, %edx
cmpl $0x2, 0x10(%rcx)
setge %dl
addl %edx, %ebx
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
jne 0x16e07
movq %r15, %rdi
movq %rax, %rsi
callq 0x14b75
movl (%r14), %eax
movl 0x4(%r14), %ecx
subl %ebx, %ecx
decl %eax
cmpl %eax, %ecx
sete %bl
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/pwelke[P]GraphMiningTools/outerplanar.c
// Function: isOuterplanarGraph
char isOuterplanarGraph(struct Graph* g, struct ShallowGraphPool* sgp, struct GraphPool* gp) {
	struct ShallowGraph* biconnectedComponents = listBiconnectedComponents(g, sgp);
	struct ShallowGraph* comp;
	char isOp = 1;
	for (comp = biconnectedComponents; comp!=NULL; comp=comp->next) {
		if (comp->m > 1) {
			isOp = isOuterplanarBlockShallow(comp, sgp, gp);
			if (isOp == 0) {
				break;
			}
		}			
	}
	/* cleanup */
	dumpShallowGraphCycle(sgp, biconnectedComponents);
	return isOp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %rbx
callq 0xb2bf
movq %rax, %r14
movb $0x1, %bpl
testq %rax, %rax
je 0x16e85
movq %r14, %r12
cmpl $0x2, 0x10(%r12)
jl 0x16e7b
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x16e9b
movl %eax, %ebp
testb %al, %al
je 0x16e85
movq 0x18(%r12), %r12
testq %r12, %r12
jne 0x16e5f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14b75
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq