// 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 Class31_Sub3_Sub1_Sub3 extends Class31_Sub3_Sub1
{

    public Class31_Sub3_Sub1_Sub3(Class11 class11, String s, int i)
    {
        aByte1499 = 1;
        anInt1501 = 279;
        Class31_Sub3_Sub2 class31_sub3_sub2 = new Class31_Sub3_Sub2((byte)114, class11.method204(s + ".dat", null));
        Class31_Sub3_Sub2 class31_sub3_sub2_1 = new Class31_Sub3_Sub2((byte)114, class11.method204("index.dat", null));
        class31_sub3_sub2_1.anInt1440 = class31_sub3_sub2.method424();
        anInt1508 = class31_sub3_sub2_1.method424();
        anInt1509 = class31_sub3_sub2_1.method424();
        int j = class31_sub3_sub2_1.method422();
        anIntArray1503 = new int[j];
        for(int k = 0; k < j - 1; k++)
            anIntArray1503[k + 1] = class31_sub3_sub2_1.method426();

        for(int l = 0; l < i; l++)
        {
            class31_sub3_sub2_1.anInt1440 += 2;
            class31_sub3_sub2.anInt1440 += class31_sub3_sub2_1.method424() * class31_sub3_sub2_1.method424();
            class31_sub3_sub2_1.anInt1440++;
        }

        anInt1506 = class31_sub3_sub2_1.method422();
        anInt1507 = class31_sub3_sub2_1.method422();
        anInt1504 = class31_sub3_sub2_1.method424();
        anInt1505 = class31_sub3_sub2_1.method424();
        int i1 = class31_sub3_sub2_1.method422();
        int j1 = anInt1504 * anInt1505;
        aByteArray1502 = new byte[j1];
        if(i1 == 0)
        {
            for(int k1 = 0; k1 < j1; k1++)
                aByteArray1502[k1] = class31_sub3_sub2.method423();

            return;
        }
        if(i1 == 1)
        {
            for(int l1 = 0; l1 < anInt1504; l1++)
            {
                for(int i2 = 0; i2 < anInt1505; i2++)
                    aByteArray1502[l1 + i2 * anInt1504] = class31_sub3_sub2.method423();

            }

        }
    }

    public void method387(int i)
    {
        anInt1508 /= 2;
        anInt1509 /= 2;
        byte abyte0[] = new byte[anInt1508 * anInt1509];
        int j = 0;
        for(int k = 0; k < anInt1505; k++)
        {
            for(int l = 0; l < anInt1504; l++)
                abyte0[(l + anInt1506 >> 1) + (k + anInt1507 >> 1) * anInt1508] = aByteArray1502[j++];

        }

        aByteArray1502 = abyte0;
        anInt1504 = anInt1508;
        if(i != 0)
        {
            return;
        } else
        {
            anInt1505 = anInt1509;
            anInt1506 = 0;
            anInt1507 = 0;
            return;
        }
    }

    public void method388(boolean flag)
    {
        if(anInt1504 == anInt1508 && anInt1505 == anInt1509)
            return;
        byte abyte0[] = new byte[anInt1508 * anInt1509];
        int i = 0;
        for(int j = 0; j < anInt1505; j++)
        {
            for(int k = 0; k < anInt1504; k++)
                abyte0[k + anInt1506 + (j + anInt1507) * anInt1508] = aByteArray1502[i++];

        }

        aByteArray1502 = abyte0;
        anInt1504 = anInt1508;
        anInt1505 = anInt1509;
        anInt1506 = 0;
        if(!flag)
        {
            for(int l = 1; l > 0; l++);
        }
        anInt1507 = 0;
    }

    public void method389(byte byte0)
    {
        byte abyte0[] = new byte[anInt1504 * anInt1505];
        int i = 0;
        for(int j = 0; j < anInt1505; j++)
        {
            for(int k = anInt1504 - 1; k >= 0; k--)
                abyte0[i++] = aByteArray1502[k + j * anInt1504];

        }

        if(byte0 != 8)
        {
            return;
        } else
        {
            aByteArray1502 = abyte0;
            anInt1506 = anInt1508 - anInt1504 - anInt1506;
            return;
        }
    }

    public void method390(int i)
    {
        byte abyte0[] = new byte[anInt1504 * anInt1505];
        if(i != 33964)
            return;
        int j = 0;
        for(int k = anInt1505 - 1; k >= 0; k--)
        {
            for(int l = 0; l < anInt1504; l++)
                abyte0[j++] = aByteArray1502[l + k * anInt1504];

        }

        aByteArray1502 = abyte0;
        anInt1507 = anInt1509 - anInt1505 - anInt1507;
    }

    public void method391(int i, byte byte0, int j, int k)
    {
        if(byte0 == aByte1499)
            byte0 = 0;
        else
            return;
        for(int l = 0; l < anIntArray1503.length; l++)
        {
            int i1 = anIntArray1503[l] >> 16 & 0xff;
            i1 += j;
            if(i1 < 0)
                i1 = 0;
            else
            if(i1 > 255)
                i1 = 255;
            int j1 = anIntArray1503[l] >> 8 & 0xff;
            j1 += i;
            if(j1 < 0)
                j1 = 0;
            else
            if(j1 > 255)
                j1 = 255;
            int k1 = anIntArray1503[l] & 0xff;
            k1 += k;
            if(k1 < 0)
                k1 = 0;
            else
            if(k1 > 255)
                k1 = 255;
            anIntArray1503[l] = (i1 << 16) + (j1 << 8) + k1;
        }

    }

    public void method392(int i, int j, int k)
    {
        j += anInt1506;
        k += anInt1507;
        int l = j + k * Class31_Sub3_Sub1.anInt1412;
        int i1 = 0;
        int j1 = anInt1505;
        int k1 = anInt1504;
        int l1 = Class31_Sub3_Sub1.anInt1412 - k1;
        int i2 = 0;
        if(i != -4899)
            return;
        if(k < Class31_Sub3_Sub1.anInt1414)
        {
            int j2 = Class31_Sub3_Sub1.anInt1414 - k;
            j1 -= j2;
            k = Class31_Sub3_Sub1.anInt1414;
            i1 += j2 * k1;
            l += j2 * Class31_Sub3_Sub1.anInt1412;
        }
        if(k + j1 > Class31_Sub3_Sub1.anInt1415)
            j1 -= (k + j1) - Class31_Sub3_Sub1.anInt1415;
        if(j < Class31_Sub3_Sub1.anInt1416)
        {
            int k2 = Class31_Sub3_Sub1.anInt1416 - j;
            k1 -= k2;
            j = Class31_Sub3_Sub1.anInt1416;
            i1 += k2;
            l += k2;
            i2 += k2;
            l1 += k2;
        }
        if(j + k1 > Class31_Sub3_Sub1.anInt1417)
        {
            int l2 = (j + k1) - Class31_Sub3_Sub1.anInt1417;
            k1 -= l2;
            i2 += l2;
            l1 += l2;
        }
        if(k1 <= 0 || j1 <= 0)
        {
            return;
        } else
        {
            method393(l, i1, Class31_Sub3_Sub1.anIntArray1411, aByteArray1502, l1, anIntArray1503, i2, false, k1, j1);
            return;
        }
    }

    public void method393(int i, int j, int ai[], byte abyte0[], int k, int ai1[], int l, 
            boolean flag, int i1, int j1)
    {
        int k1 = -(i1 >> 2);
        if(flag)
            anInt1500 = 135;
        i1 = -(i1 & 3);
        for(int l1 = -j1; l1 < 0; l1++)
        {
            for(int i2 = k1; i2 < 0; i2++)
            {
                byte byte0 = abyte0[j++];
                if(byte0 != 0)
                    ai[i++] = ai1[byte0 & 0xff];
                else
                    i++;
                byte0 = abyte0[j++];
                if(byte0 != 0)
                    ai[i++] = ai1[byte0 & 0xff];
                else
                    i++;
                byte0 = abyte0[j++];
                if(byte0 != 0)
                    ai[i++] = ai1[byte0 & 0xff];
                else
                    i++;
                byte0 = abyte0[j++];
                if(byte0 != 0)
                    ai[i++] = ai1[byte0 & 0xff];
                else
                    i++;
            }

            for(int j2 = i1; j2 < 0; j2++)
            {
                byte byte1 = abyte0[j++];
                if(byte1 != 0)
                    ai[i++] = ai1[byte1 & 0xff];
                else
                    i++;
            }

            i += k;
            j += l;
        }

    }

    public byte aByte1499;
    public int anInt1500;
    public int anInt1501;
    public byte aByteArray1502[];
    public int anIntArray1503[];
    public int anInt1504;
    public int anInt1505;
    public int anInt1506;
    public int anInt1507;
    public int anInt1508;
    public int anInt1509;
}
