// Reduced reproducer for JDK-8371146 (jdk-26+23):
// java -XX:CompileCommand=compileonly,TestReduced::test -XX:-TieredCompilation -Xcomp -XX:+StressLoopPeeling -XX:+UseG1GC -XX:StressSeed=4 TestReduced.java
// java -XX:CompileCommand=compileonly,TestReduced::test -XX:-TieredCompilation -Xcomp -XX:+StressLoopPeeling -XX:+UseZGC -XX:StressSeed=4 -XX:LoopUnrollLimit=48 TestReduced.java

class TestReduced {
    static int sum;
    static boolean condition;
    static int zero;
    static int twoDimensional[][];

    static void test() {
        int innerCount = 0;
        int conditionCount = 0;
        int oneDimensional[] = new int[10];
        for (int i = 2; i > 0; --i) {
            for (int j = i; j < 10; j++) {
                innerCount += 1;
                oneDimensional[1] += innerCount;
                oneDimensional[j] += zero;
                if (condition) {
                    conditionCount += 1;
                    oneDimensional[1] += conditionCount;
                    sum += oneDimensional[1];
                }
                twoDimensional[j] = twoDimensional[j + 1];
            }
        }
    }

    public static void main(String[] k) {
        test();
    }
}
