Solution (source code)

= Solution

Define
$$
\chi=Oc.
$$
Because $O$ is real orthogonal, the $\chi_j$ are again self-adjoint and satisfy the Majorana anticommutation relations. Using $A=O^T\varepsilon O$,
$$
H=\frac i4\chi^T\varepsilon\chi.
$$
Each two-dimensional block contributes twice the same ordered bilinear:
$$
\chi_{2j-1}\epsilon_j\chi_{2j}
+\chi_{2j}(-\epsilon_j)\chi_{2j-1}
=2\epsilon_j\chi_{2j-1}\chi_{2j}.
$$
Hence
$$
\boxed{
H=\frac12\sum_{j=1}^M
\epsilon_j\,i\chi_{2j-1}\chi_{2j}}
$$
up to the original additive constant.