// File: /workspace/github_c_makefile_star2_O1/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 0x1190
movq %rax, %r12
movl $0x12c, %edi            # imm = 0x12C
callq 0x1190
movq %rax, %r13
movl $0x12c, %edx            # imm = 0x12C
movq %r12, %rdi
xorl %esi, %esi
callq 0x10d0
movl $0x12c, %edx            # imm = 0x12C
movq %r13, %rdi
xorl %esi, %esi
callq 0x10d0
movl (%rbp), %ecx
movl 0x4(%rbp), %r8d
leaq 0x1742c(%rip), %rbx     # 0x20379
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1210
movl (%r15), %ecx
movq %r15, 0x18(%rsp)
movl 0x4(%r15), %r8d
movq %rbp, %r15
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1210
movq %r12, %rdi
movq %r13, %rsi
callq 0x1140
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, 0xc(%rsp)
movl (%rbp), %ebp
testl %ebp, %ebp
jle 0x90ce
movq %r14, 0x20(%rsp)
leaq 0x18000(%rip), %r14     # 0x20fa9
xorl %ebx, %ebx
movq %r15, 0x10(%rsp)
movl $0x12c, %edx            # imm = 0x12C
movq %r12, %rdi
xorl %esi, %esi
callq 0x10d0
movl $0x12c, %edx            # imm = 0x12C
movq %r13, %rdi
xorl %esi, %esi
callq 0x10d0
movq %r12, %rdi
leaq 0x1739c(%rip), %rsi     # 0x20374
movl %ebx, %edx
xorl %eax, %eax
callq 0x1210
movl %eax, %ebp
movq 0x10(%r15), %rax
movq (%rax,%rbx,8), %rax
testq %rax, %rax
je 0x9019
movq 0x8(%rax), %r15
testq %r15, %r15
je 0x9019
movslq %ebp, %rbp
leaq (%r12,%rbp), %rdi
movq 0x18(%r15), %rax
movl 0x18(%rax), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x1210
addl %eax, %ebp
movq 0x8(%r15), %r15
jmp 0x8ff4
movq %r13, %rdi
leaq 0x17351(%rip), %rsi     # 0x20374
movl %ebx, %edx
xorl %eax, %eax
callq 0x1210
movl %eax, %ebp
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rbx,8), %rax
testq %rax, %rax
je 0x906b
movq 0x8(%rax), %r15
testq %r15, %r15
je 0x906b
movslq %ebp, %rbp
movq %r13, %rdi
addq %rbp, %rdi
movq 0x18(%r15), %rax
movl 0x18(%rax), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x1210
addl %eax, %ebp
movq 0x8(%r15), %r15
jmp 0x9044
movq %r12, %rdi
movq %r13, %rsi
callq 0x1140
testl %eax, %eax
je 0x90b5
leaq 0x1731a(%rip), %r15     # 0x2039b
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x10b0
movl $0xa, %edi
callq 0x1040
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x10b0
leaq 0x177d4(%rip), %rdi     # 0x20880
callq 0x1070
incl 0xc(%rsp)
movq 0x10(%rsp), %r15
incq %rbx
movslq (%r15), %rbp
cmpq %rbp, %rbx
jl 0x8fb0
movq 0x20(%rsp), %r14
movq %r12, %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1030
movl 0xc(%rsp), %r12d
testl %r12d, %r12d
jle 0x9119
movl 0x4(%r15), %ecx
leaq 0x17286(%rip), %rbx     # 0x20379
movq %rbx, %rdi
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 0x23ea8(%rip), %rax     # 0x2cfc8
movq (%rax), %rdi
callq 0x11a0
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq