The US stock market’s flagship index has registered its worst quarter since 2022. What next for the S&P 500?