package Network;


public class H
{

    public H(String s)
    {
        substring = new byte[65535];
        toString = 0;
        II = 0;
        equals = 0L;
        length = 0L;
        charAt = new Object[768];
        length(charAt, s);
    }

    private void append()
    {
        int i = II;
        if(toString != 0)
            while(i == II) 
                arraycopy(arraycopy);
    }

    private void arraycopy(int i)
    {
        int j = i >> 24;
        int k = i - (j << 24);
        if(toString != 0 && j > 0)
        {
            j += toString - 8;
            k <<= toString;
            substring[II++] += (byte)k;
            k >>= 8;
            toString = 0;
        }
        for(; j > 0; j -= 8)
        {
            substring[II++] = (byte)k;
            k >>= 8;
        }

        if(j < 0)
        {
            II--;
            toString = j + 8;
        }
    }

    private int charAt(int i, int j)
    {
        int k = 0;
        int l = 1;
        int i1 = 1 << j - 1;
        for(; j > 0; j--)
        {
            if((i & l) != 0)
                k += i1;
            l <<= 1;
            i1 >>= 1;
        }

        return k;
    }

    public final synchronized byte[] I(String s)
    {
        return equals(s, null);
    }

    public final synchronized byte[] equals(String s, byte abyte0[])
    {
        toString = 0;
        II = 0;
        int i = s.length();
        length += i;
        for(int l = 0; l < i;)
        {
            int ai[] = null;
            int k = l + 1;
            Object aobj[] = charAt;
            do
            {
                if(l >= i)
                    break;
                int j = s.charAt(l);
                if(j < '\u0100')
                {
                    if(aobj[j + 512] != null)
                    {
                        ai = (int[])(int[])aobj[j + 512];
                        k = l + 1;
                    }
                    if(aobj[j] == null)
                        break;
                    aobj = (Object[])(Object[])aobj[j];
                    l++;
                    continue;
                }
                if(aobj[(j & 0xff) + 256] == null)
                    break;
                aobj = (Object[])(Object[])aobj[(j & 0xff) + 256];
                j = j >> 8 & 0xff;
                if(aobj[j + 512] != null)
                {
                    ai = (int[])(int[])aobj[j + 512];
                    k = l + 1;
                }
                if(aobj[j] == null)
                    break;
                aobj = (Object[])(Object[])aobj[j];
                l++;
            } while(true);
            l = k;
            if(ai == null)
            {
                arraycopy(append);
                arraycopy(0x10000000 + s.charAt(l - 1));
            } else
            {
                arraycopy(ai[0]);
            }
        }

        append();
        int i1 = 0;
        if(abyte0 != null)
            i1 = abyte0.length;
        byte abyte1[] = new byte[II + i1];
        if(abyte0 != null)
            System.arraycopy(abyte0, 0, abyte1, 0, i1);
        System.arraycopy(substring, 0, abyte1, i1, II);
        equals += II;
        return abyte1;
    }

    private void length(Object aobj[], String s)
    {
        int i = 0;
        int j = s.length();
        int l = 1;
        int i1 = -33;
        boolean flag = false;
        boolean flag1 = false;
        int k1;
        for(; i < j; i += k1 + 1)
        {
            int ai[] = new int[1];
            int k = s.charAt(i);
            if(k == 255)
            {
                k = s.charAt(i + 1) * 256 + s.charAt(i + 2);
                i += 2;
            }
            k1 = k / 21 + 1;
            int j1 = k % 21;
            if((l & 1) == 0)
            {
                l++;
                for(; i1 < j1; i1++)
                    l <<= 1;

            } else
            {
                while((l & 1) == 1) 
                {
                    l >>= 1;
                    i1--;
                }
                l++;
                for(; i1 < j1; i1++)
                    l <<= 1;

            }
            ai[0] = charAt(l, j1) + (j1 << 24);
            String s1 = s.substring(i + 1, i + k1 + 1);
            if(arraycopy == 0 && j1 > 8)
                arraycopy = charAt(l >> j1 - 8, 8) + 0x8000000;
            if(k1 == 3 && s1.equals("\\\\\\"))
                append = ai[0];
            else
                substring(s1, ai);
        }

    }

    private void substring(String s, Object obj)
    {
        toString(charAt, s, 0, obj);
    }

    private void toString(Object aobj[], String s, int i, Object obj)
    {
        int j = s.charAt(i / 2);
        if(j < 256)
        {
            if(i / 2 + 1 >= s.length())
            {
                if(aobj[j + 512] != null)
                    throw new RuntimeException();
                // I.I(4691) + s
                aobj[j + 512] = obj;
            } else
            {
                Object aobj1[] = (Object[])(Object[])aobj[j];
                if(aobj1 == null)
                {
                    aobj1 = new Object[768];
                    aobj[j] = ((Object) (aobj1));
                }
                toString(aobj1, s, i + 2, obj);
            }
        } else
        if((i & 1) == 0)
        {
            j &= 0xff;
            Object aobj2[] = (Object[])(Object[])aobj[256 + j];
            if(aobj2 == null)
            {
                aobj2 = new Object[768];
                aobj[256 + j] = ((Object) (aobj2));
            }
            toString(aobj2, s, i + 1, obj);
        } else
        {
            j >>= 8;
            if((i - 1) / 2 + 1 >= s.length())
            {
                if(aobj[(j & 0xff) + 512] != null)
                    throw new RuntimeException();
                //I.I(4722) + s
                aobj[(j & 0xff) + 512] = obj;
            } else
            {
                Object aobj3[] = (Object[])(Object[])aobj[(j & 0xff) + 256];
                if(aobj3 == null)
                {
                    aobj3 = new Object[768];
                    aobj[(j & 0xff) + 256] = ((Object) (aobj3));
                }
                toString(aobj3, s, i + 1, obj);
            }
        }
    }

    private int append;
    private int arraycopy;
    private Object charAt[];
    private long equals;
    private long length;
    private byte substring[];
    private int toString;
    private int II;

}
