// File: /workspace/github_c_makefile_star2_O0/pwelke[P]GraphMiningTools/cs_Outerplanar.c
// Function: _compareBlockRepresentations
struct VertexList* __compareBlockRepresentations(struct VertexList* c1, struct VertexList* c2, int m, int o1, int o2) {
	struct VertexList* idx1 = c1;
	struct VertexList* idx2 = c2;


	/* check for differences in the following edges */
	for (idx1=idx1->next, idx2=idx2->next;
			(idx1!=c1);
			idx1=idx1->next, idx2=idx2->next) {

		/* check for differences in the edge label */
		if (strcmp(idx1->label, idx2->label) < 0) {
			return c1;
		}
		if (strcmp(idx1->label, idx2->label) > 0) {
			return c2;
		}
		if (strcmp(idx1->label, idx2->label) == 0) {
			/* if edge labels do not differ, check for differences in endPoint label */
			if (strcmp(idx1->endPoint->label, idx2->endPoint->label) < 0) {
				return c1;
			}
			if (strcmp(idx1->endPoint->label, idx2->endPoint->label) > 0) {
				return c2;
			}
		}
	}

	/* check for differences in the edge label of the first edge*/
	if (strcmp(idx1->label, idx2->label) < 0) {
		return c1;
	}
	if (strcmp(idx1->label, idx2->label) > 0) {
		return c2;
	}
	if (strcmp(idx1->label, idx2->label) == 0) {
		/* if edge labels do not differ, check for differences in endPoint label */
		if (strcmp(idx1->endPoint->label, idx2->endPoint->label) < 0) {
			return c1;
		}
		if (strcmp(idx1->endPoint->label, idx2->endPoint->label) > 0) {
			return c2;
		}
	}


	/* if no difference is found in the hamiltonian cycle, check the diagonals */
	for (idx1=idx1->next, idx2=idx2->next; idx1!=c1; idx1=idx1->next, idx2=idx2->next) {
		struct VertexList* e;
		int i;

		int neighbors1 = 0;
		int neighbors2 = 0;

		struct VertexList** narray1;
		struct VertexList** narray2;

		/* count number of diagonals that go from the current vertex to a vertex with a higher
		 * index wrt the current permutation */
		for (e=idx1->endPoint->neighborhood; e; e=e->next) {
			if (mod(e->startPoint->d - o1, m + 1) < mod(e->endPoint->d - o1, m + 1)) {
				++neighbors1;
			}
		}
		for (e=idx2->endPoint->neighborhood; e; e=e->next) {
			if (mod(e->startPoint->d - o2, m + 1) < mod(e->endPoint->d - o2, m + 1)) {
				++neighbors2;
			}
		}



		/* if there are more edges with a low start vertex index, the resulting cstring is smaller */
		if (neighbors1 < neighbors2) {
			return c2;
		}
		if (neighbors2 < neighbors1) {
			return c1;
		}

		/* special cases where current vertices have no or just one incident diagonal */
		if (neighbors1 == 0) {
			continue;
		}
		if (neighbors1 == 1) {
			if (mod(idx1->endPoint->neighborhood->endPoint->d - o1, m + 1) > mod(idx2->endPoint->neighborhood->endPoint->d - o2, m + 1)) {
				return c2;
			} else {
				return c1;
			}
		}

		/* otherwise we have to sort the edges wrt their endpoints modulo the permutation */

		/* sort the edges according to their cycle indices modulo the permutation */
		narray1 = malloc(neighbors1 * sizeof(struct VertexList*));
		narray2 = malloc(neighbors2 * sizeof(struct VertexList*));
		for (i=0, e=idx1->endPoint->neighborhood; i<neighbors1; e=e->next) {
			e->flag = mod(e->startPoint->d - o1, m + 1);
			e->used = mod(e->endPoint->d - o1, m + 1);
			if (e->flag < e->used) {
				narray1[i] = e;
				++i;
			}
		}
		for (i=0, e=idx2->endPoint->neighborhood; i<neighbors2; e=e->next) {
			e->flag = mod(e->startPoint->d - o2, m + 1);
			e->used = mod(e->endPoint->d - o2, m + 1);
			if (e->flag < e->used) {
				narray2[i] = e;
				++i;
			}
		}

		qsort(narray1, neighbors1, sizeof(struct VertexList*), __compareDiagonals);
		qsort(narray2, neighbors2, sizeof(struct VertexList*), __compareDiagonals);

		/* check if the indices of the endpoints of the diagonals differ */
		for (i=0; i<neighbors1; ++i) {
			if (__compareDiagonals(&(narray1[i]), &(narray2[i])) < 0) {
				free(narray1);
				free(narray2);
				return c1;
			}
			if (__compareDiagonals(&(narray1[i]), &(narray2[i])) > 0) {
				free(narray1);
				free(narray2);
				return c2;
			}
			/* otherwise continue with the next loop iteration */
		}
		free(narray1);
		free(narray2);

	}

	/* if neither checking the hamiltonian cycle nor checking the diagonals resulted
	 * in any difference, return c1 */
	return c1;

}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movl %edx, 0x5c(%rsp)
movl %ecx, 0x58(%rsp)
movl %r8d, 0x54(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x68(%rsp), %rax
je 0x6cae
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jge 0x6be4
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jle 0x6c0d
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jne 0x6c8b
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jge 0x6c58
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jle 0x6c89
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
jmp 0x6c8b
jmp 0x6c8d
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x6bab
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jge 0x6cd7
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jle 0x6d00
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jne 0x6d7e
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jge 0x6d4b
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rsi
callq 0x1120
cmpl $0x0, %eax
jle 0x6d7c
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
jmp 0x6d7e
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x68(%rsp), %rax
je 0x7233
movl $0x0, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x6e37
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x28(%rax), %edi
subl 0x58(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, 0x14(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x28(%rax), %edi
subl 0x58(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x6e25
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x6e27
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x6dcc
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x6eb4
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x28(%rax), %edi
subl 0x54(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x28(%rax), %edi
subl 0x54(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, %ecx
movl 0x10(%rsp), %eax
cmpl %ecx, %eax
jge 0x6ea2
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x6ea4
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x6e49
movl 0x30(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x6ecd
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movl 0x2c(%rsp), %eax
cmpl 0x30(%rsp), %eax
jge 0x6ee6
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
cmpl $0x0, 0x30(%rsp)
jne 0x6ef2
jmp 0x7212
cmpl $0x1, 0x30(%rsp)
jne 0x6f6d
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movl 0x28(%rax), %edi
subl 0x58(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, 0xc(%rsp)
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movl 0x28(%rax), %edi
subl 0x54(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jle 0x6f5e
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movslq 0x30(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1170
movq %rax, 0x20(%rsp)
movslq 0x2c(%rsp), %rdi
shlq $0x3, %rdi
callq 0x1170
movq %rax, 0x18(%rsp)
movl $0x0, 0x34(%rsp)
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x30(%rsp), %eax
jge 0x704c
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x28(%rax), %edi
subl 0x58(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x24(%rax)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x28(%rax), %edi
subl 0x58(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x38(%rsp), %rax
movl 0x24(%rax), %eax
movq 0x38(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x7037
movq 0x38(%rsp), %rdx
movq 0x20(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x7039
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x6fad
movl $0x0, 0x34(%rsp)
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x7105
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x28(%rax), %edi
subl 0x54(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x24(%rax)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x28(%rax), %edi
subl 0x54(%rsp), %edi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0xda70
movl %eax, %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x38(%rsp), %rax
movl 0x24(%rax), %eax
movq 0x38(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x70f0
movq 0x38(%rsp), %rdx
movq 0x18(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x70f2
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x7066
movq 0x20(%rsp), %rdi
movslq 0x30(%rsp), %rsi
movl $0x8, %edx
leaq -0x62b(%rip), %rcx      # 0x6af0
callq 0x1060
movq 0x18(%rsp), %rdi
movslq 0x2c(%rsp), %rsi
movl $0x8, %edx
leaq -0x646(%rip), %rcx      # 0x6af0
callq 0x1060
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x30(%rsp), %eax
jge 0x71fe
movq 0x20(%rsp), %rdi
movslq 0x34(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x18(%rsp), %rsi
movslq 0x34(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x6af0
cmpl $0x0, %eax
jge 0x71a0
movq 0x20(%rsp), %rdi
callq 0x1030
movq 0x18(%rsp), %rdi
callq 0x1030
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
movq 0x20(%rsp), %rdi
movslq 0x34(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x18(%rsp), %rsi
movslq 0x34(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x6af0
cmpl $0x0, %eax
jle 0x71ec
movq 0x20(%rsp), %rdi
callq 0x1030
movq 0x18(%rsp), %rdi
callq 0x1030
movq 0x60(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x723d
jmp 0x71ee
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x7143
movq 0x20(%rsp), %rdi
callq 0x1030
movq 0x18(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x6d9a
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw (%rax,%rax)