/* Class4 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.awt.Point;

public class Class4
{
    static String[] aStringArray22 = new String[100];
    byte[][] aByteArrayArray23;
    public int anInt24;
    public int anInt25;
    byte[] aByteArray26;
    public int anInt27;
    public static Class411 aClass411_28;
    
    public int method495(int i, int i_0_) {
	return ((Class4) this).aByteArray26[i] & 0xff;
    }
    
    public int method496(int i, char c, byte i_1_) {
	if (((Class4) this).aByteArrayArray23 != null)
	    return ((Class4) this).aByteArrayArray23[i][c];
	return 0;
    }
    
    public int method497(String string, Interface3[] interface3s, byte i) {
	if (null == string)
	    return 0;
	int i_2_ = -1;
	int i_3_ = -1;
	int i_4_ = 0;
	int i_5_ = string.length();
	for (int i_6_ = 0; i_6_ < i_5_; i_6_++) {
	    char c = string.charAt(i_6_);
	    if (60 == c)
		i_2_ = i_6_;
	    else {
		if (62 == c && -1 != i_2_) {
		    String string_7_ = string.substring(1 + i_2_, i_6_);
		    i_2_ = -1;
		    if (string_7_.equals("lt"))
			c = '<';
		    else if (string_7_.equals("gt"))
			c = '>';
		    else if (string_7_.equals("nbsp"))
			c = '\u00a0';
		    else if (string_7_.equals("shy"))
			c = '\u00ad';
		    else if (string_7_.equals("times"))
			c = '\u00d7';
		    else if (string_7_.equals("euro"))
			c = '\u20ac';
		    else if (string_7_.equals("copy"))
			c = '\u00a9';
		    else if (string_7_.equals("reg"))
			c = '\u00ae';
		    else {
			if (string_7_.startsWith("img=")
			    && interface3s != null) {
			    try {
				int i_8_
				    = Class32.method780(string_7_.substring(4),
							(byte) 5);
				i_4_ += interface3s[i_8_].method4();
				i_3_ = -1;
			    } catch (Exception exception) {
				/* empty */
			    }
			}
			continue;
		    }
		}
		if (-1 == i_2_) {
		    i_4_ += ((((Class4) this).aByteArray26
			      [Class583.method7141(c, 1499770542) & 0xff])
			     & 0xff);
		    if (((Class4) this).aByteArrayArray23 != null
			&& i_3_ != -1)
			i_4_ += ((Class4) this).aByteArrayArray23[i_3_][c];
		    i_3_ = c;
		}
	    }
	}
	return i_4_;
    }
    
    public int method498(String string, int i) {
	return method497(string, null, (byte) 1);
    }
    
    public String method499(String string, int i, Interface3[] interface3s,
			    int i_9_) {
	if (method497(string, interface3s, (byte) 1) <= i)
	    return string;
	i -= method497("...", null, (byte) 1);
	int i_10_ = -1;
	int i_11_ = -1;
	int i_12_ = 0;
	int i_13_ = string.length();
	String string_14_ = "";
	for (int i_15_ = 0; i_15_ < i_13_; i_15_++) {
	    char c = string.charAt(i_15_);
	    if (60 == c)
		i_10_ = i_15_;
	    else {
		if (c == 62 && -1 != i_10_) {
		    String string_16_ = string.substring(i_10_ + 1, i_15_);
		    i_10_ = -1;
		    if (string_16_.equals("lt"))
			c = '<';
		    else if (string_16_.equals("gt"))
			c = '>';
		    else if (string_16_.equals("nbsp"))
			c = '\u00a0';
		    else if (string_16_.equals("shy"))
			c = '\u00ad';
		    else if (string_16_.equals("times"))
			c = '\u00d7';
		    else if (string_16_.equals("euro"))
			c = '\u20ac';
		    else if (string_16_.equals("copy"))
			c = '\u00a9';
		    else if (string_16_.equals("reg"))
			c = '\u00ae';
		    else {
			if (string_16_.startsWith("img=")
			    && null != interface3s) {
			    try {
				int i_17_
				    = Class32.method780(string_16_
							    .substring(4),
							(byte) 5);
				i_12_ += interface3s[i_17_].method4();
				i_11_ = -1;
				if (i_12_ > i)
				    return new StringBuilder().append
					       (string_14_).append
					       ("...").toString();
				string_14_ = string.substring(0, 1 + i_15_);
			    } catch (Exception exception) {
				/* empty */
			    }
			}
			continue;
		    }
		}
		if (-1 == i_10_) {
		    i_12_
			+= (((Class4) this).aByteArray26
			    [Class583.method7141(c, 144160054) & 0xff]) & 0xff;
		    if (null != ((Class4) this).aByteArrayArray23
			&& i_11_ != -1)
			i_12_ += ((Class4) this).aByteArrayArray23[i_11_][c];
		    i_11_ = c;
		    int i_18_ = i_12_;
		    if (null != ((Class4) this).aByteArrayArray23)
			i_18_ += ((Class4) this).aByteArrayArray23[c][46];
		    if (i_18_ > i)
			return new StringBuilder().append(string_14_).append
				   ("...").toString();
		    string_14_ = string.substring(0, i_15_ + 1);
		}
	    }
	}
	return string;
    }
    
    public int method500(String string, int[] is, String[] strings,
			 Interface3[] interface3s, byte i) {
	return method501(string, is, strings, interface3s, true, -1133018793);
    }
    
    int method501(String string, int[] is, String[] strings,
		  Interface3[] interface3s, boolean bool, int i) {
	if (null == string)
	    return 0;
	int i_19_ = 0;
	int i_20_ = 0;
	int i_21_ = -1;
	int i_22_ = 0;
	int i_23_ = 0;
	int i_24_ = -1;
	int i_25_ = -1;
	int i_26_ = 0;
	int i_27_ = string.length();
	for (int i_28_ = 0; i_28_ < i_27_; i_28_++) {
	    int i_29_
		= Class583.method7141(string.charAt(i_28_), 1819106798) & 0xff;
	    int i_30_ = 0;
	    if (i_29_ == 60)
		i_24_ = i_28_;
	    else {
		int i_31_;
		if (-1 != i_24_) {
		    if (62 != i_29_)
			continue;
		    i_31_ = i_24_;
		    String string_32_ = string.substring(1 + i_24_, i_28_);
		    i_24_ = -1;
		    if (string_32_.equals("br")) {
			strings[i_26_] = string.substring(i_20_, i_28_ + 1);
			if (++i_26_ >= strings.length)
			    return 0;
			i_20_ = i_28_ + 1;
			i_19_ = 0;
			i_21_ = -1;
			i_25_ = -1;
			continue;
		    }
		    if (string_32_.equals("lt")) {
			i_30_ += method495(60, -871252610);
			if (((Class4) this).aByteArrayArray23 != null
			    && -1 != i_25_)
			    i_30_ += (((Class4) this).aByteArrayArray23[i_25_]
				      [60]);
			i_25_ = 60;
		    } else if (string_32_.equals("gt")) {
			i_30_ += method495(62, -871252610);
			if (((Class4) this).aByteArrayArray23 != null
			    && -1 != i_25_)
			    i_30_ += (((Class4) this).aByteArrayArray23[i_25_]
				      [62]);
			i_25_ = 62;
		    } else if (string_32_.equals("nbsp")) {
			i_30_ += method495(160, -871252610);
			if (null != ((Class4) this).aByteArrayArray23
			    && i_25_ != -1)
			    i_30_ += (((Class4) this).aByteArrayArray23[i_25_]
				      [160]);
			i_25_ = 160;
		    } else if (string_32_.equals("shy")) {
			i_30_ += method495(173, -871252610);
			if (null != ((Class4) this).aByteArrayArray23
			    && i_25_ != -1)
			    i_30_ += (((Class4) this).aByteArrayArray23[i_25_]
				      [173]);
			i_25_ = 173;
		    } else if (string_32_.equals("times")) {
			i_30_ += method495(215, -871252610);
			if (null != ((Class4) this).aByteArrayArray23
			    && -1 != i_25_)
			    i_30_ += (((Class4) this).aByteArrayArray23[i_25_]
				      [215]);
			i_25_ = 215;
		    } else if (string_32_.equals("euro")) {
			i_30_ += method495(8364, -871252610);
			if (((Class4) this).aByteArrayArray23 != null
			    && -1 != i_25_)
			    i_30_ += (((Class4) this).aByteArrayArray23[i_25_]
				      [8364]);
			i_25_ = 8364;
		    } else if (string_32_.equals("copy")) {
			i_30_ += method495(169, -871252610);
			if (null != ((Class4) this).aByteArrayArray23
			    && -1 != i_25_)
			    i_30_ += (((Class4) this).aByteArrayArray23[i_25_]
				      [169]);
			i_25_ = 169;
		    } else if (string_32_.equals("reg")) {
			i_30_ += method495(174, -871252610);
			if (null != ((Class4) this).aByteArrayArray23
			    && i_25_ != -1)
			    i_30_ += (((Class4) this).aByteArrayArray23[i_25_]
				      [174]);
			i_25_ = 174;
		    } else if (string_32_.startsWith("img=")
			       && null != interface3s) {
			try {
			    int i_33_
				= Class32.method780(string_32_.substring(4),
						    (byte) 5);
			    i_30_ += interface3s[i_33_].method4();
			    i_25_ = -1;
			} catch (Exception exception) {
			    /* empty */
			}
		    }
		    i_29_ = -1;
		} else {
		    i_31_ = i_28_;
		    i_30_ += method495(i_29_, -871252610);
		    if (null != ((Class4) this).aByteArrayArray23
			&& -1 != i_25_)
			i_30_
			    += ((Class4) this).aByteArrayArray23[i_25_][i_29_];
		    i_25_ = i_29_;
		}
		if (i_30_ > 0) {
		    i_19_ += i_30_;
		    if (null != is) {
			if (i_29_ == 32) {
			    i_21_ = i_28_;
			    i_22_ = i_19_;
			    i_23_ = bool ? 1 : 0;
			}
			if (i_19_
			    > is[i_26_ < is.length ? i_26_ : is.length - 1]) {
			    if (i_21_ >= 0) {
				strings[i_26_]
				    = string.substring(i_20_,
						       1 + i_21_ - i_23_);
				if (++i_26_ >= strings.length)
				    return 0;
				i_20_ = 1 + i_21_;
				i_21_ = -1;
				i_19_ -= i_22_;
				i_25_ = -1;
			    } else {
				strings[i_26_]
				    = string.substring(i_20_, i_31_);
				if (++i_26_ >= strings.length)
				    return 0;
				i_20_ = i_31_;
				i_21_ = -1;
				i_19_ = i_30_;
				i_25_ = -1;
			    }
			}
			if (45 == i_29_) {
			    i_21_ = i_28_;
			    i_22_ = i_19_;
			    i_23_ = 0;
			}
		    }
		}
	    }
	}
	if (string.length() > i_20_) {
	    strings[i_26_] = string.substring(i_20_, string.length());
	    i_26_++;
	}
	return i_26_;
    }
    
    public Point method502(String string, int i, int i_34_, int i_35_,
			   Interface3[] interface3s, byte i_36_) {
	if (i_35_ <= 0)
	    return new Point(0, -170800249 * anInt27 + i_34_);
	if (i_35_ > string.length())
	    i_35_ = string.length();
	if (0 == i_34_)
	    i_34_ = anInt25 * -406677113;
	int i_37_ = method501(string, new int[] { i }, aStringArray22,
			      interface3s, false, -1061889309);
	int i_38_ = 0;
	for (int i_39_ = 0; i_39_ < i_37_; i_39_++) {
	    int i_40_ = aStringArray22[i_39_].length();
	    if (i_40_ + i_38_ > i_35_
		|| i_37_ - 1 == i_39_ && i_35_ == string.length()) {
		String string_41_ = string.substring(i_38_, i_35_);
		if (string_41_.endsWith("<br>")) {
		    string_41_ = "";
		    i_38_ += i_40_;
		    i_39_++;
		}
		int i_42_ = method497(string_41_, interface3s, (byte) 1);
		int i_43_ = -170800249 * anInt27 + i_34_ * i_39_;
		return new Point(i_42_, i_43_);
	    }
	    i_38_ += i_40_;
	}
	return null;
    }
    
    public String method503(String string, int i, Interface3[] interface3s,
			    int i_44_, int i_45_) {
	int i_46_ = method500(string, new int[] { i }, aStringArray22,
			      interface3s, (byte) 33);
	if (i_44_ >= 0 && i_44_ < i_46_)
	    return aStringArray22[i_44_];
	return null;
    }
    
    public int method504(String string, int i, int i_47_,
			 Interface3[] interface3s, short i_48_) {
	if (i_47_ == 0)
	    i_47_ = -406677113 * anInt25;
	int i_49_ = method500(string, new int[] { i }, aStringArray22,
			      interface3s, (byte) 61);
	int i_50_ = i_47_ * (i_49_ - 1);
	return i_50_ + anInt27 * -170800249 + 1785656317 * anInt24;
    }
    
    Class4(byte[] is) {
	Class487_Sub17 class487_sub17 = new Class487_Sub17(is);
	int i = class487_sub17.method9219(-1334567444);
	if (0 != i)
	    throw new RuntimeException("");
	boolean bool = class487_sub17.method9219(-1862009421) == 1;
	((Class4) this).aByteArray26 = new byte[256];
	class487_sub17.method9232(((Class4) this).aByteArray26, 0, 256,
				  -1818086556);
	if (bool) {
	    int[] is_51_ = new int[256];
	    int[] is_52_ = new int[256];
	    for (int i_53_ = 0; i_53_ < 256; i_53_++)
		is_51_[i_53_] = class487_sub17.method9219(-940588389);
	    for (int i_54_ = 0; i_54_ < 256; i_54_++)
		is_52_[i_54_] = class487_sub17.method9219(-2047600214);
	    byte[][] is_55_ = new byte[256][];
	    for (int i_56_ = 0; i_56_ < 256; i_56_++) {
		is_55_[i_56_] = new byte[is_51_[i_56_]];
		byte i_57_ = 0;
		for (int i_58_ = 0; i_58_ < is_55_[i_56_].length; i_58_++) {
		    i_57_ += class487_sub17.method9277(-1427719566);
		    is_55_[i_56_][i_58_] = i_57_;
		}
	    }
	    byte[][] is_59_ = new byte[256][];
	    for (int i_60_ = 0; i_60_ < 256; i_60_++) {
		is_59_[i_60_] = new byte[is_51_[i_60_]];
		byte i_61_ = 0;
		for (int i_62_ = 0; i_62_ < is_59_[i_60_].length; i_62_++) {
		    i_61_ += class487_sub17.method9277(-1597806024);
		    is_59_[i_60_][i_62_] = i_61_;
		}
	    }
	    ((Class4) this).aByteArrayArray23 = new byte[256][256];
	    for (int i_63_ = 0; i_63_ < 256; i_63_++) {
		if (i_63_ != 32 && 160 != i_63_) {
		    for (int i_64_ = 0; i_64_ < 256; i_64_++) {
			if (i_64_ != 32 && i_64_ != 160)
			    ((Class4) this).aByteArrayArray23[i_63_][i_64_]
				= (byte) Class635.method7593(is_55_, is_59_,
							     is_52_,
							     (((Class4) this)
							      .aByteArray26),
							     is_51_, i_63_,
							     i_64_,
							     1326008826);
		    }
		}
	    }
	    anInt25 = 1761074231 * (is_51_[32] + is_52_[32]);
	} else
	    anInt25 = class487_sub17.method9219(-1592789983) * 1761074231;
	class487_sub17.method9219(-669311623);
	class487_sub17.method9219(-1873562721);
	anInt27 = class487_sub17.method9219(-676182007) * 1421216311;
	anInt24 = class487_sub17.method9219(-674586619) * -2003238571;
    }
    
    public int method505(String string, int i, int i_65_, int i_66_, int i_67_,
			 Interface3[] interface3s, int i_68_) {
	if (0 == i_65_)
	    i_65_ = -406677113 * anInt25;
	int i_69_ = method501(string, new int[] { i }, aStringArray22,
			      interface3s, false, -1535717484);
	if (0 == i_69_)
	    return 0;
	if (i_67_ < 0)
	    i_67_ = 0;
	i_67_ /= i_65_;
	if (i_67_ >= i_69_)
	    i_67_ = i_69_ - 1;
	String string_70_ = aStringArray22[i_67_];
	int i_71_ = 0;
	int i_72_ = 0;
	int i_73_;
	for (i_73_ = 0; i_73_ < i_66_ && i_71_ < string_70_.length();
	     i_73_ = method497(string_70_.substring(0, ++i_71_), interface3s,
			       (byte) 1))
	    i_72_ = i_73_;
	if (i_71_ == string_70_.length() && string_70_.endsWith("<br>"))
	    i_71_ -= 4;
	if (i_66_ - i_72_ < i_73_ - i_66_)
	    i_71_--;
	for (int i_74_ = 0; i_74_ < i_67_; i_74_++)
	    i_71_ += aStringArray22[i_74_].length();
	return i_71_;
    }
    
    public int method506(String string, int i, Interface3[] interface3s,
			 int i_75_) {
	int i_76_ = method500(string, new int[] { i }, aStringArray22,
			      interface3s, (byte) 64);
	int i_77_ = 0;
	for (int i_78_ = 0; i_78_ < i_76_; i_78_++) {
	    int i_79_
		= method497(aStringArray22[i_78_], interface3s, (byte) 1);
	    if (i_79_ > i_77_)
		i_77_ = i_79_;
	}
	return i_77_;
    }
    
    public int method507(int i) {
	return ((Class4) this).aByteArray26[i] & 0xff;
    }
    
    public int method508(String string) {
	return method497(string, null, (byte) 1);
    }
    
    public int method509(String string) {
	return method497(string, null, (byte) 1);
    }
    
    public int method510(int i) {
	return ((Class4) this).aByteArray26[i] & 0xff;
    }
    
    public int method511(String string) {
	return method497(string, null, (byte) 1);
    }
    
    public int method512(String string, int i, Interface3[] interface3s,
			 byte i_80_) {
	return method500(string, new int[] { i }, aStringArray22, interface3s,
			 (byte) 16);
    }
    
    public int method513(int i) {
	return ((Class4) this).aByteArray26[i] & 0xff;
    }
    
    static final void method514(boolean bool, int i) {
	Class225.method3250(client.anInt10870 * -1899467487,
			    1881245841 * Class175.anInt2012,
			    -1922042493 * Class570.anInt7649, bool,
			    -577509895);
    }
    
    static final void method515(Class612 class612, byte i) {
	((Class612) class612).anIntArray8021
	    [(((Class612) class612).anInt8022 += 201091009) * -40654783 - 1]
	    = Class447.aClass487_Sub42_5156.aClass637_Sub8_10503
		  .method9667((byte) 1);
    }
}
