public static long hilbertPositionToXY(int level, int pos) {
    pos = pos << (32 - 2 * level);

    int i0 = deinterleave(pos);
    int i1 = deinterleave(pos >>> 1);

    int t0 = (i0 | i1) ^ 0xFFFF;
    int t1 = i0 & i1;

    int prefixT0 = prefixScan(t0);
    int prefixT1 = prefixScan(t1);

    int a = (((i0 ^ 0xFFFF) & prefixT1) | (i0 & prefixT0));

    int resultX = (a ^ i1) >>> (16 - level);
    int resultY = (a ^ i0 ^ i1) >>> (16 - level);
    return ((long) resultX << 32) | resultY;
  }
Returns the x/y coordinates from hilbert index {@code pos} at {@code level} packed into a long.

Use {@link #extractX(long)} and {@link #extractY(long)} to extract x and y from the result.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/Hilbert.java