import jagtheora.ogg.OggPacket;
import jagtheora.ogg.OggStreamState;
import jagtheora.vorbis.DSPState;
import jagtheora.vorbis.VorbisBlock;
import jagtheora.vorbis.VorbisComment;
import jagtheora.vorbis.VorbisInfo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;

public class Class225_Sub45_Sub1 extends Class225_Sub45 {

   VorbisBlock aVorbisBlock10034;
   VorbisComment aVorbisComment10035 = new VorbisComment();
   VorbisInfo aVorbisInfo10036 = new VorbisInfo();
   DSPState aDSPState10037;
   Class285 aClass285_10038;
   Class225_Sub12_Sub4 aClass225_Sub12_Sub4_10039;
   double aDouble10040;
   int anInt10041;


   void method14173(OggPacket var1) {
      if(-1753786919 * this.anInt8778 < 3) {
         int var2 = this.aVorbisInfo10036.headerIn(this.aVorbisComment10035, var1);
         if(var2 < 0) {
            throw new IllegalStateException("" + var2);
         }

         if(-1753786919 * this.anInt8778 == 2) {
            if(this.aVorbisInfo10036.channels > 2 || this.aVorbisInfo10036.channels < 1) {
               throw new RuntimeException("" + this.aVorbisInfo10036.channels);
            }

            this.aDSPState10037 = new DSPState(this.aVorbisInfo10036);
            this.aVorbisBlock10034 = new VorbisBlock(this.aDSPState10037);
            this.aClass285_10038 = new Class285(this.aVorbisInfo10036.rate, Class206.anInt2437);
            this.aClass225_Sub12_Sub4_10039 = new Class225_Sub12_Sub4(this.aVorbisInfo10036.channels);
         }
      } else {
         if(this.aVorbisBlock10034.synthesis(var1) == 0) {
            this.aDSPState10037.blockIn(this.aVorbisBlock10034);
         }

         float[][] var5 = this.aDSPState10037.pcmOut(this.aVorbisInfo10036.channels);
         this.aDouble10040 = this.aDSPState10037.granuleTime();
         if(this.aDouble10040 == -1.0D) {
            this.aDouble10040 = (double)((float)(-352104483 * this.anInt10041) / (float)this.aVorbisInfo10036.rate);
         }

         this.aDSPState10037.read(var5[0].length);
         this.anInt10041 += var5[0].length * 2078703733;
         Class225_Sub9 var3 = this.aClass225_Sub12_Sub4_10039.method16230(var5[0].length, this.aDouble10040);
         Class549.method11792(var5, var3.aShortArrayArray8518, 444709918);

         for(int var4 = 0; var4 < this.aVorbisInfo10036.channels; ++var4) {
            var3.aShortArrayArray8518[var4] = this.aClass285_10038.method5225(var3.aShortArrayArray8518[var4], -1586642169);
         }

         this.aClass225_Sub12_Sub4_10039.method16231(var3, 1896359503);
      }

   }

   void method14168(OggPacket var1, byte var2) {
      if(-1753786919 * this.anInt8778 < 3) {
         int var3 = this.aVorbisInfo10036.headerIn(this.aVorbisComment10035, var1);
         if(var3 < 0) {
            throw new IllegalStateException("" + var3);
         }

         if(-1753786919 * this.anInt8778 == 2) {
            if(this.aVorbisInfo10036.channels > 2 || this.aVorbisInfo10036.channels < 1) {
               throw new RuntimeException("" + this.aVorbisInfo10036.channels);
            }

            this.aDSPState10037 = new DSPState(this.aVorbisInfo10036);
            this.aVorbisBlock10034 = new VorbisBlock(this.aDSPState10037);
            this.aClass285_10038 = new Class285(this.aVorbisInfo10036.rate, Class206.anInt2437);
            this.aClass225_Sub12_Sub4_10039 = new Class225_Sub12_Sub4(this.aVorbisInfo10036.channels);
         }
      } else {
         if(this.aVorbisBlock10034.synthesis(var1) == 0) {
            this.aDSPState10037.blockIn(this.aVorbisBlock10034);
         }

         float[][] var6 = this.aDSPState10037.pcmOut(this.aVorbisInfo10036.channels);
         this.aDouble10040 = this.aDSPState10037.granuleTime();
         if(this.aDouble10040 == -1.0D) {
            this.aDouble10040 = (double)((float)(-352104483 * this.anInt10041) / (float)this.aVorbisInfo10036.rate);
         }

         this.aDSPState10037.read(var6[0].length);
         this.anInt10041 += var6[0].length * 2078703733;
         Class225_Sub9 var4 = this.aClass225_Sub12_Sub4_10039.method16230(var6[0].length, this.aDouble10040);
         Class549.method11792(var6, var4.aShortArrayArray8518, -1938274027);

         for(int var5 = 0; var5 < this.aVorbisInfo10036.channels; ++var5) {
            var4.aShortArrayArray8518[var5] = this.aClass285_10038.method5225(var4.aShortArrayArray8518[var5], -1094500692);
         }

         this.aClass225_Sub12_Sub4_10039.method16231(var4, 1896359503);
      }

   }

   void method14171(OggPacket var1) {
      if(-1753786919 * this.anInt8778 < 3) {
         int var2 = this.aVorbisInfo10036.headerIn(this.aVorbisComment10035, var1);
         if(var2 < 0) {
            throw new IllegalStateException("" + var2);
         }

         if(-1753786919 * this.anInt8778 == 2) {
            if(this.aVorbisInfo10036.channels > 2 || this.aVorbisInfo10036.channels < 1) {
               throw new RuntimeException("" + this.aVorbisInfo10036.channels);
            }

            this.aDSPState10037 = new DSPState(this.aVorbisInfo10036);
            this.aVorbisBlock10034 = new VorbisBlock(this.aDSPState10037);
            this.aClass285_10038 = new Class285(this.aVorbisInfo10036.rate, Class206.anInt2437);
            this.aClass225_Sub12_Sub4_10039 = new Class225_Sub12_Sub4(this.aVorbisInfo10036.channels);
         }
      } else {
         if(this.aVorbisBlock10034.synthesis(var1) == 0) {
            this.aDSPState10037.blockIn(this.aVorbisBlock10034);
         }

         float[][] var5 = this.aDSPState10037.pcmOut(this.aVorbisInfo10036.channels);
         this.aDouble10040 = this.aDSPState10037.granuleTime();
         if(this.aDouble10040 == -1.0D) {
            this.aDouble10040 = (double)((float)(-352104483 * this.anInt10041) / (float)this.aVorbisInfo10036.rate);
         }

         this.aDSPState10037.read(var5[0].length);
         this.anInt10041 += var5[0].length * 2078703733;
         Class225_Sub9 var3 = this.aClass225_Sub12_Sub4_10039.method16230(var5[0].length, this.aDouble10040);
         Class549.method11792(var5, var3.aShortArrayArray8518, 916818913);

         for(int var4 = 0; var4 < this.aVorbisInfo10036.channels; ++var4) {
            var3.aShortArrayArray8518[var4] = this.aClass285_10038.method5225(var3.aShortArrayArray8518[var4], 1065591442);
         }

         this.aClass225_Sub12_Sub4_10039.method16231(var3, 1896359503);
      }

   }

   void method14175(int var1) {
      if(null != this.aVorbisBlock10034) {
         this.aVorbisBlock10034.method6701();
      }

      if(null != this.aDSPState10037) {
         this.aDSPState10037.method6701();
      }

      this.aVorbisComment10035.method6701();
      this.aVorbisInfo10036.method6701();
      if(null != this.aClass225_Sub12_Sub4_10039) {
         this.aClass225_Sub12_Sub4_10039.method16233(-624101488);
      }

   }

   double method15584(int var1) {
      double var2 = this.aDouble10040;
      if(this.aClass225_Sub12_Sub4_10039 != null) {
         var2 = this.aClass225_Sub12_Sub4_10039.method16248((short)2798);
         if(var2 < 0.0D) {
            var2 = this.aDouble10040;
         }
      }

      return var2 - (double)(256.0F / (float)Class206.anInt2437);
   }

   int method15585(int var1) {
      int var10000;
      if(this.aClass225_Sub12_Sub4_10039 == null) {
         if(var1 <= -1267666664) {
            ;
         }

         var10000 = 0;
      } else {
         var10000 = this.aClass225_Sub12_Sub4_10039.method16253(999186284);
      }

      return var10000;
   }

   void method14166(OggPacket var1) {
      if(-1753786919 * this.anInt8778 < 3) {
         int var2 = this.aVorbisInfo10036.headerIn(this.aVorbisComment10035, var1);
         if(var2 < 0) {
            throw new IllegalStateException("" + var2);
         }

         if(-1753786919 * this.anInt8778 == 2) {
            if(this.aVorbisInfo10036.channels > 2 || this.aVorbisInfo10036.channels < 1) {
               throw new RuntimeException("" + this.aVorbisInfo10036.channels);
            }

            this.aDSPState10037 = new DSPState(this.aVorbisInfo10036);
            this.aVorbisBlock10034 = new VorbisBlock(this.aDSPState10037);
            this.aClass285_10038 = new Class285(this.aVorbisInfo10036.rate, Class206.anInt2437);
            this.aClass225_Sub12_Sub4_10039 = new Class225_Sub12_Sub4(this.aVorbisInfo10036.channels);
         }
      } else {
         if(this.aVorbisBlock10034.synthesis(var1) == 0) {
            this.aDSPState10037.blockIn(this.aVorbisBlock10034);
         }

         float[][] var5 = this.aDSPState10037.pcmOut(this.aVorbisInfo10036.channels);
         this.aDouble10040 = this.aDSPState10037.granuleTime();
         if(this.aDouble10040 == -1.0D) {
            this.aDouble10040 = (double)((float)(-352104483 * this.anInt10041) / (float)this.aVorbisInfo10036.rate);
         }

         this.aDSPState10037.read(var5[0].length);
         this.anInt10041 += var5[0].length * 2078703733;
         Class225_Sub9 var3 = this.aClass225_Sub12_Sub4_10039.method16230(var5[0].length, this.aDouble10040);
         Class549.method11792(var5, var3.aShortArrayArray8518, 556366254);

         for(int var4 = 0; var4 < this.aVorbisInfo10036.channels; ++var4) {
            var3.aShortArrayArray8518[var4] = this.aClass285_10038.method5225(var3.aShortArrayArray8518[var4], -1756629404);
         }

         this.aClass225_Sub12_Sub4_10039.method16231(var3, 1896359503);
      }

   }

   public Class225_Sub12_Sub4 method15586(byte var1) {
      return this.aClass225_Sub12_Sub4_10039;
   }

   void method14172(OggPacket var1) {
      if(-1753786919 * this.anInt8778 < 3) {
         int var2 = this.aVorbisInfo10036.headerIn(this.aVorbisComment10035, var1);
         if(var2 < 0) {
            throw new IllegalStateException("" + var2);
         }

         if(-1753786919 * this.anInt8778 == 2) {
            if(this.aVorbisInfo10036.channels > 2 || this.aVorbisInfo10036.channels < 1) {
               throw new RuntimeException("" + this.aVorbisInfo10036.channels);
            }

            this.aDSPState10037 = new DSPState(this.aVorbisInfo10036);
            this.aVorbisBlock10034 = new VorbisBlock(this.aDSPState10037);
            this.aClass285_10038 = new Class285(this.aVorbisInfo10036.rate, Class206.anInt2437);
            this.aClass225_Sub12_Sub4_10039 = new Class225_Sub12_Sub4(this.aVorbisInfo10036.channels);
         }
      } else {
         if(this.aVorbisBlock10034.synthesis(var1) == 0) {
            this.aDSPState10037.blockIn(this.aVorbisBlock10034);
         }

         float[][] var5 = this.aDSPState10037.pcmOut(this.aVorbisInfo10036.channels);
         this.aDouble10040 = this.aDSPState10037.granuleTime();
         if(this.aDouble10040 == -1.0D) {
            this.aDouble10040 = (double)((float)(-352104483 * this.anInt10041) / (float)this.aVorbisInfo10036.rate);
         }

         this.aDSPState10037.read(var5[0].length);
         this.anInt10041 += var5[0].length * 2078703733;
         Class225_Sub9 var3 = this.aClass225_Sub12_Sub4_10039.method16230(var5[0].length, this.aDouble10040);
         Class549.method11792(var5, var3.aShortArrayArray8518, -223801268);

         for(int var4 = 0; var4 < this.aVorbisInfo10036.channels; ++var4) {
            var3.aShortArrayArray8518[var4] = this.aClass285_10038.method5225(var3.aShortArrayArray8518[var4], -1750809750);
         }

         this.aClass225_Sub12_Sub4_10039.method16231(var3, 1896359503);
      }

   }

   public Class225_Sub12_Sub4 method15587() {
      return this.aClass225_Sub12_Sub4_10039;
   }

   void method14174() {
      if(null != this.aVorbisBlock10034) {
         this.aVorbisBlock10034.method6701();
      }

      if(null != this.aDSPState10037) {
         this.aDSPState10037.method6701();
      }

      this.aVorbisComment10035.method6701();
      this.aVorbisInfo10036.method6701();
      if(null != this.aClass225_Sub12_Sub4_10039) {
         this.aClass225_Sub12_Sub4_10039.method16233(1857968884);
      }

   }

   void method14167() {
      if(null != this.aVorbisBlock10034) {
         this.aVorbisBlock10034.method6701();
      }

      if(null != this.aDSPState10037) {
         this.aDSPState10037.method6701();
      }

      this.aVorbisComment10035.method6701();
      this.aVorbisInfo10036.method6701();
      if(null != this.aClass225_Sub12_Sub4_10039) {
         this.aClass225_Sub12_Sub4_10039.method16233(712453758);
      }

   }

   Class225_Sub45_Sub1(OggStreamState var1) {
      super(var1);
   }

   public Class225_Sub12_Sub4 method15588() {
      return this.aClass225_Sub12_Sub4_10039;
   }

   double method15589() {
      double var1 = this.aDouble10040;
      if(this.aClass225_Sub12_Sub4_10039 != null) {
         var1 = this.aClass225_Sub12_Sub4_10039.method16248((short)3777);
         if(var1 < 0.0D) {
            var1 = this.aDouble10040;
         }
      }

      return var1 - (double)(256.0F / (float)Class206.anInt2437);
   }

   double method15590() {
      double var1 = this.aDouble10040;
      if(this.aClass225_Sub12_Sub4_10039 != null) {
         var1 = this.aClass225_Sub12_Sub4_10039.method16248((short)29419);
         if(var1 < 0.0D) {
            var1 = this.aDouble10040;
         }
      }

      return var1 - (double)(256.0F / (float)Class206.anInt2437);
   }

   double method15591() {
      double var1 = this.aDouble10040;
      if(this.aClass225_Sub12_Sub4_10039 != null) {
         var1 = this.aClass225_Sub12_Sub4_10039.method16248((short)10846);
         if(var1 < 0.0D) {
            var1 = this.aDouble10040;
         }
      }

      return var1 - (double)(256.0F / (float)Class206.anInt2437);
   }

   double method15592() {
      double var1 = this.aDouble10040;
      if(this.aClass225_Sub12_Sub4_10039 != null) {
         var1 = this.aClass225_Sub12_Sub4_10039.method16248((short)18552);
         if(var1 < 0.0D) {
            var1 = this.aDouble10040;
         }
      }

      return var1 - (double)(256.0F / (float)Class206.anInt2437);
   }

   double method15593() {
      double var1 = this.aDouble10040;
      if(this.aClass225_Sub12_Sub4_10039 != null) {
         var1 = this.aClass225_Sub12_Sub4_10039.method16248((short)4083);
         if(var1 < 0.0D) {
            var1 = this.aDouble10040;
         }
      }

      return var1 - (double)(256.0F / (float)Class206.anInt2437);
   }

   int method15594() {
      return this.aClass225_Sub12_Sub4_10039 == null?0:this.aClass225_Sub12_Sub4_10039.method16253(999186284);
   }

   int method15595() {
      return this.aClass225_Sub12_Sub4_10039 == null?0:this.aClass225_Sub12_Sub4_10039.method16253(999186284);
   }

   static String method15596(Throwable var0, int var1) throws IOException {
      String var3;
      if(var0 instanceof RuntimeException_Sub3) {
         RuntimeException_Sub3 var2 = (RuntimeException_Sub3)var0;
         var3 = var2.aString10694 + " | ";
         var0 = var2.aThrowable10690;
      } else {
         var3 = "";
      }

      StringWriter var13 = new StringWriter();
      PrintWriter var4 = new PrintWriter(var13);
      var0.printStackTrace(var4);
      var4.close();
      String var5 = var13.toString();
      BufferedReader var6 = new BufferedReader(new StringReader(var5));
      String var7 = var6.readLine();

      while(true) {
         String var8 = var6.readLine();
         if(var8 == null) {
            var3 = var3 + "| " + var7;
            return var3;
         }

         int var9 = var8.indexOf(40);
         int var10 = var8.indexOf(41, var9 + 1);
         String var11;
         if(var9 != -1) {
            var11 = var8.substring(0, var9);
         } else {
            var11 = var8;
         }

         var11 = var11.trim();
         var11 = var11.substring(var11.lastIndexOf(32) + 1);
         var11 = var11.substring(var11.lastIndexOf(9) + 1);
         var3 = var3 + var11;
         if(-1 != var9 && -1 != var10) {
            int var12 = var8.indexOf(".java:", var9);
            if(var12 >= 0) {
               var3 = var3 + var8.substring(5 + var12, var10);
            }
         }

         var3 = var3 + ' ';
      }
   }
}
