The following arithmetic function is studied by Zagier in connection with values at odd negative integers of zeta functions of real quadratic fields: 
$$e_r (n)=\sum_{\underset{|x|\leq n}{x^{2}\equiv n\pmod{4}}}\sigma_{r}(\frac{n-x^2}{4}),$$
where $\sigma_r(d)=\sum_{\ell|d}\ell^r$.

I am interested in the $p$-adic behavior of this function. 
I would like to know whether this function appears elsewhere?
Thank you for any suggestions on how to study this function modulo p.