/* Class165 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Class165 implements Interface5 {
	Class279 aClass279_2107;
	Class279 aClass279_2108;
	public static Class135 aClass135_2109;

	public boolean method38(int i, Class525 class525, float f, int i_0_, int i_1_, boolean bool, int i_2_) {
		boolean bool_3_ = true;
		if (((Class165) this).aClass279_2107.method5589(i, 947966954))
			bool_3_ = ((Class165) this).aClass279_2107.method5582(i, (byte) 76);
		bool_3_ &= ((Class165) this).aClass279_2108.method5582(i, (byte) 92);
		return bool_3_;
	}

	int[] method3686(int i) {
		int[] is = method3688(i, 1626696216);
		if (null == is)
			return null;
		for (int i_4_ = 0; i_4_ < is.length; i_4_++) {
			if ((is[i_4_] & 0xffffff) != 0)
				is[i_4_] = is[i_4_] | ~0xffffff;
			else
				is[i_4_] = is[i_4_] & 0xffffff;
		}
		return is;
	}

	int[] method3687(int i, int i_5_) {
		int[] is = method3688(i, 1556704078);
		if (null == is)
			return null;
		for (int i_6_ = 0; i_6_ < is.length; i_6_++) {
			if ((is[i_6_] & 0xffffff) != 0)
				is[i_6_] = is[i_6_] | ~0xffffff;
			else
				is[i_6_] = is[i_6_] & 0xffffff;
		}
		return is;
	}

	int[] method3688(int i, int i_7_) {
		byte[] is = ((Class165) this).aClass279_2108.method5587(i, 2028895127);
		if (null == is)
			return null;
		int[] is_8_;
		try {
			int[] is_9_ = method3690(is, -1583105286);
			is_8_ = is_9_;
		} catch (IOException ioexception) {
			return null;
		}
		return is_8_;
	}

	float[] method3689(int i, int i_10_) {
		int[] is = method3688(i, 2122037432);
		if (null == is)
			return null;
		int[] is_11_ = null;
		if (((Class165) this).aClass279_2107.method5589(i, 947966954)) {
			byte[] is_12_ = ((Class165) this).aClass279_2107.method5587(i, 2028895127);
			if (null != is_12_) {
				try {
					is_11_ = method3690(is_12_, -1917391767);
					for (int i_13_ = 0; i_13_ < is_11_.length; i_13_++)
						is_11_[i_13_] = is_11_[i_13_] & 0xfff;
				} catch (IOException ioexception) {
					/* empty */
				}
			}
		}
		if (is_11_ == null)
			is_11_ = new int[is.length];
		float[] fs = new float[4 * is.length];
		int i_14_ = 0;
		for (int i_15_ = 0; i_15_ < is.length; i_15_++) {
			int i_16_ = is[i_15_];
			int i_17_ = i_16_ >>> 24;
			int i_18_ = (i_16_ & 0xff0000) >> 16;
			int i_19_ = (i_16_ & 0xff00) >> 8;
			int i_20_ = i_16_ & 0xff;
			float f = (float) is_11_[i_15_] * 31.0F / 4096.0F + 1.0F;
			fs[i_14_++] = (float) i_18_ * f / 255.0F;
			fs[i_14_++] = (float) i_19_ * f / 255.0F;
			fs[i_14_++] = f * (float) i_20_ / 255.0F;
			fs[i_14_++] = (float) i_17_ / 255.0F;
		}
		return fs;
	}

	public void method37(int i) {
		/* empty */
	}

	public float[] method43(int i, float f, int i_21_, int i_22_, boolean bool, int i_23_) {
		return method3689(i, 304317865);
	}

	public float[] method36(int i, float f, int i_24_, int i_25_, boolean bool) {
		return method3689(i, 500746895);
	}

	public float[] method44(int i, float f, int i_26_, int i_27_, boolean bool) {
		return method3689(i, 642772689);
	}

	int[] method3690(byte[] is, int i) throws IOException {
		BufferedImage bufferedimage = ImageIO.read(new ByteArrayInputStream(is));
		if (bufferedimage.getType() == 10 || bufferedimage.getType() == 0) {
			int[] is_28_ = null;
			is_28_ = bufferedimage.getRaster().getPixels(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), is_28_);
			int[] is_29_ = (new int[bufferedimage.getWidth() * bufferedimage.getHeight()]);
			if (bufferedimage.getType() == 10) {
				for (int i_30_ = 0; i_30_ < is_29_.length; i_30_++)
					is_29_[i_30_] = -16777216 + ((is_28_[i_30_] << 8) + (is_28_[i_30_] << 16) + is_28_[i_30_]);
			} else {
				for (int i_31_ = 0; i_31_ < is_29_.length; i_31_++) {
					int i_32_ = i_31_ * 2;
					is_29_[i_31_] = ((is_28_[i_32_] << 16) + (is_28_[i_32_] << 8) + ((is_28_[1 + i_32_] << 24) + is_28_[i_32_]));
				}
			}
			return is_29_;
		}
		return bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), null, 0, bufferedimage.getWidth());
	}

	public boolean method35(int i, Class525 class525, float f, int i_33_, int i_34_, boolean bool) {
		boolean bool_35_ = true;
		if (((Class165) this).aClass279_2107.method5589(i, 947966954))
			bool_35_ = ((Class165) this).aClass279_2107.method5582(i, (byte) 18);
		bool_35_ &= ((Class165) this).aClass279_2108.method5582(i, (byte) 104);
		return bool_35_;
	}

	public boolean method39(int i, Class525 class525, float f, int i_36_, int i_37_, boolean bool) {
		boolean bool_38_ = true;
		if (((Class165) this).aClass279_2107.method5589(i, 947966954))
			bool_38_ = ((Class165) this).aClass279_2107.method5582(i, (byte) 111);
		bool_38_ &= ((Class165) this).aClass279_2108.method5582(i, (byte) 13);
		return bool_38_;
	}

	int[] method3691(int i) {
		byte[] is = ((Class165) this).aClass279_2108.method5587(i, 2028895127);
		if (null == is)
			return null;
		int[] is_39_;
		try {
			int[] is_40_ = method3690(is, -2124676368);
			is_39_ = is_40_;
		} catch (IOException ioexception) {
			return null;
		}
		return is_39_;
	}

	int[] method3692(int i) {
		int[] is = method3688(i, 903196105);
		if (null == is)
			return null;
		for (int i_41_ = 0; i_41_ < is.length; i_41_++) {
			if ((is[i_41_] & 0xffffff) != 0)
				is[i_41_] = is[i_41_] | ~0xffffff;
			else
				is[i_41_] = is[i_41_] & 0xffffff;
		}
		return is;
	}

	int[] method3693(int i) {
		byte[] is = ((Class165) this).aClass279_2108.method5587(i, 2028895127);
		if (null == is)
			return null;
		int[] is_42_;
		try {
			int[] is_43_ = method3690(is, -1670867964);
			is_42_ = is_43_;
		} catch (IOException ioexception) {
			return null;
		}
		return is_42_;
	}

	int[] method3694(int i) {
		byte[] is = ((Class165) this).aClass279_2108.method5587(i, 2028895127);
		if (null == is)
			return null;
		int[] is_44_;
		try {
			int[] is_45_ = method3690(is, -1828793767);
			is_44_ = is_45_;
		} catch (IOException ioexception) {
			return null;
		}
		return is_44_;
	}

	int[] method3695(int i) {
		byte[] is = ((Class165) this).aClass279_2108.method5587(i, 2028895127);
		if (null == is)
			return null;
		int[] is_46_;
		try {
			int[] is_47_ = method3690(is, -1869125358);
			is_46_ = is_47_;
		} catch (IOException ioexception) {
			return null;
		}
		return is_46_;
	}

	float[] method3696(int i) {
		int[] is = method3688(i, 1234822070);
		if (null == is)
			return null;
		int[] is_48_ = null;
		if (((Class165) this).aClass279_2107.method5589(i, 947966954)) {
			byte[] is_49_ = ((Class165) this).aClass279_2107.method5587(i, 2028895127);
			if (null != is_49_) {
				try {
					is_48_ = method3690(is_49_, -1364871287);
					for (int i_50_ = 0; i_50_ < is_48_.length; i_50_++)
						is_48_[i_50_] = is_48_[i_50_] & 0xfff;
				} catch (IOException ioexception) {
					/* empty */
				}
			}
		}
		if (is_48_ == null)
			is_48_ = new int[is.length];
		float[] fs = new float[4 * is.length];
		int i_51_ = 0;
		for (int i_52_ = 0; i_52_ < is.length; i_52_++) {
			int i_53_ = is[i_52_];
			int i_54_ = i_53_ >>> 24;
			int i_55_ = (i_53_ & 0xff0000) >> 16;
			int i_56_ = (i_53_ & 0xff00) >> 8;
			int i_57_ = i_53_ & 0xff;
			float f = (float) is_48_[i_52_] * 31.0F / 4096.0F + 1.0F;
			fs[i_51_++] = (float) i_55_ * f / 255.0F;
			fs[i_51_++] = (float) i_56_ * f / 255.0F;
			fs[i_51_++] = f * (float) i_57_ / 255.0F;
			fs[i_51_++] = (float) i_54_ / 255.0F;
		}
		return fs;
	}

	public int[] method33(int i, float f, int i_58_, int i_59_, boolean bool, int i_60_) {
		return method3688(i, 291859623);
	}

	public void method40() {
		/* empty */
	}

	public void method41() {
		/* empty */
	}

	public void method42() {
		/* empty */
	}

	public int[] method47(int i, float f, int i_61_, int i_62_, boolean bool) {
		return method3687(i, -5790150);
	}

	public int[] method46(int i, float f, int i_63_, int i_64_, boolean bool) {
		return method3687(i, -511935297);
	}

	public int[] method45(int i, float f, int i_65_, int i_66_, boolean bool) {
		return method3688(i, 1670952966);
	}

	public Class165(Class279 class279, Class279 class279_67_) {
		((Class165) this).aClass279_2108 = class279;
		((Class165) this).aClass279_2107 = class279_67_;
	}

	public int[] method34(int i, float f, int i_68_, int i_69_, boolean bool, int i_70_) {
		return method3687(i, 8670192);
	}

	public float[] method48(int i, float f, int i_71_, int i_72_, boolean bool) {
		return method3689(i, 1692137745);
	}

	int[] method3697(byte[] is) throws IOException {
		BufferedImage bufferedimage = ImageIO.read(new ByteArrayInputStream(is));
		if (bufferedimage.getType() == 10 || bufferedimage.getType() == 0) {
			int[] is_73_ = null;
			is_73_ = bufferedimage.getRaster().getPixels(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), is_73_);
			int[] is_74_ = (new int[bufferedimage.getWidth() * bufferedimage.getHeight()]);
			if (bufferedimage.getType() == 10) {
				for (int i = 0; i < is_74_.length; i++)
					is_74_[i] = -16777216 + ((is_73_[i] << 8) + (is_73_[i] << 16) + is_73_[i]);
			} else {
				for (int i = 0; i < is_74_.length; i++) {
					int i_75_ = i * 2;
					is_74_[i] = ((is_73_[i_75_] << 16) + (is_73_[i_75_] << 8) + ((is_73_[1 + i_75_] << 24) + is_73_[i_75_]));
				}
			}
			return is_74_;
		}
		return bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), null, 0, bufferedimage.getWidth());
	}

	public static void method3698(int i) {
		Class328.aClass113_5129.method2642(-1790723577);
	}

	static void method3699(int i, int i_76_, int i_77_, Class587_Sub47 class587_sub47, int i_78_) {
		long l = (long) (i << 28 | i_77_ << 14 | i_76_);
		Class587_Sub41 class587_sub41 = (Class587_Sub41) client.aClass445_8176.method7988(l);
		if (class587_sub41 == null) {
			class587_sub41 = new Class587_Sub41();
			client.aClass445_8176.method8011(class587_sub41, l);
			class587_sub41.aClass413_9830.method7337(class587_sub47, -1837118572);
		} else {
			Class417 class417 = Class434.aClass419_6267.method7587((class587_sub47.anInt9901 * -121699593), (byte) 63);
			int i_79_ = class417.anInt6116 * -1789595629;
			if (1 == class417.anInt6087 * 1652950727)
				i_79_ *= (-396150095 * ((Class587_Sub47) class587_sub47).anInt9900) + 1;
			for (Class587_Sub47 class587_sub47_80_ = ((Class587_Sub47) class587_sub41.aClass413_9830.method7361(1847609362)); null != class587_sub47_80_; class587_sub47_80_ = (Class587_Sub47) class587_sub41.aClass413_9830.method7344(-1267338890)) {
				class417 = Class434.aClass419_6267.method7587((-121699593 * (class587_sub47_80_.anInt9901)), (byte) 8);
				int i_81_ = class417.anInt6116 * -1789595629;
				if (class417.anInt6087 * 1652950727 == 1)
					i_81_ *= 1 + (((Class587_Sub47) class587_sub47_80_).anInt9900 * -396150095);
				if (i_79_ > i_81_) {
					Class406.method7242(class587_sub47, class587_sub47_80_, -1777820124);
					return;
				}
			}
			class587_sub41.aClass413_9830.method7337(class587_sub47, -2146589092);
		}
	}
}
