Precise asymptotics of reweighted least-squares algorithms for linear diagonal networks