// File: /workspace/github_cpp_makefile_star2_O1/jkeys-ecg-nmsu[P]graph-with-search-algorithms/Kruskal.cpp
// Function: Kruskal_MST_cclabels(Graph&)
Graph Kruskal_MST_cclabels ( Graph & g) {	
	Graph r(g.num_nodes() + 1);
	r.copyNodes(g);
	r.copyEdges(g);
	r.reset();
		
	make_set_cc(g);
	
	vector<Edge> E = get_all_edges(g);
	
	// make_edge_heap(E);
	
	sort(E.begin(), E.end(), edge_heap_comp);
	
	// while(!E.empty()) {
	for(int i = 0; i != E.size(); i++) {
		// Edge e = cheapest_edge(E); //get cheapest edge and pop
		Edge e = E.at(i);
		Node u = g.getNode(e.u_id());
		Node v = g.getNode(e.v_id());
		
		if(!same_set_cc(g, u, v)) {
			// cerr << "in cc, sets are disjoint, edge: ";
			// e.print(r);
			
			r.pushEdge(e);			
			union_set_cc(g, u, v);
		}
		
		
	}
	
	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4e30
leal 0x1(%rax), %esi
movq %rbx, %rdi
callq 0x30aa
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x555a
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x55a8
movq -0x30(%rbp), %rdi
callq 0x549a
movq %r14, %rdi
callq 0xc61b
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0xc740
movq -0x50(%rbp), %rbx
movq -0x48(%rbp), %r15
cmpq %r15, %rbx
je 0xd154
movq %r15, %rax
subq %rbx, %rax
sarq $0x4, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0xcef(%rip), %rcx      # 0xc448
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdf01
leaq -0xd01(%rip), %rdx      # 0xc448
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdfd4
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
subq %rdi, %rdx
je 0xd5f8
movq %r14, -0x38(%rbp)
sarq $0x4, %rdx
leaq -0x150(%rbp), %r15
leaq -0x350(%rbp), %rbx
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpq %r12, %rdx
jbe 0xd618
movups (%rdi,%r14), %xmm0
movaps %xmm0, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7c34
movslq %eax, %rsi
movq -0x38(%rbp), %rdi
callq 0x3f6c
movq %rax, %r13
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x2bfe
movups 0x20(%r13), %xmm0
movups 0x30(%r13), %xmm1
movups 0x40(%r13), %xmm2
movups 0x50(%r13), %xmm3
leaq -0xd0(%rbp), %rax
movups %xmm3, 0x40(%rax)
movups %xmm2, 0x30(%rax)
movups %xmm1, 0x20(%rax)
movups %xmm0, 0x10(%rax)
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x60(%r13), %rsi
movq 0x68(%r13), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x2bfe
leaq -0x60(%rbp), %rdi
callq 0x7c3c
movslq %eax, %rsi
movq -0x38(%rbp), %rdi
callq 0x3f6c
movq %rax, %r13
movq %r15, -0x160(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x2bfe
movups 0x20(%r13), %xmm0
movups 0x30(%r13), %xmm1
movups 0x40(%r13), %xmm2
movups 0x50(%r13), %xmm3
movups %xmm3, 0x40(%r15)
movups %xmm2, 0x30(%r15)
movups %xmm1, 0x20(%r15)
movups %xmm0, 0x10(%r15)
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq 0x60(%r13), %rsi
movq 0x68(%r13), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x2bfe
leaq -0x250(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x260(%rbp), %rdi
callq 0x2bfe
leaq -0xd0(%rbp), %rax
movups 0x10(%rax), %xmm0
movups 0x20(%rax), %xmm1
movups 0x30(%rax), %xmm2
movups 0x40(%rax), %xmm3
leaq -0x250(%rbp), %rax
movups %xmm3, 0x40(%rax)
movups %xmm2, 0x30(%rax)
movups %xmm1, 0x20(%rax)
movups %xmm0, 0x10(%rax)
leaq -0x1f0(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x200(%rbp), %rdi
callq 0x2bfe
leaq -0x2d0(%rbp), %r13
movq %r13, -0x2e0(%rbp)
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
addq %rsi, %rdx
leaq -0x2e0(%rbp), %rdi
callq 0x2bfe
movups 0x10(%r15), %xmm0
movups 0x20(%r15), %xmm1
movups 0x30(%r15), %xmm2
movups 0x40(%r15), %xmm3
movups %xmm3, 0x40(%r13)
movups %xmm2, 0x30(%r13)
movups %xmm1, 0x20(%r13)
movups %xmm0, 0x10(%r13)
leaq -0x270(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x280(%rbp), %rdi
callq 0x2bfe
movq -0x38(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0x2e0(%rbp), %rdx
callq 0xc8a5
movl %eax, %r13d
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0xd3c7
callq 0x21f0
movq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
cmpq %rax, %rdi
je 0xd3df
callq 0x21f0
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0xd3f7
callq 0x21f0
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xd40f
callq 0x21f0
testb %r13b, %r13b
jne 0xd586
movq -0x30(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4ce4
leaq -0x1d0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e0(%rbp), %rdi
callq 0x2bfe
leaq -0xd0(%rbp), %rax
movups 0x10(%rax), %xmm0
movups 0x20(%rax), %xmm1
movups 0x30(%rax), %xmm2
movups 0x40(%rax), %xmm3
leaq -0x1d0(%rbp), %rax
movups %xmm3, 0x40(%rax)
movups %xmm2, 0x30(%rax)
movups %xmm1, 0x20(%rax)
movups %xmm0, 0x10(%rax)
leaq -0x170(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x180(%rbp), %rdi
callq 0x2bfe
movq %rbx, -0x360(%rbp)
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
addq %rsi, %rdx
leaq -0x360(%rbp), %rdi
callq 0x2bfe
movups 0x10(%r15), %xmm0
movups 0x20(%r15), %xmm1
movups 0x30(%r15), %xmm2
movups 0x40(%r15), %xmm3
movups %xmm3, 0x40(%rbx)
movups %xmm2, 0x30(%rbx)
movups %xmm1, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
leaq -0x2f0(%rbp), %rax
movq %rax, -0x300(%rbp)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x300(%rbp), %rdi
callq 0x2bfe
movq -0x38(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
leaq -0x360(%rbp), %rdx
callq 0xca96
movq -0x300(%rbp), %rdi
leaq -0x2f0(%rbp), %rax
cmpq %rax, %rdi
je 0xd545
callq 0x21f0
movq -0x360(%rbp), %rdi
cmpq %rbx, %rdi
je 0xd556
callq 0x21f0
movq -0x180(%rbp), %rdi
leaq -0x170(%rbp), %rax
cmpq %rax, %rdi
je 0xd56e
callq 0x21f0
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0xd586
callq 0x21f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xd59e
callq 0x21f0
movq -0x160(%rbp), %rdi
cmpq %r15, %rdi
je 0xd5af
callq 0x21f0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xd5c1
callq 0x21f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xd5d9
callq 0x21f0
incq %r12
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
subq %rdi, %rdx
sarq $0x4, %rdx
addq $0x10, %r14
cmpq %rdx, %r12
jne 0xd181
testq %rdi, %rdi
je 0xd602
callq 0x21f0
movq -0x30(%rbp), %rax
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d37(%rip), %rdi      # 0xf356
movq %r12, %rsi
xorl %eax, %eax
callq 0x22f0
jmp 0xd630
jmp 0xd73e
movq %rax, %r14
jmp 0xd74f
movq %rax, %r14
jmp 0xd675
movq %rax, %r14
leaq -0x360(%rbp), %rdi
callq 0x2b90
jmp 0xd675
movq %rax, %r14
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
jmp 0xd6d1
movq %rax, %r14
movq -0x360(%rbp), %rdi
cmpq %rbx, %rdi
je 0xd675
callq 0x21f0
leaq -0x1e0(%rbp), %rdi
jmp 0xd715
jmp 0xd73e
movq %rax, %r14
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0xd741
callq 0x21f0
jmp 0xd741
movq %rax, %r14
movq -0x160(%rbp), %rdi
cmpq %r15, %rdi
je 0xd730
callq 0x21f0
jmp 0xd730
movq %rax, %r14
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xd71f
callq 0x21f0
jmp 0xd71f
movq %rax, %r14
jmp 0xd70e
movq %rax, %r14
movq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
cmpq %rax, %rdi
je 0xd70e
callq 0x21f0
jmp 0xd70e
movq %rax, %r14
leaq -0x2e0(%rbp), %rdi
callq 0x2b90
leaq -0x260(%rbp), %rdi
callq 0x2b90
jmp 0xd71f
movq %rax, %r14
leaq -0x160(%rbp), %rdi
callq 0x2b90
jmp 0xd730
movq %rax, %r14
leaq -0xe0(%rbp), %rdi
callq 0x2b90
jmp 0xd741
movq %rax, %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xd74f
callq 0x21f0
movq -0x30(%rbp), %rdi
callq 0x2bc6
movq %r14, %rdi
callq 0x2380