><>, 56 bytes
Try it online! or verify all mutations.
How the original program works (outdated)
The interpreter starts in cell (0, 0).
^ sets the direction to upwards, so the instruction pointer (IP) wraps around to cell (0, 20).
' activates string mode: until the next
' is encountered, all characters under the IP are pushed on the stack. The same
' is found again after wrapping around, so we push
The IP lands at (0, 19), still going upwards. Executing
d3*} pushes 13 = 0xd, then 3, multiplies both values (39 / single quote), then rotates the stack to the right. This leaves the stack as follows.
The next two instructions (
^) do nothing at this point.
:84*= duplicates the top of the stack, pushes 8 and 4, multiplies them (32 / space), then tests the duplicated character for equality with space. For the unaltered program, this will always push 0.
? skips the next instruction if the top of the stack is falsy. For the original program, it always is, so
~ is always skipped.
oao pops and prints the top of the stack, pushes a 10 / linefeed, then pops and prints linefeed.
0f. jumps to cell (0, 15) (the bottommost
^), starting over with the next character on the stack.
Once the stack is empty, the entire source code has been printed.
: will fail and the program exits.
How the mutated programs work (outdated)
Duplicating any non-linefeed character will only extend the program horizontally. Since the program is executed vertically, these extra instructions will never get executed.
Duplicating any linefeed before the bottomost
^ will shift cells (0, 14) and (0, 15) to (0, 15) and (0, 16).
0f. will now jump to the cell before the bottommost
^, which is also a
^, so the program is not affected by the shift.
Finally, any duplicated linefeed character will also alter the string. Short lines are padded with spaces, so a 32 / space will be inserted at the linefeed's position.
84*= will push 1 for space, so
? doesn't skip the next instruction. In this case,
~ pops and discards space, so the following
o will print the character above space instead.