I want to count the $x, y \mod a$ and $r, s \mod b$ subject to the following conditions (defining $u, v, w, k$ which exist by the coprimality conditions)
$$(a, x, y) = 1$$
$$(b, r, s) = 1$$
$$ as+xr+yb \equiv 0 \mod ab$$
$$ux+vy \equiv 1 \mod a$$
$$wr + ks \equiv 1 \mod b$$
$$ux-wr \equiv 0 \mod a$$
I have no general method to address such a question. Toying with the congruences, I end up with the relation $x \equiv -yr \mod a$, but I don't know if it helps.