bin/lib: split star counting from driver program.