Replace  ifstream with FILE*, because the former is too slow.