A surprisingly fun and light puzzle! Spent a few minutes on a spreadsheet mapping out encodings and found a pretty nice one. If we take 4 bits and map them out to 2, 2bit numbers, we can get 16 cases solved easily by counting quicksilver by 1's / 2's. (the left of the machine) The 5th bit activates some special logic that disables the last bit of a 2bit number by stealing the two's place atom (leaving 0-1), then it adds 4 by replacing a lead with silver (getting to 4-5). This maps 8 more cases. The final 8 cases are using the stolen bit to instead figure out if the output should be reversed or not. This leads all 32 cases covered, not using the 4 cases of (4-5, 5-4, 4-4, 5-5). Of course while building the machine I have shuffled around which input atoms actually correspond to which bits at my convenience, so the encoding looks undecipherable at a glance, but the core logic was surprisingly easy to implement.