On the Subject of Dominoes

There’s the two types of ways to use ‘em, as a game or as an open sandbox.

The top of the module displays 4 buttons which are broken and cannot be pushed without the help of the lines of dominoes shown below them. Determine the order of which to push the buttons by looking at the numbers shown on each of the white dots on the starting domino in each line. If a button is pushed down by a domino out of order, a strike will occur and the module will reset. The module must be looked at from below to see the dots on the dominoes.

Each domino has 2 sets of dots, 1 to 6, above and below a white line. A value will be given to each line to determine the order. Use the following instructions to determine the values for all four domino lines.

If there are 3 or more ports on the bomb, add both amounts.
Otherwise, if there are 3 or more batteries on the bomb, subtract the top amount by the bottom amount.
Otherwise, if there are any lit indicators, multiply both amounts.
Otherwise, divide the bottom amount by the top amount.

Finally, decide which order the buttons should be pressed down in.

If there are more lit indicators than unlit indicators, use ascending order.
Otherwise, if there are more unlit indicators than lit indicators, use descending order.
Otherwise, if the 3rd character of the serial number is even, use descending order.
Otherwise, use ascending order.

If you have 2 results which are the same, press them in the order that they appear in on the bomb.