// File: Ripser[P]ripser/ripser.cpp
// Function: ripser<compressed_distance_matrix<(compressed_matrix_layout)0>>::simplex_coboundary_enumerator::next()
diameter_entry_t next() {
		while ((binomial_coeff(j, k) <= idx_below)) {
			idx_below -= binomial_coeff(j, k);
			idx_above += binomial_coeff(j, k + 1);
			--j;
			--k;
			assert(k != -1);
		}
		value_t cofacet_diameter = get_diameter(simplex);
		for (index_t i : vertices) cofacet_diameter = std::max(cofacet_diameter, dist(j, i));
		index_t cofacet_index = idx_above + binomial_coeff(j--, k + 1) + idx_below;
		coefficient_t cofacet_coefficient =
		    (k & 1 ? modulus - 1 : 1) * get_coefficient(simplex) % modulus;
		return diameter_entry_t(cofacet_diameter, cofacet_index, cofacet_coefficient);
	}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x58(%rax), %rdi
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
callq 0x5d20
movq 0x18(%rsp), %rcx
cmpq (%rcx), %rax
jg 0x1fe2c
movq 0x18(%rsp), %rax
movq 0x58(%rax), %rdi
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
callq 0x5d20
movq %rax, %rdx
movq 0x18(%rsp), %rax
movq (%rax), %rcx
subq %rdx, %rcx
movq %rcx, (%rax)
movq 0x58(%rax), %rdi
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq $0x1, %rdx
callq 0x5d20
movq %rax, %rcx
movq 0x18(%rsp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x18(%rax)
jmp 0x1fda3
movq 0x18(%rsp), %rdi
addq $0x38, %rdi
callq 0x2ab0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movss (%rcx), %xmm0
movss %xmm0, 0x5c(%rsp)
addq $0x20, %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x1ffc0
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
callq 0xaa70
movq %rax, 0x40(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1fff0
testb $0x1, %al
jne 0x1fe88
jmp 0x1fedf
leaq 0x48(%rsp), %rdi
callq 0xad00
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq (%rcx), %rcx
movq %rcx, 0x38(%rsp)
movq 0x50(%rax), %rdi
movq 0x10(%rax), %rsi
movq 0x38(%rsp), %rdx
callq 0x2c40
movss %xmm0, 0x34(%rsp)
leaq 0x5c(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x75d0
movss (%rax), %xmm0
movss %xmm0, 0x5c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x20030
jmp 0x1fe73
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x58(%rax), %rdi
movq 0x10(%rax), %rsi
movq %rsi, %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rdx
addq $0x1, %rdx
callq 0x5d20
movq 0x10(%rsp), %rcx
movq %rax, %rdx
movq 0x18(%rsp), %rax
addq %rdx, %rcx
addq (%rax), %rcx
movq %rcx, 0x28(%rsp)
movq 0x18(%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x1ff45
movq 0x18(%rsp), %rax
movzwl 0x48(%rax), %eax
subl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1ff50
movl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1ff50
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
addq $0x38, %rdi
callq 0x2a90
movq 0x18(%rsp), %rcx
movw %ax, %dx
movl 0x8(%rsp), %eax
movzwl %dx, %edx
imull %edx, %eax
movzwl 0x48(%rcx), %ecx
cltd
idivl %ecx
movw %dx, %ax
movw %ax, 0x26(%rsp)
movss 0x5c(%rsp), %xmm0
movq 0x28(%rsp), %rsi
movzwl 0x26(%rsp), %edx
leaq 0x68(%rsp), %rdi
callq 0x17810
movss 0x68(%rsp), %xmm0
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)