// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

import sign.signlink;

public class Class22
{

    public static Class22 method273(int i)
    {
        for(int j = 0; j < 20; j++)
            if(aClass22Array304[j].anInt305 == i)
                return aClass22Array304[j];

        anInt306 = (anInt306 + 1) % 20;
        Class22 class22 = aClass22Array304[anInt306];
        aClass31_Sub3_Sub2_348.anInt1440 = anIntArray334[i];
        class22.anInt305 = i;
        class22.method280();
        class22.method279(aClass31_Sub3_Sub2_348, (byte)59);
        return class22;
    }

    public boolean method274(int i, int j)
    {
        if(i != 0)
        {
            for(int k = 1; k > 0; k++);
        }
        if(anIntArray326 == null)
        {
            if(anIntArray324 == null)
                return true;
            if(j != 10)
                return true;
            boolean flag = true;
            for(int i1 = 0; i1 < anIntArray324.length; i1++)
                flag &= Class31_Sub3_Sub3_Sub2.method468(anIntArray324[i1] & 0xffff);

            return flag;
        }
        for(int l = 0; l < anIntArray326.length; l++)
            if(anIntArray326[l] == j)
                return Class31_Sub3_Sub3_Sub2.method468(anIntArray324[l] & 0xffff);

        return true;
    }

    public static void method275(Class11 class11)
    {
        aClass31_Sub3_Sub2_348 = new Class31_Sub3_Sub2((byte)114, class11.method204("loc.dat", null));
        Class31_Sub3_Sub2 class31_sub3_sub2 = new Class31_Sub3_Sub2((byte)114, class11.method204("loc.idx", null));
        anInt346 = class31_sub3_sub2.method424();
        anIntArray334 = new int[anInt346];
        int i = 2;
        for(int j = 0; j < anInt346; j++)
        {
            anIntArray334[j] = i;
            i += class31_sub3_sub2.method424();
        }

        aClass22Array304 = new Class22[20];
        for(int k = 0; k < 20; k++)
            aClass22Array304[k] = new Class22();

    }

    public Class22 method276(int i)
    {
        i = 38 / i;
        int j = -1;
        if(anInt325 != -1)
        {
            Class13 class13 = Class13.aClass13Array218[anInt325];
            int k = class13.anInt220;
            int l = class13.anInt221;
            int i1 = class13.anInt222;
            int j1 = client.anIntArray1305[i1 - l];
            j = aClient341.anIntArray1111[k] >> l & j1;
        } else
        if(anInt303 != -1)
            j = aClient341.anIntArray1111[anInt303];
        if(j < 0 || j >= anIntArray320.length || anIntArray320[j] == -1)
            return null;
        else
            return method273(anIntArray320[j]);
    }

    public static void method277(boolean flag)
    {
        aClass36_347 = null;
        aClass36_342 = null;
        if(flag)
        {
            return;
        } else
        {
            anIntArray334 = null;
            aClass22Array304 = null;
            aClass31_Sub3_Sub2_348 = null;
            return;
        }
    }

    public Class31_Sub3_Sub3_Sub2 method278(int i, int j, boolean flag, int k)
    {
        if(!flag)
            throw new NullPointerException();
        Class31_Sub3_Sub3_Sub2 class31_sub3_sub3_sub2 = null;
        long l;
        if(anIntArray326 == null)
        {
            if(j != 10)
                return null;
            l = (long)((anInt305 << 6) + i) + ((long)(k + 1) << 32);
            Class31_Sub3_Sub3_Sub2 class31_sub3_sub3_sub2_1 = (Class31_Sub3_Sub3_Sub2)aClass36_342.method565(l);
            if(class31_sub3_sub3_sub2_1 != null)
                return class31_sub3_sub3_sub2_1;
            if(anIntArray324 == null)
                return null;
            boolean flag2 = aBoolean328 ^ (i > 3);
            int k1 = anIntArray324.length;
            for(int l1 = 0; l1 < k1; l1++)
            {
                int k2 = anIntArray324[l1];
                if(flag2)
                    k2 += 0x10000;
                class31_sub3_sub3_sub2 = (Class31_Sub3_Sub3_Sub2)aClass36_347.method565(k2);
                if(class31_sub3_sub3_sub2 == null)
                {
                    class31_sub3_sub3_sub2 = Class31_Sub3_Sub3_Sub2.method467(k2 & 0xffff);
                    if(class31_sub3_sub3_sub2 == null)
                        return null;
                    if(flag2)
                        class31_sub3_sub3_sub2.method482((byte)8);
                    aClass36_347.method566(k2, true, class31_sub3_sub3_sub2);
                }
                if(k1 > 1)
                    aClass31_Sub3_Sub3_Sub2Array332[l1] = class31_sub3_sub3_sub2;
            }

            if(k1 > 1)
                class31_sub3_sub3_sub2 = new Class31_Sub3_Sub3_Sub2(aClass31_Sub3_Sub3_Sub2Array332, 3, k1);
        } else
        {
            int i1 = -1;
            for(int j1 = 0; j1 < anIntArray326.length; j1++)
            {
                if(anIntArray326[j1] != j)
                    continue;
                i1 = j1;
                break;
            }

            if(i1 == -1)
                return null;
            l = (long)((anInt305 << 6) + (i1 << 3) + i) + ((long)(k + 1) << 32);
            Class31_Sub3_Sub3_Sub2 class31_sub3_sub3_sub2_2 = (Class31_Sub3_Sub3_Sub2)aClass36_342.method565(l);
            if(class31_sub3_sub3_sub2_2 != null)
                return class31_sub3_sub3_sub2_2;
            int i2 = anIntArray324[i1];
            boolean flag4 = aBoolean328 ^ (i > 3);
            if(flag4)
                i2 += 0x10000;
            class31_sub3_sub3_sub2 = (Class31_Sub3_Sub3_Sub2)aClass36_347.method565(i2);
            if(class31_sub3_sub3_sub2 == null)
            {
                class31_sub3_sub3_sub2 = Class31_Sub3_Sub3_Sub2.method467(i2 & 0xffff);
                if(class31_sub3_sub3_sub2 == null)
                    return null;
                if(flag4)
                    class31_sub3_sub3_sub2.method482((byte)8);
                aClass36_347.method566(i2, true, class31_sub3_sub3_sub2);
            }
        }
        boolean flag1;
        if(anInt329 != 128 || anInt338 != 128 || anInt318 != 128)
            flag1 = true;
        else
            flag1 = false;
        boolean flag3;
        if(anInt310 != 0 || anInt336 != 0 || anInt333 != 0)
            flag3 = true;
        else
            flag3 = false;
        Class31_Sub3_Sub3_Sub2 class31_sub3_sub3_sub2_3 = new Class31_Sub3_Sub3_Sub2(Class32.method509(k, true), class31_sub3_sub3_sub2, i == 0 && k == -1 && !flag1 && !flag3, false, anIntArray314 == null);
        if(k != -1)
        {
            class31_sub3_sub3_sub2_3.method474(166);
            class31_sub3_sub3_sub2_3.method475(257, k);
            class31_sub3_sub3_sub2_3.anIntArrayArray1575 = null;
            class31_sub3_sub3_sub2_3.anIntArrayArray1574 = null;
        }
        while(i-- > 0) 
            class31_sub3_sub3_sub2_3.method478((byte)93);
        if(anIntArray314 != null)
        {
            for(int j2 = 0; j2 < anIntArray314.length; j2++)
                class31_sub3_sub3_sub2_3.method481(anIntArray314[j2], anIntArray350[j2]);

        }
        if(flag1)
            class31_sub3_sub3_sub2_3.method483(anInt329, -39776, anInt338, anInt318);
        if(flag3)
            class31_sub3_sub3_sub2_3.method480(anInt310, anInt336, false, anInt333);
        class31_sub3_sub3_sub2_3.method484(64 + aByte340, 768 + aByte308 * 5, -50, -10, -50, !aBoolean322);
        if(anInt321 == 1)
            class31_sub3_sub3_sub2_3.anInt1571 = ((Class31_Sub3_Sub3) (class31_sub3_sub3_sub2_3)).anInt1454;
        aClass36_342.method566(l, true, class31_sub3_sub3_sub2_3);
        return class31_sub3_sub3_sub2_3;
    }

    public void method279(Class31_Sub3_Sub2 class31_sub3_sub2, byte byte0)
    {
        if(byte0 != 59)
            throw new NullPointerException();
        int i = -1;
label0:
        do
        {
            int j;
            do
            {
                j = class31_sub3_sub2.method422();
                if(j == 0)
                    break label0;
                if(j == 1)
                {
                    int k = class31_sub3_sub2.method422();
                    if(k > 0)
                        if(anIntArray324 == null || aBoolean309)
                        {
                            anIntArray326 = new int[k];
                            anIntArray324 = new int[k];
                            for(int k1 = 0; k1 < k; k1++)
                            {
                                anIntArray324[k1] = class31_sub3_sub2.method424();
                                anIntArray326[k1] = class31_sub3_sub2.method422();
                            }

                        } else
                        {
                            class31_sub3_sub2.anInt1440 += k * 3;
                        }
                } else
                if(j == 2)
                    aString331 = class31_sub3_sub2.method429();
                else
                if(j == 3)
                    aByteArray330 = class31_sub3_sub2.method430((byte)0);
                else
                if(j == 5)
                {
                    int l = class31_sub3_sub2.method422();
                    if(l > 0)
                        if(anIntArray324 == null || aBoolean309)
                        {
                            anIntArray326 = null;
                            anIntArray324 = new int[l];
                            for(int l1 = 0; l1 < l; l1++)
                                anIntArray324[l1] = class31_sub3_sub2.method424();

                        } else
                        {
                            class31_sub3_sub2.anInt1440 += l * 2;
                        }
                } else
                if(j == 14)
                    anInt323 = class31_sub3_sub2.method422();
                else
                if(j == 15)
                    anInt344 = class31_sub3_sub2.method422();
                else
                if(j == 17)
                    aBoolean302 = false;
                else
                if(j == 18)
                    aBoolean315 = false;
                else
                if(j == 19)
                {
                    i = class31_sub3_sub2.method422();
                    if(i == 1)
                        aBoolean316 = true;
                } else
                if(j == 21)
                    aBoolean349 = true;
                else
                if(j == 22)
                    aBoolean322 = true;
                else
                if(j == 23)
                    aBoolean337 = true;
                else
                if(j == 24)
                {
                    anInt343 = class31_sub3_sub2.method424();
                    if(anInt343 == 65535)
                        anInt343 = -1;
                } else
                if(j == 28)
                    anInt313 = class31_sub3_sub2.method422();
                else
                if(j == 29)
                    aByte340 = class31_sub3_sub2.method423();
                else
                if(j == 39)
                    aByte308 = class31_sub3_sub2.method423();
                else
                if(j >= 30 && j < 39)
                {
                    if(aStringArray339 == null)
                        aStringArray339 = new String[5];
                    aStringArray339[j - 30] = class31_sub3_sub2.method429();
                    if(aStringArray339[j - 30].equalsIgnoreCase("hidden"))
                        aStringArray339[j - 30] = null;
                } else
                if(j == 40)
                {
                    int i1 = class31_sub3_sub2.method422();
                    anIntArray314 = new int[i1];
                    anIntArray350 = new int[i1];
                    for(int i2 = 0; i2 < i1; i2++)
                    {
                        anIntArray314[i2] = class31_sub3_sub2.method424();
                        anIntArray350[i2] = class31_sub3_sub2.method424();
                    }

                } else
                if(j == 60)
                    anInt312 = class31_sub3_sub2.method424();
                else
                if(j == 62)
                    aBoolean328 = true;
                else
                if(j == 64)
                    aBoolean307 = false;
                else
                if(j == 65)
                    anInt329 = class31_sub3_sub2.method424();
                else
                if(j == 66)
                    anInt338 = class31_sub3_sub2.method424();
                else
                if(j == 67)
                    anInt318 = class31_sub3_sub2.method424();
                else
                if(j == 68)
                    anInt327 = class31_sub3_sub2.method424();
                else
                if(j == 69)
                    anInt345 = class31_sub3_sub2.method422();
                else
                if(j == 70)
                    anInt310 = class31_sub3_sub2.method425();
                else
                if(j == 71)
                    anInt336 = class31_sub3_sub2.method425();
                else
                if(j == 72)
                    anInt333 = class31_sub3_sub2.method425();
                else
                if(j == 73)
                    aBoolean317 = true;
                else
                if(j == 74)
                {
                    aBoolean311 = true;
                } else
                {
                    if(j != 75)
                        continue;
                    anInt321 = class31_sub3_sub2.method422();
                }
                continue label0;
            } while(j != 77);
            anInt325 = class31_sub3_sub2.method424();
            if(anInt325 == 65535)
                anInt325 = -1;
            anInt303 = class31_sub3_sub2.method424();
            if(anInt303 == 65535)
                anInt303 = -1;
            int j1 = class31_sub3_sub2.method422();
            anIntArray320 = new int[j1 + 1];
            for(int j2 = 0; j2 <= j1; j2++)
            {
                anIntArray320[j2] = class31_sub3_sub2.method424();
                if(anIntArray320[j2] == 65535)
                    anIntArray320[j2] = -1;
            }

        } while(true);
        if(i == -1)
        {
            aBoolean316 = false;
            if(anIntArray324 != null && (anIntArray326 == null || anIntArray326[0] == 10))
                aBoolean316 = true;
            if(aStringArray339 != null)
                aBoolean316 = true;
        }
        if(aBoolean311)
        {
            aBoolean302 = false;
            aBoolean315 = false;
        }
        if(anInt321 == -1)
            anInt321 = aBoolean302 ? 1 : 0;
    }

    public void method280()
    {
        anIntArray324 = null;
        anIntArray326 = null;
        aString331 = null;
        aByteArray330 = null;
        anIntArray314 = null;
        anIntArray350 = null;
        anInt323 = 1;
        anInt344 = 1;
        aBoolean302 = true;
        aBoolean315 = true;
        aBoolean316 = false;
        aBoolean349 = false;
        aBoolean322 = false;
        aBoolean337 = false;
        anInt343 = -1;
        anInt313 = 16;
        aByte340 = 0;
        aByte308 = 0;
        aStringArray339 = null;
        anInt312 = -1;
        anInt327 = -1;
        aBoolean328 = false;
        aBoolean307 = true;
        anInt329 = 128;
        anInt338 = 128;
        anInt318 = 128;
        anInt345 = 0;
        anInt310 = 0;
        anInt336 = 0;
        anInt333 = 0;
        aBoolean317 = false;
        aBoolean311 = false;
        anInt321 = -1;
        anInt325 = -1;
        anInt303 = -1;
        anIntArray320 = null;
    }

    public boolean method281(int i)
    {
        if(anIntArray324 == null)
            return true;
        boolean flag = true;
        for(int j = 0; j < anIntArray324.length; j++)
            flag &= Class31_Sub3_Sub3_Sub2.method468(anIntArray324[j] & 0xffff);

        i = 12 / i;
        return flag;
    }

    public void method282(byte byte0, Class27_Sub1 class27_sub1)
    {
        if(anIntArray324 == null)
            return;
        for(int i = 0; i < anIntArray324.length; i++)
            class27_sub1.method308(0, anIntArray324[i] & 0xffff, 0);

        if(byte0 == 1)
        {
            byte0 = 0;
            return;
        } else
        {
            aBoolean301 = !aBoolean301;
            return;
        }
    }

    public Class31_Sub3_Sub3_Sub2 method283(int i, int j, int k, int l, int i1, int j1, int k1)
    {
        Class31_Sub3_Sub3_Sub2 class31_sub3_sub3_sub2 = method278(j, i, true, k1);
        if(class31_sub3_sub3_sub2 == null)
            return null;
        if(aBoolean349 || aBoolean322)
            class31_sub3_sub3_sub2 = new Class31_Sub3_Sub3_Sub2(153, aBoolean322, aBoolean349, class31_sub3_sub3_sub2);
        if(aBoolean349)
        {
            int l1 = (k + l + i1 + j1) / 4;
            for(int i2 = 0; i2 < class31_sub3_sub3_sub2.anInt1544; i2++)
            {
                int j2 = class31_sub3_sub3_sub2.anIntArray1545[i2];
                int k2 = class31_sub3_sub3_sub2.anIntArray1547[i2];
                int l2 = k + ((l - k) * (j2 + 64)) / 128;
                int i3 = j1 + ((i1 - j1) * (j2 + 64)) / 128;
                int j3 = l2 + ((i3 - l2) * (k2 + 64)) / 128;
                class31_sub3_sub3_sub2.anIntArray1546[i2] += j3 - l1;
            }

            class31_sub3_sub3_sub2.method472(aBoolean335);
        }
        return class31_sub3_sub3_sub2;
    }

    public Class22()
    {
        aBoolean301 = false;
        anInt305 = -1;
        anInt319 = 279;
        aBoolean335 = false;
    }

    public boolean aBoolean301;
    public boolean aBoolean302;
    public int anInt303;
    public static Class22 aClass22Array304[];
    public int anInt305;
    public static int anInt306;
    public boolean aBoolean307;
    public byte aByte308;
    public static boolean aBoolean309;
    public int anInt310;
    public boolean aBoolean311;
    public int anInt312;
    public int anInt313;
    public int anIntArray314[];
    public boolean aBoolean315;
    public boolean aBoolean316;
    public boolean aBoolean317;
    public int anInt318;
    public int anInt319;
    public int anIntArray320[];
    public int anInt321;
    public boolean aBoolean322;
    public int anInt323;
    public int anIntArray324[];
    public int anInt325;
    public int anIntArray326[];
    public int anInt327;
    public boolean aBoolean328;
    public int anInt329;
    public byte aByteArray330[];
    public String aString331;
    public static Class31_Sub3_Sub3_Sub2 aClass31_Sub3_Sub3_Sub2Array332[] = new Class31_Sub3_Sub3_Sub2[4];
    public int anInt333;
    public static int anIntArray334[];
    public boolean aBoolean335;
    public int anInt336;
    public boolean aBoolean337;
    public int anInt338;
    public String aStringArray339[];
    public byte aByte340;
    public static client aClient341;
    public static Class36 aClass36_342 = new Class36(40, false);
    public int anInt343;
    public int anInt344;
    public int anInt345;
    public static int anInt346;
    public static Class36 aClass36_347 = new Class36(500, false);
    public static Class31_Sub3_Sub2 aClass31_Sub3_Sub2_348;
    public boolean aBoolean349;
    public int anIntArray350[];

}
