// File: /workspace/github_cpp_makefile_star2_O1/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 %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rcx, 0x8(%rsp)
movq 0xabda(%rip), %r12      # 0x11fc8
leaq 0x529a(%rip), %rsi      # 0xc68f
movl $0x1d, %edx
movq %r12, %rdi
callq 0x2240
movq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x21f0
movq %rax, %r12
leaq 0x5268(%rip), %rsi      # 0xc681
movl $0x1, %edx
movq %rax, %rdi
callq 0x2240
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x7775
leaq 0x70(%rsp), %rbp
leaq 0x90(%rsp), %r13
xorl %edx, %edx
movq %rdx, 0x28(%rsp)
movq %rdx, %rcx
shlq $0x4, %rcx
movss (%rax,%rcx), %xmm0
movss %xmm0, 0x4(%rsp)
movq 0x8(%rax,%rcx), %r12
leaq 0x40(%rsp), %rdi
callq 0x9318
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 %r12, %rsi
movq %rbp, %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %r8
callq 0x934a
movq %rax, %rcx
movss %xmm0, 0x10(%rsp)
movq %rax, 0x18(%rsp)
cmpq $-0x1, %rax
je 0x75be
movq %rcx, %rax
xorl %edx, %edx
divq 0x8(%rbx)
movq %rbx, %rdi
movq %rdx, %rsi
leaq 0x18(%rsp), %rdx
callq 0x9b98
testq %rax, %rax
je 0x751b
movq (%rax), %rax
jmp 0x751d
xorl %eax, %eax
testq %rax, %rax
je 0x7573
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 %r14, %rdx
leaq 0x30(%rsp), %r9
pushq %rbp
pushq %r13
callq 0x953c
addq $0x10, %rsp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x95f2
jmp 0x74e0
movss 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdx
incq %rdx
movq %r15, %rdi
callq 0x962a
cmpq $-0x1, %rax
je 0x766f
movq %r15, %rdi
movq %rax, %rsi
leaq 0x8(%rsp), %rdx
movq %r13, %rcx
movq %rbp, %r8
callq 0x968a
movq %r15, %rdi
movq %rbp, %rsi
callq 0x95f2
jmp 0x74e0
movl $0x2, %edx
movq 0xa9fe(%rip), %rdi      # 0x11fc8
leaq 0x4ff2(%rip), %rsi      # 0xc5c3
callq 0x2240
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movq 0xa9e2(%rip), %rdi      # 0x11fc8
callq 0x2300
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
leaq 0x508e(%rip), %rsi      # 0xc68b
callq 0x2240
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x7639
callq 0x21e0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x764b
callq 0x21e0
movq 0x28(%rsp), %rdx
incq %rdx
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %rdx
jb 0x747c
jmp 0x7775
movss 0x10(%rsp), %xmm1
movss 0x34(%r15), %xmm0
mulss 0x4(%rsp), %xmm0
movss %xmm1, 0x24(%rsp)
ucomiss %xmm0, %xmm1
jbe 0x7724
movl $0x2, %edx
movq 0xa92c(%rip), %rdi      # 0x11fc8
leaq 0x4f20(%rip), %rsi      # 0xc5c3
callq 0x2240
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rsp), %xmm0
movq 0xa910(%rip), %rdi      # 0x11fc8
callq 0x2300
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4fb7(%rip), %rsi      # 0xc686
callq 0x2240
xorps %xmm0, %xmm0
cvtss2sd 0x24(%rsp), %xmm0
movq %r12, %rdi
callq 0x2300
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4f96(%rip), %rsi      # 0xc68d
callq 0x2240
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x9bec
movq %r15, %rdi
movq %r13, %rsi
callq 0x97a2
movq %rax, %r12
cmpq $-0x1, %rax
je 0x762a
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x980a
cmpq $-0x1, %r12
jne 0x7745
jmp 0x762a
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x7784
callq 0x21e0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7793
callq 0x21e0
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x77ba
jmp 0x77ba
movq %rax, %rbx
jmp 0x77de
jmp 0x77ba
jmp 0x77ba
jmp 0x77ba
jmp 0x77ba
jmp 0x77ba
jmp 0x77ba
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x77cc
callq 0x21e0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x77de
callq 0x21e0
leaq 0x40(%rsp), %rdi
callq 0x984e
movq %rbx, %rdi
callq 0x2360