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

#ifdef PRINT_PERSISTENCE_PAIRS
		std::cout << "persistence intervals in dim " << dim << ":" << std::endl;
#endif

		compressed_sparse_matrix<diameter_entry_t> reduction_matrix;
		
#ifdef INDICATE_PROGRESS
		std::chrono::steady_clock::time_point next = std::chrono::steady_clock::now() + time_step;
#endif
		for (size_t index_column_to_reduce = 0; index_column_to_reduce < columns_to_reduce.size();
		     ++index_column_to_reduce) {

			diameter_entry_t column_to_reduce(columns_to_reduce[index_column_to_reduce], 1);
			value_t diameter = get_diameter(column_to_reduce);

			reduction_matrix.append_column();

			std::priority_queue<diameter_entry_t, std::vector<diameter_entry_t>,
			                    greater_diameter_or_smaller_index_comp<diameter_entry_t>>
			    working_reduction_column, working_coboundary;

			diameter_entry_t e, pivot = init_coboundary_and_get_pivot(
			                        column_to_reduce, working_coboundary, dim, pivot_column_index);

			while (true) {
#ifdef INDICATE_PROGRESS
				if (std::chrono::steady_clock::now() > next) {
					std::cerr << clear_line << "reducing column " << index_column_to_reduce + 1
					          << "/" << columns_to_reduce.size() << " (diameter " << diameter << ")"
					          << std::flush;
					next = std::chrono::steady_clock::now() + time_step;
				}
#endif
				if (get_index(pivot) != -1) {
					auto pair = pivot_column_index.find(get_entry(pivot));
					if (pair != pivot_column_index.end()) {
						entry_t other_pivot = pair->first;
						index_t index_column_to_add = pair->second;
						coefficient_t factor =
						    modulus - get_coefficient(pivot) *
						                  multiplicative_inverse[get_coefficient(other_pivot)] %
						                  modulus;

						add_coboundary(reduction_matrix, columns_to_reduce, index_column_to_add,
						               factor, dim, working_reduction_column, working_coboundary);

						pivot = get_pivot(working_coboundary);
					} else if (get_index(e = get_zero_apparent_facet(pivot, dim + 1)) != -1) {
						set_coefficient(e, modulus - get_coefficient(e));

						add_simplex_coboundary(e, dim, working_reduction_column, working_coboundary);

						pivot = get_pivot(working_coboundary);
					} else {
#ifdef PRINT_PERSISTENCE_PAIRS
						value_t death = get_diameter(pivot);
						if (death > diameter * ratio) {
#ifdef INDICATE_PROGRESS
							std::cerr << clear_line << std::flush;
#endif
							std::cout << " [" << diameter << "," << death << ")" << std::endl;
						}
#endif
						pivot_column_index.insert({get_entry(pivot), index_column_to_reduce});

						while (true) {
							diameter_entry_t e = pop_pivot(working_reduction_column);
							if (get_index(e) == -1) break;
							assert(get_coefficient(e) > 0);
							reduction_matrix.push_back(e);
						}
						break;
					}
				} else {
#ifdef PRINT_PERSISTENCE_PAIRS
#ifdef INDICATE_PROGRESS
					std::cerr << clear_line << std::flush;
#endif
					std::cout << " [" << diameter << ", )" << std::endl;
#endif
					break;
				}
			}
		}
#ifdef INDICATE_PROGRESS
		std::cerr << clear_line << std::flush;
#endif
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r15
movq %rcx, 0x8(%rsp)
movq 0xabdd(%rip), %r12      # 0x11fc8
leaq 0x529d(%rip), %rsi      # 0xc68f
movl $0x1d, %edx
movq %r12, %rdi
callq 0x2230
movq %r12, %rdi
movq %r14, %rsi
callq 0x21e0
movq %rax, %r14
leaq 0x526d(%rip), %rsi      # 0xc681
movl $0x1, %edx
movq %rax, %rdi
callq 0x2230
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movq (%r13), %rax
movq %r13, 0x28(%rsp)
cmpq %rax, 0x8(%r13)
je 0x7772
leaq 0x70(%rsp), %rbp
leaq 0x90(%rsp), %r12
xorl %r13d, %r13d
movq %r13, %rcx
shlq $0x4, %rcx
movss (%rax,%rcx), %xmm0
movss %xmm0, 0x4(%rsp)
movq 0x8(%rax,%rcx), %r14
leaq 0x40(%rsp), %rdi
callq 0x92b4
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movq %rax, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movq %r15, %rdi
movss 0x4(%rsp), %xmm0
movq %r14, %rsi
movq %rbp, %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %r8
callq 0x92e6
movq %rax, %rcx
movss %xmm0, 0x10(%rsp)
movq %rax, 0x18(%rsp)
cmpq $-0x1, %rax
je 0x75b8
movq %rcx, %rax
xorl %edx, %edx
divq 0x8(%rbx)
movq %rbx, %rdi
movq %rdx, %rsi
leaq 0x18(%rsp), %rdx
callq 0x9b58
testq %rax, %rax
je 0x756d
movq (%rax), %rax
testq %rax, %rax
je 0x756d
movq 0x10(%rax), %rcx
movl 0x38(%r15), %esi
movq 0x58(%r15), %rax
movzwl 0x2(%rax), %eax
xorl %edx, %edx
divw %si
subl %edx, %esi
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movzwl %si, %r8d
movq %r15, %rdi
leaq 0x40(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %r9
pushq %rbp
pushq %r12
callq 0x94dc
addq $0x10, %rsp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x9594
jmp 0x74dc
movss 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdx
incq %rdx
movq %r15, %rdi
callq 0x95de
cmpq $-0x1, %rax
je 0x7668
movq %r15, %rdi
movq %rax, %rsi
leaq 0x8(%rsp), %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0x963e
movq %r15, %rdi
movq %rbp, %rsi
callq 0x9594
jmp 0x74dc
movl $0x2, %edx
movq 0xaa04(%rip), %rdi      # 0x11fc8
leaq 0x4ff8(%rip), %rsi      # 0xc5c3
callq 0x2230
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movq 0xa9e8(%rip), %rdi      # 0x11fc8
callq 0x22f0
movq %rax, %r14
movl $0x3, %edx
movq %rax, %rdi
leaq 0x5094(%rip), %rsi      # 0xc68b
callq 0x2230
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x7632
callq 0x21d0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x7644
callq 0x21d0
incq %r13
movq 0x28(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r13
jb 0x747d
jmp 0x775c
movss 0x10(%rsp), %xmm1
movss 0x34(%r15), %xmm0
mulss 0x4(%rsp), %xmm0
movss %xmm1, 0x24(%rsp)
ucomiss %xmm0, %xmm1
jbe 0x771c
movl $0x2, %edx
movq 0xa933(%rip), %rdi      # 0x11fc8
leaq 0x4f27(%rip), %rsi      # 0xc5c3
callq 0x2230
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movq 0xa917(%rip), %rdi      # 0x11fc8
callq 0x22f0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4fbe(%rip), %rsi      # 0xc686
callq 0x2230
xorps %xmm0, %xmm0
cvtss2sd 0x24(%rsp), %xmm0
movq %r14, %rdi
callq 0x22f0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4f9d(%rip), %rsi      # 0xc68d
callq 0x2230
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %r13, 0x38(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x9bae
movq %r15, %rdi
movq %r12, %rsi
callq 0x9756
cmpq $-0x1, %rax
je 0x7623
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x97be
jmp 0x7738
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x776b
callq 0x21d0
movq 0x40(%rsp), %rdi
jmp 0x7774
xorl %edi, %edi
testq %rdi, %rdi
je 0x777e
callq 0x21d0
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x77a5
jmp 0x77a5
movq %rax, %rbx
jmp 0x77c9
jmp 0x77a5
jmp 0x77a5
jmp 0x77a5
jmp 0x77a5
jmp 0x77a5
jmp 0x77a5
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x77b7
callq 0x21d0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x77c9
callq 0x21d0
leaq 0x40(%rsp), %rdi
callq 0x9802
movq %rbx, %rdi
callq 0x2350
nop