package edu.cmu.cs.vbc.prog.benchmark;

import edu.cmu.cs.varex.annotation.VConditional;

/**
 *
 * @author chupanw
 */
public class SortArray {
    @VConditional
    public static boolean f1;
    @VConditional
    public static boolean f2;
    @VConditional
    private static boolean f3;
    @VConditional
    private static boolean f4;
    @VConditional
    private static boolean f5;
    @VConditional
    private static boolean f6;
    @VConditional
    private static boolean f7;
    @VConditional
    private static boolean f8;
    @VConditional
    private static boolean f9;
    @VConditional
    private static boolean f10;


    public int[] randomArray = new int[]{2200,2308,4687,6445,8610,1627,8591,1513,1899,4467,3090,1910,6139,9155,8436,2222,7846,6865,278,6130,2154,5180,4837,775,6917,6776,9688,7007,3619,8566,9154,8672,4820,8303,712,3187,4988,2094,7005,2314,501,9911,6728,3583,7439,184,7527,5190,2199,4986,1645,126,453,7459,7191,1801,2943,6828,6380,5973,7035,3274,9874,4518,3698,2636,7069,2242,6096,4831,3123,921,408,9009,9611,8207,5013,2336,2500,6552,3627,1790,9602,9935,6491,6820,7779,9474,6549,6144,4943,5629,6152,5324,8414,3537,5125,508,67,6769,5602,8436,9318,1081,1786,6260,5856,252,7345,3137,79,984,6341,5072,186,5096,6609,7026,302,2774,9339,2551,2342,202,3837,4192,8457,3588,4753,213,1069,4818,9765,5696,1770,8414,4878,9492,9354,9464,5784,5693,8940,5291,3323,7893,4535,2590,1914,9280,9196,2505,565,1717,4868,2914,7055,6026,8968,2723,4442,2587,4848,4410,7933,6294,5139,7933,5719,70,6477,6215,2926,1593,6111,6500,1488,5808,3247,2341,7915,9636,7312,7088,9768,1071,7533,4919,3937,2846,3215,2499,387,465,2686,2156,5823,3627,7892,3496,2107,6861,7357,7679,4646,730,4891,7543,9176,5014,38,4352,3255,9792,9888,2269,5430,6505,806,5997,7048,3919,1042,598,1650,5499,173,4430,1519,6739,243,5061,8381,5661,7311,2066,8420,7986,2469,1400,9415,5114,5598,8484,5603,5689,7182,4822,2036,3685,9345,4090,4103,8691,7284,130,3738,5102,1633,6545,3184,7315,6130,3399,5057,3323,9286,3572,8941,8742,5537,7419,1857,1984,8877,8565,3122,9235,7871,5566,8679,3097,1989,1168,291,2956,3691,8361,6111,5805,188,5564,7734,6381,1590,9650,1610,1930,2118,7274,7317,3001,1954,8804,618,797,4086,6438,7561,8082,6646,2857,3361,8873,9011,7955,4271,7408,6729,3073,3925,3100,7988,3681,2167,4182,7170,5306,1534,5791,7924,2840,5679,3745,3118,6872,6070,4420,1486,348,5627,5706,7161,5275,6967,3928,7937,4040,6032,8481,3491,4573,6400,400,300,5237,6660,5169,252,4195,1488,6717,706,5490,3616,4033,6023,3641,9017,7514,9303,1370,7517,6703,5402,9368,2110,8074,2162,2371,58,6164,9148,7218,4836,828,4360,9035,467,9940,9782,3953,4484,4825,5990,4955,9067,3613,6034,7677,9767,6130,7672,4310,8195,8996,1246,4837,1512,3380,6234,5368,9408,8701,7658,8482,9141,5557,2909,8616,2152,3106,2549,9625,686,6678,8964,1560,5637,5352,9347,23,2164,9104,2754,8402,2304,2895,4089,996,1403,5081,3949,7306,774,2368,8735,7411,2119,2958,1662,7024,2742,8110,4700,2030,4258,4488,7166,3948,8017,6584,2509,6091,4404,4265,9242,9650,4408,9763,5583,5403,8905,1757,4048,1150,5729,8145,2672,1559,7807,6188,3231,470,5938,7982,4801,8388,532,772,874,4061,6404,6495,5286,478,8587,8192,3989,4043,1104,7667,4003,3629,5384,9989,1430,7879,9301,756,6704,9796,1087,770,4037,959,8400,8564,7542,1359,3560,6765,8028,6332,1041,5986,3280,3010,7741,1610,1654,4161,7644,9348,9114,2142,7434,2869,8675,3914,2165,8252,5701,7117,1484,5892,7795,6991,8162,4854,6288,1155,594,71,1318,8736,2925,6965,9440,2445,767,346,3250,5720,2655,4331,4200,9635,8293,5824,2268,9275,2742,3967,8049,3431,7290,3127,8221,393,9359,7110,9923,660,1414,8647,6302,4523,1931,8700,2490,3153,4035,2612,6699,4803,3854,3482,3185,6862,9723,1578,2644,2894,2091,4415,2217,3668,7389,7918,1143,6771,601,4665,2179,6327,1752,4961,9783,6498,160,91,1537,276,6190,1037,5831,7735,2668,4886,3033,6821,674,8903,3535,6902,4120,6866,6625,3497,7194,9309,3942,7486,6020,2211,3379,7614,3581,2024,5573,9416,4592,6166,6794,697,8788,3848,4090,4471,9854,403,9475,1546,7229,3212,6081,1592,4947,8394,3837,4603,5923,2569,7100,2561,1733,2840,9257,6671,8423,3120,525,9506,366,6849,5401,725,4730,9738,3846,9912,151,7189,2484,6547,8511,7293,4943,4887,5805,7180,9136,2861,573,870,7808,6989,496,1804,6775,205,4827,8941,4418,1044,2430,9135,4434,7578,4290,6470,3265,2510,5100,2607,1552,6451,9294,3884,4588,7080,7821,8125,4111,5139,5005,5398,2707,2313,840,2434,8785,5244,4397,2068,8104,2882,645,6950,3481,5006,706,1409,2414,7149,6656,6807,8827,5455,4909,4752,5821,2655,5733,703,4750,2641,4773,8992,9179,7271,7105,6432,2045,3441,3746,3321,9283,8383,423,1577,6161,2707,9836,1198,5042,8840,5448,8688,168,1817,6640,3482,8836,4799,4425,5606,3601,6523,2491,2789,4011,1820,4896,904,5005,206,2300,2751,184,8960,1415,1787,2287,7055,2086,3361,5951,820,3479,2365,1484,3510,9163,1952,167,6062,9006,6456,9148,3702,817,6411,3175,6588,7433,6944,1670,8745,1440,8042,42,72,9034,7121,5191,5749,8274,4351,7819,9812,1346,3252,1099,5083,482,8758,7913,8861,8503,5704,2082,9396,3149,6566,6420,2986,2735,8730,6172,7972,3139,2014,7725,9884,5779,6399,3341,937,2486,4923,6185,157,2733,9223,2809,5803,3912,8606,5455,8627,8649,1018,7720,6347,305,2008,3781,9579,6295,3100,9763,5333,9111,7536,2806,4160,9047,4794,2660,8160,628,201,1182,9699,8827,5995,9562,3482,8787,8143,747,9490,3688,4097,4498,2526,6547,6808,5966,179,8228,712,3934,8095,9346,3428,4072,3687,5225,5188,2194,6460,6786,2478,6621,1833,960,2996,7825,1468,3334,5562,5859,2606,3623,915,500,929,5237,8199,1379,5365,7675,2147,6899,3191,9382,4941,951,5238,958,1873,1289,6083,2706,3293,9338,4724,9521,4390,3523,3077,4389,4773,6682,8797,8730,1554,2289,3400,2205,7339,8649,2086,6271,3713,788,6351};

    public static void main(String[] args) {
        SortArray foo = new SortArray(); // trigger auto initialization of conditional fields
        sort(foo.randomArray);
        SortArray bar = new SortArray();
        modify(bar.randomArray);
        sort(bar.randomArray);
    }

    private static void modify(int[] a) {
        for (int i = 0; i < a.length; i+=10) {
            if (f1)
                a[i + 0] += 1;
            if (f2)
                a[i + 1] += 2;
            if (f3)
                a[i + 2] += 3;
            if (f4)
                a[i + 3] += 4;
            if (f5)
                a[i + 4] += 5;
            if (f6)
                a[i + 5] += 6;
            if (f7)
                a[i + 6] += 7;
            if (f8)
                a[i + 7] += 8;
            if (f9)
                a[i + 8] += 9;
            if (f10)
                a[i + 9] += 10;
        }
    }

    private static void sort(int[] a) {
        java.util.Arrays.sort(a);
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }
    }
}
