The question is inspired from Preparing a quantum state from a classical probability distribution which shows how basis encoding $\frac{1}{\sqrt n}\sum_{x=0}^{n-1}|x\rangle|p(x)\rangle$ may be converted to $\sum_{x=0}^{n-1}\sqrt{p(x)}|x\rangle$ by using appropriate normalization and amplitude amplification. Crticially, this assumes that $U_p$ that generates $U_p|x\rangle|0\rangle = |x\rangle|p(x)\rangle$ is accessible.
This question goes in the other direction. Suppose that we know $U_{ap}$ that generates $U_{ap}|0\rangle = \sum_{x=0}^{n-1}\sqrt{p(x)}|x\rangle$. Is there a quantum operation that converts $\sum_{x=0}^{n-1}\sqrt{p(x)}|x\rangle$ into $\frac{1}{\sqrt n}\sum_{x=0}^{n-1}|x\rangle|p(x)\rangle$ using $U_{ap}$?