/*
 * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

/**
 * @test
 * @bug 8287217
 * @summary CCP must remove nodes that are not traversed, else their type can be inconsistent
 * @run main/othervm -Xcomp -XX:CompileCommand=compileonly,Test::test
 *                   Test
 */

public class Test {

    static void test() {
        Byte x = 1;
        {
            boolean flagus8533 = _mutatorFlip();
            int limitus8533 = 2;
            for (; limitus8533 < 4; limitus8533 *= 2) { }
            int zerous8533 = 34;
            for (int peelus8533 = 2; peelus8533 < limitus8533; peelus8533++) { zerous8533 = 0; }
            for (int i = 0; i < 10000; i++) {
                if (flagus8533)
                    break;

                if (zerous8533 == 0) {
                    if ((i & 1) == 0) {
                        int Ni7073 = 32;
                        for (int i7073 = 0; i7073 < Ni7073; i7073++) {
                            if (i7073 < 10) {
                                x = (byte) x;
                            }
                        }
                        int Ni6055 = 32;
                        for (int i6055 = 0; i6055 < Ni6055; i6055++) {
                            if (foo22363366283782686(i6055, 10)) {
                                x = (byte) x;
                            }
                        }
                        int Ni8516 = 32;
                        for (int i8516 = 0; i8516 < Ni8516; i8516++) {
                            if (i8516 < 10) {
                                {
                                    final int N9719 = 32;
                                    java.lang.Object object9719 = "hot";
                                    for (int i9719 = 0; i9719 < N9719; i9719++) {
                                        object9719.toString();
                                        if (i9719 == N9719 - 1) {
                                            x = (byte) x;
                                        }
                                    }
                                    object9719 = java.lang.Integer.valueOf(1);
                                    object9719.toString();
                                    int Ni8496 = 32;
                                    for (int i8496 = 0; i8496 < Ni8496; i8496++) {
                                        if (i8496 < 10) {
                                            x = (byte) x;
                                        }
                                    }
                                    x = (byte) x;
                                }
                            }
                        }
                        int M769 = 4;
                        int N769 = 8;
                        for (int i769 = 0; i769 < M769; i769++) {
                            for (int j769 = 0; j769 < N769; j769++) {
                                switch (i769) {
                                    case -1, -2, -3 :
                                        break;
                                    case 0 :
                                        x = (byte) x;
                                }
                            }
                        }
                        int M3845 = 4;
                        int N3845 = 8;
                        for (int i3845 = 0; i3845 < M3845; i3845++) {
                            for (int j3845 = 0; foo22387793585598441(new MyInteger(j3845).v(), N3845); j3845++) {
                                switch (i3845) {
                                    case -1, -2, -3 :
                                        break;
                                    case 0 :
                                        x = (byte) x;
                                }
                            }
                        }
                        int M1595 = 4;
                        int N1595 = 8;
                        for (int i1595 = 0; foo22386442258156695(i1595, M1595); i1595++) {
                            for (int j1595 = 0; j1595 < N1595; j1595++) {
                                switch (i1595) {
                                    case -1, -2, -3 :
                                        break;
                                    case 0 :
                                        x = (byte) x;
                                }
                            }
                        }
                        x = (byte) x;
                    }
                } else {
                    if ((i & 1) == 0) {
                        int Ni7073 = 32;
                        for (int i7073 = 0; i7073 < Ni7073; i7073++) {
                            if (i7073 < 10) {
                                x = (byte) x;
                            }
                        }
                        int Ni6055 = 32;
                        for (int i6055 = 0; i6055 < Ni6055; i6055++) {
                            if (foo22363366283782686(i6055, 10)) {
                                x = (byte) x;
                            }
                        }
                        int Ni8516 = 32;
                        for (int i8516 = 0; i8516 < Ni8516; i8516++) {
                            if (i8516 < 10) {
                                {
                                    final int N9719 = 32;
                                    java.lang.Object object9719 = "hot";
                                    for (int i9719 = 0; i9719 < N9719; i9719++) {
                                        object9719.toString();
                                        if (i9719 == N9719 - 1) {
                                            x = (byte) x;
                                        }
                                    }
                                    object9719 = java.lang.Integer.valueOf(1);
                                    object9719.toString();
                                    int Ni8496 = 32;
                                    for (int i8496 = 0; i8496 < Ni8496; i8496++) {
                                        if (i8496 < 10) {
                                            x = (byte) x;
                                        }
                                    }
                                    x = (byte) x;
                                }
                            }
                        }
                        int M769 = 4;
                        int N769 = 8;
                        for (int i769 = 0; i769 < M769; i769++) {
                            for (int j769 = 0; j769 < N769; j769++) {
                                switch (i769) {
                                    case -1, -2, -3 :
                                        break;
                                    case 0 :
                                        x = (byte) x;
                                }
                            }
                        }
                        int M3845 = 4;
                        int N3845 = 8;
                        for (int i3845 = 0; i3845 < M3845; i3845++) {
                            for (int j3845 = 0; j3845 < N3845; j3845++) {
                                switch (i3845) {
                                    case -1, -2, -3 :
                                        break;
                                    case 0 :
                                        x = (byte) x;
                                }
                            }
                        }
                        int M1595 = 4;
                        int N1595 = 8;
                        for (int i1595 = 0; i1595 < M1595; i1595++) {
                            for (int j1595 = 0; j1595 < N1595; j1595++) {
                                switch (i1595) {
                                    case -1, -2, -3 :
                                        break;
                                    case 0 :
                                        x = (byte) x;
                                }
                            }
                        }
                        {
                            int limitlz194 = 2;
                            for (; limitlz194 < 4; limitlz194 *= 2) { }
                            int zerolz194 = 34;
                            for (int peellz194 = 2; peellz194 < limitlz194; peellz194++) { zerolz194 = 0; }
                            if (zerolz194 == 0) {
                                int Ni4194 = 32;
                                for (int i4194 = 0; i4194 < Ni4194; i4194++) {
                                    if (i4194 < 10)
                                        x = (byte) x;

                                }
                                x = (byte) x;
                            } else {
                                x = (byte) x;
                            }
                        }
                    }
                    int _unswitchMarkus8533 = 0;
                }
            }
        }
    }

    public static void main(String[] strArr) {
        for (int i = 0; i < 11; i++) {
            test();
        }
    }

    private static boolean foo22363366283782686(int p0, int p1) {
        return foo22363537003847861(p0, p1);
    }

    private static boolean foo22363537003847861(int p0, int p1) {
        return p0 < p1;
    }

    private static volatile boolean _mutatorToggle = false;

    private static boolean _mutatorFlip() {
        {
            final int N7263 = 32;
            java.lang.Object object7263 = "hot";
            for (int i7263 = 0; i7263 < N7263; i7263++) {
                object7263.toString();
                if (i7263 == N7263 - 1)
                    _mutatorToggle = !_mutatorToggle;

            }
            object7263 = java.lang.Integer.valueOf(1);
            object7263.toString();
            {
                int limitlz6386 = 2;
                for (; limitlz6386 < 4; limitlz6386 *= 2) { };
                int zerolz6386 = 34;
                for (int peellz6386 = 2; peellz6386 < limitlz6386; peellz6386++) { zerolz6386 = 0; };
                if (zerolz6386 == 0) {
                    _mutatorToggle = !_mutatorToggle;
                } else {
                    _mutatorToggle = !_mutatorToggle;
                }
            }
        }
        return _mutatorToggle;
    }

    private static boolean foo22386442258156695(int p0, int p1) {
        return p0 < p1;
    }

    static class MyInteger {
        public int v;

        public MyInteger(int v) {
            int M8103 = 4;
            int N8103 = 8;
            for (int i8103 = 0; i8103 < M8103; i8103++) {
                for (int j8103 = 0; j8103 < N8103; j8103++) {
                    switch (i8103) {
                        case -1, -2, -3 :
                            break;
                        case 0 :
                            this.v = v;
                    }
                }
            }
            {
                int limitlz1549 = 2;
                for (; limitlz1549 < 4; limitlz1549 *= 2) { }
                int zerolz1549 = 34;
                for (int peellz1549 = 2; peellz1549 < limitlz1549; peellz1549++) { zerolz1549 = 0; }
                if (zerolz1549 == 0) {
                    int M4018 = 4;
                    int N4018 = 8;
                    for (int i4018 = 0; i4018 < M4018; i4018++) {
                        for (int j4018 = 0; j4018 < N4018; j4018++) {
                            switch (i4018) {
                                case -1, -2, -3 :
                                    break;
                                case 0 :
                                    this.v = v;
                            }
                        }
                    }
                    this.v = v;
                } else {
                    this.v = v;
                }
            }
        }

        public int v() {
            return v;
        }
    }

        private static boolean foo22387793585598441(int p0, int p1) {
            return p0 < p1;
        }
}
