import java.util.Random;

public class Class394 {

   Class402[] aClass402Array4871;
   Class253 aClass253_4872;
   static final int anInt4873 = 0;
   int anInt4874;
   public static Class387 aClass387_4875;


   Class402 method6732(int var1, int var2) {
      if(-1909947335 * this.anInt4874 == -1) {
         return new Class402(false, new Class385[0]);
      } else {
         Class385 var3 = new Class385(this.anInt4874 * -1909947335, var1, var2);
         return new Class402(false, new Class385[]{var3});
      }
   }

   Class402 method6733(int var1, int var2, short var3) {
      if(-1909947335 * this.anInt4874 == -1) {
         return new Class402(false, new Class385[0]);
      } else {
         Class385 var4 = new Class385(this.anInt4874 * -1909947335, var1, var2);
         return new Class402(false, new Class385[]{var4});
      }
   }

   public Class394(Class481 var1, Class470 var2, Class253 var3) {
      this.aClass253_4872 = var3;
      RS2Buffer var4 = new RS2Buffer(this.aClass253_4872.method4547(0, 0, (byte)38));
      int var5 = var4.buffer != null && var4.buffer.length >= 1?var4.readUnsignedByte(-700559597):-1;
      if(var5 < 4) {
         this.aClass402Array4871 = new Class402[0];
         this.anInt4874 = -1173498377;
      } else {
         int var6 = var4.readUnsignedByte(-700559597);
         Class373[] var7 = Class153.method2774(-264472576);
         boolean var8 = true;
         int var9;
         int var10;
         if(var6 != var7.length) {
            var8 = false;
         } else {
            for(var9 = 0; var9 < var7.length; ++var9) {
               var10 = var4.readUnsignedByte(-700559597);
               if(-813208235 * var7[var9].anInt4656 != var10) {
                  var8 = false;
                  break;
               }
            }
         }

         if(var8) {
            var9 = var4.readUnsignedByte(-700559597);
            var10 = var4.readUnsignedByte(-700559597);
            int var11;
            int var12;
            if(var5 > 2) {
               this.anInt4874 = var4.method13732(-1839488989) * 1173498377;
               var11 = var4.readTriByte(-2147201306);
               var12 = var4.readUnsignedShort(-937710807);
            } else {
               this.anInt4874 = -1173498377;
               var11 = 0;
               var12 = 0;
            }

            this.aClass402Array4871 = new Class402[var10 + 1];

            int var13;
            for(var13 = 0; var13 < var9; ++var13) {
               int var14 = var4.readUnsignedByte(-700559597);
               boolean var15 = var4.readUnsignedByte(-700559597) == 1;
               int var16 = var4.readUnsignedShort(-937710807);
               Class385[] var17;
               int var19;
               int var18;
               int var21;
               int var20;
               if(-1 == this.anInt4874 * -1909947335) {
                  var17 = new Class385[var16];

                  for(var18 = 0; var18 < var16; ++var18) {
                     var19 = var4.readUnsignedShort(-937710807);
                     var20 = var4.readTriByte(-267911220);
                     var21 = var4.readUnsignedShort(-937710807);
                     var17[var18] = new Class385(var19, var20, var21);
                  }

                  this.aClass402Array4871[var14] = new Class402(var15, var17);
               } else {
                  var17 = new Class385[var16 + 1];
                  var17[0] = new Class385(this.anInt4874 * -1909947335, var11, var12);

                  for(var18 = 0; var18 < var16; ++var18) {
                     var19 = var4.readUnsignedShort(-937710807);
                     var20 = var4.readTriByte(-1484114254);
                     var21 = var4.readUnsignedShort(-937710807);
                     var17[1 + var18] = new Class385(var19, var20, var21);
                  }
               }

               this.aClass402Array4871[var14] = new Class402(var15, var17);
            }

            for(var13 = 0; var13 < 1 + var10; ++var13) {
               if(this.aClass402Array4871[var13] == null) {
                  this.aClass402Array4871[var13] = this.method6733(var11, var12, (short)32511);
               }
            }
         } else {
            this.aClass402Array4871 = new Class402[0];
            this.anInt4874 = -1173498377;
         }
      }

   }

   public Class385[] method6734(int var1, byte var2) {
      if(var1 >= 0 && var1 < this.aClass402Array4871.length) {
         Class402 var3 = this.aClass402Array4871[var1];
         if(var3.aBool4919 && var3.aClass385Array4918.length > 1) {
            int var4 = this.anInt4874 * -1909947335 == -1?0:1;
            Random var5 = new Random();
            Class385[] var6 = new Class385[var3.aClass385Array4918.length];
            System.arraycopy(var3.aClass385Array4918, 0, var6, 0, var6.length);

            for(int var7 = var4; var7 < var6.length; ++var7) {
               int var8 = Class300.method5381(var5, var6.length - var4, (byte)-59) + var4;
               Class385 var9 = var3.aClass385Array4918[var7];
               var6[var7] = var6[var8];
               var6[var8] = var9;
            }

            return var6;
         } else {
            return var3.aClass385Array4918;
         }
      } else {
         return this.method6733(0, 0, (short)19953).aClass385Array4918;
      }
   }

   public Class404 method6735(int var1) {
      byte[] var2 = this.aClass253_4872.method4547(var1, 0, (byte)32);
      Class404 var3 = new Class404();
      var3.method6829(new RS2Buffer(var2), '\u80e1');
      return var3;
   }

   Class402 method6736(int var1, int var2) {
      if(-1909947335 * this.anInt4874 == -1) {
         return new Class402(false, new Class385[0]);
      } else {
         Class385 var3 = new Class385(this.anInt4874 * -1909947335, var1, var2);
         return new Class402(false, new Class385[]{var3});
      }
   }

   public boolean method6737(int var1) {
      return -1 != -1909947335 * this.anInt4874;
   }

   public Class404 method6738(int var1, byte var2) {
      byte[] var3 = this.aClass253_4872.method4547(var1, 0, (byte)-17);
      Class404 var4 = new Class404();
      var4.method6829(new RS2Buffer(var3), '\u80e1');
      return var4;
   }

   public Class404 method6739(int var1) {
      byte[] var2 = this.aClass253_4872.method4547(var1, 0, (byte)-14);
      Class404 var3 = new Class404();
      var3.method6829(new RS2Buffer(var2), '\u80e1');
      return var3;
   }

   Class402 method6740(int var1, int var2) {
      if(-1909947335 * this.anInt4874 == -1) {
         return new Class402(false, new Class385[0]);
      } else {
         Class385 var3 = new Class385(this.anInt4874 * -1909947335, var1, var2);
         return new Class402(false, new Class385[]{var3});
      }
   }

   public Class404 method6741(int var1) {
      byte[] var2 = this.aClass253_4872.method4547(var1, 0, (byte)-6);
      Class404 var3 = new Class404();
      var3.method6829(new RS2Buffer(var2), '\u80e1');
      return var3;
   }

   public Class404 method6742(int var1) {
      byte[] var2 = this.aClass253_4872.method4547(var1, 0, (byte)-92);
      Class404 var3 = new Class404();
      var3.method6829(new RS2Buffer(var2), '\u80e1');
      return var3;
   }

   static final void method6743(Class508 var0, byte var1) {
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = var0.aClass515_Sub1_Sub1_Sub1_6017.method13406(-2010432543);
   }

   static final void method6744(Class508 var0, int var1) {
      Class505 var10000;
      if(var0.aBool6014) {
         if(var1 != -16711936) {
            ;
         }

         var10000 = var0.aClass505_6011;
      } else {
         var10000 = var0.aClass505_6010;
      }

      Class505 var2 = var10000;
      Class124 var3 = var2.aClass124_5977;
      Class121 var4 = var2.aClass121_5978;
      Class244.method4379(var3, var4, var0, 607554759);
   }

   static Class40[] method6745(int var0) {
      return new Class40[]{Class40.aClass40_435, Class40.aClass40_436, Class40.aClass40_438};
   }

   static void method6746(RS2Buffer var0, byte var1) {
      for(int var2 = 0; var2 < -697354895 * Class462.anInt5734; ++var2) {
         int var3 = var0.readSmart(922706973);
         int var4 = var0.readUnsignedShort(-937710807);
         if('\uffff' == var4) {
            var4 = -1;
         }

         if(null != Class530.aClass536_Sub1Array7213[var3]) {
            Class530.aClass536_Sub1Array7213[var3].anInt7289 = var4 * 1620191437;
         }
      }

   }
}
