def METHOD_NAME(stars_path: pathlib.Path, out_stars_path: pathlib.Path) -> None:
    """Prunes the stars.dat file"""
    with open(stars_path, 'rb') as file:
        data: bytes = file.read()
    header_format = struct.Struct('<8sHI')
    star_format = struct.Struct('<I')
    header, version, total_stars = header_format.unpack_from(data, 0)
    if header != b'CELSTARS' or version != 0x0100:
        raise RuntimeError('Bad format for stars.dat, aborting')
    with open(out_stars_path, 'wb') as file:
        file.write(header_format.pack(b'CELSTARS', 0x0100, 0))
        output_stars = 0
        for i in range(total_stars):
            offset = 14 + i*20
            hip = star_format.unpack_from(data, offset)[0]
            if hip >= 1_000_000:
                continue
            output_stars += 1
            file.write(data[offset:offset+20])
        file.seek(10)
        file.write(struct.pack('<I', output_stars))
    print(f"stars.dat: original {total_stars} => pruned {output_stars}")