Given a discrete symmetry of a quantum field theory one can try to
gauge the symmetry, or in other words construct a corresponding
orbifold theory; the orbifold field theory is constructed by
taking the quotient by the symmetry group and projecting the Hilbert space onto the invariant states.
In this paper we focus on the defect approach to orbifolds [1]}, [2]}
and show that the orbifold theory corresponding to the symmetry introduced in Section REF  is the Yang-Mills theory
with gauge group \(G\rtimes \mathsf {Out}(G)\) . We can further naturally
twist the orbifold theory by a two-cocycle \(c\in H^2(\mathsf {Out}(G);U(1))\) 
representing the inclusion of discrete torsion. The resulting orbifold
theory will then be a two-dimensional Yang-Mills theory based on the structure group
\(G\rtimes \mathsf {Out}(G)\)  with a topological Dijkgraaf-Witten term [3]} for the
finite group \(\mathsf {Out}(G)\)  added to the Yang-Mills action functional
(REF ); this corresponds to coupling the Yang-Mills
theory to a two-dimensional symmetry protected topological phase,
which is specified by the two-cocycle \(c\)  and protected by the \(\mathsf {Out}(G)\) -symmetry.
