4. As shown in Figure $1, a$ is the result output in the program flowchart. Then, the coefficient of the term containing $x^{2}$ in the expansion of the binomial $\left(a \sqrt{x}-\frac{1}{\sqrt{x}}\right)^{6}$ is . $\qquad$
4. $-\frac{3}{16}$.

When $i=2016$, $a=\frac{1}{2}$.
Notice that,
$$
\begin{array}{l}
T_{r+1}=\mathrm{C}_{6}^{r}(a \sqrt{x})^{r}\left(-\frac{1}{\sqrt{x}}\right)^{6-r} \\
=(-1)^{6-r} a^{r} \mathrm{C}_{6}^{r} x^{r-3} .
\end{array}
$$

Thus, the coefficient of the $x^{2}$ term is
$$
(-1)^{6-5} a^{5} C_{6}^{5}=-\left(\frac{1}{2}\right)^{5} \times 6=-\frac{3}{16} \text {. }
$$