// Path: src/io/lacuna/bifurcan/utils/Bits.java
// public static int bitOffset(long n) {
//   return deBruijnIndex[0xFF & (int) ((n * 0x022fdd63cc95386dL) >>> 58)];
// }
// 
// Path: src/io/lacuna/bifurcan/utils/Bits.java
// public static long highestBit(long n) {
//   return Long.highestOneBit(n);
// }
// 
// Path: src/io/lacuna/bifurcan/utils/Bits.java
// public static long lowestBit(long n) {
//   return n & -n;
// }


import java.util.NoSuchElementException;
import java.util.PrimitiveIterator;
import static io.lacuna.bifurcan.utils.Bits.bitOffset;
import static io.lacuna.bifurcan.utils.Bits.highestBit;
import static io.lacuna.bifurcan.utils.Bits.lowestBit;
import static java.lang.Integer.bitCount;
  }

  public static int startIndex(int bitmap) {
    return bitOffset(lowestBit(bitmap & 0xFFFFFFFFL));
  }

  public static int endIndex(int bitmap) {
    return bitOffset(highestBit(bitmap & 0xFFFFFFFFL));
  }

  public static PrimitiveIterator.OfInt masks(int bitmap) {
    return new PrimitiveIterator.OfInt() {
      int b = bitmap;

      @Override
      public int nextInt() {
        int result = lowestBit(b);
        b &= ~result;
        return result;
      }

      @Override
      public boolean hasNext() {
        return b != 0;
      }
    };
  }

  static PrimitiveIterator.OfInt reverseMasks(int bitmap) {
    return new PrimitiveIterator.OfInt() {
// Path: src/io/lacuna/bifurcan/utils/Bits.java
// public static int bitOffset(long n) {
//   return deBruijnIndex[0xFF & (int) ((n * 0x022fdd63cc95386dL) >>> 58)];
// }
// 
// Path: src/io/lacuna/bifurcan/utils/Bits.java
// public static long highestBit(long n) {
//   return Long.highestOneBit(n);
// }
// 
// Path: src/io/lacuna/bifurcan/utils/Bits.java
// public static long lowestBit(long n) {
//   return n & -n;
// }


// Path: src/io/lacuna/bifurcan/nodes/Util.java
import java.util.NoSuchElementException;
import java.util.PrimitiveIterator;
import static io.lacuna.bifurcan.utils.Bits.bitOffset;
import static io.lacuna.bifurcan.utils.Bits.highestBit;
import static io.lacuna.bifurcan.utils.Bits.lowestBit;
import static java.lang.Integer.bitCount;

  }

  public static int startIndex(int bitmap) {
    return bitOffset(lowestBit(bitmap & 0xFFFFFFFFL));
  }

  public static int endIndex(int bitmap) {
    return bitOffset(highestBit(bitmap & 0xFFFFFFFFL));
  }

  public static PrimitiveIterator.OfInt masks(int bitmap) {
    return new PrimitiveIterator.OfInt() {
      int b = bitmap;

      @Override
      public int nextInt() {
        int result = lowestBit(b);
        b &= ~result;
        return result;
      }

      @Override
      public boolean hasNext() {
        return b != 0;
      }
    };
  }

  static PrimitiveIterator.OfInt reverseMasks(int bitmap) {
    return new PrimitiveIterator.OfInt() {
      int b = bitmap;