// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// Generated by Fuzzlyn v1.4 on 2021-09-09 16:16:00
// Run on .NET 7.0.0-dev on X64 Windows
// Seed: 9372673482466191512
// Reduced from 87.8 KiB to 1.2 KiB in 00:02:21
// Debug: Outputs 1
// Release: Outputs 0
//
// Test that if we run out of budget during VN memory disambiguation,
// we still correctly mark the load of vr3[0] as loop variant.
//

using System.Runtime.CompilerServices;
using Xunit;

public class Program
{
    static int s_result = -1;

    [MethodImpl(MethodImplOptions.NoInlining)]
    static void Consume(ushort u)
    {
         if (u == 1)
         {
             s_result = 100;
         }
    }

    [Fact]
    public static int TestEntryPoint()
    {
        ushort[] vr3 = new ushort[]{0};
        for (int vr4 = 0; vr4 < 2; vr4++)
        {
            vr3[0] = 1;
            var vr5 = new byte[][][][]{new byte[][][]{new byte[][]{new byte[]{1}, new byte[]{1, 1}}}, new byte[][][]{new byte[][]{new byte[]{1, 1}, new byte[]{1, 1}}, new byte[][]{new byte[]{1}}, new byte[][]{new byte[]{1}}, new byte[][]{new byte[]{1}, new byte[]{1}}, new byte[][]{new byte[]{1}}}, new byte[][][]{new byte[][]{new byte[]{1}}, new byte[][]{new byte[]{1}}, new byte[][]{new byte[]{1}}, new byte[][]{new byte[]{1}, new byte[]{1}}, new byte[][]{new byte[]{1}, new byte[]{1}, new byte[]{1}}, new byte[][]{new byte[]{1}}}, new byte[][][]{new byte[][]{new byte[]{1, 1}}, new byte[][]{new byte[]{1}}, new byte[][]{new byte[]{1, 1}}, new byte[][]{new byte[]{0}}, new byte[][]{new byte[]{1}, new byte[]{1, 1}}}, new byte[][][]{new byte[][]{new byte[]{0}, new byte[]{0}, new byte[]{1}}, new byte[][]{new byte[]{1}, new byte[]{1, 1}}, new byte[][]{new byte[]{1}}, new byte[][]{new byte[]{1}}, new byte[][]{new byte[]{1}}}, new byte[][][]{new byte[][]{new byte[]{1, 1}}}};
            var vr6 = vr3[0];
            Consume(vr6);
        }
        return s_result;
    }
}