/* Class587_Sub18_Sub3 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import jagtheora.ogg.OggPacket;
import jagtheora.ogg.OggStreamState;
import jagtheora.vorbis.DSPState;
import jagtheora.vorbis.VorbisBlock;
import jagtheora.vorbis.VorbisComment;
import jagtheora.vorbis.VorbisInfo;

public class Class587_Sub18_Sub3 extends Class587_Sub18 {
	DSPState aDSPState10586;
	VorbisComment aVorbisComment10587;
	int anInt10588;
	VorbisBlock aVorbisBlock10589;
	Class586 aClass586_10590;
	Class587_Sub37_Sub1 aClass587_Sub37_Sub1_10591;
	double aDouble10592;
	VorbisInfo aVorbisInfo10593 = new VorbisInfo();

	void method15783(OggPacket oggpacket, byte i) {
		if (((Class587_Sub18_Sub3) this).anInt9631 * -1058950957 < 3) {
			int i_0_ = (((Class587_Sub18_Sub3) this).aVorbisInfo10593.headerIn(((Class587_Sub18_Sub3) this).aVorbisComment10587, oggpacket));
			if (i_0_ < 0)
				throw new IllegalStateException(new StringBuilder().append("").append(i_0_).toString());
			if (2 == ((Class587_Sub18_Sub3) this).anInt9631 * -1058950957) {
				if (((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels > 2 || (((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels < 1))
					throw new RuntimeException(new StringBuilder().append("").append(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels).toString());
				((Class587_Sub18_Sub3) this).aDSPState10586 = new DSPState(((Class587_Sub18_Sub3) this).aVorbisInfo10593);
				((Class587_Sub18_Sub3) this).aVorbisBlock10589 = new VorbisBlock(((Class587_Sub18_Sub3) this).aDSPState10586);
				((Class587_Sub18_Sub3) this).aClass586_10590 = new Class586((((Class587_Sub18_Sub3) this).aVorbisInfo10593.rate), Class594.anInt7712);
				((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 = new Class587_Sub37_Sub1(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels);
			}
		} else {
			if (((Class587_Sub18_Sub3) this).aVorbisBlock10589.synthesis(oggpacket) == 0)
				((Class587_Sub18_Sub3) this).aDSPState10586.blockIn(((Class587_Sub18_Sub3) this).aVorbisBlock10589);
			float[][] fs = (((Class587_Sub18_Sub3) this).aDSPState10586.pcmOut(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels));
			((Class587_Sub18_Sub3) this).aDouble10592 = ((Class587_Sub18_Sub3) this).aDSPState10586.granuleTime();
			if (-1.0 == ((Class587_Sub18_Sub3) this).aDouble10592)
				((Class587_Sub18_Sub3) this).aDouble10592 = (double) ((float) (793740977 * (((Class587_Sub18_Sub3) this).anInt10588)) / (float) (((Class587_Sub18_Sub3) this).aVorbisInfo10593.rate));
			((Class587_Sub18_Sub3) this).aDSPState10586.read(fs[0].length);
			((Class587_Sub18_Sub3) this).anInt10588 += fs[0].length * -1181154735;
			Class587_Sub9 class587_sub9 = (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16861(fs[0].length, ((Class587_Sub18_Sub3) this).aDouble10592));
			Class317.method6260(fs, (((Class587_Sub9) class587_sub9).aShortArrayArray8589), (byte) 0);
			for (int i_1_ = 0; i_1_ < ((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels; i_1_++)
				((Class587_Sub9) class587_sub9).aShortArrayArray8589[i_1_] = (((Class587_Sub18_Sub3) this).aClass586_10590.method12742((((Class587_Sub9) class587_sub9).aShortArrayArray8589[i_1_]), (byte) 100));
			((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16858(class587_sub9, (byte) 114);
		}
	}

	void method15784(int i) {
		if (((Class587_Sub18_Sub3) this).aVorbisBlock10589 != null)
			((Class587_Sub18_Sub3) this).aVorbisBlock10589.method7231();
		if (null != ((Class587_Sub18_Sub3) this).aDSPState10586)
			((Class587_Sub18_Sub3) this).aDSPState10586.method7231();
		((Class587_Sub18_Sub3) this).aVorbisComment10587.method7231();
		((Class587_Sub18_Sub3) this).aVorbisInfo10593.method7231();
		if (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 != null)
			((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16860(-1558655452);
	}

	public Class587_Sub37_Sub1 method16777(byte i) {
		return ((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591;
	}

	Class587_Sub18_Sub3(OggStreamState oggstreamstate) {
		super(oggstreamstate);
		((Class587_Sub18_Sub3) this).aVorbisComment10587 = new VorbisComment();
	}

	void method15790() {
		if (((Class587_Sub18_Sub3) this).aVorbisBlock10589 != null)
			((Class587_Sub18_Sub3) this).aVorbisBlock10589.method7231();
		if (null != ((Class587_Sub18_Sub3) this).aDSPState10586)
			((Class587_Sub18_Sub3) this).aDSPState10586.method7231();
		((Class587_Sub18_Sub3) this).aVorbisComment10587.method7231();
		((Class587_Sub18_Sub3) this).aVorbisInfo10593.method7231();
		if (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 != null)
			((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16860(-1845388273);
	}

	void method15788() {
		if (((Class587_Sub18_Sub3) this).aVorbisBlock10589 != null)
			((Class587_Sub18_Sub3) this).aVorbisBlock10589.method7231();
		if (null != ((Class587_Sub18_Sub3) this).aDSPState10586)
			((Class587_Sub18_Sub3) this).aDSPState10586.method7231();
		((Class587_Sub18_Sub3) this).aVorbisComment10587.method7231();
		((Class587_Sub18_Sub3) this).aVorbisInfo10593.method7231();
		if (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 != null)
			((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16860(-2113722418);
	}

	int method16778(int i) {
		return (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 == null ? 0 : ((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16873(-1942839877));
	}

	void method15789() {
		if (((Class587_Sub18_Sub3) this).aVorbisBlock10589 != null)
			((Class587_Sub18_Sub3) this).aVorbisBlock10589.method7231();
		if (null != ((Class587_Sub18_Sub3) this).aDSPState10586)
			((Class587_Sub18_Sub3) this).aDSPState10586.method7231();
		((Class587_Sub18_Sub3) this).aVorbisComment10587.method7231();
		((Class587_Sub18_Sub3) this).aVorbisInfo10593.method7231();
		if (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 != null)
			((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16860(-1912071537);
	}

	double method16779(int i) {
		double d = ((Class587_Sub18_Sub3) this).aDouble10592;
		if (null != ((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591) {
			d = ((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16859(1699461889);
			if (d < 0.0)
				d = ((Class587_Sub18_Sub3) this).aDouble10592;
		}
		return d - (double) (256.0F / (float) Class594.anInt7712);
	}

	void method15791(OggPacket oggpacket) {
		if (((Class587_Sub18_Sub3) this).anInt9631 * -1058950957 < 3) {
			int i = (((Class587_Sub18_Sub3) this).aVorbisInfo10593.headerIn(((Class587_Sub18_Sub3) this).aVorbisComment10587, oggpacket));
			if (i < 0)
				throw new IllegalStateException(new StringBuilder().append("").append(i).toString());
			if (2 == ((Class587_Sub18_Sub3) this).anInt9631 * -1058950957) {
				if (((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels > 2 || (((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels < 1))
					throw new RuntimeException(new StringBuilder().append("").append(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels).toString());
				((Class587_Sub18_Sub3) this).aDSPState10586 = new DSPState(((Class587_Sub18_Sub3) this).aVorbisInfo10593);
				((Class587_Sub18_Sub3) this).aVorbisBlock10589 = new VorbisBlock(((Class587_Sub18_Sub3) this).aDSPState10586);
				((Class587_Sub18_Sub3) this).aClass586_10590 = new Class586((((Class587_Sub18_Sub3) this).aVorbisInfo10593.rate), Class594.anInt7712);
				((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 = new Class587_Sub37_Sub1(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels);
			}
		} else {
			if (((Class587_Sub18_Sub3) this).aVorbisBlock10589.synthesis(oggpacket) == 0)
				((Class587_Sub18_Sub3) this).aDSPState10586.blockIn(((Class587_Sub18_Sub3) this).aVorbisBlock10589);
			float[][] fs = (((Class587_Sub18_Sub3) this).aDSPState10586.pcmOut(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels));
			((Class587_Sub18_Sub3) this).aDouble10592 = ((Class587_Sub18_Sub3) this).aDSPState10586.granuleTime();
			if (-1.0 == ((Class587_Sub18_Sub3) this).aDouble10592)
				((Class587_Sub18_Sub3) this).aDouble10592 = (double) ((float) (793740977 * (((Class587_Sub18_Sub3) this).anInt10588)) / (float) (((Class587_Sub18_Sub3) this).aVorbisInfo10593.rate));
			((Class587_Sub18_Sub3) this).aDSPState10586.read(fs[0].length);
			((Class587_Sub18_Sub3) this).anInt10588 += fs[0].length * -1181154735;
			Class587_Sub9 class587_sub9 = (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16861(fs[0].length, ((Class587_Sub18_Sub3) this).aDouble10592));
			Class317.method6260(fs, (((Class587_Sub9) class587_sub9).aShortArrayArray8589), (byte) 0);
			for (int i = 0; i < ((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels; i++)
				((Class587_Sub9) class587_sub9).aShortArrayArray8589[i] = (((Class587_Sub18_Sub3) this).aClass586_10590.method12742((((Class587_Sub9) class587_sub9).aShortArrayArray8589[i]), (byte) -20));
			((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16858(class587_sub9, (byte) 36);
		}
	}

	void method15782(OggPacket oggpacket) {
		if (((Class587_Sub18_Sub3) this).anInt9631 * -1058950957 < 3) {
			int i = (((Class587_Sub18_Sub3) this).aVorbisInfo10593.headerIn(((Class587_Sub18_Sub3) this).aVorbisComment10587, oggpacket));
			if (i < 0)
				throw new IllegalStateException(new StringBuilder().append("").append(i).toString());
			if (2 == ((Class587_Sub18_Sub3) this).anInt9631 * -1058950957) {
				if (((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels > 2 || (((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels < 1))
					throw new RuntimeException(new StringBuilder().append("").append(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels).toString());
				((Class587_Sub18_Sub3) this).aDSPState10586 = new DSPState(((Class587_Sub18_Sub3) this).aVorbisInfo10593);
				((Class587_Sub18_Sub3) this).aVorbisBlock10589 = new VorbisBlock(((Class587_Sub18_Sub3) this).aDSPState10586);
				((Class587_Sub18_Sub3) this).aClass586_10590 = new Class586((((Class587_Sub18_Sub3) this).aVorbisInfo10593.rate), Class594.anInt7712);
				((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 = new Class587_Sub37_Sub1(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels);
			}
		} else {
			if (((Class587_Sub18_Sub3) this).aVorbisBlock10589.synthesis(oggpacket) == 0)
				((Class587_Sub18_Sub3) this).aDSPState10586.blockIn(((Class587_Sub18_Sub3) this).aVorbisBlock10589);
			float[][] fs = (((Class587_Sub18_Sub3) this).aDSPState10586.pcmOut(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels));
			((Class587_Sub18_Sub3) this).aDouble10592 = ((Class587_Sub18_Sub3) this).aDSPState10586.granuleTime();
			if (-1.0 == ((Class587_Sub18_Sub3) this).aDouble10592)
				((Class587_Sub18_Sub3) this).aDouble10592 = (double) ((float) (793740977 * (((Class587_Sub18_Sub3) this).anInt10588)) / (float) (((Class587_Sub18_Sub3) this).aVorbisInfo10593.rate));
			((Class587_Sub18_Sub3) this).aDSPState10586.read(fs[0].length);
			((Class587_Sub18_Sub3) this).anInt10588 += fs[0].length * -1181154735;
			Class587_Sub9 class587_sub9 = (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16861(fs[0].length, ((Class587_Sub18_Sub3) this).aDouble10592));
			Class317.method6260(fs, (((Class587_Sub9) class587_sub9).aShortArrayArray8589), (byte) 0);
			for (int i = 0; i < ((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels; i++)
				((Class587_Sub9) class587_sub9).aShortArrayArray8589[i] = (((Class587_Sub18_Sub3) this).aClass586_10590.method12742((((Class587_Sub9) class587_sub9).aShortArrayArray8589[i]), (byte) -9));
			((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16858(class587_sub9, (byte) 103);
		}
	}

	void method15793(OggPacket oggpacket) {
		if (((Class587_Sub18_Sub3) this).anInt9631 * -1058950957 < 3) {
			int i = (((Class587_Sub18_Sub3) this).aVorbisInfo10593.headerIn(((Class587_Sub18_Sub3) this).aVorbisComment10587, oggpacket));
			if (i < 0)
				throw new IllegalStateException(new StringBuilder().append("").append(i).toString());
			if (2 == ((Class587_Sub18_Sub3) this).anInt9631 * -1058950957) {
				if (((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels > 2 || (((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels < 1))
					throw new RuntimeException(new StringBuilder().append("").append(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels).toString());
				((Class587_Sub18_Sub3) this).aDSPState10586 = new DSPState(((Class587_Sub18_Sub3) this).aVorbisInfo10593);
				((Class587_Sub18_Sub3) this).aVorbisBlock10589 = new VorbisBlock(((Class587_Sub18_Sub3) this).aDSPState10586);
				((Class587_Sub18_Sub3) this).aClass586_10590 = new Class586((((Class587_Sub18_Sub3) this).aVorbisInfo10593.rate), Class594.anInt7712);
				((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 = new Class587_Sub37_Sub1(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels);
			}
		} else {
			if (((Class587_Sub18_Sub3) this).aVorbisBlock10589.synthesis(oggpacket) == 0)
				((Class587_Sub18_Sub3) this).aDSPState10586.blockIn(((Class587_Sub18_Sub3) this).aVorbisBlock10589);
			float[][] fs = (((Class587_Sub18_Sub3) this).aDSPState10586.pcmOut(((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels));
			((Class587_Sub18_Sub3) this).aDouble10592 = ((Class587_Sub18_Sub3) this).aDSPState10586.granuleTime();
			if (-1.0 == ((Class587_Sub18_Sub3) this).aDouble10592)
				((Class587_Sub18_Sub3) this).aDouble10592 = (double) ((float) (793740977 * (((Class587_Sub18_Sub3) this).anInt10588)) / (float) (((Class587_Sub18_Sub3) this).aVorbisInfo10593.rate));
			((Class587_Sub18_Sub3) this).aDSPState10586.read(fs[0].length);
			((Class587_Sub18_Sub3) this).anInt10588 += fs[0].length * -1181154735;
			Class587_Sub9 class587_sub9 = (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16861(fs[0].length, ((Class587_Sub18_Sub3) this).aDouble10592));
			Class317.method6260(fs, (((Class587_Sub9) class587_sub9).aShortArrayArray8589), (byte) 0);
			for (int i = 0; i < ((Class587_Sub18_Sub3) this).aVorbisInfo10593.channels; i++)
				((Class587_Sub9) class587_sub9).aShortArrayArray8589[i] = (((Class587_Sub18_Sub3) this).aClass586_10590.method12742((((Class587_Sub9) class587_sub9).aShortArrayArray8589[i]), (byte) 35));
			((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16858(class587_sub9, (byte) 13);
		}
	}

	public Class587_Sub37_Sub1 method16780() {
		return ((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591;
	}

	int method16781() {
		return (((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591 == null ? 0 : ((Class587_Sub18_Sub3) this).aClass587_Sub37_Sub1_10591.method16873(-1942839877));
	}
}
