// File: Ripser[P]ripser/ripser.cpp
// Function: read_point_cloud(std::istream&)
euclidean_distance_matrix read_point_cloud(std::istream& input_stream) {
	std::vector<std::vector<value_t>> points;

	std::string line;
	value_t value;
	while (std::getline(input_stream, line)) {
		std::vector<value_t> point;
		std::istringstream s(line);
		while (s >> value) {
			point.push_back(value);
			s.ignore();
		}
		if (!point.empty()) points.push_back(point);
		assert(point.size() == points.front().size());
	}

	euclidean_distance_matrix eucl_dist(std::move(points));
	index_t n = eucl_dist.size();
	std::cout << "point cloud with " << n << " points in dimension "
	          << eucl_dist.points.front().size() << std::endl;

	return eucl_dist;
}

// Assembly:
subq $0x268, %rsp            # imm = 0x268
movq %rdi, 0x50(%rsp)
movq %rdi, %rax
movq %rax, 0x58(%rsp)
movq %rdi, 0x260(%rsp)
movq %rsi, 0x258(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x6180
leaq 0x220(%rsp), %rdi
callq 0x22c0
movq 0x258(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x2070
movq %rax, 0x48(%rsp)
jmp 0x31fa
movq 0x48(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2280
movb %al, 0x47(%rsp)
jmp 0x3214
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x3221
jmp 0x3352
leaq 0x1f0(%rsp), %rdi
callq 0x6190
leaq 0x70(%rsp), %rdi
leaq 0x220(%rsp), %rsi
movl $0x8, %edx
callq 0x2340
jmp 0x3247
jmp 0x3249
leaq 0x70(%rsp), %rdi
leaq 0x21c(%rsp), %rsi
callq 0x2080
movq %rax, 0x38(%rsp)
jmp 0x3262
movq 0x38(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2280
movb %al, 0x37(%rsp)
jmp 0x327c
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x3286
jmp 0x32fa
leaq 0x1f0(%rsp), %rdi
leaq 0x21c(%rsp), %rsi
callq 0x61a0
jmp 0x329d
leaq 0x70(%rsp), %rdi
callq 0x23c0
jmp 0x32a9
jmp 0x3249
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0x3466
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0x3340
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x2110
jmp 0x3340
leaq 0x1f0(%rsp), %rdi
callq 0x6210
testb $0x1, %al
jne 0x3324
leaq 0x240(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x6260
jmp 0x3322
jmp 0x3324
leaq 0x70(%rsp), %rdi
callq 0x2110
leaq 0x1f0(%rsp), %rdi
callq 0x62d0
jmp 0x31de
leaq 0x1f0(%rsp), %rdi
callq 0x62d0
jmp 0x3466
movq 0x50(%rsp), %rdi
movb $0x0, 0x6f(%rsp)
leaq 0x240(%rsp), %rsi
callq 0x6330
jmp 0x336b
movq 0x50(%rsp), %rdi
callq 0x63f0
movq %rax, 0x28(%rsp)
jmp 0x337c
movq 0x28(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x2bc2b(%rip), %rdi     # 0x2efb8
leaq 0x1ed1d(%rip), %rsi     # 0x220b1
callq 0x2230
movq %rax, 0x20(%rsp)
jmp 0x33a0
movq 0x20(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x23d0
movq %rax, 0x18(%rsp)
jmp 0x33b6
movq 0x18(%rsp), %rdi
leaq 0x1ed01(%rip), %rsi     # 0x220c3
callq 0x2230
movq %rax, 0x10(%rsp)
jmp 0x33ce
movq 0x50(%rsp), %rdi
callq 0x6400
movq %rax, %rdi
callq 0x6430
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x2090
movq %rax, 0x8(%rsp)
jmp 0x33f4
movq 0x8(%rsp), %rdi
movq 0x2bb90(%rip), %rsi     # 0x2ef90
callq 0x2250
jmp 0x3407
movb $0x1, 0x6f(%rsp)
testb $0x1, 0x6f(%rsp)
jne 0x343f
jmp 0x3435
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
callq 0x6450
jmp 0x3466
movq 0x50(%rsp), %rdi
callq 0x6450
leaq 0x220(%rsp), %rdi
callq 0x2448
leaq 0x240(%rsp), %rdi
callq 0x6460
movq 0x58(%rsp), %rax
addq $0x268, %rsp            # imm = 0x268
retq
leaq 0x220(%rsp), %rdi
callq 0x2448
leaq 0x240(%rsp), %rdi
callq 0x6460
movq 0x210(%rsp), %rdi
callq 0x2380
nopl (%rax)