An equivalent computation of a Feynman diagram

A typical second-order diagram for the self-energy gives integrals such as: $$\int \int d \omega^\prime \omega^{\prime \prime} g(\omega-\omega^{\prime})g(\omega^{\prime \prime})g(\omega^{\prime}+\omega^{\prime \prime}),\tag1$$ where $$g$$ is the one-electron causal Green function. (I am omitting unimportant prefactors for the discussion here).

I've seen several times how, instead of computing directly this integral, one reformulates this as: \eqalign{ &\int_{-\infty}^{E} \int_{-\infty}^{E} \int^{\infty}_{E}\dfrac{\rho(\omega_1)\rho(\omega_2)\rho(\omega_3)}{\omega-\omega_1-\omega_2+\omega_3} d\omega_1d\omega_2d\omega_3 + {}\cr &\qquad \int^{\infty}_{E} \int^{\infty}_{E} \int_{-\infty}^{E}\dfrac{\rho(\omega_1)\rho(\omega_2)\rho(\omega_3)}{\omega-\omega_1-\omega_2+\omega_3} d\omega_1d\omega_2d\omega_3,\cr}\tag2

where $$\rho$$ is the local density of states ($$\rho=\frac{-1}{\pi}\text{Im}(g)$$) and $$E$$ is the Fermi level (I am assuming zero temperature for these computations; this is not important for what I am asking).

I have not seen a proof of the fact that these two expressions coincide, and apparently it is nowhere to be found!

I tried substituting in the first integral the spectral decomposition of the causal Green function in terms of the Density of States, which should be: $$g(\omega)= \int_E^{\infty} \dfrac{\rho(\omega^\prime)}{\omega^\prime-\omega+i\eta}+ \int^E_{-\infty} \dfrac{\rho(\omega^\prime)}{\omega^\prime-\omega-i\eta},$$

but after making the whole substitution I get several integrals of terms like $$\dfrac{1}{(\omega-\omega_1+i\eta)(\omega_1+\omega_2+i\eta)(\omega_2+i\eta)},$$ (to be integrated in $$\omega_1$$ and $$\omega_2$$), which don't give the nice denominators of the second expression.

Actually, performing just one of the integrals, the one over $$\omega_2,$$ for instance, gives a real part which is a logarithm and an arctan for the imaginary part, so I don't see how (1) and (2) can be equivalent (however, I've seen it employed in some papers, and without any explanation at all, which makes me think that this is something pretty standard, even though it is not found in basic textbooks. Example: here)