$\newcommand{\Ket}[1]{\left|#1\right>}$
I understand that in general quantum black box algorithms (such as the ones which play a part in Simon's & Deutsch's algorithm) implement a quantum circuit to compute some function $f\left(x\right)$ in such a way that the input is fed with trailing zero qubits, and the result is the input followed by the output, e.g:
$$\Ket{x}\Ket{0} \rightarrow \Ket{x}\Ket{f(x)}\,.$$
My question is, since basically one can write the above more explicitly as:$$ \Ket{x}\otimes\Ket{0} \rightarrow \Ket{x}\otimes\Ket{f(x)} \,,$$whether it is possible, in case $\Ket{x}$ is not a pure state but a superposition, to get an output which "mixes" inputs with the wrong outputs.
To clarify what I mean I'll give an example: Suppose our input is the one qubit superposition:
$$\Ket{x} = \frac{\Ket{0}+\Ket{1}}{\sqrt{2}}$$
Will the result of the black-box circuit be the following tensor product:
$$ \left\lbrack\frac{\Ket{0}+\Ket{1}}{\sqrt{2}}\right\rbrack \otimes \left\lbrack\frac{\Ket{f(0)}+\Ket{f(1)}}{\sqrt{2}}\right\rbrack $$
(Which I find confusing and unlikely) Or, the other option which seems to be more natural:
$$\frac{\Ket{0}\Ket{f(0)}+\Ket{1}\Ket{f(1)}}{\sqrt{2}}$$
(Or perhaps both are wrong? :))