// File: /workspace/github_c_makefile_star2_O0/Mithreindeir[P]ewcc/src/main.c
// Function: test_graph
void test_graph()
{
	int num = 10;
	/*Set up basic graph to color*/
	struct vertex **graph = calloc(num, sizeof(struct vertex*));
	for (int i = 0; i < num; i++) {
		graph[i] = vertex_init();
		graph[i]->ocolor = i;
	}
	/*b c d e f g h j k m*/
	/*0 1 2 3 4 5 6 7 8 9*/
	/*m f e j b k g h d c*/
	/*
Vertex b: color 1: good
Vertex c: color 2: good
Vertex d: color 1: good
Vertex e: color 2: good
Vertex f: color 1: good
Vertex g: color 1: good
Vertex h: color 2: good
Vertex j: color 0: good
Vertex k: color 2: good
Vertex m: color 0: good

	 *
	 * */

	add_edge(graph[0], graph[1]);
	add_edge(graph[0], graph[3]);
	add_edge(graph[0], graph[8]);
	add_edge(graph[0], graph[9]);

	add_edge(graph[1], graph[9]);

	add_edge(graph[2], graph[8]);
	add_edge(graph[2], graph[9]);

	add_edge(graph[3], graph[9]);
	add_edge(graph[3], graph[4]);
	add_edge(graph[3], graph[7]);

	add_edge(graph[4], graph[7]);
	add_edge(graph[4], graph[9]);

	add_edge(graph[5], graph[8]);
	add_edge(graph[5], graph[6]);
	add_edge(graph[5], graph[7]);

	add_edge(graph[6], graph[7]);

	add_edge(graph[7], graph[8]);

	color_graph(graph, num, 3);

	for (int i = 0; i < num; i++)
		printf("Node %d: color %d\n", i, graph[i]->color);

	for (int i = 0; i < num; i++) vertex_free(graph[i]);
	free(graph);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0xa, -0x4(%rbp)
movslq -0x4(%rbp), %rdi
movl $0x8, %esi
callq 0x2090
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x4262
movb $0x0, %al
callq 0x52a0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, (%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4228
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x5300
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %esi
movl $0x3, %edx
callq 0x5640
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x440e
movl -0x18(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x4(%rax), %edx
leaq 0x7e95(%rip), %rdi      # 0xc291
movb $0x0, %al
callq 0x2060
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x43db
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x4439
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x53c0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4415
movq -0x10(%rbp), %rdi
callq 0x2030
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)