def preprocess_code(code)
      code = Utils.bytes_to_int_array code
      ops = []

      i = 0
      while i < code.size
        o = Opcodes::TABLE.fetch(code[i], [:INVALID, 0, 0, 0]) + [code[i], 0]
        ops.push o

        if o[0][0,Opcodes::PREFIX_PUSH.size] == Opcodes::PREFIX_PUSH
          n = o[0][Opcodes::PREFIX_PUSH.size..-1].to_i
          n.times do |j|
            i += 1
            byte = i < code.size ? code[i] : 0
            o[-1] = (o[-1] << 8) + byte

            # polyfill, these INVALID ops will be skipped in execution
            ops.push [:INVALID, 0, 0, 0, byte, 0] if i < code.size
          end
        end

        i += 1
      end

      ops
    end
def preprocess_code(code)
      code = Utils.bytes_to_int_array code
      ops = []

      i = 0
      while i < code.size
        o = Opcodes::TABLE.fetch(code[i], [:INVALID, 0, 0, 0]) + [code[i], 0]
        ops.push o

        if o[0][0,Opcodes::PREFIX_PUSH.size] == Opcodes::PREFIX_PUSH
          n = o[0][Opcodes::PREFIX_PUSH.size..-1].to_i
          n.times do |j|
            i += 1
            byte = i < code.size ? code[i] : 0
            o[-1] = (o[-1] << 8) + byte

            # polyfill, these INVALID ops will be skipped in execution
            ops.push [:INVALID, 0, 0, 0, byte, 0] if i < code.size
          end
        end

        i += 1
      end

      ops
    end
Preprocesses code, and determines which locations are in the middle of
 pushdata and thus invalid