package mapped;

import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSRawPcmStream;

@ObfuscatedName("bb")
public class RawPcmStream extends PcmStream implements RSRawPcmStream {
   @ObfuscatedName("at")
   int field327;
   @ObfuscatedName("ah")
   int field322;
   @ObfuscatedName("ar")
   int field323;
   @ObfuscatedName("ao")
   int field324;
   @ObfuscatedName("ab")
   int field325;
   @ObfuscatedName("au")
   int field326;
   @ObfuscatedName("aa")
   int field321;
   @ObfuscatedName("ac")
   int numLoops;
   @ObfuscatedName("al")
   int start;
   @ObfuscatedName("az")
   int end;
   @ObfuscatedName("ap")
   boolean field331;
   @ObfuscatedName("av")
   int field332;
   @ObfuscatedName("ax")
   int field329;
   @ObfuscatedName("as")
   int field333;
   @ObfuscatedName("ay")
   int field335;

   @ObfuscatedSignature(
      descriptor = "(Lbt;II)V"
   )
   RawPcmStream(RawSound var1, int var2, int var3) {
      super.sound = var1;
      this.start = var1.start;
      this.end = var1.end;
      this.field331 = var1.field250;
      this.field322 = var2;
      this.field323 = var3;
      this.field324 = 8192;
      this.field327 = 0;
      this.method905_base();
   }

   @ObfuscatedSignature(
      descriptor = "(Lbt;III)V"
   )
   RawPcmStream(RawSound var1, int var2, int var3, int var4) {
      super.sound = var1;
      this.start = var1.start;
      this.end = var1.end;
      this.field331 = var1.field250;
      this.field322 = var2;
      this.field323 = var3;
      this.field324 = var4;
      this.field327 = 0;
      this.method905_base();
   }

   @ObfuscatedName("ab")
   void method905_base() {
      this.field325 = this.field323;
      this.field326 = method1019_base(this.field323, this.field324);
      this.field321 = method959_base(this.field323, this.field324);
   }

   @ObfuscatedName("au")
   @ObfuscatedSignature(
      descriptor = "()Lbk;"
   )
   protected PcmStream vmethod6210() {
      return null;
   }

   @ObfuscatedName("aa")
   @ObfuscatedSignature(
      descriptor = "()Lbk;"
   )
   protected PcmStream vmethod6222() {
      return null;
   }

   @ObfuscatedName("ac")
   protected int vmethod6210_base() {
      return this.field323 == 0 && this.field332 == 0?0:1;
   }

   @ObfuscatedName("al")
   public synchronized void fill_base(int[] var1, int var2, int var3) {
      if(this.field323 == 0 && this.field332 == 0) {
         this.skip_base(var3);
      } else {
         RawSound var4 = (RawSound)super.sound;
         int var5 = this.start << 8;
         int var6 = this.end << 8;
         int var7 = var4.samples.length << 8;
         int var8 = var6 - var5;
         if(var8 <= 0) {
            this.numLoops = 0;
         }

         int var9 = var2;
         var3 += var2;
         if(this.field327 < 0) {
            if(this.field322 <= 0) {
               this.method914_base();
               this.remove_base();
               return;
            }

            this.field327 = 0;
         }

         if(this.field327 >= var7) {
            if(this.field322 >= 0) {
               this.method914_base();
               this.remove_base();
               return;
            }

            this.field327 = var7 - 1;
         }

         if(this.numLoops < 0) {
            if(this.field331) {
               if(this.field322 < 0) {
                  var9 = this.method928_base(var1, var2, var5, var3, var4.samples[this.start]);
                  if(this.field327 >= var5) {
                     return;
                  }

                  this.field327 = var5 + var5 - 1 - this.field327;
                  this.field322 = -this.field322;
               }

               while(true) {
                  var9 = this.method927_base(var1, var9, var6, var3, var4.samples[this.end - 1]);
                  if(this.field327 < var6) {
                     return;
                  }

                  this.field327 = var6 + var6 - 1 - this.field327;
                  this.field322 = -this.field322;
                  var9 = this.method928_base(var1, var9, var5, var3, var4.samples[this.start]);
                  if(this.field327 >= var5) {
                     return;
                  }

                  this.field327 = var5 + var5 - 1 - this.field327;
                  this.field322 = -this.field322;
               }
            } else if(this.field322 < 0) {
               while(true) {
                  var9 = this.method928_base(var1, var9, var5, var3, var4.samples[this.end - 1]);
                  if(this.field327 >= var5) {
                     return;
                  }

                  this.field327 = var6 - 1 - (var6 - 1 - this.field327) % var8;
               }
            } else {
               while(true) {
                  var9 = this.method927_base(var1, var9, var6, var3, var4.samples[this.start]);
                  if(this.field327 < var6) {
                     return;
                  }

                  this.field327 = var5 + (this.field327 - var5) % var8;
               }
            }
         } else {
            if(this.numLoops > 0) {
               if(this.field331) {
                  label148: {
                     if(this.field322 < 0) {
                        var9 = this.method928_base(var1, var2, var5, var3, var4.samples[this.start]);
                        if(this.field327 >= var5) {
                           return;
                        }

                        this.field327 = var5 + var5 - 1 - this.field327;
                        this.field322 = -this.field322;
                        if(--this.numLoops == 0) {
                           break label148;
                        }
                     }

                     do {
                        var9 = this.method927_base(var1, var9, var6, var3, var4.samples[this.end - 1]);
                        if(this.field327 < var6) {
                           return;
                        }

                        this.field327 = var6 + var6 - 1 - this.field327;
                        this.field322 = -this.field322;
                        if(--this.numLoops == 0) {
                           break;
                        }

                        var9 = this.method928_base(var1, var9, var5, var3, var4.samples[this.start]);
                        if(this.field327 >= var5) {
                           return;
                        }

                        this.field327 = var5 + var5 - 1 - this.field327;
                        this.field322 = -this.field322;
                     } while(--this.numLoops != 0);
                  }
               } else {
                  int var10;
                  if(this.field322 < 0) {
                     while(true) {
                        var9 = this.method928_base(var1, var9, var5, var3, var4.samples[this.end - 1]);
                        if(this.field327 >= var5) {
                           return;
                        }

                        var10 = (var6 - 1 - this.field327) / var8;
                        if(var10 >= this.numLoops) {
                           this.field327 += var8 * this.numLoops;
                           this.numLoops = 0;
                           break;
                        }

                        this.field327 += var8 * var10;
                        this.numLoops -= var10;
                     }
                  } else {
                     while(true) {
                        var9 = this.method927_base(var1, var9, var6, var3, var4.samples[this.start]);
                        if(this.field327 < var6) {
                           return;
                        }

                        var10 = (this.field327 - var5) / var8;
                        if(var10 >= this.numLoops) {
                           this.field327 -= var8 * this.numLoops;
                           this.numLoops = 0;
                           break;
                        }

                        this.field327 -= var8 * var10;
                        this.numLoops -= var10;
                     }
                  }
               }
            }

            if(this.field322 < 0) {
               this.method928_base(var1, var9, 0, var3, 0);
               if(this.field327 < 0) {
                  this.field327 = -1;
                  this.method914_base();
                  this.remove_base();
               }
            } else {
               this.method927_base(var1, var9, var7, var3, 0);
               if(this.field327 >= var7) {
                  this.field327 = var7;
                  this.method914_base();
                  this.remove_base();
               }
            }

         }
      }
   }

   @ObfuscatedName("az")
   public synchronized void setNumLoops_base(int var1) {
      this.numLoops = var1;
   }

   @ObfuscatedName("ap")
   public synchronized void skip_base(int var1) {
      if(this.field332 > 0) {
         if(var1 >= this.field332) {
            if(this.field323 == Integer.MIN_VALUE) {
               this.field323 = 0;
               this.field321 = 0;
               this.field326 = 0;
               this.field325 = 0;
               this.remove_base();
               var1 = this.field332;
            }

            this.field332 = 0;
            this.method905_base();
         } else {
            this.field325 += this.field329 * var1;
            this.field326 += this.field333 * var1;
            this.field321 += this.field335 * var1;
            this.field332 -= var1;
         }
      }

      RawSound var2 = (RawSound)super.sound;
      int var3 = this.start << 8;
      int var4 = this.end << 8;
      int var5 = var2.samples.length << 8;
      int var6 = var4 - var3;
      if(var6 <= 0) {
         this.numLoops = 0;
      }

      if(this.field327 < 0) {
         if(this.field322 <= 0) {
            this.method914_base();
            this.remove_base();
            return;
         }

         this.field327 = 0;
      }

      if(this.field327 >= var5) {
         if(this.field322 >= 0) {
            this.method914_base();
            this.remove_base();
            return;
         }

         this.field327 = var5 - 1;
      }

      this.field327 += this.field322 * var1;
      if(this.numLoops < 0) {
         if(!this.field331) {
            if(this.field322 < 0) {
               if(this.field327 >= var3) {
                  return;
               }

               this.field327 = var4 - 1 - (var4 - 1 - this.field327) % var6;
            } else {
               if(this.field327 < var4) {
                  return;
               }

               this.field327 = var3 + (this.field327 - var3) % var6;
            }

         } else {
            if(this.field322 < 0) {
               if(this.field327 >= var3) {
                  return;
               }

               this.field327 = var3 + var3 - 1 - this.field327;
               this.field322 = -this.field322;
            }

            while(this.field327 >= var4) {
               this.field327 = var4 + var4 - 1 - this.field327;
               this.field322 = -this.field322;
               if(this.field327 >= var3) {
                  return;
               }

               this.field327 = var3 + var3 - 1 - this.field327;
               this.field322 = -this.field322;
            }

         }
      } else {
         if(this.numLoops > 0) {
            if(this.field331) {
               label126: {
                  if(this.field322 < 0) {
                     if(this.field327 >= var3) {
                        return;
                     }

                     this.field327 = var3 + var3 - 1 - this.field327;
                     this.field322 = -this.field322;
                     if(--this.numLoops == 0) {
                        break label126;
                     }
                  }

                  do {
                     if(this.field327 < var4) {
                        return;
                     }

                     this.field327 = var4 + var4 - 1 - this.field327;
                     this.field322 = -this.field322;
                     if(--this.numLoops == 0) {
                        break;
                     }

                     if(this.field327 >= var3) {
                        return;
                     }

                     this.field327 = var3 + var3 - 1 - this.field327;
                     this.field322 = -this.field322;
                  } while(--this.numLoops != 0);
               }
            } else {
               int var7;
               if(this.field322 < 0) {
                  if(this.field327 >= var3) {
                     return;
                  }

                  var7 = (var4 - 1 - this.field327) / var6;
                  if(var7 < this.numLoops) {
                     this.field327 += var6 * var7;
                     this.numLoops -= var7;
                     return;
                  }

                  this.field327 += var6 * this.numLoops;
                  this.numLoops = 0;
               } else {
                  if(this.field327 < var4) {
                     return;
                  }

                  var7 = (this.field327 - var3) / var6;
                  if(var7 < this.numLoops) {
                     this.field327 -= var6 * var7;
                     this.numLoops -= var7;
                     return;
                  }

                  this.field327 -= var6 * this.numLoops;
                  this.numLoops = 0;
               }
            }
         }

         if(this.field322 < 0) {
            if(this.field327 < 0) {
               this.field327 = -1;
               this.method914_base();
               this.remove_base();
            }
         } else if(this.field327 >= var5) {
            this.field327 = var5;
            this.method914_base();
            this.remove_base();
         }

      }
   }

   @ObfuscatedName("av")
   public synchronized void method1000_base(int var1) {
      this.method909_base(var1 << 6, this.method988_base());
   }

   @ObfuscatedName("ax")
   synchronized void method1010_base(int var1) {
      this.method909_base(var1, this.method988_base());
   }

   @ObfuscatedName("as")
   synchronized void method909_base(int var1, int var2) {
      this.field323 = var1;
      this.field324 = var2;
      this.field332 = 0;
      this.method905_base();
   }

   @ObfuscatedName("ay")
   public synchronized int method994_base() {
      return this.field323 == Integer.MIN_VALUE?0:this.field323;
   }

   @ObfuscatedName("ak")
   public synchronized int method988_base() {
      return this.field324 < 0?-1:this.field324;
   }

   @ObfuscatedName("aj")
   public synchronized void method912_base(int var1) {
      int var2 = ((RawSound)super.sound).samples.length << 8;
      if(var1 < -1) {
         var1 = -1;
      }

      if(var1 > var2) {
         var1 = var2;
      }

      this.field327 = var1;
   }

   @ObfuscatedName("am")
   @ObfuscatedSignature(
      descriptor = "(Z)V",
      garbageValue = "1"
   )
   public synchronized void method902_base() {
      this.field322 = (this.field322 ^ this.field322 >> 31) + (this.field322 >>> 31);
      this.field322 = -this.field322;
   }

   @ObfuscatedName("aq")
   void method914_base() {
      if(this.field332 != 0) {
         if(this.field323 == Integer.MIN_VALUE) {
            this.field323 = 0;
         }

         this.field332 = 0;
         this.method905_base();
      }

   }

   @ObfuscatedName("ai")
   public synchronized void method915_base(int var1, int var2) {
      this.method916_base(var1, var2, this.method988_base());
   }

   @ObfuscatedName("aw")
   public synchronized void method916_base(int var1, int var2, int var3) {
      if(var1 == 0) {
         this.method909_base(var2, var3);
      } else {
         int var4 = method1019_base(var2, var3);
         int var5 = method959_base(var2, var3);
         if(var4 == this.field326 && var5 == this.field321) {
            this.field332 = 0;
         } else {
            int var6 = var2 - this.field325;
            if(this.field325 - var2 > var6) {
               var6 = this.field325 - var2;
            }

            if(var4 - this.field326 > var6) {
               var6 = var4 - this.field326;
            }

            if(this.field326 - var4 > var6) {
               var6 = this.field326 - var4;
            }

            if(var5 - this.field321 > var6) {
               var6 = var5 - this.field321;
            }

            if(this.field321 - var5 > var6) {
               var6 = this.field321 - var5;
            }

            if(var1 > var6) {
               var1 = var6;
            }

            this.field332 = var1;
            this.field323 = var2;
            this.field324 = var3;
            this.field329 = (var2 - this.field325) / var1;
            this.field333 = (var4 - this.field326) / var1;
            this.field335 = (var5 - this.field321) / var1;
         }
      }
   }

   @ObfuscatedName("ae")
   public synchronized void method917_base(int var1) {
      if(var1 == 0) {
         this.method1010_base(0);
         this.remove_base();
      } else if(this.field326 == 0 && this.field321 == 0) {
         this.field332 = 0;
         this.field323 = 0;
         this.field325 = 0;
         this.remove_base();
      } else {
         int var2 = -this.field325;
         if(this.field325 > var2) {
            var2 = this.field325;
         }

         if(-this.field326 > var2) {
            var2 = -this.field326;
         }

         if(this.field326 > var2) {
            var2 = this.field326;
         }

         if(-this.field321 > var2) {
            var2 = -this.field321;
         }

         if(this.field321 > var2) {
            var2 = this.field321;
         }

         if(var1 > var2) {
            var1 = var2;
         }

         this.field332 = var1;
         this.field323 = Integer.MIN_VALUE;
         this.field329 = -this.field325 / var1;
         this.field333 = -this.field326 / var1;
         this.field335 = -this.field321 / var1;
      }
   }

   @ObfuscatedName("an")
   public synchronized void method913_base(int var1) {
      if(this.field322 < 0) {
         this.field322 = -var1;
      } else {
         this.field322 = var1;
      }

   }

   @ObfuscatedName("ag")
   public synchronized int method919_base() {
      return this.field322 < 0?-this.field322:this.field322;
   }

   @ObfuscatedName("ad")
   public boolean method1008_base() {
      return this.field327 < 0 || this.field327 >= ((RawSound)super.sound).samples.length << 8;
   }

   @ObfuscatedName("af")
   public boolean method921_base() {
      return this.field332 != 0;
   }

   @ObfuscatedName("bn")
   int method927_base(int[] var1, int var2, int var3, int var4, int var5) {
      while(true) {
         if(this.field332 > 0) {
            int var6 = var2 + this.field332;
            if(var6 > var4) {
               var6 = var4;
            }

            this.field332 += var2;
            if(this.field322 == 256 && (this.field327 & 255) == 0) {
               if(WorldMapRectangle.PcmPlayer_stereo) {
                  var2 = method939(0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field326, this.field321, this.field333, this.field335, 0, var6, var3, this);
               } else {
                  var2 = method944(((RawSound)super.sound).samples, var1, this.field327, var2, this.field325, this.field329, 0, var6, var3, this);
               }
            } else if(WorldMapRectangle.PcmPlayer_stereo) {
               var2 = method943(0, 0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field326, this.field321, this.field333, this.field335, 0, var6, var3, this, this.field322, var5);
            } else {
               var2 = method990(0, 0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field325, this.field329, 0, var6, var3, this, this.field322, var5);
            }

            this.field332 -= var2;
            if(this.field332 != 0) {
               return var2;
            }

            if(!this.method929_base()) {
               continue;
            }

            return var4;
         }

         if(this.field322 == 256 && (this.field327 & 255) == 0) {
            if(WorldMapRectangle.PcmPlayer_stereo) {
               return method931(0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field326, this.field321, 0, var4, var3, this);
            }

            return method930(((RawSound)super.sound).samples, var1, this.field327, var2, this.field325, 0, var4, var3, this);
         }

         if(WorldMapRectangle.PcmPlayer_stereo) {
            return method935(0, 0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field326, this.field321, 0, var4, var3, this, this.field322, var5);
         }

         return method918(0, 0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field325, 0, var4, var3, this, this.field322, var5);
      }
   }

   @ObfuscatedName("bo")
   int method928_base(int[] var1, int var2, int var3, int var4, int var5) {
      while(true) {
         if(this.field332 > 0) {
            int var6 = var2 + this.field332;
            if(var6 > var4) {
               var6 = var4;
            }

            this.field332 += var2;
            if(this.field322 == -256 && (this.field327 & 255) == 0) {
               if(WorldMapRectangle.PcmPlayer_stereo) {
                  var2 = method1014(0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field326, this.field321, this.field333, this.field335, 0, var6, var3, this);
               } else {
                  var2 = method940(((RawSound)super.sound).samples, var1, this.field327, var2, this.field325, this.field329, 0, var6, var3, this);
               }
            } else if(WorldMapRectangle.PcmPlayer_stereo) {
               var2 = method945(0, 0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field326, this.field321, this.field333, this.field335, 0, var6, var3, this, this.field322, var5);
            } else {
               var2 = method955(0, 0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field325, this.field329, 0, var6, var3, this, this.field322, var5);
            }

            this.field332 -= var2;
            if(this.field332 != 0) {
               return var2;
            }

            if(!this.method929_base()) {
               continue;
            }

            return var4;
         }

         if(this.field322 == -256 && (this.field327 & 255) == 0) {
            if(WorldMapRectangle.PcmPlayer_stereo) {
               return method950(0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field326, this.field321, 0, var4, var3, this);
            }

            return method932(((RawSound)super.sound).samples, var1, this.field327, var2, this.field325, 0, var4, var3, this);
         }

         if(WorldMapRectangle.PcmPlayer_stereo) {
            return method984(0, 0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field326, this.field321, 0, var4, var3, this, this.field322, var5);
         }

         return method936(0, 0, ((RawSound)super.sound).samples, var1, this.field327, var2, this.field325, 0, var4, var3, this, this.field322, var5);
      }
   }

   @ObfuscatedName("bz")
   boolean method929_base() {
      int var1 = this.field323;
      int var2;
      int var3;
      if(var1 == Integer.MIN_VALUE) {
         var3 = 0;
         var2 = 0;
         var1 = 0;
      } else {
         var2 = method1019_base(var1, this.field324);
         var3 = method959_base(var1, this.field324);
      }

      if(var1 == this.field325 && var2 == this.field326 && var3 == this.field321) {
         if(this.field323 == Integer.MIN_VALUE) {
            this.field323 = 0;
            this.field321 = 0;
            this.field326 = 0;
            this.field325 = 0;
            this.remove_base();
            return true;
         } else {
            this.method905_base();
            return false;
         }
      } else {
         if(this.field325 < var1) {
            this.field329 = 1;
            this.field332 = var1 - this.field325;
         } else if(this.field325 > var1) {
            this.field329 = -1;
            this.field332 = this.field325 - var1;
         } else {
            this.field329 = 0;
         }

         if(this.field326 < var2) {
            this.field333 = 1;
            if(this.field332 == 0 || this.field332 > var2 - this.field326) {
               this.field332 = var2 - this.field326;
            }
         } else if(this.field326 > var2) {
            this.field333 = -1;
            if(this.field332 == 0 || this.field332 > this.field326 - var2) {
               this.field332 = this.field326 - var2;
            }
         } else {
            this.field333 = 0;
         }

         if(this.field321 < var3) {
            this.field335 = 1;
            if(this.field332 == 0 || this.field332 > var3 - this.field321) {
               this.field332 = var3 - this.field321;
            }
         } else if(this.field321 > var3) {
            this.field335 = -1;
            if(this.field332 == 0 || this.field332 > this.field321 - var3) {
               this.field332 = this.field321 - var3;
            }
         } else {
            this.field335 = 0;
         }

         return false;
      }
   }

   @ObfuscatedName("bx")
   int vmethod1046_base() {
      int var1 = this.field325 * 3 >> 6;
      var1 = (var1 ^ var1 >> 31) + (var1 >>> 31);
      if(this.numLoops == 0) {
         var1 -= var1 * this.field327 / (((RawSound)super.sound).samples.length << 8);
      } else if(this.numLoops >= 0) {
         var1 -= var1 * this.start / ((RawSound)super.sound).samples.length;
      }

      return var1 > 255?255:var1;
   }

   public void setNumLoops(int var1) {
      this.setNumLoops_base(var1);
   }

   @ObfuscatedName("at")
   static int method1019_base(int var0, int var1) {
      return var1 < 0?var0:(int)((double)var0 * Math.sqrt((double)(16384 - var1) * 1.220703125E-4D) + 0.5D);
   }

   @ObfuscatedName("ah")
   static int method959_base(int var0, int var1) {
      return var1 < 0?-var0:(int)((double)var0 * Math.sqrt((double)var1 * 1.220703125E-4D) + 0.5D);
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(Lbt;II)Lbb;"
   )
   public static RawPcmStream method949(RawSound var0, int var1, int var2) {
      return var0.samples != null && var0.samples.length != 0?new RawPcmStream(var0, (int)((long)var0.sampleRate * 256L * (long)var1 / (long)(PcmPlayer.field275 * 100)), var2 << 6):null;
   }

   @ObfuscatedName("ao")
   @ObfuscatedSignature(
      descriptor = "(Lbt;III)Lbb;"
   )
   public static RawPcmStream method904(RawSound var0, int var1, int var2, int var3) {
      return var0.samples != null && var0.samples.length != 0?new RawPcmStream(var0, var1, var2, var3):null;
   }

   @ObfuscatedName("bc")
   @ObfuscatedSignature(
      descriptor = "([B[IIIIIIILbb;)I"
   )
   static int method930(byte[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, RawPcmStream var8) {
      var2 >>= 8;
      var7 >>= 8;
      var4 <<= 2;
      if((var5 = var3 + var7 - var2) > var6) {
         var5 = var6;
      }

      int var10001;
      for(var5 -= 3; var3 < var5; var1[var10001] += var0[var2++] * var4) {
         var10001 = var3++;
         var1[var10001] += var0[var2++] * var4;
         var10001 = var3++;
         var1[var10001] += var0[var2++] * var4;
         var10001 = var3++;
         var1[var10001] += var0[var2++] * var4;
         var10001 = var3++;
      }

      for(var5 += 3; var3 < var5; var1[var10001] += var0[var2++] * var4) {
         var10001 = var3++;
      }

      var8.field327 = var2 << 8;
      return var3;
   }

   @ObfuscatedName("bs")
   @ObfuscatedSignature(
      descriptor = "(I[B[IIIIIIIILbb;)I"
   )
   static int method931(int var0, byte[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, RawPcmStream var10) {
      var3 >>= 8;
      var9 >>= 8;
      var5 <<= 2;
      var6 <<= 2;
      if((var7 = var4 + var9 - var3) > var8) {
         var7 = var8;
      }

      var4 <<= 1;
      var7 <<= 1;

      int var10001;
      byte var11;
      for(var7 -= 6; var4 < var7; var2[var10001] += var11 * var6) {
         var11 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
         var2[var10001] += var11 * var6;
         var11 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
         var2[var10001] += var11 * var6;
         var11 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
         var2[var10001] += var11 * var6;
         var11 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
      }

      for(var7 += 6; var4 < var7; var2[var10001] += var11 * var6) {
         var11 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
      }

      var10.field327 = var3 << 8;
      return var4 >> 1;
   }

   @ObfuscatedName("bb")
   @ObfuscatedSignature(
      descriptor = "([B[IIIIIIILbb;)I"
   )
   static int method932(byte[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, RawPcmStream var8) {
      var2 >>= 8;
      var7 >>= 8;
      var4 <<= 2;
      if((var5 = var3 + var2 - (var7 - 1)) > var6) {
         var5 = var6;
      }

      int var10001;
      for(var5 -= 3; var3 < var5; var1[var10001] += var0[var2--] * var4) {
         var10001 = var3++;
         var1[var10001] += var0[var2--] * var4;
         var10001 = var3++;
         var1[var10001] += var0[var2--] * var4;
         var10001 = var3++;
         var1[var10001] += var0[var2--] * var4;
         var10001 = var3++;
      }

      for(var5 += 3; var3 < var5; var1[var10001] += var0[var2--] * var4) {
         var10001 = var3++;
      }

      var8.field327 = var2 << 8;
      return var3;
   }

   @ObfuscatedName("bk")
   @ObfuscatedSignature(
      descriptor = "(I[B[IIIIIIIILbb;)I"
   )
   static int method950(int var0, byte[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, RawPcmStream var10) {
      var3 >>= 8;
      var9 >>= 8;
      var5 <<= 2;
      var6 <<= 2;
      if((var7 = var3 + var4 - (var9 - 1)) > var8) {
         var7 = var8;
      }

      var4 <<= 1;
      var7 <<= 1;

      int var10001;
      byte var11;
      for(var7 -= 6; var4 < var7; var2[var10001] += var11 * var6) {
         var11 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
         var2[var10001] += var11 * var6;
         var11 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
         var2[var10001] += var11 * var6;
         var11 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
         var2[var10001] += var11 * var6;
         var11 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
      }

      for(var7 += 6; var4 < var7; var2[var10001] += var11 * var6) {
         var11 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var11 * var5;
         var10001 = var4++;
      }

      var10.field327 = var3 << 8;
      return var4 >> 1;
   }

   @ObfuscatedName("br")
   @ObfuscatedSignature(
      descriptor = "(II[B[IIIIIIILbb;II)I"
   )
   static int method918(int var0, int var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, RawPcmStream var10, int var11, int var12) {
      if(var11 == 0 || (var7 = var5 + (var11 + (var9 - var4) - 257) / var11) > var8) {
         var7 = var8;
      }

      byte var13;
      int var10001;
      while(var5 < var7) {
         var1 = var4 >> 8;
         var13 = var2[var1];
         var10001 = var5++;
         var3[var10001] += ((var13 << 8) + (var2[var1 + 1] - var13) * (var4 & 255)) * var6 >> 6;
         var4 += var11;
      }

      if(var11 == 0 || (var7 = var5 + (var11 + (var9 - var4) - 1) / var11) > var8) {
         var7 = var8;
      }

      for(var1 = var12; var5 < var7; var4 += var11) {
         var13 = var2[var4 >> 8];
         var10001 = var5++;
         var3[var10001] += ((var13 << 8) + (var1 - var13) * (var4 & 255)) * var6 >> 6;
      }

      var10.field327 = var4;
      return var5;
   }

   @ObfuscatedName("bq")
   @ObfuscatedSignature(
      descriptor = "(II[B[IIIIIIIILbb;II)I"
   )
   static int method935(int var0, int var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, RawPcmStream var11, int var12, int var13) {
      if(var12 == 0 || (var8 = var5 + (var10 - var4 + var12 - 257) / var12) > var9) {
         var8 = var9;
      }

      var5 <<= 1;

      byte var14;
      int var10001;
      for(var8 <<= 1; var5 < var8; var4 += var12) {
         var1 = var4 >> 8;
         var14 = var2[var1];
         var0 = (var14 << 8) + (var4 & 255) * (var2[var1 + 1] - var14);
         var10001 = var5++;
         var3[var10001] += var0 * var6 >> 6;
         var10001 = var5++;
         var3[var10001] += var0 * var7 >> 6;
      }

      if(var12 == 0 || (var8 = (var5 >> 1) + (var10 - var4 + var12 - 1) / var12) > var9) {
         var8 = var9;
      }

      var8 <<= 1;

      for(var1 = var13; var5 < var8; var4 += var12) {
         var14 = var2[var4 >> 8];
         var0 = (var14 << 8) + (var1 - var14) * (var4 & 255);
         var10001 = var5++;
         var3[var10001] += var0 * var6 >> 6;
         var10001 = var5++;
         var3[var10001] += var0 * var7 >> 6;
      }

      var11.field327 = var4;
      return var5 >> 1;
   }

   @ObfuscatedName("cf")
   @ObfuscatedSignature(
      descriptor = "(II[B[IIIIIIILbb;II)I"
   )
   static int method936(int var0, int var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, RawPcmStream var10, int var11, int var12) {
      if(var11 == 0 || (var7 = var5 + (var11 + (var9 + 256 - var4)) / var11) > var8) {
         var7 = var8;
      }

      int var10001;
      while(var5 < var7) {
         var1 = var4 >> 8;
         byte var13 = var2[var1 - 1];
         var10001 = var5++;
         var3[var10001] += ((var13 << 8) + (var2[var1] - var13) * (var4 & 255)) * var6 >> 6;
         var4 += var11;
      }

      if(var11 == 0 || (var7 = var5 + (var11 + (var9 - var4)) / var11) > var8) {
         var7 = var8;
      }

      var0 = var12;

      for(var1 = var11; var5 < var7; var4 += var1) {
         var10001 = var5++;
         var3[var10001] += ((var0 << 8) + (var2[var4 >> 8] - var0) * (var4 & 255)) * var6 >> 6;
      }

      var10.field327 = var4;
      return var5;
   }

   @ObfuscatedName("cg")
   @ObfuscatedSignature(
      descriptor = "(II[B[IIIIIIIILbb;II)I"
   )
   static int method984(int var0, int var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, RawPcmStream var11, int var12, int var13) {
      if(var12 == 0 || (var8 = var5 + (var10 + 256 - var4 + var12) / var12) > var9) {
         var8 = var9;
      }

      var5 <<= 1;

      int var10001;
      for(var8 <<= 1; var5 < var8; var4 += var12) {
         var1 = var4 >> 8;
         byte var14 = var2[var1 - 1];
         var0 = (var2[var1] - var14) * (var4 & 255) + (var14 << 8);
         var10001 = var5++;
         var3[var10001] += var0 * var6 >> 6;
         var10001 = var5++;
         var3[var10001] += var0 * var7 >> 6;
      }

      if(var12 == 0 || (var8 = (var5 >> 1) + (var10 - var4 + var12) / var12) > var9) {
         var8 = var9;
      }

      var8 <<= 1;

      for(var1 = var13; var5 < var8; var4 += var12) {
         var0 = (var1 << 8) + (var4 & 255) * (var2[var4 >> 8] - var1);
         var10001 = var5++;
         var3[var10001] += var0 * var6 >> 6;
         var10001 = var5++;
         var3[var10001] += var0 * var7 >> 6;
      }

      var11.field327 = var4;
      return var5 >> 1;
   }

   @ObfuscatedName("cv")
   @ObfuscatedSignature(
      descriptor = "([B[IIIIIIIILbb;)I"
   )
   static int method944(byte[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, RawPcmStream var9) {
      var2 >>= 8;
      var8 >>= 8;
      var4 <<= 2;
      var5 <<= 2;
      if((var6 = var3 + var8 - var2) > var7) {
         var6 = var7;
      }

      var9.field326 += var9.field333 * (var6 - var3);
      var9.field321 += var9.field335 * (var6 - var3);

      int var10001;
      for(var6 -= 3; var3 < var6; var4 += var5) {
         var10001 = var3++;
         var1[var10001] += var0[var2++] * var4;
         var4 += var5;
         var10001 = var3++;
         var1[var10001] += var0[var2++] * var4;
         var4 += var5;
         var10001 = var3++;
         var1[var10001] += var0[var2++] * var4;
         var4 += var5;
         var10001 = var3++;
         var1[var10001] += var0[var2++] * var4;
      }

      for(var6 += 3; var3 < var6; var4 += var5) {
         var10001 = var3++;
         var1[var10001] += var0[var2++] * var4;
      }

      var9.field325 = var4 >> 2;
      var9.field327 = var2 << 8;
      return var3;
   }

   @ObfuscatedName("cx")
   @ObfuscatedSignature(
      descriptor = "(I[B[IIIIIIIIIILbb;)I"
   )
   static int method939(int var0, byte[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, RawPcmStream var12) {
      var3 >>= 8;
      var11 >>= 8;
      var5 <<= 2;
      var6 <<= 2;
      var7 <<= 2;
      var8 <<= 2;
      if((var9 = var11 + var4 - var3) > var10) {
         var9 = var10;
      }

      var12.field325 += var12.field329 * (var9 - var4);
      var4 <<= 1;
      var9 <<= 1;

      byte var13;
      int var10001;
      for(var9 -= 6; var4 < var9; var6 += var8) {
         var13 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
         var6 += var8;
         var13 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
         var6 += var8;
         var13 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
         var6 += var8;
         var13 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
      }

      for(var9 += 6; var4 < var9; var6 += var8) {
         var13 = var1[var3++];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
      }

      var12.field326 = var5 >> 2;
      var12.field321 = var6 >> 2;
      var12.field327 = var3 << 8;
      return var4 >> 1;
   }

   @ObfuscatedName("cp")
   @ObfuscatedSignature(
      descriptor = "([B[IIIIIIIILbb;)I"
   )
   static int method940(byte[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, RawPcmStream var9) {
      var2 >>= 8;
      var8 >>= 8;
      var4 <<= 2;
      var5 <<= 2;
      if((var6 = var3 + var2 - (var8 - 1)) > var7) {
         var6 = var7;
      }

      var9.field326 += var9.field333 * (var6 - var3);
      var9.field321 += var9.field335 * (var6 - var3);

      int var10001;
      for(var6 -= 3; var3 < var6; var4 += var5) {
         var10001 = var3++;
         var1[var10001] += var0[var2--] * var4;
         var4 += var5;
         var10001 = var3++;
         var1[var10001] += var0[var2--] * var4;
         var4 += var5;
         var10001 = var3++;
         var1[var10001] += var0[var2--] * var4;
         var4 += var5;
         var10001 = var3++;
         var1[var10001] += var0[var2--] * var4;
      }

      for(var6 += 3; var3 < var6; var4 += var5) {
         var10001 = var3++;
         var1[var10001] += var0[var2--] * var4;
      }

      var9.field325 = var4 >> 2;
      var9.field327 = var2 << 8;
      return var3;
   }

   @ObfuscatedName("ce")
   @ObfuscatedSignature(
      descriptor = "(I[B[IIIIIIIIIILbb;)I"
   )
   static int method1014(int var0, byte[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, RawPcmStream var12) {
      var3 >>= 8;
      var11 >>= 8;
      var5 <<= 2;
      var6 <<= 2;
      var7 <<= 2;
      var8 <<= 2;
      if((var9 = var3 + var4 - (var11 - 1)) > var10) {
         var9 = var10;
      }

      var12.field325 += var12.field329 * (var9 - var4);
      var4 <<= 1;
      var9 <<= 1;

      byte var13;
      int var10001;
      for(var9 -= 6; var4 < var9; var6 += var8) {
         var13 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
         var6 += var8;
         var13 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
         var6 += var8;
         var13 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
         var6 += var8;
         var13 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
      }

      for(var9 += 6; var4 < var9; var6 += var8) {
         var13 = var1[var3--];
         var10001 = var4++;
         var2[var10001] += var13 * var5;
         var5 += var7;
         var10001 = var4++;
         var2[var10001] += var13 * var6;
      }

      var12.field326 = var5 >> 2;
      var12.field321 = var6 >> 2;
      var12.field327 = var3 << 8;
      return var4 >> 1;
   }

   @ObfuscatedName("ci")
   @ObfuscatedSignature(
      descriptor = "(II[B[IIIIIIIILbb;II)I"
   )
   static int method990(int var0, int var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, RawPcmStream var11, int var12, int var13) {
      var11.field326 -= var11.field333 * var5;
      var11.field321 -= var11.field335 * var5;
      if(var12 == 0 || (var8 = var5 + (var10 - var4 + var12 - 257) / var12) > var9) {
         var8 = var9;
      }

      byte var14;
      int var10001;
      while(var5 < var8) {
         var1 = var4 >> 8;
         var14 = var2[var1];
         var10001 = var5++;
         var3[var10001] += ((var14 << 8) + (var2[var1 + 1] - var14) * (var4 & 255)) * var6 >> 6;
         var6 += var7;
         var4 += var12;
      }

      if(var12 == 0 || (var8 = var5 + (var10 - var4 + var12 - 1) / var12) > var9) {
         var8 = var9;
      }

      for(var1 = var13; var5 < var8; var4 += var12) {
         var14 = var2[var4 >> 8];
         var10001 = var5++;
         var3[var10001] += ((var14 << 8) + (var1 - var14) * (var4 & 255)) * var6 >> 6;
         var6 += var7;
      }

      var11.field326 += var11.field333 * var5;
      var11.field321 += var11.field335 * var5;
      var11.field325 = var6;
      var11.field327 = var4;
      return var5;
   }

   @ObfuscatedName("ct")
   @ObfuscatedSignature(
      descriptor = "(II[B[IIIIIIIIIILbb;II)I"
   )
   static int method943(int var0, int var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, RawPcmStream var13, int var14, int var15) {
      var13.field325 -= var5 * var13.field329;
      if(var14 == 0 || (var10 = var5 + (var12 - var4 + var14 - 257) / var14) > var11) {
         var10 = var11;
      }

      var5 <<= 1;

      byte var16;
      int var10001;
      for(var10 <<= 1; var5 < var10; var4 += var14) {
         var1 = var4 >> 8;
         var16 = var2[var1];
         var0 = (var16 << 8) + (var4 & 255) * (var2[var1 + 1] - var16);
         var10001 = var5++;
         var3[var10001] += var0 * var6 >> 6;
         var6 += var8;
         var10001 = var5++;
         var3[var10001] += var0 * var7 >> 6;
         var7 += var9;
      }

      if(var14 == 0 || (var10 = (var5 >> 1) + (var12 - var4 + var14 - 1) / var14) > var11) {
         var10 = var11;
      }

      var10 <<= 1;

      for(var1 = var15; var5 < var10; var4 += var14) {
         var16 = var2[var4 >> 8];
         var0 = (var16 << 8) + (var1 - var16) * (var4 & 255);
         var10001 = var5++;
         var3[var10001] += var0 * var6 >> 6;
         var6 += var8;
         var10001 = var5++;
         var3[var10001] += var0 * var7 >> 6;
         var7 += var9;
      }

      var5 >>= 1;
      var13.field325 += var13.field329 * var5;
      var13.field326 = var6;
      var13.field321 = var7;
      var13.field327 = var4;
      return var5;
   }

   @ObfuscatedName("cw")
   @ObfuscatedSignature(
      descriptor = "(II[B[IIIIIIIILbb;II)I"
   )
   static int method955(int var0, int var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, RawPcmStream var11, int var12, int var13) {
      var11.field326 -= var11.field333 * var5;
      var11.field321 -= var11.field335 * var5;
      if(var12 == 0 || (var8 = var5 + (var10 + 256 - var4 + var12) / var12) > var9) {
         var8 = var9;
      }

      int var10001;
      while(var5 < var8) {
         var1 = var4 >> 8;
         byte var14 = var2[var1 - 1];
         var10001 = var5++;
         var3[var10001] += ((var14 << 8) + (var2[var1] - var14) * (var4 & 255)) * var6 >> 6;
         var6 += var7;
         var4 += var12;
      }

      if(var12 == 0 || (var8 = var5 + (var10 - var4 + var12) / var12) > var9) {
         var8 = var9;
      }

      var0 = var13;

      for(var1 = var12; var5 < var8; var4 += var1) {
         var10001 = var5++;
         var3[var10001] += ((var0 << 8) + (var2[var4 >> 8] - var0) * (var4 & 255)) * var6 >> 6;
         var6 += var7;
      }

      var11.field326 += var11.field333 * var5;
      var11.field321 += var11.field335 * var5;
      var11.field325 = var6;
      var11.field327 = var4;
      return var5;
   }

   @ObfuscatedName("cq")
   @ObfuscatedSignature(
      descriptor = "(II[B[IIIIIIIIIILbb;II)I"
   )
   static int method945(int var0, int var1, byte[] var2, int[] var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, RawPcmStream var13, int var14, int var15) {
      var13.field325 -= var5 * var13.field329;
      if(var14 == 0 || (var10 = var5 + (var12 + 256 - var4 + var14) / var14) > var11) {
         var10 = var11;
      }

      var5 <<= 1;

      int var10001;
      for(var10 <<= 1; var5 < var10; var4 += var14) {
         var1 = var4 >> 8;
         byte var16 = var2[var1 - 1];
         var0 = (var2[var1] - var16) * (var4 & 255) + (var16 << 8);
         var10001 = var5++;
         var3[var10001] += var0 * var6 >> 6;
         var6 += var8;
         var10001 = var5++;
         var3[var10001] += var0 * var7 >> 6;
         var7 += var9;
      }

      if(var14 == 0 || (var10 = (var5 >> 1) + (var12 - var4 + var14) / var14) > var11) {
         var10 = var11;
      }

      var10 <<= 1;

      for(var1 = var15; var5 < var10; var4 += var14) {
         var0 = (var1 << 8) + (var4 & 255) * (var2[var4 >> 8] - var1);
         var10001 = var5++;
         var3[var10001] += var0 * var6 >> 6;
         var6 += var8;
         var10001 = var5++;
         var3[var10001] += var0 * var7 >> 6;
         var7 += var9;
      }

      var5 >>= 1;
      var13.field325 += var13.field329 * var5;
      var13.field326 = var6;
      var13.field321 = var7;
      var13.field327 = var4;
      return var5;
   }
}
