optimize sfun_XRF_full3 by using stored index_after