S&P 500 barely gains while Dow ends lower as Cisco and Walmart drag