Suppose you have a contour that passes over multiple Riemann sheets, but eventually comes back to itself (it's a closed contour). For example, the function $\sqrt{z}$ is analytic on the Riemann surface $\Omega$ consisting of two Riemann sheets (each identical to $\mathbb{C}$) which are glued along the positive real axis $[0,\infty)$. If I were to have a function $f(z)=g(z)\sqrt{z}$, where $g(z)$ has isolated poles at some $\{z_i\}\in\Omega$, how would Cauchy's residue theorem change if I consider contours which wind around both Riemann sheets? Now it seems a little difficult for me to define "inside" and "outside" the contour.
The reason I'm interested in this is because I'm trying to evaluate an integral by contour integration where the integrand actually has 4 branch cuts and 4 Riemann sheets.
$$\lim_{M\rightarrow\infty}\int_{-\infty}^{\infty} \frac{1}{(z^2+\frac{a^2}{M^2}+i\epsilon)(z^2+b^2M^2+i\epsilon)}e^{-\sqrt{z^2+\frac{a^2}{M^2}}-\sqrt{z^2+b^2M^2}} dz$$
I see no way to get a simple answer for this by constructing a contour which dodges the branch cuts. Therefore I'm thinking that, maybe, I can construct a contour which actually jumps through multiple sheets, and picks up multiple poles (on different sheets) via a 'modified' residue theorem.
I'll assume $a > 0, \, b > 0, \, \epsilon \geq 0$. Let $A = z^2 + (a/M)^2$ and $B = z^2 + (b M)^2$. Since $$\left| \frac {e^{-\sqrt A - \sqrt B}} {(A + i \epsilon) (B + i \epsilon)} \right| \leq \frac {e^{-|z| - b M}} {(a/M)^2 (b M)^2},$$ the limit of the integral is zero. If the question is about the asymptotic behaviour of the integral, we have to consider the cases $\epsilon > 0$ and $\epsilon = 0$ separately. The non-exponential part is $$\frac 1 {(A + i \epsilon) (B + i \epsilon)} = \frac {M^4} {b^2 M^4 - a^2} \left( \frac 1 {M^2 (A + i \epsilon)} - \frac 1 {M^2 (B + i \epsilon)} \right).$$ Consider the $e^{-\sqrt A - \sqrt B}/(M^2 (A + i \epsilon))$ term first. If $\epsilon = 0$, then, setting $z = x/M$, we obtain $$\lim_{M \to \infty} M e^{b M} \int_{\mathbb R} \frac {e^{-\sqrt A - \sqrt B}} {M^2 A} dz = \int_{\mathbb R} \frac {dx} {x^2 + a^2},$$ since $b M -\sqrt A - \sqrt B \rvert_{z = x/M}$ is negative and tends to zero when $M \to \infty$. If $\epsilon > 0$, then $$\lim_{M \to \infty} M^2 e^{b M} \int_{\mathbb R} \frac {e^{-\sqrt A - \sqrt B}} {M^2 (A + i \epsilon)} dz = \int_{\mathbb R} \frac {e^{-|z|}} {z^2 + i \epsilon} dz.$$ It can be shown in the same way that the integral of the $e^{-\sqrt A - \sqrt B}/(M^2 (B + i \epsilon))$ term is asymptotically smaller. Therefore $$f(M) \sim \cases { \frac {\pi e^{-b M}} {a b^2 M} & $\epsilon = 0$ \\ \vphantom {\displaystyle \int} \frac {2 e^{-b M}} {b^2 M^2} \! \int_{\mathbb R^+} \hspace {-1px} \frac {e^{-z}} {z^2 + i \epsilon} dz & $\epsilon > 0$}, \quad M \to \infty.$$