// File: /workspace/github_cpp_makefile_star2_O2/Ripser[P]ripser/ripser.cpp
// Function: ripser<sparse_distance_matrix>::compute_dim_0_pairs(std::vector<std::pair<float, long>, std::allocator<std::pair<float, long>>>&, std::vector<std::pair<float, long>, std::allocator<std::pair<float, long>>>&)
void compute_dim_0_pairs(std::vector<diameter_index_t>& edges,
	                         std::vector<diameter_index_t>& columns_to_reduce) {
#ifdef PRINT_PERSISTENCE_PAIRS
		std::cout << "persistence intervals in dim 0:" << std::endl;
#endif

		union_find dset(n);

		edges = get_edges();
		std::sort(edges.rbegin(), edges.rend(),
		          greater_diameter_or_smaller_index<diameter_index_t>);
		std::vector<index_t> vertices_of_edge(2);
		for (auto e : edges) {
			get_simplex_vertices(get_index(e), 1, n, vertices_of_edge.rbegin());
			index_t u = dset.find(vertices_of_edge[0]), v = dset.find(vertices_of_edge[1]);

			if (u != v) {
#ifdef PRINT_PERSISTENCE_PAIRS
				if (get_diameter(e) != 0)
					std::cout << " [0," << get_diameter(e) << ")" << std::endl;
#endif
				dset.link(u, v);
			} else if ((dim_max > 0) && (get_index(get_zero_apparent_cofacet(e, 1)) == -1))
				columns_to_reduce.push_back(e);
		}
		if (dim_max > 0) std::reverse(columns_to_reduce.begin(), columns_to_reduce.end());

#ifdef PRINT_PERSISTENCE_PAIRS
		for (index_t i = 0; i < n; ++i)
			if (dset.find(i) == i) std::cout << " [0, )" << std::endl;
#endif
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, 0x18(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq 0xca85(%rip), %rdi      # 0x12fb8
leaq 0x60ee(%rip), %rsi      # 0xc628
callq 0x21f0
movq %rax, %rdi
callq 0x20e0
movq 0x20(%rbx), %rsi
leaq 0x58(%rsp), %rdi
callq 0x6c9c
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x28ae
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x6fa2
movq %r15, %rdi
callq 0x5006
movq 0x8(%r14), %rax
leaq 0x50(%rsp), %rdi
movq %rax, (%rdi)
movq (%r14), %rax
leaq 0x48(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x78a(%rip), %rdx       # 0x6d22
callq 0x6cfe
leaq 0x20(%rsp), %rdi
pushq $0x2
popq %rsi
movq %rsp, %rdx
callq 0x3dea
movq (%r14), %r13
movq 0x8(%r14), %r12
leaq 0x58(%rsp), %rbp
cmpq %r12, %r13
je 0x66b2
movups (%r13), %xmm0
movaps %xmm0, (%rsp)
movq 0x8(%rsp), %rdx
movq 0x20(%rbx), %r8
movq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
pushq $0x1
popq %rcx
leaq 0x38(%rsp), %r9
callq 0x6d48
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq %rbp, %rdi
callq 0x6dca
movq %rax, %r14
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rbp, %rdi
callq 0x6dca
cmpq %rax, %r14
jne 0x6651
cmpq $0x0, 0x28(%rbx)
jle 0x66a9
movss (%rsp), %xmm0
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
pushq $0x1
popq %rdx
callq 0x6e42
cmpq $-0x1, %rax
jne 0x66a9
movq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x6e9e
jmp 0x66a9
movq %rax, %r15
movss (%rsp), %xmm0
ucomiss 0x5a1c(%rip), %xmm0     # 0xc07c
jne 0x6664
jnp 0x669b
movq 0xc94d(%rip), %rdi      # 0x12fb8
leaq 0x5fd6(%rip), %rsi      # 0xc648
callq 0x21f0
movss (%rsp), %xmm0
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
leaq 0x5fc4(%rip), %rsi      # 0xc652
callq 0x21f0
movq %rax, %rdi
callq 0x20e0
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x6df0
addq $0x10, %r13
jmp 0x65b9
cmpq $0x0, 0x28(%rbx)
jle 0x66ca
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x8658
xorl %r14d, %r14d
leaq 0x58(%rsp), %r15
movq 0xc8df(%rip), %r12      # 0x12fb8
leaq 0x5f6d(%rip), %r13      # 0xc64d
cmpq 0x20(%rbx), %r14
jge 0x670e
movq %r15, %rdi
movq %r14, %rsi
callq 0x6dca
cmpq %rax, %r14
jne 0x6709
movq %r12, %rdi
movq %r13, %rsi
callq 0x21f0
movq %rax, %rdi
callq 0x20e0
incq %r14
jmp 0x66e0
leaq 0x20(%rsp), %rdi
callq 0x4d06
leaq 0x58(%rsp), %rdi
callq 0x6ebc
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6745
jmp 0x673a
jmp 0x673a
movq %rax, %rbx
jmp 0x6752
jmp 0x6745
jmp 0x6745
jmp 0x6745
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4d06
leaq 0x58(%rsp), %rdi
callq 0x6ebc
movq %rbx, %rdi
callq 0x2300