code: def split_bits(value, *bits):
      
      result = []
      for b in reversed(bits):
          mask = (1 << b) - 1
          result.append(value & mask)
          value = value >> b
      assert value == 0
  
      result.reverse()
      return result
docs: Split integer value into list of ints, according to `bits` list.
  
      For example, split_bits(0x1234, 4, 8, 4) == [0x1, 0x23, 0x4]