/* Class314_Sub2 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

public class Class314_Sub2 extends Class314
{
    Thread aThread10234;
    Class310 aClass310_10235;
    HashMap aHashMap10236;
    volatile boolean aBool10237 = false;
    static final float aFloat10238 = 2.0F;
    Thread aThread10239;
    List aList10240 = new ArrayList();
    Runnable aRunnable10241 = new Class578(this);
    Runnable aRunnable10242 = new Class562(this);
    
    HashMap method16680() {
	return ((Class314_Sub2) this).aHashMap10236;
    }
    
    public void method6170() {
	HashMap hashmap = method16681(-1586257286);
	synchronized (hashmap) {
	    Iterator iterator = hashmap.keySet().iterator();
	    while (iterator.hasNext()) {
		Class298 class298 = (Class298) iterator.next();
		Class222[] class222s = (Class222[]) hashmap.get(class298);
		for (int i = 0; i < class222s.length; i++) {
		    if (class222s[i].method4458(-2023202825)
			!= Class297.aClass297_4327) {
			class222s[i].method4505(-215818361);
			class222s[i].method4461(-1701110044);
		    }
		}
	    }
	}
	boolean bool = false;
	while (!bool) {
	    bool = true;
	    synchronized (hashmap) {
		Iterator iterator = hashmap.keySet().iterator();
		while (iterator.hasNext()) {
		    Class298 class298 = (Class298) iterator.next();
		    Class222[] class222s = (Class222[]) hashmap.get(class298);
		    for (int i = 0; i < class222s.length; i++) {
			if (class222s[i].method4458(-331567152)
			    != Class297.aClass297_4327) {
			    class222s[i].method4540((byte) -122);
			    bool = false;
			}
		    }
		}
	    }
	    Class43.method1220(10L);
	}
	((Class314_Sub2) this).aBool10237 = true;
	try {
	    ((Class314_Sub2) this).aThread10234.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
	try {
	    ((Class314_Sub2) this).aThread10239.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
    }
    
    public int method6153(Object object, byte i) {
	if (object != null && object instanceof Class577) {
	    Class577 class577 = (Class577) object;
	    synchronized (((Class577) class577).aClass573_7559) {
		int i_0_ = class577.method12721((byte) 9);
		return i_0_;
	    }
	}
	return 0;
    }
    
    public void method6169() {
	HashMap hashmap = method16681(-1686928120);
	synchronized (hashmap) {
	    Iterator iterator = hashmap.keySet().iterator();
	    while (iterator.hasNext()) {
		Class298 class298 = (Class298) iterator.next();
		Class222[] class222s = (Class222[]) hashmap.get(class298);
		for (int i = 0; i < class222s.length; i++) {
		    if (class222s[i].method4458(209951913)
			!= Class297.aClass297_4327) {
			class222s[i].method4505(-938498741);
			class222s[i].method4461(-1701110044);
		    }
		}
	    }
	}
	boolean bool = false;
	while (!bool) {
	    bool = true;
	    synchronized (hashmap) {
		Iterator iterator = hashmap.keySet().iterator();
		while (iterator.hasNext()) {
		    Class298 class298 = (Class298) iterator.next();
		    Class222[] class222s = (Class222[]) hashmap.get(class298);
		    for (int i = 0; i < class222s.length; i++) {
			if (class222s[i].method4458(1706828383)
			    != Class297.aClass297_4327) {
			    class222s[i].method4540((byte) -44);
			    bool = false;
			}
		    }
		}
	    }
	    Class43.method1220(10L);
	}
	((Class314_Sub2) this).aBool10237 = true;
	try {
	    ((Class314_Sub2) this).aThread10234.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
	try {
	    ((Class314_Sub2) this).aThread10239.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
    }
    
    public Class314_Sub2(Class483 class483) {
	((Class314_Sub2) this).aClass310_10235 = new Class310(this);
	((Class314_Sub2) this).aHashMap10236 = new HashMap();
	Iterator iterator = class483.aHashMap6480.keySet().iterator();
	while (iterator.hasNext()) {
	    Class298 class298 = (Class298) iterator.next();
	    ((Class314_Sub2) this).aHashMap10236.put(class298,
						     (new Class222
						      [((Integer)
							class483
							    .aHashMap6480
							    .get(class298))
							   .intValue()]));
	}
	iterator = ((Class314_Sub2) this).aHashMap10236.keySet().iterator();
	while (iterator.hasNext()) {
	    Class298 class298 = (Class298) iterator.next();
	    Class222[] class222s
		= ((Class222[])
		   ((Class314_Sub2) this).aHashMap10236.get(class298));
	    for (int i = 0; i < class222s.length; i++) {
		Class56 class56 = new Class56(2.0F);
		class56.method287(0, Class309.aClass309_4582,
				  Class302.aClass302_4538, 2);
		class222s[i] = new Class222(class298, 8192, 3, class56, this);
	    }
	}
	Class573 class573 = new Class573(this, 44100.0F, 32768);
	Class573 class573_1_ = new Class573(this, 22050.0F, 16384);
	((Class314_Sub2) this).aList10240.add(class573);
	((Class314_Sub2) this).aList10240.add(class573_1_);
	((Class314_Sub2) this).aThread10234
	    = new Thread(((Class314_Sub2) this).aRunnable10242);
	((Class314_Sub2) this).aThread10239
	    = new Thread(((Class314_Sub2) this).aRunnable10241);
	((Class314_Sub2) this).aThread10234.setPriority(10);
	((Class314_Sub2) this).aThread10239.setPriority(10);
	((Class314_Sub2) this).aThread10234.start();
	((Class314_Sub2) this).aThread10239.start();
    }
    
    public Object method6160(int i, int i_2_, Class309 class309,
			     Class302 class302, int i_3_, float f,
			     short i_4_) {
	Class573 class573 = method16682((float) i_2_ * f, (short) 27479);
	Class577 class577
	    = new Class577(this, class573, i_3_, f * (float) i_2_,
			   -1803716693 * class309.anInt4583, i < 2 ? 2 : i,
			   (Class309.aClass309_4582 == class309
			    || class309 == Class309.aClass309_4580),
			   Class302.aClass302_4539 == class302);
	synchronized (((Class577) class577).aClass573_7559) {
	    ((Class577) class577).aClass573_7559.method12643(class577,
							     -1122596870);
	}
	return class577;
    }
    
    public void method6157(Object object, int i) {
	if (object != null && object instanceof Class577) {
	    Class577 class577 = (Class577) object;
	    synchronized (((Class577) class577).aClass573_7559) {
		((Class577) class577).aClass573_7559.method12644(class577,
								 1650388970);
	    }
	}
    }
    
    public void method6151(Object object) {
	if (object != null && object instanceof Class577) {
	    Class577 class577 = (Class577) object;
	    synchronized (((Class577) class577).aClass573_7559) {
		((Class577) class577).aClass573_7559.method12644(class577,
								 911114753);
	    }
	}
    }
    
    HashMap method16681(int i) {
	return ((Class314_Sub2) this).aHashMap10236;
    }
    
    Class573 method16682(float f, short i) {
	float f_5_ = -1.0F;
	float f_6_ = 3.4028235E38F;
	Class573 class573 = null;
	Iterator iterator = ((Class314_Sub2) this).aList10240.iterator();
	while (iterator.hasNext()) {
	    Class573 class573_7_ = (Class573) iterator.next();
	    float f_8_ = ((Class573) class573_7_).aFloat7430;
	    float f_9_ = Math.abs(f_8_ - f);
	    if (f_5_ < 0.0F || f_9_ < f_6_) {
		f_5_ = f_8_;
		f_6_ = f_9_;
		class573 = class573_7_;
	    }
	}
	return class573;
    }
    
    public Class310 method6166(byte i) {
	return ((Class314_Sub2) this).aClass310_10235;
    }
    
    public void method6164(int i) {
	HashMap hashmap = method16681(-1092607536);
	synchronized (hashmap) {
	    Iterator iterator = hashmap.keySet().iterator();
	    while (iterator.hasNext()) {
		Class298 class298 = (Class298) iterator.next();
		Class222[] class222s = (Class222[]) hashmap.get(class298);
		for (int i_10_ = 0; i_10_ < class222s.length; i_10_++) {
		    if (class222s[i_10_].method4458(-2099810958)
			!= Class297.aClass297_4327) {
			class222s[i_10_].method4505(-1851380148);
			class222s[i_10_].method4461(-1701110044);
		    }
		}
	    }
	}
	boolean bool = false;
	while (!bool) {
	    bool = true;
	    synchronized (hashmap) {
		Iterator iterator = hashmap.keySet().iterator();
		while (iterator.hasNext()) {
		    Class298 class298 = (Class298) iterator.next();
		    Class222[] class222s = (Class222[]) hashmap.get(class298);
		    for (int i_11_ = 0; i_11_ < class222s.length; i_11_++) {
			if (class222s[i_11_].method4458(1742917588)
			    != Class297.aClass297_4327) {
			    class222s[i_11_].method4540((byte) -3);
			    bool = false;
			}
		    }
		}
	    }
	    Class43.method1220(10L);
	}
	((Class314_Sub2) this).aBool10237 = true;
	try {
	    ((Class314_Sub2) this).aThread10234.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
	try {
	    ((Class314_Sub2) this).aThread10239.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
    }
    
    public void method6148() {
	if (((Class314_Sub2) this).aClass310_10235 != null)
	    ((Class314_Sub2) this).aClass310_10235.method6109(-1362428651);
	Iterator iterator
	    = ((Class314_Sub2) this).aHashMap10236.keySet().iterator();
	while (iterator.hasNext()) {
	    Class298 class298 = (Class298) iterator.next();
	    Class222[] class222s
		= ((Class222[])
		   ((Class314_Sub2) this).aHashMap10236.get(class298));
	    if (!class298.aBool4338) {
		boolean bool = false;
		for (int i = 0; i < class222s.length; i++) {
		    class222s[i].method4540((byte) -6);
		    bool |= class222s[i].method4472((byte) 17);
		}
		if (bool)
		    Arrays.sort(class222s, new Class560(this));
	    }
	    int i = 6;
	    boolean bool = false;
	    int i_12_ = class222s.length - 1;
	    while (false == bool) {
		float f = class222s[i_12_].method4470(2106999398);
		Class297 class297 = class222s[i_12_].method4458(1165657001);
		if (f < 0.0F) {
		    if (class297 == Class297.aClass297_4331
			|| Class297.aClass297_4329 == class297
			|| Class297.aClass297_4333 == class297)
			class222s[i_12_].method4505(-1016846797);
		} else
		    bool = true;
		if (--i_12_ < 0)
		    bool = true;
	    }
	    if (i_12_ >= class222s.length - i) {
		for (/**/; i_12_ >= class222s.length - i; i_12_--) {
		    Class297 class297
			= class222s[i_12_].method4458(-1788153967);
		    if (Class297.aClass297_4331 == class297)
			class222s[i_12_].method4505(-1743386158);
		}
	    }
	}
    }
    
    public void method6159() {
	if (((Class314_Sub2) this).aClass310_10235 != null)
	    ((Class314_Sub2) this).aClass310_10235.method6109(-1362428651);
	Iterator iterator
	    = ((Class314_Sub2) this).aHashMap10236.keySet().iterator();
	while (iterator.hasNext()) {
	    Class298 class298 = (Class298) iterator.next();
	    Class222[] class222s
		= ((Class222[])
		   ((Class314_Sub2) this).aHashMap10236.get(class298));
	    if (!class298.aBool4338) {
		boolean bool = false;
		for (int i = 0; i < class222s.length; i++) {
		    class222s[i].method4540((byte) -60);
		    bool |= class222s[i].method4472((byte) 50);
		}
		if (bool)
		    Arrays.sort(class222s, new Class560(this));
	    }
	    int i = 6;
	    boolean bool = false;
	    int i_13_ = class222s.length - 1;
	    while (false == bool) {
		float f = class222s[i_13_].method4470(2106999398);
		Class297 class297 = class222s[i_13_].method4458(-1330365312);
		if (f < 0.0F) {
		    if (class297 == Class297.aClass297_4331
			|| Class297.aClass297_4329 == class297
			|| Class297.aClass297_4333 == class297)
			class222s[i_13_].method4505(-201507383);
		} else
		    bool = true;
		if (--i_13_ < 0)
		    bool = true;
	    }
	    if (i_13_ >= class222s.length - i) {
		for (/**/; i_13_ >= class222s.length - i; i_13_--) {
		    Class297 class297
			= class222s[i_13_].method4458(1607364937);
		    if (Class297.aClass297_4331 == class297)
			class222s[i_13_].method4505(192699370);
		}
	    }
	}
    }
    
    public int method6163(Object object) {
	if (object != null && object instanceof Class577) {
	    Class577 class577 = (Class577) object;
	    synchronized (((Class577) class577).aClass573_7559) {
		int i = class577.method12721((byte) -37);
		return i;
	    }
	}
	return 0;
    }
    
    public int method6161(Object object) {
	if (object != null && object instanceof Class577) {
	    Class577 class577 = (Class577) object;
	    synchronized (((Class577) class577).aClass573_7559) {
		int i = class577.method12721((byte) -21);
		return i;
	    }
	}
	return 0;
    }
    
    public Object method6162(int i, int i_14_, Class309 class309,
			     Class302 class302, int i_15_, float f) {
	Class573 class573 = method16682((float) i_14_ * f, (short) 11843);
	Class577 class577
	    = new Class577(this, class573, i_15_, f * (float) i_14_,
			   -1803716693 * class309.anInt4583, i < 2 ? 2 : i,
			   (Class309.aClass309_4582 == class309
			    || class309 == Class309.aClass309_4580),
			   Class302.aClass302_4539 == class302);
	synchronized (((Class577) class577).aClass573_7559) {
	    ((Class577) class577).aClass573_7559.method12643(class577,
							     -910245004);
	}
	return class577;
    }
    
    public void method6168(Object object) {
	if (object != null && object instanceof Class577) {
	    Class577 class577 = (Class577) object;
	    synchronized (((Class577) class577).aClass573_7559) {
		((Class577) class577).aClass573_7559.method12644(class577,
								 2885656);
	    }
	}
    }
    
    public void method6149(int i) {
	if (((Class314_Sub2) this).aClass310_10235 != null)
	    ((Class314_Sub2) this).aClass310_10235.method6109(-1362428651);
	Iterator iterator
	    = ((Class314_Sub2) this).aHashMap10236.keySet().iterator();
	while (iterator.hasNext()) {
	    Class298 class298 = (Class298) iterator.next();
	    Class222[] class222s
		= ((Class222[])
		   ((Class314_Sub2) this).aHashMap10236.get(class298));
	    if (!class298.aBool4338) {
		boolean bool = false;
		for (int i_16_ = 0; i_16_ < class222s.length; i_16_++) {
		    class222s[i_16_].method4540((byte) -75);
		    bool |= class222s[i_16_].method4472((byte) 40);
		}
		if (bool)
		    Arrays.sort(class222s, new Class560(this));
	    }
	    int i_17_ = 6;
	    boolean bool = false;
	    int i_18_ = class222s.length - 1;
	    while (false == bool) {
		float f = class222s[i_18_].method4470(2106999398);
		Class297 class297 = class222s[i_18_].method4458(-1316017109);
		if (f < 0.0F) {
		    if (class297 == Class297.aClass297_4331
			|| Class297.aClass297_4329 == class297
			|| Class297.aClass297_4333 == class297)
			class222s[i_18_].method4505(-1558230973);
		} else
		    bool = true;
		if (--i_18_ < 0)
		    bool = true;
	    }
	    if (i_18_ >= class222s.length - i_17_) {
		for (/**/; i_18_ >= class222s.length - i_17_; i_18_--) {
		    Class297 class297
			= class222s[i_18_].method4458(-887148294);
		    if (Class297.aClass297_4331 == class297)
			class222s[i_18_].method4505(75296947);
		}
	    }
	}
    }
    
    public void method6150(Object object, byte[] is, int i, int i_19_) {
	if (object != null && object instanceof Class577) {
	    Class577 class577 = (Class577) object;
	    synchronized (((Class577) class577).aClass573_7559) {
		class577.method12717(is, i, i_19_, -16777216);
	    }
	}
    }
    
    Object method6155(Class388 class388, int i) {
	return null;
    }
    
    public Class222 method6156(Class298 class298) {
	synchronized (((Class314_Sub2) this).aHashMap10236) {
	    Class222[] class222s
		= ((Class222[])
		   ((Class314_Sub2) this).aHashMap10236.get(class298));
	    if (null == class222s) {
		Class222 class222 = null;
		return class222;
	    }
	    for (int i = 0; i < class222s.length; i++) {
		Class222 class222 = class222s[i];
		Class297 class297 = class222.method4458(-341241538);
		if (Class297.aClass297_4327 == class297) {
		    class222.method4530(-1122579100);
		    Class222 class222_20_ = class222;
		    return class222_20_;
		}
	    }
	}
	return null;
    }
    
    Object method6167(Class388 class388) {
	return null;
    }
    
    public Class310 method6158() {
	return ((Class314_Sub2) this).aClass310_10235;
    }
    
    public Class222 method6154(Class298 class298, byte i) {
	synchronized (((Class314_Sub2) this).aHashMap10236) {
	    Class222[] class222s
		= ((Class222[])
		   ((Class314_Sub2) this).aHashMap10236.get(class298));
	    if (null == class222s) {
		Class222 class222 = null;
		return class222;
	    }
	    for (int i_21_ = 0; i_21_ < class222s.length; i_21_++) {
		Class222 class222 = class222s[i_21_];
		Class297 class297 = class222.method4458(-987642904);
		if (Class297.aClass297_4327 == class297) {
		    class222.method4530(-931186616);
		    Class222 class222_22_ = class222;
		    return class222_22_;
		}
	    }
	}
	return null;
    }
    
    public Class222 method6165(Class298 class298) {
	synchronized (((Class314_Sub2) this).aHashMap10236) {
	    Class222[] class222s
		= ((Class222[])
		   ((Class314_Sub2) this).aHashMap10236.get(class298));
	    if (null == class222s) {
		Class222 class222 = null;
		return class222;
	    }
	    for (int i = 0; i < class222s.length; i++) {
		Class222 class222 = class222s[i];
		Class297 class297 = class222.method4458(924602639);
		if (Class297.aClass297_4327 == class297) {
		    class222.method4530(887001034);
		    Class222 class222_23_ = class222;
		    return class222_23_;
		}
	    }
	}
	return null;
    }
    
    public void method6152(Object object, byte[] is, int i, int i_24_,
			   int i_25_) {
	if (object != null && object instanceof Class577) {
	    Class577 class577 = (Class577) object;
	    synchronized (((Class577) class577).aClass573_7559) {
		class577.method12717(is, i, i_24_, -16777216);
	    }
	}
    }
    
    Class573 method16683(float f) {
	float f_26_ = -1.0F;
	float f_27_ = 3.4028235E38F;
	Class573 class573 = null;
	Iterator iterator = ((Class314_Sub2) this).aList10240.iterator();
	while (iterator.hasNext()) {
	    Class573 class573_28_ = (Class573) iterator.next();
	    float f_29_ = ((Class573) class573_28_).aFloat7430;
	    float f_30_ = Math.abs(f_29_ - f);
	    if (f_26_ < 0.0F || f_30_ < f_27_) {
		f_26_ = f_29_;
		f_27_ = f_30_;
		class573 = class573_28_;
	    }
	}
	return class573;
    }
    
    Class573 method16684(float f) {
	float f_31_ = -1.0F;
	float f_32_ = 3.4028235E38F;
	Class573 class573 = null;
	Iterator iterator = ((Class314_Sub2) this).aList10240.iterator();
	while (iterator.hasNext()) {
	    Class573 class573_33_ = (Class573) iterator.next();
	    float f_34_ = ((Class573) class573_33_).aFloat7430;
	    float f_35_ = Math.abs(f_34_ - f);
	    if (f_31_ < 0.0F || f_35_ < f_32_) {
		f_31_ = f_34_;
		f_32_ = f_35_;
		class573 = class573_33_;
	    }
	}
	return class573;
    }
    
    static final void method16685(Class479 class479, int i) {
	int i_36_ = (((Class479) class479).anIntArray6435
		     [((((Class479) class479).anInt6442 -= -1158629699)
		       * -117934955)]);
	((Class479) class479).anIntArray6435
	    [(((Class479) class479).anInt6442 += -1158629699) * -117934955 - 1]
	    = (((Class479) class479).aClass243_Sub38_6447.aClass63Array9935
	       [i_36_].anInt803) * -1690148613;
    }
    
    public static Class243_Sub11_Sub15 method16686(short i) {
	return Class321.aClass243_Sub11_Sub15_4739;
    }
    
    static final void method16687(Class479 class479, int i) {
	((Class479) class479).anInt6432 -= -2099265090;
	String string
	    = (String) (((Class479) class479).anObjectArray6437
			[-611591393 * ((Class479) class479).anInt6432]);
	String string_37_
	    = (String) (((Class479) class479).anObjectArray6437
			[-611591393 * ((Class479) class479).anInt6432 + 1]);
	if ((((Class479) class479).anIntArray6435
	     [(((Class479) class479).anInt6442 -= -1158629699) * -117934955])
	    == 1)
	    ((Class479) class479).anObjectArray6437
		[((((Class479) class479).anInt6432 += -1049632545) * -611591393
		  - 1)]
		= string;
	else
	    ((Class479) class479).anObjectArray6437
		[((((Class479) class479).anInt6432 += -1049632545) * -611591393
		  - 1)]
		= string_37_;
    }
}
