US stocks close mixed, S&P 500 records worst week since 2020