// File: /workspace/github_cpp_makefile_star2_O2/Ripser[P]ripser/ripser.cpp
// Function: ripser<compressed_distance_matrix<(compressed_matrix_layout)0>>::assemble_columns_to_reduce(std::vector<std::pair<float, long>, std::allocator<std::pair<float, long>>>&, std::vector<std::pair<float, long>, std::allocator<std::pair<float, long>>>&, std::unordered_map<long, unsigned long, ripser<compressed_distance_matrix<(compressed_matrix_layout)0>>::entry_hash, ripser<compressed_distance_matrix<(compressed_matrix_layout)0>>::equal_index, std::allocator<std::pair<long const, unsigned long>>>&, long)
void assemble_columns_to_reduce(std::vector<diameter_index_t>& simplices,
	                                std::vector<diameter_index_t>& columns_to_reduce,
	                                entry_hash_map& pivot_column_index, index_t dim) {

#ifdef INDICATE_PROGRESS
		std::cerr << clear_line << "assembling columns" << std::flush;
		std::chrono::steady_clock::time_point next = std::chrono::steady_clock::now() + time_step;
#endif

		columns_to_reduce.clear();
		std::vector<diameter_index_t> next_simplices;

		simplex_coboundary_enumerator cofacets(*this);

		for (diameter_index_t& simplex : simplices) {
			cofacets.set_simplex(diameter_entry_t(simplex, 1), dim - 1);

			while (cofacets.has_next(false)) {
#ifdef INDICATE_PROGRESS
				if (std::chrono::steady_clock::now() > next) {
					std::cerr << clear_line << "assembling " << next_simplices.size()
					          << " columns (processing " << std::distance(&simplices[0], &simplex)
					          << "/" << simplices.size() << " simplices)" << std::flush;
					next = std::chrono::steady_clock::now() + time_step;
				}
#endif
				auto cofacet = cofacets.next();
				if (get_diameter(cofacet) <= threshold) {
					if (dim < dim_max) next_simplices.push_back({get_diameter(cofacet), get_index(cofacet)});
					if (!is_in_zero_apparent_pair(cofacet, dim) &&
					    (pivot_column_index.find(get_entry(cofacet)) == pivot_column_index.end()))
						columns_to_reduce.push_back({get_diameter(cofacet), get_index(cofacet)});
				}
			}
		}

		if (dim < dim_max) simplices.swap(next_simplices);

#ifdef INDICATE_PROGRESS
		std::cerr << clear_line << "sorting " << columns_to_reduce.size() << " columns"
		          << std::flush;
#endif

		std::sort(columns_to_reduce.begin(), columns_to_reduce.end(),
		          greater_diameter_or_smaller_index<diameter_index_t>);
#ifdef INDICATE_PROGRESS
		std::cerr << clear_line << std::flush;
#endif
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r8, %r12
movq %rcx, %r13
movq %rdi, %rbp
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0xa3af
movq %rax, 0x8(%rdx)
movq %rdx, 0x18(%rsp)
leaq 0x20(%rsp), %rax
andq $0x0, 0x10(%rax)
leaq 0x80(%rsp), %rcx
andq $0x0, 0x20(%rcx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movups %xmm0, (%rcx)
movups %xmm0, 0xc(%rcx)
movzwl 0x48(%rbp), %eax
movw %ax, 0x28(%rcx)
movq %rbp, 0x30(%rcx)
leaq 0x50(%rbp), %rax
movq %rax, 0x38(%rcx)
movq %rbp, 0x40(%rcx)
movq (%rsi), %r15
movq %rsi, 0x48(%rsp)
movq 0x8(%rsi), %rax
movq %rax, 0x58(%rsp)
leaq -0x1(%r12), %rax
movq %rax, 0x50(%rsp)
leaq 0x60(%rsp), %r14
leaq 0x38(%rsp), %rbx
cmpq 0x58(%rsp), %r15
je 0xa50e
movss (%r15), %xmm0
movq 0x8(%r15), %rsi
movq %r14, %rdi
movq 0x50(%rsp), %rdx
callq 0xa804
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
cmpq %rcx, %rax
jl 0xa505
movq 0xb8(%rsp), %rdx
movq (%rdx), %rdx
imulq $0x18, %rcx, %rcx
movq (%rdx,%rcx), %rcx
movq (%rcx,%rax,8), %rax
cmpq 0x60(%rsp), %rax
jle 0xa505
movq %r14, %rdi
callq 0xa874
movss %xmm0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movss 0x40(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jb 0xa436
cmpq %r12, 0x38(%rbp)
jle 0xa4b1
movss %xmm0, 0x38(%rsp)
movq %rax, 0x40(%rsp)
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x5014
movss 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rax
movq %rbp, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xb346
testb %al, %al
jne 0xa436
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0xb150
testq %rax, %rax
jne 0xa436
movq 0x10(%rsp), %rax
movss 0x8(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x5014
jmp 0xa436
addq $0x10, %r15
jmp 0xa415
cmpq %r12, 0x38(%rbp)
jle 0xa53b
movq 0x48(%rsp), %rdx
movq 0x10(%rdx), %rax
movaps 0x20(%rsp), %xmm0
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rdx)
movups (%rdx), %xmm1
movups %xmm0, (%rdx)
movaps %xmm1, 0x20(%rsp)
movq %rax, 0x30(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
leaq -0x382c(%rip), %rdx     # 0x6d22
callq 0x95b9
leaq 0x80(%rsp), %rdi
callq 0x4d06
leaq 0x20(%rsp), %rdi
callq 0x5006
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa586
jmp 0xa586
jmp 0xa586
jmp 0xa586
jmp 0xa586
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x4d06
leaq 0x20(%rsp), %rdi
callq 0x5006
movq %rbx, %rdi
callq 0x2300