// File: /workspace/github_cpp_makefile_star2_O1/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)
xorl %r15d, %r15d
leaq 0x10(%rsp), %rax
movq %r15, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r15, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x58(%rsp), %r13
leaq 0x78(%rsp), %rbp
leaq 0xc(%rsp), %r12
movq 0xed0f(%rip), %rbx      # 0x11fc0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x23b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x345f
movq %rbp, %rdi
movq %r13, %rsi
movl $0x8, %edx
callq 0x2330
movq %rbp, %rdi
leaq 0x48(%rsp), %rsi
callq 0x2120
movq %rbp, %rdi
callq 0x2390
movq %rbp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x2120
movq %rbp, %rdi
callq 0x2390
movq %rbp, %rdi
movq %r12, %rsi
callq 0x23d0
movq %rbp, %rdi
callq 0x2390
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rax
cmpq %rax, %rcx
je 0x3442
movq 0x18(%rsp), %rdx
subq 0x10(%rsp), %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
movq %rdx, 0x28(%rsp)
incq %rcx
movq %rcx, 0x30(%rsp)
incq %rax
movq %rax, 0x38(%rsp)
movl $0x8, %eax
leaq 0x28(%rsp), %rcx
movq (%rcx), %rdx
cmpq 0x28(%rsp,%rax), %rdx
jae 0x3392
leaq (%rsp,%rax), %rcx
addq $0x28, %rcx
addq $0x8, %rax
cmpq $0x18, %rax
jne 0x3380
movq (%rcx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x4da2
movq 0x48(%rsp), %rax
movq 0x10(%rsp), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x33ea
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rdi)
jmp 0x33f4
leaq 0x28(%rsp), %rdx
callq 0x631e
movq 0x40(%rsp), %rax
movq 0x10(%rsp), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x3435
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x8(%rdi)
jmp 0x343f
leaq 0x28(%rsp), %rdx
callq 0x631e
incq %r15
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x22c0
leaq 0xf0(%rsp), %rdi
callq 0x20a0
jmp 0x32b1
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq %rax, %rcx
je 0x34e0
movl $0x8, %r12d
xorl %r13d, %r13d
movq -0x8(%rax,%r12), %rbx
movq (%rax,%r12), %r14
cmpq %r14, %rbx
je 0x34b2
movq %r14, %rax
subq %rbx, %rax
sarq $0x4, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6455
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6508
incq %r13
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq $0x18, %r12
cmpq %rdx, %r13
jb 0x3477
movq 0x50(%rsp), %rbx
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq %r15, 0x18(%rbx)
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x351e
callq 0x21e0
leaq 0x10(%rsp), %rdi
callq 0x4e24
movq %rbx, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x354c
jmp 0x354c
jmp 0x354c
jmp 0x3547
jmp 0x3547
movq %rax, %rbx
jmp 0x356d
movq %rax, %rbx
movq 0xea6a(%rip), %rsi      # 0x11fc0
leaq 0x78(%rsp), %rdi
callq 0x22c0
leaq 0xf0(%rsp), %rdi
callq 0x20a0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x3581
callq 0x21e0
leaq 0x10(%rsp), %rdi
callq 0x4e24
movq %rbx, %rdi
callq 0x2360