// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/outerplanar.c
// Function: mergeBBtree
int* mergeBBtree(struct Graph* g, struct Graph*h) {
	struct Vertex** tmp;
	int i, j, tmpN;
	int actualVertices = 0;
	for (i=0; i<g->n; ++i) {
		if (g->vertices[i]) {
			++actualVertices;
		}
	}

	/* up to this point, there may be elements of copy->vertices, that are NULL */
	tmp = g->vertices;
	tmpN = g->n;

	/* set the number of vertices correctly */
	int newSize = actualVertices + h->n;
	setVertexNumber(g, newSize);
	int* originalIDs = malloc(newSize * sizeof(int));

	/* shift the vertices that are there into the new array and
	 * assign new numbers */
	j = 0;
	for (i=0; i<tmpN; ++i) {
		if (tmp[i]) {
			g->vertices[j] = tmp[i];
			originalIDs[j] = g->vertices[j]->number;
			g->vertices[j]->number = j;
			++j;
		}
	}

	/* attach the block vertices to the new tree */
	for (i=0; i<h->n; ++i) {
		g->vertices[j] = h->vertices[i];
		originalIDs[j] = -1 - i;
		g->vertices[j]->number = j;
		++j;	
	}

	/* set the number of edges correctly */
	g->m += h->m;

	free(tmp);

	return originalIDs;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x30(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x257ca
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x257bb
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x257bd
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x2578e
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movl 0x10(%rsp), %eax
movq 0x28(%rsp), %rcx
addl (%rcx), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0xaa00
movslq 0xc(%rsp), %rdi
shlq $0x2, %rdi
callq 0x1170
movq %rax, (%rsp)
movl $0x0, 0x18(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x14(%rsp), %eax
jge 0x258b8
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x258a6
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x18(%rax), %edx
movq (%rsp), %rax
movslq 0x18(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x18(%rsp), %ecx
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x18(%rax)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x258a8
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x25822
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x25937
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subl 0x1c(%rsp), %edx
movq (%rsp), %rax
movslq 0x18(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x18(%rsp), %ecx
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x18(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, 0x18(%rax)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x258c0
movq 0x28(%rsp), %rax
movl 0x4(%rax), %ecx
movq 0x30(%rsp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq 0x20(%rsp), %rdi
callq 0x1030
movq (%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)