// File: /workspace/github_cpp_makefile_star2_O3/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 0x4e6e
leal 0x1(%rax), %esi
movq %rbx, %rdi
callq 0x30e8
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x559e
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x55ec
movq -0x30(%rbp), %rdi
callq 0x54de
movq %r14, %rdi
callq 0xc690
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0xc7b5
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %rbx
cmpq %rbx, %r15
je 0xd681
movq %rbx, %rax
subq %r15, %rax
sarq $0x4, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0xd19(%rip), %rcx      # 0xc4b4
movq %r15, %rdi
movq %rbx, %rsi
callq 0xdf6e
leaq -0xd2b(%rip), %rdx      # 0xc4b4
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe041
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %rdx
subq %r15, %rdx
je 0xd681
movq %r14, -0x38(%rbp)
sarq $0x4, %rdx
leaq -0x150(%rbp), %rbx
leaq -0xd0(%rbp), %r12
xorl %r14d, %r14d
xorl %r13d, %r13d
cmpq %r13, %rdx
jbe 0xd6a4
movups (%r15,%r14), %xmm0
movaps %xmm0, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7cb4
movslq %eax, %rsi
movq -0x38(%rbp), %rdi
callq 0x3faa
movq %rax, %r15
movq %rbx, -0x160(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x2c2e
movups 0x20(%r15), %xmm0
movups 0x30(%r15), %xmm1
movups 0x40(%r15), %xmm2
movups 0x50(%r15), %xmm3
movups %xmm3, 0x40(%rbx)
movups %xmm2, 0x30(%rbx)
movups %xmm1, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq 0x60(%r15), %rsi
movq 0x68(%r15), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x2c2e
leaq -0x60(%rbp), %rdi
callq 0x7cbc
movslq %eax, %rsi
movq -0x38(%rbp), %rdi
callq 0x3faa
movq %rax, %r15
movq %r12, -0xe0(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x2c2e
movups 0x20(%r15), %xmm0
movups 0x30(%r15), %xmm1
movups 0x40(%r15), %xmm2
movups 0x50(%r15), %xmm3
movups %xmm3, 0x40(%r12)
movups %xmm2, 0x30(%r12)
movups %xmm1, 0x20(%r12)
movups %xmm0, 0x10(%r12)
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x60(%r15), %rsi
movq 0x68(%r15), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x2c2e
leaq -0x250(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
addq %rsi, %rdx
leaq -0x260(%rbp), %rdi
callq 0x2c2e
movups 0x10(%rbx), %xmm0
movups 0x20(%rbx), %xmm1
movups 0x30(%rbx), %xmm2
movups 0x40(%rbx), %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 -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x200(%rbp), %rdi
callq 0x2c2e
leaq -0x2d0(%rbp), %r15
movq %r15, -0x2e0(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x2e0(%rbp), %rdi
callq 0x2c2e
movups 0x10(%r12), %xmm0
movups 0x20(%r12), %xmm1
movups 0x30(%r12), %xmm2
movups 0x40(%r12), %xmm3
movups %xmm3, 0x40(%r15)
movups %xmm2, 0x30(%r15)
movups %xmm1, 0x20(%r15)
movups %xmm0, 0x10(%r15)
leaq -0x270(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x280(%rbp), %rdi
callq 0x2c2e
movq -0x38(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0x2e0(%rbp), %rdx
callq 0xc937
movl %eax, %r15d
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0xd44f
callq 0x21f0
movq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
cmpq %rax, %rdi
je 0xd467
callq 0x21f0
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0xd47f
callq 0x21f0
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xd497
callq 0x21f0
testb %r15b, %r15b
leaq -0x350(%rbp), %r15
jne 0xd616
movq -0x30(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4d22
leaq -0x1d0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e0(%rbp), %rdi
callq 0x2c2e
movups 0x10(%rbx), %xmm0
movups 0x20(%rbx), %xmm1
movups 0x30(%rbx), %xmm2
movups 0x40(%rbx), %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 -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x180(%rbp), %rdi
callq 0x2c2e
movq %r15, -0x360(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x360(%rbp), %rdi
callq 0x2c2e
movups 0x10(%r12), %xmm0
movups 0x20(%r12), %xmm1
movups 0x30(%r12), %xmm2
movups 0x40(%r12), %xmm3
movups %xmm3, 0x40(%r15)
movups %xmm2, 0x30(%r15)
movups %xmm1, 0x20(%r15)
movups %xmm0, 0x10(%r15)
leaq -0x2f0(%rbp), %rax
movq %rax, -0x300(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x300(%rbp), %rdi
callq 0x2c2e
movq -0x38(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
leaq -0x360(%rbp), %rdx
callq 0xcb28
movq -0x300(%rbp), %rdi
leaq -0x2f0(%rbp), %rax
cmpq %rax, %rdi
je 0xd5d5
callq 0x21f0
movq -0x360(%rbp), %rdi
cmpq %r15, %rdi
je 0xd5e6
callq 0x21f0
movq -0x180(%rbp), %rdi
leaq -0x170(%rbp), %rax
cmpq %rax, %rdi
je 0xd5fe
callq 0x21f0
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0xd616
callq 0x21f0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xd628
callq 0x21f0
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0xd639
callq 0x21f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xd651
callq 0x21f0
movq -0x160(%rbp), %rdi
cmpq %rbx, %rdi
je 0xd662
callq 0x21f0
incq %r13
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %rdx
subq %r15, %rdx
sarq $0x4, %rdx
addq $0x10, %r14
cmpq %rdx, %r13
jne 0xd217
testq %r15, %r15
je 0xd68e
movq %r15, %rdi
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 0x1cab(%rip), %rdi      # 0xf356
movq %r13, %rsi
xorl %eax, %eax
callq 0x22f0
jmp 0xd6bc
jmp 0xd7c3
movq %rax, %r14
jmp 0xd7d4
movq %rax, %r14
jmp 0xd701
movq %rax, %r14
leaq -0x360(%rbp), %rdi
callq 0x2bc0
jmp 0xd701
movq %rax, %r14
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
jmp 0xd756
movq %rax, %r14
movq -0x360(%rbp), %rdi
cmpq %r15, %rdi
je 0xd701
callq 0x21f0
leaq -0x1e0(%rbp), %rdi
jmp 0xd79a
jmp 0xd7c3
movq %rax, %r14
movq -0x160(%rbp), %rdi
cmpq %rbx, %rdi
je 0xd7c6
callq 0x21f0
jmp 0xd7c6
movq %rax, %r14
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0xd7b5
callq 0x21f0
jmp 0xd7b5
movq %rax, %r14
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0xd7a4
callq 0x21f0
jmp 0xd7a4
movq %rax, %r14
jmp 0xd793
movq %rax, %r14
movq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
cmpq %rax, %rdi
je 0xd793
callq 0x21f0
jmp 0xd793
movq %rax, %r14
leaq -0x2e0(%rbp), %rdi
callq 0x2bc0
leaq -0x260(%rbp), %rdi
callq 0x2bc0
jmp 0xd7a4
movq %rax, %r14
leaq -0xe0(%rbp), %rdi
callq 0x2bc0
jmp 0xd7b5
movq %rax, %r14
leaq -0x160(%rbp), %rdi
callq 0x2bc0
jmp 0xd7c6
movq %rax, %r14
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xd7d4
callq 0x21f0
movq -0x30(%rbp), %rdi
callq 0x2bf6
movq %r14, %rdi
callq 0x2380