// File: jkeys-ecg-nmsu[P]graph-with-search-algorithms/Debug.cpp
// Function: testall()
bool testall() {	
	Graph g;
	g.scan_undirected("in_test_1.txt");
	g.save("out_test_1.txt");
	
	Graph g_new = Kruskal_MST_cclabels ( g);

	std::cerr << g << endl << endl;	
		
	std::cerr << "g1 cc: " << endl;
	printMST(g, g_new.get_MST());
	
	vector<Edge> pc1 = { Edge(3, 4, 1), Edge(2, 3, 2), Edge(1, 2, 3), Edge(0, 1, 4) };
	if(!g_new.sameEdges(pc1)) 
		return false;

	g_new = Kruskal_MST_djsets ( g);
	std::cerr << "g1 djset: " << endl;	
	
	printMST(g, g_new.get_MST());
	
	if(!g_new.sameEdges(pc1)) 
		return false;	
	
	/*******************************************************/
	
	// g.scan_undirected("in_test_2.txt");
	// g.save("out_test_2.txt");

	// g_new = Kruskal_MST_cclabels ( g);

	 // std::cerr << g << endl << endl;	
		
	// std::cerr << "g2 cc: " << endl;
	// printMST(g, g_new.get_MST());
	
	// vector<Edge> pc2 = { Edge(2, 5, -5), Edge(1, 4, -3), Edge(0,1,-1), Edge(1,3,1), Edge(0,2,2), Edge(8,7, 3), Edge(5,8,4), Edge(2,5,5), Edge(7,8,6) };
	// if(!g_new.sameEdges(pc2)) 
		// return false;

	// g_new = Kruskal_MST_djsets ( g);
	// std::cerr << "g2 djset: " << endl;	
	
	// printMST(g, g_new.get_MST());
	
	// if(!g_new.sameEdges(pc2)) 
		// return false;		
	
	/*******************************************************/

 	/* g.scan("in_test_3.txt");	
	g.save("out_test_3.txt");
	
	std::cerr << g << endl << endl;	
	std::cerr << "g3 list: " << endl;	
	Node n3 = g.getNode(0);
	Dijkstra_list(g, n3);

	printDist(g);	
	
	vector<int> pc3 = { 0, 3, 6, 9, 12, 15 };
	if(!g.sameDistances(pc3)) 
		return false;

	std::cerr << g << endl << endl;	
	std::cerr << "g3 heap: " << endl;	
	n3 = g.getNode(0);
	Dijkstra_heap(g, n3);

	printDist(g);	
	
	if(!g.sameDistances(pc3)) 
		return false; */
	
	/*******************************************************/
	
/* 	g.scan("in_test_4.txt");	
	g.save("out_test_4.txt");
	
	std::cerr << g << endl << endl;	
	std::cerr << "g4 list: " << endl;	
	Node n4 = g.getNode(0);
	Dijkstra_list(g, n4);

	printDist(g);	
	
	vector<int> pc4 = { 0, 4, 8, 12, 8, 12, 12, 16, 16 };
	if(!g.sameDistances(pc4)) 
		return false;
	
	std::cerr << g << endl << endl;	
	std::cerr << "g4 heap: " << endl;	
	n4 = g.getNode(0);
	Dijkstra_heap(g, n4);

	printDist(g);	
	
	if(!g.sameDistances(pc4)) 
		return false; */
	
	/*******************************************************/
	
	// g.scan("in_test_5.txt");	
	// g.save("out_test_5.txt");
	
	// std::cerr << g << endl << endl;	
	// std::cerr << "g5 list: " << endl;	
	// Node n5 = g.getNode(0);
	// Dijkstra_list(g, n5);

	// printDist(g);	
	
	// vector<int> pc5 = { 0, 5, 10, 10, 10, 15, 15, 20, 25, 30, 20, 25 };
	// if(!g.sameDistances(pc5)) 
		// return false;  
	
	// std::cerr << g << endl << endl;	
	// std::cerr << "g5 heap: " << endl;	
	// n5 = g.getNode(0);
	// Dijkstra_heap(g, n5);

	// printDist(g);		
	
	// if(!g.sameDistances(pc5)) 
		// return false;  
	
	/*******************************************************/
	
	return true;	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
leaq -0x78(%rbp), %rdi
callq 0x3b90
leaq -0x99(%rbp), %rdi
movq %rdi, -0x298(%rbp)
callq 0x23f0
movq -0x298(%rbp), %rdx
leaq 0x979b(%rip), %rsi      # 0x1a380
leaq -0x98(%rbp), %rdi
callq 0x2310
jmp 0x10bf3
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x46e0
jmp 0x10c05
leaq -0x98(%rbp), %rdi
callq 0x2170
leaq -0x99(%rbp), %rdi
callq 0x2290
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x23f0
movq -0x2a0(%rbp), %rdx
leaq 0x9750(%rip), %rsi      # 0x1a38e
leaq -0xd0(%rbp), %rdi
callq 0x2310
jmp 0x10c4c
leaq -0x78(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x6cb0
jmp 0x10c5e
leaq -0xd0(%rbp), %rdi
callq 0x2170
leaq -0xd1(%rbp), %rdi
callq 0x2290
leaq -0x148(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x175d0
jmp 0x10c88
movq 0x16361(%rip), %rdi     # 0x26ff0
leaq -0x78(%rbp), %rsi
callq 0x7430
movq %rax, -0x2a8(%rbp)
jmp 0x10ca1
movq -0x2a8(%rbp), %rdi
movq 0x16311(%rip), %rsi     # 0x26fc0
callq 0x2280
movq %rax, -0x2b0(%rbp)
jmp 0x10cbd
movq -0x2b0(%rbp), %rdi
movq 0x162f5(%rip), %rsi     # 0x26fc0
callq 0x2280
jmp 0x10cd2
movq 0x16317(%rip), %rdi     # 0x26ff0
leaq 0x96bd(%rip), %rsi      # 0x1a39d
callq 0x2240
movq %rax, -0x2b8(%rbp)
jmp 0x10cee
movq -0x2b8(%rbp), %rdi
movq 0x162c4(%rip), %rsi     # 0x26fc0
callq 0x2280
jmp 0x10d03
leaq -0x148(%rbp), %rdi
callq 0x6410
movq %rax, -0x2c0(%rbp)
jmp 0x10d18
movq -0x2c0(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x11e20
jmp 0x10d2d
leaq -0x78(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x11190
jmp 0x10d3f
leaq -0x160(%rbp), %rdi
callq 0x2c50
leaq -0x1c8(%rbp), %rdi
movl $0x3, %esi
movl $0x4, %edx
movsd 0x92ec(%rip), %xmm0     # 0x1a050
callq 0xee90
jmp 0x10d6b
leaq -0x1b8(%rbp), %rdi
movl $0x2, %esi
movl $0x3, %edx
movsd 0x92c4(%rip), %xmm0     # 0x1a048
callq 0xee90
jmp 0x10d8b
leaq -0x1a8(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
movsd 0x95cc(%rip), %xmm0     # 0x1a370
callq 0xee90
jmp 0x10dab
leaq -0x198(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
movsd 0x95b7(%rip), %xmm0     # 0x1a378
callq 0xee90
jmp 0x10dc8
leaq -0x1c8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq $0x4, -0x180(%rbp)
leaq -0x1c9(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x8cc0
movq -0x2c8(%rbp), %rcx
movq -0x188(%rbp), %rsi
movq -0x180(%rbp), %rdx
leaq -0x178(%rbp), %rdi
callq 0x11f10
jmp 0x10e17
leaq -0x1c9(%rbp), %rdi
callq 0x2f60
leaq -0x1e8(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x11e20
jmp 0x10e38
leaq -0x148(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x6520
movb %al, -0x2c9(%rbp)
jmp 0x10e53
movb -0x2c9(%rbp), %al
xorb $-0x1, %al
movb %al, -0x2ca(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x2c50
movb -0x2ca(%rbp), %al
testb $0x1, %al
jne 0x10e7c
jmp 0x10fc3
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1ec(%rbp)
jmp 0x11128
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x10ec1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x2170
leaq -0x99(%rbp), %rdi
callq 0x2290
jmp 0x1116f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x10f04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x2170
leaq -0xd1(%rbp), %rdi
callq 0x2290
jmp 0x1116f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x1116f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x11163
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x2c50
jmp 0x11163
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x1c9(%rbp), %rdi
callq 0x2f60
jmp 0x11163
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x11157
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x2c50
jmp 0x11157
leaq -0x260(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x179d0
jmp 0x10fd5
leaq -0x148(%rbp), %rdi
leaq -0x260(%rbp), %rsi
movq %rsi, -0x2e0(%rbp)
callq 0x11f90
movq -0x2e0(%rbp), %rdi
callq 0x2c00
movq 0x15fee(%rip), %rdi     # 0x26ff0
leaq 0x939c(%rip), %rsi      # 0x1a3a5
callq 0x2240
movq %rax, -0x2d8(%rbp)
jmp 0x11017
movq -0x2d8(%rbp), %rdi
movq 0x15f9b(%rip), %rsi     # 0x26fc0
callq 0x2280
jmp 0x1102c
leaq -0x148(%rbp), %rdi
callq 0x6410
movq %rax, -0x2e8(%rbp)
jmp 0x11041
movq -0x2e8(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x11e20
jmp 0x11056
leaq -0x78(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x11190
jmp 0x11068
leaq -0x278(%rbp), %rdi
callq 0x2c50
leaq -0x290(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x11e20
jmp 0x11089
leaq -0x148(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x6520
movb %al, -0x2e9(%rbp)
jmp 0x110a4
movb -0x2e9(%rbp), %al
xorb $-0x1, %al
movb %al, -0x2ea(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x2c50
movb -0x2ea(%rbp), %al
testb $0x1, %al
jne 0x110ca
jmp 0x1111a
movb $0x0, -0x1(%rbp)
movl $0x1, -0x1ec(%rbp)
jmp 0x11128
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x2c50
jmp 0x11157
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x2c50
jmp 0x11157
movb $0x1, -0x1(%rbp)
movl $0x1, -0x1ec(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x2c50
leaq -0x148(%rbp), %rdi
callq 0x2c00
leaq -0x78(%rbp), %rdi
callq 0x2c00
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
leaq -0x178(%rbp), %rdi
callq 0x2c50
leaq -0x148(%rbp), %rdi
callq 0x2c00
leaq -0x78(%rbp), %rdi
callq 0x2c00
movq -0xa8(%rbp), %rdi
callq 0x23e0
nopw %cs:(%rax,%rax)