// File: /workspace/github_cpp_makefile_star2_O2/Ripser[P]ripser/ripser.cpp
// Function: read_sparse_distance_matrix(std::istream&)
sparse_distance_matrix read_sparse_distance_matrix(std::istream& input_stream) {
	std::vector<std::vector<index_diameter_t>> neighbors;
	index_t num_edges = 0;

	std::string line;
	while (std::getline(input_stream, line)) {
		std::istringstream s(line);
		size_t i, j;
		value_t value;
		s >> i;
		s.ignore();
		s >> j;
		s.ignore();
		s >> value;
		s.ignore();
		if (i != j) {
			neighbors.resize(std::max({neighbors.size(), i + 1, j + 1}));
			neighbors[i].push_back({j, value});
			neighbors[j].push_back({i, value});
			++num_edges;
		}
	}

	for (size_t i = 0; i < neighbors.size(); ++i)
		std::sort(neighbors[i].begin(), neighbors[i].end());

	return sparse_distance_matrix(std::move(neighbors), num_edges);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rsi, %r14
movq %rdi, 0x50(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
andq $0x0, 0x10(%rcx)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movaps %xmm0, (%rcx)
movb $0x0, (%rax)
xorl %r15d, %r15d
leaq 0x58(%rsp), %r12
leaq 0x78(%rsp), %r13
pushq $0x18
popq %rbp
leaq 0x38(%rsp), %rbx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2c7f
movq %r13, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x22c0
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
callq 0x2110
movq %r13, %rdi
callq 0x2330
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2110
movq %r13, %rdi
callq 0x2330
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
callq 0x2370
movq %r13, %rdi
callq 0x2330
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rcx
cmpq %rcx, %rsi
je 0x2c72
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
cqto
idivq %rbp
movq %rax, 0x38(%rsp)
incq %rsi
movq %rsi, 0x40(%rsp)
incq %rcx
movq %rcx, 0x48(%rsp)
movq %rbx, %rdi
pushq $0x3
popq %rsi
callq 0x3fd1
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x3f9c
imulq $0x18, 0x18(%rsp), %rdi
addq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rsp)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movq %rbx, %rsi
callq 0x56be
imulq $0x18, 0x10(%rsp), %rdi
addq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movq %rbx, %rsi
callq 0x56be
incq %r15
movq %r13, %rdi
callq 0x20d0
jmp 0x2b64
pushq $0x8
popq %rbx
xorl %r14d, %r14d
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rsi
movq %rsi, %rax
subq %rcx, %rax
cqto
idivq %rbp
cmpq %rax, %r14
jae 0x2cb6
movq -0x8(%rcx,%rbx), %rdi
movq (%rcx,%rbx), %rsi
callq 0x5819
incq %r14
addq $0x18, %rbx
jmp 0x2c85
movq 0x50(%rsp), %r14
movq %rcx, (%r14)
movq %rsi, 0x8(%r14)
leaq 0x20(%rsp), %rbx
movq 0x10(%rbx), %rax
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movq %r15, 0x18(%r14)
leaq 0x58(%rsp), %rdi
callq 0x2388
movq %rbx, %rdi
callq 0x3fe0
movq %r14, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d14
jmp 0x2d14
jmp 0x2d0f
jmp 0x2d0f
jmp 0x2d14
movq %rax, %rbx
jmp 0x2d21
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x20d0
leaq 0x58(%rsp), %rdi
callq 0x2388
leaq 0x20(%rsp), %rdi
callq 0x3fe0
movq %rbx, %rdi
callq 0x2300