The arithmetic theory of loop groups. II: The Hilbert-modular case Two-dimensional \(\ell\)-adic representations of the fundamental group of a curve over a finite field and automorphic forms on \(\mathrm{GL}(2)\) 