/* Class574 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.io.IOException;
import java.io.OutputStream;

public class Class574 implements Runnable {
	IOException anIOException7359;
	OutputStream anOutputStream7360;
	Thread aThread7361;
	byte[] aByteArray7362;
	int anInt7363 = 0;
	int anInt7364 = 0;
	int anInt7365;
	boolean aBool7366;

	void method12397() {
		((Class574) this).anOutputStream7360 = new OutputStream_Sub1();
	}

	public void method12398() {
		do {
			int i;
			synchronized (this) {
				for (;;) {
					if (((Class574) this).anIOException7359 != null)
						return;
					if (((Class574) this).anInt7363 * 682628585 <= ((Class574) this).anInt7364 * 1784717947)
						i = (((Class574) this).anInt7364 * 1784717947 - 682628585 * ((Class574) this).anInt7363);
					else
						i = (1784717947 * ((Class574) this).anInt7364 + (((Class574) this).anInt7365 * 1741553793 - ((Class574) this).anInt7363 * 682628585));
					if (i > 0)
						break;
					try {
						((Class574) this).anOutputStream7360.flush();
					} catch (IOException ioexception) {
						((Class574) this).anIOException7359 = ioexception;
						return;
					}
					if (method12409((short) 1338))
						return;
					try {
						this.wait();
					} catch (InterruptedException interruptedexception) {
						/* empty */
					}
				}
			}
			try {
				if (i + 682628585 * ((Class574) this).anInt7363 <= ((Class574) this).anInt7365 * 1741553793)
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, ((Class574) this).anInt7363 * 682628585, i);
				else {
					int i_0_ = (((Class574) this).anInt7365 * 1741553793 - ((Class574) this).anInt7363 * 682628585);
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, ((Class574) this).anInt7363 * 682628585, i_0_);
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, 0, i - i_0_);
				}
			} catch (IOException ioexception) {
				synchronized (this) {
					((Class574) this).anIOException7359 = ioexception;
					break;
				}
			}
			synchronized (this) {
				((Class574) this).anInt7363 = ((682628585 * ((Class574) this).anInt7363 + i) % (1741553793 * ((Class574) this).anInt7365) * -2104618407);
			}
		} while (!method12409((short) 24864));
	}

	void method12399() {
		((Class574) this).anOutputStream7360 = new OutputStream_Sub1();
	}

	boolean method12400() {
		if (((Class574) this).aBool7366) {
			try {
				((Class574) this).anOutputStream7360.close();
				if (((Class574) this).anIOException7359 == null)
					((Class574) this).anIOException7359 = new IOException("");
			} catch (IOException ioexception) {
				if (((Class574) this).anIOException7359 == null)
					((Class574) this).anIOException7359 = new IOException(ioexception);
			}
			return true;
		}
		return false;
	}

	void method12401(int i) {
		synchronized (this) {
			((Class574) this).aBool7366 = true;
			this.notifyAll();
		}
		try {
			((Class574) this).aThread7361.join();
		} catch (InterruptedException interruptedexception) {
			/* empty */
		}
	}

	void method12402(int i) {
		((Class574) this).anOutputStream7360 = new OutputStream_Sub1();
	}

	public void method12403() {
		do {
			int i;
			synchronized (this) {
				for (;;) {
					if (((Class574) this).anIOException7359 != null)
						return;
					if (((Class574) this).anInt7363 * 682628585 <= ((Class574) this).anInt7364 * 1784717947)
						i = (((Class574) this).anInt7364 * 1784717947 - 682628585 * ((Class574) this).anInt7363);
					else
						i = (1784717947 * ((Class574) this).anInt7364 + (((Class574) this).anInt7365 * 1741553793 - ((Class574) this).anInt7363 * 682628585));
					if (i > 0)
						break;
					try {
						((Class574) this).anOutputStream7360.flush();
					} catch (IOException ioexception) {
						((Class574) this).anIOException7359 = ioexception;
						return;
					}
					if (method12409((short) 32543))
						return;
					try {
						this.wait();
					} catch (InterruptedException interruptedexception) {
						/* empty */
					}
				}
			}
			try {
				if (i + 682628585 * ((Class574) this).anInt7363 <= ((Class574) this).anInt7365 * 1741553793)
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, ((Class574) this).anInt7363 * 682628585, i);
				else {
					int i_1_ = (((Class574) this).anInt7365 * 1741553793 - ((Class574) this).anInt7363 * 682628585);
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, ((Class574) this).anInt7363 * 682628585, i_1_);
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, 0, i - i_1_);
				}
			} catch (IOException ioexception) {
				synchronized (this) {
					((Class574) this).anIOException7359 = ioexception;
					break;
				}
			}
			synchronized (this) {
				((Class574) this).anInt7363 = ((682628585 * ((Class574) this).anInt7363 + i) % (1741553793 * ((Class574) this).anInt7365) * -2104618407);
			}
		} while (!method12409((short) 1402));
	}

	void method12404(byte[] is, int i, int i_2_, int i_3_) throws IOException {
		if (i_2_ < 0 || i < 0 || i_2_ + i > is.length)
			throw new IOException();
		synchronized (this) {
			if (null != ((Class574) this).anIOException7359)
				throw new IOException(((Class574) this).anIOException7359.toString());
			int i_4_;
			if (((Class574) this).anInt7363 * 682628585 <= 1784717947 * ((Class574) this).anInt7364)
				i_4_ = (((Class574) this).anInt7365 * 1741553793 - 1784717947 * ((Class574) this).anInt7364 + 682628585 * ((Class574) this).anInt7363 - 1);
			else
				i_4_ = (682628585 * ((Class574) this).anInt7363 - ((Class574) this).anInt7364 * 1784717947 - 1);
			if (i_4_ < i_2_)
				throw new IOException("");
			if (i_2_ + 1784717947 * ((Class574) this).anInt7364 <= 1741553793 * ((Class574) this).anInt7365)
				System.arraycopy(is, i, ((Class574) this).aByteArray7362, 1784717947 * ((Class574) this).anInt7364, i_2_);
			else {
				int i_5_ = (((Class574) this).anInt7365 * 1741553793 - ((Class574) this).anInt7364 * 1784717947);
				System.arraycopy(is, i, ((Class574) this).aByteArray7362, 1784717947 * ((Class574) this).anInt7364, i_5_);
				System.arraycopy(is, i + i_5_, ((Class574) this).aByteArray7362, 0, i_2_ - i_5_);
			}
			((Class574) this).anInt7364 = -1486885709 * ((((Class574) this).anInt7364 * 1784717947 + i_2_) % (((Class574) this).anInt7365 * 1741553793));
			this.notifyAll();
		}
	}

	void method12405(byte[] is, int i, int i_6_) throws IOException {
		if (i_6_ < 0 || i < 0 || i_6_ + i > is.length)
			throw new IOException();
		synchronized (this) {
			if (null != ((Class574) this).anIOException7359)
				throw new IOException(((Class574) this).anIOException7359.toString());
			int i_7_;
			if (((Class574) this).anInt7363 * 682628585 <= 1784717947 * ((Class574) this).anInt7364)
				i_7_ = (((Class574) this).anInt7365 * 1741553793 - 1784717947 * ((Class574) this).anInt7364 + 682628585 * ((Class574) this).anInt7363 - 1);
			else
				i_7_ = (682628585 * ((Class574) this).anInt7363 - ((Class574) this).anInt7364 * 1784717947 - 1);
			if (i_7_ < i_6_)
				throw new IOException("");
			if (i_6_ + 1784717947 * ((Class574) this).anInt7364 <= 1741553793 * ((Class574) this).anInt7365)
				System.arraycopy(is, i, ((Class574) this).aByteArray7362, 1784717947 * ((Class574) this).anInt7364, i_6_);
			else {
				int i_8_ = (((Class574) this).anInt7365 * 1741553793 - ((Class574) this).anInt7364 * 1784717947);
				System.arraycopy(is, i, ((Class574) this).aByteArray7362, 1784717947 * ((Class574) this).anInt7364, i_8_);
				System.arraycopy(is, i + i_8_, ((Class574) this).aByteArray7362, 0, i_6_ - i_8_);
			}
			((Class574) this).anInt7364 = -1486885709 * ((((Class574) this).anInt7364 * 1784717947 + i_6_) % (((Class574) this).anInt7365 * 1741553793));
			this.notifyAll();
		}
	}

	Class574(OutputStream outputstream, int i) {
		((Class574) this).anOutputStream7360 = outputstream;
		((Class574) this).anInt7365 = (1 + i) * -166576255;
		((Class574) this).aByteArray7362 = new byte[((Class574) this).anInt7365 * 1741553793];
		((Class574) this).aThread7361 = new Thread(this);
		((Class574) this).aThread7361.setDaemon(true);
		((Class574) this).aThread7361.start();
	}

	void method12406() {
		synchronized (this) {
			((Class574) this).aBool7366 = true;
			this.notifyAll();
		}
		try {
			((Class574) this).aThread7361.join();
		} catch (InterruptedException interruptedexception) {
			/* empty */
		}
	}

	void method12407() {
		((Class574) this).anOutputStream7360 = new OutputStream_Sub1();
	}

	void method12408() {
		((Class574) this).anOutputStream7360 = new OutputStream_Sub1();
	}

	boolean method12409(short i) {
		if (((Class574) this).aBool7366) {
			try {
				((Class574) this).anOutputStream7360.close();
				if (((Class574) this).anIOException7359 == null)
					((Class574) this).anIOException7359 = new IOException("");
			} catch (IOException ioexception) {
				if (((Class574) this).anIOException7359 == null)
					((Class574) this).anIOException7359 = new IOException(ioexception);
			}
			return true;
		}
		return false;
	}

	public void run() {
		do {
			int i;
			synchronized (this) {
				for (;;) {
					if (((Class574) this).anIOException7359 != null)
						return;
					if (((Class574) this).anInt7363 * 682628585 <= ((Class574) this).anInt7364 * 1784717947)
						i = (((Class574) this).anInt7364 * 1784717947 - 682628585 * ((Class574) this).anInt7363);
					else
						i = (1784717947 * ((Class574) this).anInt7364 + (((Class574) this).anInt7365 * 1741553793 - ((Class574) this).anInt7363 * 682628585));
					if (i > 0)
						break;
					try {
						((Class574) this).anOutputStream7360.flush();
					} catch (IOException ioexception) {
						((Class574) this).anIOException7359 = ioexception;
						return;
					}
					if (method12409((short) 32347))
						return;
					try {
						this.wait();
					} catch (InterruptedException interruptedexception) {
						/* empty */
					}
				}
			}
			try {
				if (i + 682628585 * ((Class574) this).anInt7363 <= ((Class574) this).anInt7365 * 1741553793)
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, ((Class574) this).anInt7363 * 682628585, i);
				else {
					int i_9_ = (((Class574) this).anInt7365 * 1741553793 - ((Class574) this).anInt7363 * 682628585);
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, ((Class574) this).anInt7363 * 682628585, i_9_);
					((Class574) this).anOutputStream7360.write(((Class574) this).aByteArray7362, 0, i - i_9_);
				}
			} catch (IOException ioexception) {
				synchronized (this) {
					((Class574) this).anIOException7359 = ioexception;
					break;
				}
			}
			synchronized (this) {
				((Class574) this).anInt7363 = ((682628585 * ((Class574) this).anInt7363 + i) % (1741553793 * ((Class574) this).anInt7365) * -2104618407);
			}
		} while (!method12409((short) 2959));
	}

	void method12410() {
		((Class574) this).anOutputStream7360 = new OutputStream_Sub1();
	}

	static final void method12411(Class477 class477, byte i) {
		((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1] = client.anInt8001 * 440465081;
	}

	static final void method12412(Class477 class477, byte i) {
		((Class477) class477).anInt6500 -= -688286802;
		String string = (String) (((Class477) class477).anObjectArray6499[((Class477) class477).anInt6500 * -443336217]);
		String string_10_ = (String) (((Class477) class477).anObjectArray6499[1 + ((Class477) class477).anInt6500 * -443336217]);
		Class319.method6277(string, string_10_, 897126709);
	}

	static final void method12413(Class477 class477, int i) {
		((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1] = Class238.anInt2781 * 631308341;
		((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1] = 631308341 * Class238.anInt2781;
		((Class477) class477).anIntArray6497[(((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1] = 1;
	}

	public static void method12414(Class546 class546, byte i) {
		Class559.aClass546_7295 = class546;
	}

	static final void method12415(Class477 class477, int i) {
		((Class477) class477).anInt6498 -= -1140365234;
		int i_11_ = (((Class477) class477).anIntArray6497[2028895127 * ((Class477) class477).anInt6498]);
		int i_12_ = (((Class477) class477).anIntArray6497[1 + ((Class477) class477).anInt6498 * 2028895127]);
		Class616 class616 = Class12.aClass623_76.method13188(i_12_, (byte) -93);
		if (class616.method13097(1033823054))
			((Class477) class477).anObjectArray6499[((((Class477) class477).anInt6500 += 1803340247) * -443336217 - 1)] = client.aClass237_8070.method4688(-16777216).method11741(i_11_, -672876493).method11601(i_12_, class616.aString7859, -43565027);
		else
			((Class477) class477).anIntArray6497[((((Class477) class477).anInt6498 += 1577301031) * 2028895127 - 1)] = (client.aClass237_8070.method4688(-16777216).method11741(i_11_, -496051115).method11628(i_12_, class616.anInt7858 * -162093731, -90726495));
	}

	public static void method12416(int i, int i_13_) {
		if (client.anInt8013 * 906940163 != i) {
			client.anInt8034 = 0;
			if (i == 19 || i == 8)
				Class518.method11643(729102023);
			if (19 != i && Class307_Sub2.aClass572_9988 != null) {
				Class307_Sub2.aClass572_9988.method12362(16777472);
				Class307_Sub2.aClass572_9988 = null;
			}
			if (i == 17)
				Class266.method5297((906940163 * client.anInt8013 == 2 || client.anInt8013 * 906940163 == 1 || ((Class119.aClass511_1651.anInt6812 * 191544363) != client.anInt8190 * -659987771)), (byte) 1);
			if (i == 7) {
				boolean bool;
				if (-1 == -494388251 * Class119.aClass511_1651.anInt6813)
					bool = 3 == 906940163 * client.anInt8013;
				else
					bool = (-494388251 * Class119.aClass511_1651.anInt6813 != -659987771 * client.anInt8190);
				Class360_Sub3.method16419(bool, (byte) 82);
			}
			if (3 == i || 15 == i) {
				if (!Class15.method724((byte) 8))
					return;
			} else if (i == 16 || 18 == i && client.anInt8013 * 906940163 != 12) {
				if (!Class518.method11643(-752457480))
					return;
			} else if (i == 1)
				Class13.method646((short) 8717);
			if (Class172.method3773(i, -2145641980)) {
				client.aClass237_8070.method4697((byte) -11);
				Class269.method5337(true, 2028895127);
			}
			if (6 == i || 17 == i)
				Class360.method6893((byte) 0);
			boolean bool = (4 == i || Class69_Sub2.method16430(i, 263883239) || Class396.method7141(i, (byte) -98));
			boolean bool_14_ = (4 == 906940163 * client.anInt8013 || Class69_Sub2.method16430(client.anInt8013 * 906940163, 1974779248) || Class396.method7141(906940163 * client.anInt8013, (byte) -35));
			if (bool_14_ != bool)
				Class121.aClass275_1667.method5395(!bool, (byte) 42);
			if (Class172.method3773(i, -2138960544) || 19 == i || i == 8)
				Class327.aClass84_5125.method1903();
			client.anInt8013 = i * 1354732459;
		}
	}
}
