/* Class341_Sub1 - 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 Class341_Sub1 extends Class341
{
    Thread aThread9947;
    Thread aThread9948;
    Class334 aClass334_9949;
    volatile boolean aBool9950 = false;
    static final float aFloat9951 = 2.0F;
    List aList9952 = new ArrayList();
    HashMap aHashMap9953;
    Runnable aRunnable9954 = new Class498(this);
    Runnable aRunnable9955 = new Class500(this);
    
    public Class341_Sub1(Class601 class601) {
	((Class341_Sub1) this).aClass334_9949 = new Class334(this);
	((Class341_Sub1) this).aHashMap9953 = new HashMap();
	Iterator iterator = class601.aHashMap7923.keySet().iterator();
	while (iterator.hasNext()) {
	    Class447 class447 = (Class447) iterator.next();
	    ((Class341_Sub1) this).aHashMap9953.put(class447,
						    (new Class444
						     [((Integer)
						       class601
							   .aHashMap7923
							   .get(class447))
							  .intValue()]));
	}
	iterator = ((Class341_Sub1) this).aHashMap9953.keySet().iterator();
	while (iterator.hasNext()) {
	    Class447 class447 = (Class447) iterator.next();
	    Class444[] class444s
		= ((Class444[])
		   ((Class341_Sub1) this).aHashMap9953.get(class447));
	    for (int i = 0; i < class444s.length; i++) {
		Class217 class217 = new Class217(2.0F);
		class217.method250(0, Class339.aClass339_3630,
				   Class346.aClass346_3675, 2);
		class444s[i] = new Class444(class447, 8192, 3, class217, this);
	    }
	}
	Class492 class492 = new Class492(this, 44100.0F, 32768);
	Class492 class492_0_ = new Class492(this, 22050.0F, 16384);
	((Class341_Sub1) this).aList9952.add(class492);
	((Class341_Sub1) this).aList9952.add(class492_0_);
	((Class341_Sub1) this).aThread9948
	    = new Thread(((Class341_Sub1) this).aRunnable9955);
	((Class341_Sub1) this).aThread9947
	    = new Thread(((Class341_Sub1) this).aRunnable9954);
	((Class341_Sub1) this).aThread9948.setPriority(10);
	((Class341_Sub1) this).aThread9947.setPriority(10);
	((Class341_Sub1) this).aThread9948.start();
	((Class341_Sub1) this).aThread9947.start();
    }
    
    public void method4325(short i) {
	if (((Class341_Sub1) this).aClass334_9949 != null)
	    ((Class341_Sub1) this).aClass334_9949.method4314(410419664);
	Iterator iterator
	    = ((Class341_Sub1) this).aHashMap9953.keySet().iterator();
	while (iterator.hasNext()) {
	    Class447 class447 = (Class447) iterator.next();
	    Class444[] class444s
		= ((Class444[])
		   ((Class341_Sub1) this).aHashMap9953.get(class447));
	    if (!class447.aBool5155) {
		boolean bool = false;
		for (int i_1_ = 0; i_1_ < class444s.length; i_1_++) {
		    class444s[i_1_].method5393(1579399319);
		    bool |= class444s[i_1_].method5392(1054657580);
		}
		if (bool)
		    Arrays.sort(class444s, new Class509(this));
	    }
	    int i_2_ = 6;
	    boolean bool = false;
	    int i_3_ = class444s.length - 1;
	    while (false == bool) {
		float f = class444s[i_3_].method5390((byte) 12);
		Class446 class446 = class444s[i_3_].method5378((byte) 91);
		if (f < 0.0F) {
		    if (class446 == Class446.aClass446_5139
			|| class446 == Class446.aClass446_5137
			|| Class446.aClass446_5142 == class446)
			class444s[i_3_].method5423(827913018);
		} else
		    bool = true;
		if (--i_3_ < 0)
		    bool = true;
	    }
	    if (i_3_ >= class444s.length - i_2_) {
		for (/**/; i_3_ >= class444s.length - i_2_; i_3_--) {
		    Class446 class446 = class444s[i_3_].method5378((byte) 33);
		    if (class446 == Class446.aClass446_5139)
			class444s[i_3_].method5423(827913018);
		}
	    }
	}
    }
    
    public int method4328(Object object, int i) {
	if (object != null && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		int i_4_ = class505.method6256(-1197327328);
		return i_4_;
	    }
	}
	return 0;
    }
    
    public void method4341(Object object) {
	if (object != null && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		((Class505) class505).aClass492_6986.method6028(class505,
								(byte) 3);
	    }
	}
    }
    
    public Object method4326(int i, int i_5_, Class339 class339,
			     Class346 class346, int i_6_, float f, int i_7_) {
	Class492 class492 = method8954(f * (float) i_5_, (byte) 21);
	Class505 class505
	    = new Class505(this, class492, i_6_, (float) i_5_ * f,
			   -1632554221 * class339.anInt3626, i < 2 ? 2 : i,
			   (Class339.aClass339_3630 == class339
			    || class339 == Class339.aClass339_3627),
			   class346 == Class346.aClass346_3674);
	synchronized (((Class505) class505).aClass492_6986) {
	    ((Class505) class505).aClass492_6986.method6027(class505,
							    1751257752);
	}
	return class505;
    }
    
    public void method4343(Object object, byte[] is, int i, int i_8_) {
	if (null != object && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		class505.method6255(is, i, i_8_, 1782404785);
	    }
	}
    }
    
    Object method4346(Class347 class347) {
	return null;
    }
    
    public Class444 method4329(Class447 class447, int i) {
	synchronized (((Class341_Sub1) this).aHashMap9953) {
	    Class444[] class444s
		= ((Class444[])
		   ((Class341_Sub1) this).aHashMap9953.get(class447));
	    if (null == class444s) {
		Class444 class444 = null;
		return class444;
	    }
	    for (int i_9_ = 0; i_9_ < class444s.length; i_9_++) {
		Class444 class444 = class444s[i_9_];
		Class446 class446 = class444.method5378((byte) 71);
		if (Class446.aClass446_5141 == class446) {
		    class444.method5382(-359332844);
		    Class444 class444_10_ = class444;
		    return class444_10_;
		}
	    }
	}
	return null;
    }
    
    HashMap method8953(int i) {
	return ((Class341_Sub1) this).aHashMap9953;
    }
    
    public Class334 method4336(byte i) {
	return ((Class341_Sub1) this).aClass334_9949;
    }
    
    public void method4349(int i) {
	HashMap hashmap = method8953(69043221);
	synchronized (hashmap) {
	    Iterator iterator = hashmap.keySet().iterator();
	    while (iterator.hasNext()) {
		Class447 class447 = (Class447) iterator.next();
		Class444[] class444s = (Class444[]) hashmap.get(class447);
		for (int i_11_ = 0; i_11_ < class444s.length; i_11_++) {
		    if (class444s[i_11_].method5378((byte) 37)
			!= Class446.aClass446_5141) {
			class444s[i_11_].method5423(827913018);
			class444s[i_11_].method5414(-87796838);
		    }
		}
	    }
	}
	boolean bool = false;
	while (!bool) {
	    bool = true;
	    synchronized (hashmap) {
		Iterator iterator = hashmap.keySet().iterator();
		while (iterator.hasNext()) {
		    Class447 class447 = (Class447) iterator.next();
		    Class444[] class444s = (Class444[]) hashmap.get(class447);
		    for (int i_12_ = 0; i_12_ < class444s.length; i_12_++) {
			if (class444s[i_12_].method5378((byte) 12)
			    != Class446.aClass446_5141) {
			    class444s[i_12_].method5393(1241351628);
			    bool = false;
			}
		    }
		}
	    }
	    Class118.method1565(10L);
	}
	((Class341_Sub1) this).aBool9950 = true;
	try {
	    ((Class341_Sub1) this).aThread9948.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
	try {
	    ((Class341_Sub1) this).aThread9947.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
    }
    
    Class492 method8954(float f, byte i) {
	float f_13_ = -1.0F;
	float f_14_ = 3.4028235E38F;
	Class492 class492 = null;
	Iterator iterator = ((Class341_Sub1) this).aList9952.iterator();
	while (iterator.hasNext()) {
	    Class492 class492_15_ = (Class492) iterator.next();
	    float f_16_ = ((Class492) class492_15_).aFloat6729;
	    float f_17_ = Math.abs(f_16_ - f);
	    if (f_13_ < 0.0F || f_17_ < f_14_) {
		f_13_ = f_16_;
		f_14_ = f_17_;
		class492 = class492_15_;
	    }
	}
	return class492;
    }
    
    public int method4334(Object object) {
	if (object != null && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		int i = class505.method6256(827419992);
		return i;
	    }
	}
	return 0;
    }
    
    public int method4335(Object object) {
	if (object != null && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		int i = class505.method6256(-1606060544);
		return i;
	    }
	}
	return 0;
    }
    
    public void method4340(Object object, byte[] is, int i, int i_18_,
			   int i_19_) {
	if (null != object && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		class505.method6255(is, i, i_18_, 805608156);
	    }
	}
    }
    
    public Object method4332(int i, int i_20_, Class339 class339,
			     Class346 class346, int i_21_, float f) {
	Class492 class492 = method8954(f * (float) i_20_, (byte) 22);
	Class505 class505
	    = new Class505(this, class492, i_21_, (float) i_20_ * f,
			   -1632554221 * class339.anInt3626, i < 2 ? 2 : i,
			   (Class339.aClass339_3630 == class339
			    || class339 == Class339.aClass339_3627),
			   class346 == Class346.aClass346_3674);
	synchronized (((Class505) class505).aClass492_6986) {
	    ((Class505) class505).aClass492_6986.method6027(class505,
							    -71518380);
	}
	return class505;
    }
    
    public void method4342(Object object) {
	if (object != null && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		((Class505) class505).aClass492_6986.method6028(class505,
								(byte) 3);
	    }
	}
    }
    
    public Object method4339(int i, int i_22_, Class339 class339,
			     Class346 class346, int i_23_, float f) {
	Class492 class492 = method8954(f * (float) i_22_, (byte) 119);
	Class505 class505
	    = new Class505(this, class492, i_23_, (float) i_22_ * f,
			   -1632554221 * class339.anInt3626, i < 2 ? 2 : i,
			   (Class339.aClass339_3630 == class339
			    || class339 == Class339.aClass339_3627),
			   class346 == Class346.aClass346_3674);
	synchronized (((Class505) class505).aClass492_6986) {
	    ((Class505) class505).aClass492_6986.method6027(class505,
							    235896029);
	}
	return class505;
    }
    
    public void method4331(Object object) {
	if (object != null && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		((Class505) class505).aClass492_6986.method6028(class505,
								(byte) 3);
	    }
	}
    }
    
    public void method4344(Object object, byte[] is, int i, int i_24_) {
	if (null != object && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		class505.method6255(is, i, i_24_, 1388608018);
	    }
	}
    }
    
    public Object method4338(int i, int i_25_, Class339 class339,
			     Class346 class346, int i_26_, float f) {
	Class492 class492 = method8954(f * (float) i_25_, (byte) 51);
	Class505 class505
	    = new Class505(this, class492, i_26_, (float) i_25_ * f,
			   -1632554221 * class339.anInt3626, i < 2 ? 2 : i,
			   (Class339.aClass339_3630 == class339
			    || class339 == Class339.aClass339_3627),
			   class346 == Class346.aClass346_3674);
	synchronized (((Class505) class505).aClass492_6986) {
	    ((Class505) class505).aClass492_6986.method6027(class505,
							    -1876776815);
	}
	return class505;
    }
    
    public void method4327(Object object, int i) {
	if (object != null && object instanceof Class505) {
	    Class505 class505 = (Class505) object;
	    synchronized (((Class505) class505).aClass492_6986) {
		((Class505) class505).aClass492_6986.method6028(class505,
								(byte) 3);
	    }
	}
    }
    
    public Class444 method4345(Class447 class447) {
	synchronized (((Class341_Sub1) this).aHashMap9953) {
	    Class444[] class444s
		= ((Class444[])
		   ((Class341_Sub1) this).aHashMap9953.get(class447));
	    if (null == class444s) {
		Class444 class444 = null;
		return class444;
	    }
	    for (int i = 0; i < class444s.length; i++) {
		Class444 class444 = class444s[i];
		Class446 class446 = class444.method5378((byte) 5);
		if (Class446.aClass446_5141 == class446) {
		    class444.method5382(-922895648);
		    Class444 class444_27_ = class444;
		    return class444_27_;
		}
	    }
	}
	return null;
    }
    
    public Object method4337(int i, int i_28_, Class339 class339,
			     Class346 class346, int i_29_, float f) {
	Class492 class492 = method8954(f * (float) i_28_, (byte) 50);
	Class505 class505
	    = new Class505(this, class492, i_29_, (float) i_28_ * f,
			   -1632554221 * class339.anInt3626, i < 2 ? 2 : i,
			   (Class339.aClass339_3630 == class339
			    || class339 == Class339.aClass339_3627),
			   class346 == Class346.aClass346_3674);
	synchronized (((Class505) class505).aClass492_6986) {
	    ((Class505) class505).aClass492_6986.method6027(class505,
							    -2030479274);
	}
	return class505;
    }
    
    Object method4324(Class347 class347) {
	return null;
    }
    
    public void method4348() {
	HashMap hashmap = method8953(1991149852);
	synchronized (hashmap) {
	    Iterator iterator = hashmap.keySet().iterator();
	    while (iterator.hasNext()) {
		Class447 class447 = (Class447) iterator.next();
		Class444[] class444s = (Class444[]) hashmap.get(class447);
		for (int i = 0; i < class444s.length; i++) {
		    if (class444s[i].method5378((byte) 126)
			!= Class446.aClass446_5141) {
			class444s[i].method5423(827913018);
			class444s[i].method5414(-357352127);
		    }
		}
	    }
	}
	boolean bool = false;
	while (!bool) {
	    bool = true;
	    synchronized (hashmap) {
		Iterator iterator = hashmap.keySet().iterator();
		while (iterator.hasNext()) {
		    Class447 class447 = (Class447) iterator.next();
		    Class444[] class444s = (Class444[]) hashmap.get(class447);
		    for (int i = 0; i < class444s.length; i++) {
			if (class444s[i].method5378((byte) 9)
			    != Class446.aClass446_5141) {
			    class444s[i].method5393(1644423677);
			    bool = false;
			}
		    }
		}
	    }
	    Class118.method1565(10L);
	}
	((Class341_Sub1) this).aBool9950 = true;
	try {
	    ((Class341_Sub1) this).aThread9948.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
	try {
	    ((Class341_Sub1) this).aThread9947.join();
	} catch (InterruptedException interruptedexception) {
	    interruptedexception.printStackTrace();
	}
    }
    
    public Class334 method4347() {
	return ((Class341_Sub1) this).aClass334_9949;
    }
    
    public Class334 method4350() {
	return ((Class341_Sub1) this).aClass334_9949;
    }
    
    public Class334 method4351() {
	return ((Class341_Sub1) this).aClass334_9949;
    }
    
    public void method4333() {
	if (((Class341_Sub1) this).aClass334_9949 != null)
	    ((Class341_Sub1) this).aClass334_9949.method4314(410419664);
	Iterator iterator
	    = ((Class341_Sub1) this).aHashMap9953.keySet().iterator();
	while (iterator.hasNext()) {
	    Class447 class447 = (Class447) iterator.next();
	    Class444[] class444s
		= ((Class444[])
		   ((Class341_Sub1) this).aHashMap9953.get(class447));
	    if (!class447.aBool5155) {
		boolean bool = false;
		for (int i = 0; i < class444s.length; i++) {
		    class444s[i].method5393(659483726);
		    bool |= class444s[i].method5392(974632035);
		}
		if (bool)
		    Arrays.sort(class444s, new Class509(this));
	    }
	    int i = 6;
	    boolean bool = false;
	    int i_30_ = class444s.length - 1;
	    while (false == bool) {
		float f = class444s[i_30_].method5390((byte) 88);
		Class446 class446 = class444s[i_30_].method5378((byte) 96);
		if (f < 0.0F) {
		    if (class446 == Class446.aClass446_5139
			|| class446 == Class446.aClass446_5137
			|| Class446.aClass446_5142 == class446)
			class444s[i_30_].method5423(827913018);
		} else
		    bool = true;
		if (--i_30_ < 0)
		    bool = true;
	    }
	    if (i_30_ >= class444s.length - i) {
		for (/**/; i_30_ >= class444s.length - i; i_30_--) {
		    Class446 class446 = class444s[i_30_].method5378((byte) 81);
		    if (class446 == Class446.aClass446_5139)
			class444s[i_30_].method5423(827913018);
		}
	    }
	}
    }
    
    Object method4330(Class347 class347, byte i) {
	return null;
    }
    
    static final void method8955(Class612 class612, byte i) {
	int i_31_
	    = (((Class612) class612).anIntArray8021
	       [(((Class612) class612).anInt8022 -= 201091009) * -40654783]);
	((Class612) class612).anIntArray8021
	    [(((Class612) class612).anInt8022 += 201091009) * -40654783 - 1]
	    = (((Class657)
		Class469.aClass662_Sub20_5330.method31(i_31_, 735041248))
	       .anInt8340) * -1095958973;
    }
    
    static void method8956(Interface61 interface61, byte i) {
	while (Class516.aLinkedList7053.size() > 10)
	    Class516.aLinkedList7053.remove();
	Class516.aLinkedList7053.add(interface61);
    }
}
