import java.util.Date;

public class Class295 implements Interface16 {

   String aString3481;
   Class182_Sub2 aClass182_Sub2_3482;
   public Class169 aClass169_3483;
   int anInt3484;
   int anInt3485;
   public int anInt3486;
   static int[] anIntArray3487 = new int[32];
   static int anInt3488;


   void method5334(RS2Buffer var1, boolean var2, byte var3) {
      while(true) {
         int var4 = var1.readUnsignedByte(-700559597);
         if(var4 == 0) {
            return;
         }

         this.method5335(var1, var4, var2, (byte)7);
      }
   }

   void method5335(RS2Buffer var1, int var2, boolean var3, byte var4) {
      Class375 var5 = (Class375)Class79.method1636(Class354.method6393(-754102615), var2, (byte)29);
      switch(var5.anInt4687 * -1262785287) {
      case 4:
      case 6:
      case 7:
      default:
         break;
      case 5:
         this.anInt3484 = var1.readUnsignedByte(-700559597) * -1439404161;
         this.anInt3485 = var1.readUnsignedByte(-700559597) * 696881585;
         break;
      case 8:
         int var6 = var1.readUnsignedByte(-700559597);
         Class251 var7 = (Class251)Class79.method1636(Class251.method4479(-1294222989), var6, (byte)84);
         if(var7 == null) {
            throw new IllegalStateException("");
         }

         int var8 = var1.readLargeSmart(2039132256);
         Class182_Sub1 var9 = (Class182_Sub1)this.aClass182_Sub2_3482.aMap8999.get(var7);
         if(null != var9) {
            this.aClass169_3483 = var9.method14423(var8, -1867011032);
         } else if(!var3) {
            throw new IllegalStateException("");
         }
      }

   }

   public int method5336(int var1, int var2) {
      int var3 = anIntArray3487[this.anInt3485 * 469899089 - -178564993 * this.anInt3484];
      return var1 >> -178564993 * this.anInt3484 & var3;
   }

   public int method5337(int var1, int var2, int var3) throws Exception_Sub1 {
      int var4 = anIntArray3487[469899089 * this.anInt3485 - -178564993 * this.anInt3484];
      if(var2 >= 0 && var2 <= var4) {
         var4 <<= -178564993 * this.anInt3484;
         return var1 & ~var4 | var2 << -178564993 * this.anInt3484 & var4;
      } else {
         throw new Exception_Sub1(this.aString3481, var2, var4);
      }
   }

   static {
      int var0 = 2;

      for(int var1 = 0; var1 < 32; ++var1) {
         anIntArray3487[var1] = var0 - 1;
         var0 += var0;
      }

   }

   public int method5338(int var1) {
      int var2 = anIntArray3487[this.anInt3485 * 469899089 - -178564993 * this.anInt3484];
      return var1 >> -178564993 * this.anInt3484 & var2;
   }

   void method5339(RS2Buffer var1, int var2, boolean var3) {
      Class375 var4 = (Class375)Class79.method1636(Class354.method6393(-754102615), var2, (byte)-37);
      switch(var4.anInt4687 * -1262785287) {
      case 4:
      case 6:
      case 7:
      default:
         break;
      case 5:
         this.anInt3484 = var1.readUnsignedByte(-700559597) * -1439404161;
         this.anInt3485 = var1.readUnsignedByte(-700559597) * 696881585;
         break;
      case 8:
         int var5 = var1.readUnsignedByte(-700559597);
         Class251 var6 = (Class251)Class79.method1636(Class251.method4479(-1294222989), var5, (byte)-111);
         if(var6 == null) {
            throw new IllegalStateException("");
         }

         int var7 = var1.readLargeSmart(1618503377);
         Class182_Sub1 var8 = (Class182_Sub1)this.aClass182_Sub2_3482.aMap8999.get(var6);
         if(null != var8) {
            this.aClass169_3483 = var8.method14423(var7, 945218839);
         } else if(!var3) {
            throw new IllegalStateException("");
         }
      }

   }

   void method5340(RS2Buffer var1, int var2, boolean var3) {
      Class375 var4 = (Class375)Class79.method1636(Class354.method6393(-754102615), var2, (byte)19);
      switch(var4.anInt4687 * -1262785287) {
      case 4:
      case 6:
      case 7:
      default:
         break;
      case 5:
         this.anInt3484 = var1.readUnsignedByte(-700559597) * -1439404161;
         this.anInt3485 = var1.readUnsignedByte(-700559597) * 696881585;
         break;
      case 8:
         int var5 = var1.readUnsignedByte(-700559597);
         Class251 var6 = (Class251)Class79.method1636(Class251.method4479(-1294222989), var5, (byte)-11);
         if(var6 == null) {
            throw new IllegalStateException("");
         }

         int var7 = var1.readLargeSmart(1719972278);
         Class182_Sub1 var8 = (Class182_Sub1)this.aClass182_Sub2_3482.aMap8999.get(var6);
         if(null != var8) {
            this.aClass169_3483 = var8.method14423(var7, -1065308245);
         } else if(!var3) {
            throw new IllegalStateException("");
         }
      }

   }

   public int method5341(int var1) {
      int var2 = anIntArray3487[this.anInt3485 * 469899089 - -178564993 * this.anInt3484];
      return var1 >> -178564993 * this.anInt3484 & var2;
   }

   public int method5342(int var1) {
      int var2 = anIntArray3487[this.anInt3485 * 469899089 - -178564993 * this.anInt3484];
      return var1 >> -178564993 * this.anInt3484 & var2;
   }

   public int method5343(int var1, int var2) throws Exception_Sub1 {
      int var3 = anIntArray3487[469899089 * this.anInt3485 - -178564993 * this.anInt3484];
      if(var2 >= 0 && var2 <= var3) {
         var3 <<= -178564993 * this.anInt3484;
         return var1 & ~var3 | var2 << -178564993 * this.anInt3484 & var3;
      } else {
         throw new Exception_Sub1(this.aString3481, var2, var3);
      }
   }

   public int method5344(int var1) {
      int var2 = anIntArray3487[this.anInt3485 * 469899089 - -178564993 * this.anInt3484];
      return var1 >> -178564993 * this.anInt3484 & var2;
   }

   void method5345(RS2Buffer var1, int var2, boolean var3) {
      Class375 var4 = (Class375)Class79.method1636(Class354.method6393(-754102615), var2, (byte)54);
      switch(var4.anInt4687 * -1262785287) {
      case 4:
      case 6:
      case 7:
      default:
         break;
      case 5:
         this.anInt3484 = var1.readUnsignedByte(-700559597) * -1439404161;
         this.anInt3485 = var1.readUnsignedByte(-700559597) * 696881585;
         break;
      case 8:
         int var5 = var1.readUnsignedByte(-700559597);
         Class251 var6 = (Class251)Class79.method1636(Class251.method4479(-1294222989), var5, (byte)31);
         if(var6 == null) {
            throw new IllegalStateException("");
         }

         int var7 = var1.readLargeSmart(1805946646);
         Class182_Sub1 var8 = (Class182_Sub1)this.aClass182_Sub2_3482.aMap8999.get(var6);
         if(null != var8) {
            this.aClass169_3483 = var8.method14423(var7, 393591596);
         } else if(!var3) {
            throw new IllegalStateException("");
         }
      }

   }

   public int method5346(int var1, int var2) throws Exception_Sub1 {
      int var3 = anIntArray3487[469899089 * this.anInt3485 - -178564993 * this.anInt3484];
      if(var2 >= 0 && var2 <= var3) {
         var3 <<= -178564993 * this.anInt3484;
         return var1 & ~var3 | var2 << -178564993 * this.anInt3484 & var3;
      } else {
         throw new Exception_Sub1(this.aString3481, var2, var3);
      }
   }

   static final void method5347(Class508 var0, int var1) {
      Class505 var2 = var0.aBool6014?var0.aClass505_6011:var0.aClass505_6010;
      Class124 var3 = var2.aClass124_5977;
      Class121 var4 = var2.aClass121_5978;
      Class118_Sub4.method13175(var3, var4, var0, -1269107365);
   }

   static final void method5348(Class508 var0, byte var1) {
      int var2 = var0.anIntArray6027[(var0.anInt6003 -= 98312473) * -937710807];
      Class124 var3 = Class97.method1903(var2, 483338338);
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = 111746753 * var3.anInt1518;
   }

   static final void method5349(Class508 var0, int var1) {
      Class505 var2 = var0.aBool6014?var0.aClass505_6011:var0.aClass505_6010;
      Class124 var3 = var2.aClass124_5977;
      Class105.method2159(var3, var0, 36936271);
   }

   static void method5350(long var0) {
      Class409.aCalendar5009.setTime(new Date(var0));
   }

   static final void method5351(Class508 var0, int var1) {
      int var2 = var0.anIntArray6027[(var0.anInt6003 -= 98312473) * -937710807];
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = Class500.aClass225_Sub6_5953.aClass463_Sub16_8474.method7808(var2, 1166253062);
   }

   static final void method5352(int var0) {
      int var1 = Class184.anInt2209 * -583589671;
      int[] var2 = Class184.anIntArray2204;

      for(int var3 = 0; var3 < var1; ++var3) {
         Class515_Sub1_Sub4_Sub4_Sub1 var4 = client.aClass515_Sub1_Sub4_Sub4_Sub1Array7799[var2[var3]];
         if(null != var4) {
            Class362.method6447(var4, false, (byte)-24);
         }
      }

   }

   static int method5353(int var0, int var1, byte var2) {
      return Class458.aClass458_5697.anInt5719 * -1372814303 != var0 && -1372814303 * Class458.aClass458_5714.anInt5719 != var0?Class515_Sub1_Sub3_Sub1.anIntArray10723[var1 & 3]:Class515_Sub1_Sub3_Sub1.anIntArray10714[var1 & 3];
   }

   public static Class536_Sub1 method5354(int var0) {
      Class419.anInt5319 = 0;
      return Class515_Sub1_Sub4_Sub4_Sub1.method16817((byte)38);
   }
}
