Multiply, Subtact, bitwise AND

Your code should read the values in RAM[0] and RAM[1], then behave as follows:

  • If RAM[1] = 0, multiply RAM[0] by −3 and store the result in RAM[2].
  • If RAM[1] = 3, subtract 50 from RAM[0] and store the result in RAM[2].
  • Otherwise, take a bitwise AND of RAM[0] with RAM[1] and store the result in RAM[2].

For example, given these input values, your code should leave the following values in RAM[2]:

RAM[0] RAM[1] RAM[2]
-2 0 6
51 3 1
30 15 14

You may assume that RAM[0] is between −10000 and 10000 (so that no integer overflows can occur). For full credit your code will need to pass several test cases.