Answer: The balanced equation is
Au(s) + 3HNO3(aq) + 4HCl(aq) ---> HAuCl4(aq) + 3NO2(g) +3H2O(l)
The function of HCl in a solution of Aqua regia, that is used to dissolve gold is to dissolve other metals like quartz or iron stone that surround the gold.
Explanation: To balance the equation, we check the ratio of each element in the reacting side and the product side ( left and right hand side). Let their ratio be equal be adding moles to the compound of the element or the element it's self in either side of the equation.
HCl which is called hydrochloric acid, is an acid that does not react with gold, but it react with every other substance, like your skin, metals etc. it is used to clean a gold, by dipping the gold inside it, all the metals on the surface of the gold will dissolve.
When dissolving a gold in aqua regia solution, HCL is added to prepare this solution because it will help to dissolve all other substance on the surface of the gold.