nicer gccount C implementation