muiceoil and mairteoil are old compound words that were modified in the spelling reform of the 1940s. At this point, it makes most sense to think of them not as compound words, but as single words that follow the leathan le leathan, caol le caol rule, and that muc becomes muic so that there is a slender i before the cl to match the slender e that comes after it.
The plural of muc is muca. muice is the genitive of muc, but under normal circumstances, the genitive noun comes after the nominative noun - feoil mhuice - "meat of (a) pig"/"pig meat". You might guess that muiceoil is just feoil mhuice in reverse, but in the case of "mutton", you get caoireoil whereas the "genitive phrase" version would be feoil chaorach, whereas caoir is just a slenderized version of the nominative caora.
(I'm sure there's probably an official explanation for with it's muiceoil rather than feoil mhuice, but for the purposes of recognizing the meats that you might encounter, recognizing that the root has been slenderized to match the slender ending is probably sufficient).