// File: /workspace/github_c_makefile_star2_O2/pwelke[P]GraphMiningTools/graphPrinting.c
// Function: diffGraphs
char diffGraphs(char* name, struct Graph *g, struct Graph* h) {
	int n = 300;
	int diffs = 0;
	char* s1 = malloc(n * sizeof(char));
	char* s2 = malloc(n * sizeof(char));
	int i;
	cleanString(s1,n);
	cleanString(s2,n);

	sprintf(s1, "%s has %i vertices and %i edges:\n", name, g->n, g->m);
	sprintf(s2, "%s has %i vertices and %i edges:\n", name, h->n, h->m);

	if (strcmp(s1, s2) != 0) {
		++diffs;
	}
	for (i=0; i<g->n; ++i) {
		int store1 = 0;
		int store2 = 0;
		cleanString(s1, n);
		cleanString(s2, n);
		store1 += sprintf(s1, "%i: ", i);
		if (g->vertices[i]) {
			struct VertexList *idx;
			for (idx = g->vertices[i]->neighborhood; idx; idx = idx->next) {
				store1 += sprintf(s1+store1, "%i ", idx->endPoint->number);	
			}
		}
			store2 += sprintf(s2, "%i: ", i);
		if (h->vertices[i]) {
			struct VertexList *idx;
			for (idx = h->vertices[i]->neighborhood; idx; idx = idx->next) {
				store2 += sprintf(s2+store2, "%i ", idx->endPoint->number);	
			}
		}
		if (strcmp(s1, s2) != 0) {
			printf("%s", s1);
			printf("\n");
			printf("%s", s2);
			printf("\n\n");
			++diffs;
		}
	}
	free(s1);
	free(s2);

	if (diffs > 0) {
		printf("%s has %i vertices and %i edges:\n", name, g->n, g->m);
		printf("%s has %i vertices and %i edges:\n", name, h->n, h->m);
	}
	fflush(stdout);
	return diffs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %rbp
movq %rdi, %r14
movl $0x12c, %edi            # imm = 0x12C
callq 0x1180
movq %rax, %r12
movl $0x12c, %edi            # imm = 0x12C
callq 0x1180
movq %rax, %r13
movq %r12, %rdi
movl $0x12c, %esi            # imm = 0x12C
callq 0x6bf6
movq %r13, %rdi
movl $0x12c, %esi            # imm = 0x12C
callq 0x6bf6
movl (%rbp), %ecx
movl 0x4(%rbp), %r8d
leaq 0x16714(%rip), %rbx     # 0x1d379
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1200
movl (%r15), %ecx
movq %r15, 0x18(%rsp)
movl 0x4(%r15), %r8d
movq %rbp, %r15
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, 0x20(%rsp)
movq %r14, %rdx
xorl %eax, %eax
callq 0x1200
movq %r12, %rdi
movq %r13, %rsi
callq 0x1130
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, 0xc(%rsp)
leaq 0x172c3(%rip), %r14     # 0x1df79
xorl %ebx, %ebx
movq %rbp, 0x10(%rsp)
movslq (%r15), %rbp
cmpq %rbp, %rbx
jge 0x6dcd
movq %r12, %rdi
movl $0x12c, %esi            # imm = 0x12C
callq 0x6bf6
movq %r13, %rdi
movl $0x12c, %esi            # imm = 0x12C
callq 0x6bf6
movq %r12, %rdi
leaq 0x16687(%rip), %rsi     # 0x1d374
movl %ebx, %edx
xorl %eax, %eax
callq 0x1200
movl %eax, %ebp
movq 0x10(%r15), %rax
movq (%rax,%rbx,8), %r15
testq %r15, %r15
jne 0x6d21
jmp 0x6d2a
movslq %ebp, %rbp
leaq (%r12,%rbp), %rdi
movq 0x18(%r15), %rax
movl 0x18(%rax), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x1200
addl %eax, %ebp
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x6d07
movq %r13, %rdi
leaq 0x16640(%rip), %rsi     # 0x1d374
movl %ebx, %edx
xorl %eax, %eax
callq 0x1200
movl %eax, %ebp
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %r15
testq %r15, %r15
jne 0x6d6f
jmp 0x6d78
movslq %ebp, %rbp
movq %r13, %rdi
addq %rbp, %rdi
movq 0x18(%r15), %rax
movl 0x18(%rax), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x1200
addl %eax, %ebp
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x6d53
movq %r12, %rdi
movq %r13, %rsi
callq 0x1130
testl %eax, %eax
je 0x6dc0
leaq 0x1660d(%rip), %r15     # 0x1d39b
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x10b0
pushq $0xa
popq %rdi
callq 0x1040
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x10b0
leaq 0x16a94(%rip), %rdi     # 0x1d84b
callq 0x1070
incl 0xc(%rsp)
movq 0x10(%rsp), %r15
incq %rbx
jmp 0x6cbd
movq %r12, %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1030
movl 0xc(%rsp), %r12d
testl %r12d, %r12d
jle 0x6e1d
movl 0x4(%r15), %ecx
leaq 0x16587(%rip), %rbx     # 0x1d379
movq %rbx, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10b0
movq 0x18(%rsp), %rax
movl (%rax), %edx
movl 0x4(%rax), %ecx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x10b0
movq 0x231a4(%rip), %rax     # 0x29fc8
movq (%rax), %rdi
callq 0x1190
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq