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

public class Class531 implements Runnable
{
    int anInt7252 = 0;
    OutputStream anOutputStream7253;
    IOException anIOException7254;
    byte[] aByteArray7255;
    int anInt7256;
    int anInt7257 = 0;
    Thread aThread7258;
    boolean aBool7259;
    static boolean aBool7260;
    
    public void method6508() {
	do {
	    int i;
	    synchronized (this) {
		for (;;) {
		    if (null != ((Class531) this).anIOException7254)
			return;
		    if (-1429435571 * ((Class531) this).anInt7252
			<= 1254649361 * ((Class531) this).anInt7257)
			i = (((Class531) this).anInt7257 * 1254649361
			     - -1429435571 * ((Class531) this).anInt7252);
		    else
			i = (1254649361 * ((Class531) this).anInt7257
			     + (159172831 * ((Class531) this).anInt7256
				- ((Class531) this).anInt7252 * -1429435571));
		    if (i > 0)
			break;
		    try {
			((Class531) this).anOutputStream7253.flush();
		    } catch (IOException ioexception) {
			((Class531) this).anIOException7254 = ioexception;
			return;
		    }
		    if (method6513(-2140349476))
			return;
		    try {
			this.wait();
		    } catch (InterruptedException interruptedexception) {
			/* empty */
		    }
		}
	    }
	    try {
		if (-1429435571 * ((Class531) this).anInt7252 + i
		    <= ((Class531) this).anInt7256 * 159172831)
		    ((Class531) this).anOutputStream7253.write
			(((Class531) this).aByteArray7255,
			 -1429435571 * ((Class531) this).anInt7252, i);
		else {
		    int i_0_ = (((Class531) this).anInt7256 * 159172831
				- -1429435571 * ((Class531) this).anInt7252);
		    ((Class531) this).anOutputStream7253.write
			(((Class531) this).aByteArray7255,
			 -1429435571 * ((Class531) this).anInt7252, i_0_);
		    ((Class531) this).anOutputStream7253
			.write(((Class531) this).aByteArray7255, 0, i - i_0_);
		}
	    } catch (IOException ioexception) {
		synchronized (this) {
		    ((Class531) this).anIOException7254 = ioexception;
		    break;
		}
	    }
	    synchronized (this) {
		((Class531) this).anInt7252
		    = (-1103125115
		       * ((((Class531) this).anInt7252 * -1429435571 + i)
			  % (((Class531) this).anInt7256 * 159172831)));
	    }
	} while (!method6513(-2145680038));
    }
    
    void method6509() {
	synchronized (this) {
	    ((Class531) this).aBool7259 = true;
	    this.notifyAll();
	}
	try {
	    ((Class531) this).aThread7258.join();
	} catch (InterruptedException interruptedexception) {
	    /* empty */
	}
    }
    
    public void run() {
	do {
	    int i;
	    synchronized (this) {
		for (;;) {
		    if (null != ((Class531) this).anIOException7254)
			return;
		    if (-1429435571 * ((Class531) this).anInt7252
			<= 1254649361 * ((Class531) this).anInt7257)
			i = (((Class531) this).anInt7257 * 1254649361
			     - -1429435571 * ((Class531) this).anInt7252);
		    else
			i = (1254649361 * ((Class531) this).anInt7257
			     + (159172831 * ((Class531) this).anInt7256
				- ((Class531) this).anInt7252 * -1429435571));
		    if (i > 0)
			break;
		    try {
			((Class531) this).anOutputStream7253.flush();
		    } catch (IOException ioexception) {
			((Class531) this).anIOException7254 = ioexception;
			return;
		    }
		    if (method6513(-2133365334))
			return;
		    try {
			this.wait();
		    } catch (InterruptedException interruptedexception) {
			/* empty */
		    }
		}
	    }
	    try {
		if (-1429435571 * ((Class531) this).anInt7252 + i
		    <= ((Class531) this).anInt7256 * 159172831)
		    ((Class531) this).anOutputStream7253.write
			(((Class531) this).aByteArray7255,
			 -1429435571 * ((Class531) this).anInt7252, i);
		else {
		    int i_1_ = (((Class531) this).anInt7256 * 159172831
				- -1429435571 * ((Class531) this).anInt7252);
		    ((Class531) this).anOutputStream7253.write
			(((Class531) this).aByteArray7255,
			 -1429435571 * ((Class531) this).anInt7252, i_1_);
		    ((Class531) this).anOutputStream7253
			.write(((Class531) this).aByteArray7255, 0, i - i_1_);
		}
	    } catch (IOException ioexception) {
		synchronized (this) {
		    ((Class531) this).anIOException7254 = ioexception;
		    break;
		}
	    }
	    synchronized (this) {
		((Class531) this).anInt7252
		    = (-1103125115
		       * ((((Class531) this).anInt7252 * -1429435571 + i)
			  % (((Class531) this).anInt7256 * 159172831)));
	    }
	} while (!method6513(-2129904096));
    }
    
    void method6510(byte[] is, int i, int i_2_, byte i_3_) throws IOException {
	if (i_2_ < 0 || i < 0 || i_2_ + i > is.length)
	    throw new IOException();
	synchronized (this) {
	    if (((Class531) this).anIOException7254 != null)
		throw new IOException(((Class531) this).anIOException7254
					  .toString());
	    int i_4_;
	    if (((Class531) this).anInt7252 * -1429435571
		<= ((Class531) this).anInt7257 * 1254649361)
		i_4_ = (((Class531) this).anInt7256 * 159172831
			- 1254649361 * ((Class531) this).anInt7257
			+ ((Class531) this).anInt7252 * -1429435571 - 1);
	    else
		i_4_ = (-1429435571 * ((Class531) this).anInt7252
			- ((Class531) this).anInt7257 * 1254649361 - 1);
	    if (i_4_ < i_2_)
		throw new IOException("");
	    if (1254649361 * ((Class531) this).anInt7257 + i_2_
		<= 159172831 * ((Class531) this).anInt7256)
		System.arraycopy(is, i, ((Class531) this).aByteArray7255,
				 1254649361 * ((Class531) this).anInt7257,
				 i_2_);
	    else {
		int i_5_ = (((Class531) this).anInt7256 * 159172831
			    - ((Class531) this).anInt7257 * 1254649361);
		System.arraycopy(is, i, ((Class531) this).aByteArray7255,
				 1254649361 * ((Class531) this).anInt7257,
				 i_5_);
		System.arraycopy(is, i + i_5_,
				 ((Class531) this).aByteArray7255, 0,
				 i_2_ - i_5_);
	    }
	    ((Class531) this).anInt7257
		= ((i_2_ + 1254649361 * ((Class531) this).anInt7257)
		   % (((Class531) this).anInt7256 * 159172831) * -303021327);
	    this.notifyAll();
	}
    }
    
    boolean method6511() {
	if (((Class531) this).aBool7259) {
	    try {
		((Class531) this).anOutputStream7253.close();
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254 = new IOException("");
	    } catch (IOException ioexception) {
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254
			= new IOException(ioexception);
	    }
	    return true;
	}
	return false;
    }
    
    void method6512(int i) {
	((Class531) this).anOutputStream7253 = new OutputStream_Sub1();
    }
    
    boolean method6513(int i) {
	if (((Class531) this).aBool7259) {
	    try {
		((Class531) this).anOutputStream7253.close();
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254 = new IOException("");
	    } catch (IOException ioexception) {
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254
			= new IOException(ioexception);
	    }
	    return true;
	}
	return false;
    }
    
    public void method6514() {
	do {
	    int i;
	    synchronized (this) {
		for (;;) {
		    if (null != ((Class531) this).anIOException7254)
			return;
		    if (-1429435571 * ((Class531) this).anInt7252
			<= 1254649361 * ((Class531) this).anInt7257)
			i = (((Class531) this).anInt7257 * 1254649361
			     - -1429435571 * ((Class531) this).anInt7252);
		    else
			i = (1254649361 * ((Class531) this).anInt7257
			     + (159172831 * ((Class531) this).anInt7256
				- ((Class531) this).anInt7252 * -1429435571));
		    if (i > 0)
			break;
		    try {
			((Class531) this).anOutputStream7253.flush();
		    } catch (IOException ioexception) {
			((Class531) this).anIOException7254 = ioexception;
			return;
		    }
		    if (method6513(-2135845184))
			return;
		    try {
			this.wait();
		    } catch (InterruptedException interruptedexception) {
			/* empty */
		    }
		}
	    }
	    try {
		if (-1429435571 * ((Class531) this).anInt7252 + i
		    <= ((Class531) this).anInt7256 * 159172831)
		    ((Class531) this).anOutputStream7253.write
			(((Class531) this).aByteArray7255,
			 -1429435571 * ((Class531) this).anInt7252, i);
		else {
		    int i_6_ = (((Class531) this).anInt7256 * 159172831
				- -1429435571 * ((Class531) this).anInt7252);
		    ((Class531) this).anOutputStream7253.write
			(((Class531) this).aByteArray7255,
			 -1429435571 * ((Class531) this).anInt7252, i_6_);
		    ((Class531) this).anOutputStream7253
			.write(((Class531) this).aByteArray7255, 0, i - i_6_);
		}
	    } catch (IOException ioexception) {
		synchronized (this) {
		    ((Class531) this).anIOException7254 = ioexception;
		    break;
		}
	    }
	    synchronized (this) {
		((Class531) this).anInt7252
		    = (-1103125115
		       * ((((Class531) this).anInt7252 * -1429435571 + i)
			  % (((Class531) this).anInt7256 * 159172831)));
	    }
	} while (!method6513(-2146433284));
    }
    
    boolean method6515() {
	if (((Class531) this).aBool7259) {
	    try {
		((Class531) this).anOutputStream7253.close();
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254 = new IOException("");
	    } catch (IOException ioexception) {
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254
			= new IOException(ioexception);
	    }
	    return true;
	}
	return false;
    }
    
    boolean method6516() {
	if (((Class531) this).aBool7259) {
	    try {
		((Class531) this).anOutputStream7253.close();
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254 = new IOException("");
	    } catch (IOException ioexception) {
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254
			= new IOException(ioexception);
	    }
	    return true;
	}
	return false;
    }
    
    Class531(OutputStream outputstream, int i) {
	((Class531) this).anOutputStream7253 = outputstream;
	((Class531) this).anInt7256 = (i + 1) * -1480002785;
	((Class531) this).aByteArray7255
	    = new byte[159172831 * ((Class531) this).anInt7256];
	((Class531) this).aThread7258 = new Thread(this);
	((Class531) this).aThread7258.setDaemon(true);
	((Class531) this).aThread7258.start();
    }
    
    boolean method6517() {
	if (((Class531) this).aBool7259) {
	    try {
		((Class531) this).anOutputStream7253.close();
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254 = new IOException("");
	    } catch (IOException ioexception) {
		if (((Class531) this).anIOException7254 == null)
		    ((Class531) this).anIOException7254
			= new IOException(ioexception);
	    }
	    return true;
	}
	return false;
    }
    
    void method6518() {
	synchronized (this) {
	    ((Class531) this).aBool7259 = true;
	    this.notifyAll();
	}
	try {
	    ((Class531) this).aThread7258.join();
	} catch (InterruptedException interruptedexception) {
	    /* empty */
	}
    }
    
    void method6519(byte i) {
	synchronized (this) {
	    ((Class531) this).aBool7259 = true;
	    this.notifyAll();
	}
	try {
	    ((Class531) this).aThread7258.join();
	} catch (InterruptedException interruptedexception) {
	    /* empty */
	}
    }
    
    void method6520() {
	synchronized (this) {
	    ((Class531) this).aBool7259 = true;
	    this.notifyAll();
	}
	try {
	    ((Class531) this).aThread7258.join();
	} catch (InterruptedException interruptedexception) {
	    /* empty */
	}
    }
    
    void method6521() {
	((Class531) this).anOutputStream7253 = new OutputStream_Sub1();
    }
    
    static final void method6522(Class612 class612, byte i) {
	int i_7_
	    = (((Class612) class612).anIntArray8021
	       [(((Class612) class612).anInt8022 -= 201091009) * -40654783]);
	((Class612) class612).anIntArray8021
	    [(((Class612) class612).anInt8022 += 201091009) * -40654783 - 1]
	    = (((Class657)
		Class469.aClass662_Sub20_5330.method31(i_7_, 1808740544))
	       .anInt8349) * -429469681;
    }
    
    static void method6523(int i) {
	client.aClass65_10676.method1059(1851008017);
	if (1092525213 * Class55.anInt630 < 2) {
	    Class665.aClass677_8433.method8063((byte) 52);
	    Class55.anInt629 = 0;
	    Class55.anInt630 += -1498101323;
	    Class55.aClass37_627 = Class37.aClass37_456;
	} else {
	    Class55.aClass37_627 = null;
	    Class488.aClass646_6702 = Class646.aClass646_8240;
	    Class579.method7065(14, -2037288426);
	}
    }
    
    static final void method6524(Class612 class612, byte i) {
	Class590_Sub1_Sub5_Sub1_Sub1 class590_sub1_sub5_sub1_sub1
	    = ((Class590_Sub1_Sub5_Sub1_Sub1)
	       ((Class612) class612).aClass590_Sub1_Sub5_Sub1_8016);
	String string = class590_sub1_sub5_sub1_sub1.aString11849;
	Class257 class257 = class590_sub1_sub5_sub1_sub1.aClass257_11851;
	if (null != class257.anIntArray3009) {
	    class257 = class257.method3550(Class452.aClass69_5208,
					   Class452.aClass69_5208, 820030037);
	    if (null == class257)
		string = "";
	    else
		string = class257.aString3029;
	}
	if (string == null)
	    string = "";
	((Class612) class612).anObjectArray8034
	    [(((Class612) class612).anInt8017 += 1516150619) * -1930397485 - 1]
	    = string;
    }
    
    static String method6525(String string, int i) {
	if (Class470.aString5331.startsWith("win"))
	    return new StringBuilder().append(string).append(".dll")
		       .toString();
	if (Class470.aString5331.startsWith("linux"))
	    return new StringBuilder().append("lib").append(string).append
		       (".so").toString();
	if (Class470.aString5331.startsWith("mac"))
	    return new StringBuilder().append("lib").append(string).append
		       (".dylib").toString();
	return null;
    }
}
