public class P2 {
    public static void main (String[] args) {
        test(true, false);
    }
    public static void test(boolean flag, boolean flag2) {
        int x = 0;
        if (flag2) { // runtime check, avoid infinite loop
            while (true) { // infinite loop (no exit)
                if (flag) {
                    x++;
                }
                do { // inner loop
                    // assert for this block
                    // Region
                    // Phi -> SubI -> XorI ---> Phi
                    x = (x - 1) ^ 1;
                    // Problem: this looks like a loop, but we have no LoopNode
                    // We have no LoopNode, because this is all in an infinite
                    // loop, and during PhaseIdealLoop::build_loop_tree we do not
                    // attach the loops of an infinite loop to the loop tree,
                    // and hence we do not get to call beautify_loop on these loops
    	            // which would have turned the Region into a LoopNode.
                } while (x < 0);
            }
        }
    }
}
