Let $f(x,y) = a^2 x^2 - (b^2 - 2ac)xy + c^2 y^2$ be a positive definite binary quadratic form with co-prime integer coefficients such that $b \ne 0$. For a given pair of integers $(u,v)$ and a prime $p | f(u,v)$, we see that $u$ is a quadratic residue modulo $p$ if and only if $v$ is because

$$\displaystyle b^2 uv \equiv (ax + cy)^2 \pmod{p}.$$

Define the function $r(u,v)$ by

$$\displaystyle r(u,v) = \sum_{m | f(u,v)} \left(\frac{u}{m} \right) = \sum_{m | f(u,v)} \left(\frac{v}{m}\right).$$

Here $\left(\frac{\cdot}{n}\right)$ denotes the Jacobi symbol. What is the asymptotic value of

$$\displaystyle \sum_{f(u,v) \leq X} r(u,v)?$$