Forcing bits on
OR is the bit-setter: every bit the mask has on comes out on in the result, and the rest pass through untouched. For that, MWCC uses ori.
Watch n get OR'd with 0x05, decimal 5:
ori r3, r3, 5
blr
Plain ori has no dot, so it never touches the condition register the way andi. does. Contiguity doesn't matter either — ori swallows any 16-bit pattern you throw at it, which is why the rotate tricks AND sometimes needs never show up here.
The one real limit is width. A constant past the low 16 bits won't fit, so MWCC splits it in two: oris for the high half-word, ori for the low. A pair like that just means the mask outgrew the bottom 16 bits.
The target is below. Turn its ori immediate back into the mask, then write the C expression behind it.
ori r3, r3, 18
blr
Your task
Write func_8031d49c to match the target.