The input is split into a 2-atom string and a 3-atom string, each one corresponding to one metal in the output. Triplex is used to move each string out of the way before it is used to transport quicksilver, meaning salt=1 and fire=0. Each string is read in reverse, so salt-fire-salt-fire-fire corresponds to the binary number 01001. The number for each string is the number of quicksilver added to the metal. If the 3-atom string is 110 or 111 (6 or 7), there are too many quicksilver to be stored in a single metal, so they are special cased. The overall string would be xx11x, meaning there are 8 special case inputs. Luckily, gold and silver have yet to be used as the first atom of an output, so they are used to mark the special case outputs. The original first atom (from the 2-atom string) becomes the new second atom, and the first atom becomes gold if the string ends in 0 and silver if the string ends in 1. This leaves the four unused output strings as the ones that use only silver and gold.