import java.util.HashMap;
import java.util.Map;

public final class Class340 {

   long aLong4369;
   AbstractQueue_Sub1 anAbstractQueue_Sub1_4370;
   AbstractQueue_Sub1 anAbstractQueue_Sub1_4371;
   Map aMap4372;
   Class339 aClass339_4373;
   int anInt4374;


   public Class340(int var1, Class339 var2) {
      this(-1L, var1, var2);
   }

   public void method6241() {
      synchronized(this) {
         this.aMap4372.clear();
         this.anAbstractQueue_Sub1_4370.clear();
         if(this.method6242(-522760518)) {
            this.anAbstractQueue_Sub1_4371.clear();
         }

      }
   }

   boolean method6242(int var1) {
      return this.anInt4374 * 967188907 != -1;
   }

   public Object method6243(Object var1, byte var2) {
      synchronized(this) {
         if(-1L != -7839424572598457685L * this.aLong4369) {
            this.method6247(1861078467);
         }

         Class248 var4 = (Class248)this.aMap4372.get(var1);
         if(var4 == null) {
            return null;
         } else {
            this.method6246(var4, false, 1261520001);
            return var4.anObject2960;
         }
      }
   }

   public Object method6244(Object var1, Object var2, int var3) {
      synchronized(this) {
         if(this.aLong4369 * -7839424572598457685L != -1L) {
            this.method6247(-747309415);
         }

         Class248 var5 = (Class248)this.aMap4372.get(var1);
         if(var5 != null) {
            Object var9 = var5.anObject2960;
            var5.anObject2960 = var2;
            this.method6246(var5, false, 1261520001);
            return var9;
         } else {
            Class248 var6;
            if(this.method6242(630918195) && this.aMap4372.size() == this.anInt4374 * 967188907) {
               var6 = (Class248)this.anAbstractQueue_Sub1_4371.remove();
               this.aMap4372.remove(var6.anObject2961);
               this.anAbstractQueue_Sub1_4370.remove(var6);
            }

            var6 = new Class248(var2, var1);
            this.aMap4372.put(var1, var6);
            this.method6246(var6, true, 1261520001);
            return null;
         }
      }
   }

   public Object method6245(Object var1, int var2) {
      synchronized(this) {
         if(-1L != -7839424572598457685L * this.aLong4369) {
            this.method6247(1333363823);
         }

         Class248 var4 = (Class248)this.aMap4372.remove(var1);
         if(var4 != null) {
            this.anAbstractQueue_Sub1_4370.remove(var4);
            if(this.method6242(-1285614841)) {
               this.anAbstractQueue_Sub1_4371.remove(var4);
            }

            return var4.anObject2960;
         } else {
            return null;
         }
      }
   }

   void method6246(Class248 var1, boolean var2, int var3) {
      if(!var2) {
         this.anAbstractQueue_Sub1_4370.remove(var1);
         if(this.method6242(-2032997067) && !this.anAbstractQueue_Sub1_4371.remove(var1)) {
            throw new IllegalStateException("");
         }
      }

      var1.aLong2962 = System.currentTimeMillis() * -807238943942863013L;
      if(this.method6242(-1627597064)) {
         switch(-1809087925 * this.aClass339_4373.anInt4365) {
         case 0:
            var1.aLong2963 += 6523284144713514155L;
            break;
         case 1:
            var1.aLong2963 = 7562586425726550257L * var1.aLong2962;
         }

         this.anAbstractQueue_Sub1_4371.add(var1);
      }

      this.anAbstractQueue_Sub1_4370.add(var1);
   }

   void method6247(int var1) {
      if(this.aLong4369 * -7839424572598457685L == -1L) {
         throw new IllegalStateException("");
      } else {
         long var2 = System.currentTimeMillis() - this.aLong4369 * -7839424572598457685L;

         while(!this.anAbstractQueue_Sub1_4370.isEmpty()) {
            Class248 var4 = (Class248)this.anAbstractQueue_Sub1_4370.peek();
            if(-5007303547077672749L * var4.aLong2962 >= var2) {
               return;
            }

            this.aMap4372.remove(var4.anObject2961);
            this.anAbstractQueue_Sub1_4370.remove(var4);
            if(this.method6242(1132303418)) {
               this.anAbstractQueue_Sub1_4371.remove(var4);
            }
         }

      }
   }

   public void method6248(byte var1) {
      synchronized(this) {
         this.aMap4372.clear();
         this.anAbstractQueue_Sub1_4370.clear();
         if(this.method6242(483021180)) {
            if(var1 == 0) {
               ;
            }

            this.anAbstractQueue_Sub1_4371.clear();
         }

      }
   }

   boolean method6249() {
      return this.anInt4374 * 967188907 != -1;
   }

   public Object method6250(Object var1) {
      synchronized(this) {
         if(-1L != -7839424572598457685L * this.aLong4369) {
            this.method6247(-204851489);
         }

         Class248 var3 = (Class248)this.aMap4372.remove(var1);
         if(var3 != null) {
            this.anAbstractQueue_Sub1_4370.remove(var3);
            if(this.method6242(-1531932142)) {
               this.anAbstractQueue_Sub1_4371.remove(var3);
            }

            return var3.anObject2960;
         } else {
            return null;
         }
      }
   }

   public Object method6251(Object var1) {
      synchronized(this) {
         if(-1L != -7839424572598457685L * this.aLong4369) {
            this.method6247(134834358);
         }

         Class248 var3 = (Class248)this.aMap4372.get(var1);
         if(var3 == null) {
            return null;
         } else {
            this.method6246(var3, false, 1261520001);
            return var3.anObject2960;
         }
      }
   }

   public Object method6252(Object var1) {
      synchronized(this) {
         if(-1L != -7839424572598457685L * this.aLong4369) {
            this.method6247(1412117461);
         }

         Class248 var3 = (Class248)this.aMap4372.get(var1);
         if(var3 == null) {
            return null;
         } else {
            this.method6246(var3, false, 1261520001);
            return var3.anObject2960;
         }
      }
   }

   boolean method6253() {
      return this.anInt4374 * 967188907 != -1;
   }

   boolean method6254() {
      return this.anInt4374 * 967188907 != -1;
   }

   public Object method6255(Object var1, Object var2) {
      synchronized(this) {
         if(this.aLong4369 * -7839424572598457685L != -1L) {
            this.method6247(723563001);
         }

         Class248 var4 = (Class248)this.aMap4372.get(var1);
         if(var4 != null) {
            Object var8 = var4.anObject2960;
            var4.anObject2960 = var2;
            this.method6246(var4, false, 1261520001);
            return var8;
         } else {
            Class248 var5;
            if(this.method6242(1180817555) && this.aMap4372.size() == this.anInt4374 * 967188907) {
               var5 = (Class248)this.anAbstractQueue_Sub1_4371.remove();
               this.aMap4372.remove(var5.anObject2961);
               this.anAbstractQueue_Sub1_4370.remove(var5);
            }

            var5 = new Class248(var2, var1);
            this.aMap4372.put(var1, var5);
            this.method6246(var5, true, 1261520001);
            return null;
         }
      }
   }

   public Object method6256(Object var1, Object var2) {
      synchronized(this) {
         if(this.aLong4369 * -7839424572598457685L != -1L) {
            this.method6247(338204577);
         }

         Class248 var4 = (Class248)this.aMap4372.get(var1);
         if(var4 != null) {
            Object var8 = var4.anObject2960;
            var4.anObject2960 = var2;
            this.method6246(var4, false, 1261520001);
            return var8;
         } else {
            Class248 var5;
            if(this.method6242(-1954343405) && this.aMap4372.size() == this.anInt4374 * 967188907) {
               var5 = (Class248)this.anAbstractQueue_Sub1_4371.remove();
               this.aMap4372.remove(var5.anObject2961);
               this.anAbstractQueue_Sub1_4370.remove(var5);
            }

            var5 = new Class248(var2, var1);
            this.aMap4372.put(var1, var5);
            this.method6246(var5, true, 1261520001);
            return null;
         }
      }
   }

   public Object method6257(Object var1, Object var2) {
      synchronized(this) {
         if(this.aLong4369 * -7839424572598457685L != -1L) {
            this.method6247(2132757854);
         }

         Class248 var4 = (Class248)this.aMap4372.get(var1);
         if(var4 != null) {
            Object var8 = var4.anObject2960;
            var4.anObject2960 = var2;
            this.method6246(var4, false, 1261520001);
            return var8;
         } else {
            Class248 var5;
            if(this.method6242(-657868635) && this.aMap4372.size() == this.anInt4374 * 967188907) {
               var5 = (Class248)this.anAbstractQueue_Sub1_4371.remove();
               this.aMap4372.remove(var5.anObject2961);
               this.anAbstractQueue_Sub1_4370.remove(var5);
            }

            var5 = new Class248(var2, var1);
            this.aMap4372.put(var1, var5);
            this.method6246(var5, true, 1261520001);
            return null;
         }
      }
   }

   public Object method6258(Object var1) {
      synchronized(this) {
         if(-1L != -7839424572598457685L * this.aLong4369) {
            this.method6247(-204035146);
         }

         Class248 var3 = (Class248)this.aMap4372.remove(var1);
         if(var3 != null) {
            this.anAbstractQueue_Sub1_4370.remove(var3);
            if(this.method6242(-2103140644)) {
               this.anAbstractQueue_Sub1_4371.remove(var3);
            }

            return var3.anObject2960;
         } else {
            return null;
         }
      }
   }

   Class340(long var1, int var3, Class339 var4) {
      this.aLong4369 = 1958361870063353859L * var1;
      this.anInt4374 = var3 * 1974718723;
      this.aClass339_4373 = var4;
      if(-1 == this.anInt4374 * 967188907) {
         this.aMap4372 = new HashMap(64);
         this.anAbstractQueue_Sub1_4370 = new AbstractQueue_Sub1(64);
         this.anAbstractQueue_Sub1_4371 = null;
      } else {
         if(this.aClass339_4373 == null) {
            throw new IllegalArgumentException("");
         }

         this.aMap4372 = new HashMap(967188907 * this.anInt4374);
         this.anAbstractQueue_Sub1_4370 = new AbstractQueue_Sub1(967188907 * this.anInt4374);
         this.anAbstractQueue_Sub1_4371 = new AbstractQueue_Sub1(967188907 * this.anInt4374);
      }

   }

   void method6259(Class248 var1, boolean var2) {
      if(!var2) {
         this.anAbstractQueue_Sub1_4370.remove(var1);
         if(this.method6242(127215466) && !this.anAbstractQueue_Sub1_4371.remove(var1)) {
            throw new IllegalStateException("");
         }
      }

      var1.aLong2962 = System.currentTimeMillis() * -807238943942863013L;
      if(this.method6242(-686221627)) {
         switch(-1809087925 * this.aClass339_4373.anInt4365) {
         case 0:
            var1.aLong2963 += 6523284144713514155L;
            break;
         case 1:
            var1.aLong2963 = 7562586425726550257L * var1.aLong2962;
         }

         this.anAbstractQueue_Sub1_4371.add(var1);
      }

      this.anAbstractQueue_Sub1_4370.add(var1);
   }

   public Object method6260(Object var1, Object var2) {
      synchronized(this) {
         if(this.aLong4369 * -7839424572598457685L != -1L) {
            this.method6247(-65516138);
         }

         Class248 var4 = (Class248)this.aMap4372.get(var1);
         if(var4 != null) {
            Object var8 = var4.anObject2960;
            var4.anObject2960 = var2;
            this.method6246(var4, false, 1261520001);
            return var8;
         } else {
            Class248 var5;
            if(this.method6242(1914910387) && this.aMap4372.size() == this.anInt4374 * 967188907) {
               var5 = (Class248)this.anAbstractQueue_Sub1_4371.remove();
               this.aMap4372.remove(var5.anObject2961);
               this.anAbstractQueue_Sub1_4370.remove(var5);
            }

            var5 = new Class248(var2, var1);
            this.aMap4372.put(var1, var5);
            this.method6246(var5, true, 1261520001);
            return null;
         }
      }
   }

   void method6261() {
      if(this.aLong4369 * -7839424572598457685L == -1L) {
         throw new IllegalStateException("");
      } else {
         long var1 = System.currentTimeMillis() - this.aLong4369 * -7839424572598457685L;

         while(!this.anAbstractQueue_Sub1_4370.isEmpty()) {
            Class248 var3 = (Class248)this.anAbstractQueue_Sub1_4370.peek();
            if(-5007303547077672749L * var3.aLong2962 >= var1) {
               return;
            }

            this.aMap4372.remove(var3.anObject2961);
            this.anAbstractQueue_Sub1_4370.remove(var3);
            if(this.method6242(-798909156)) {
               this.anAbstractQueue_Sub1_4371.remove(var3);
            }
         }

      }
   }

   public void method6262() {
      synchronized(this) {
         this.aMap4372.clear();
         this.anAbstractQueue_Sub1_4370.clear();
         if(this.method6242(1190093708)) {
            this.anAbstractQueue_Sub1_4371.clear();
         }

      }
   }

   public void method6263() {
      synchronized(this) {
         this.aMap4372.clear();
         this.anAbstractQueue_Sub1_4370.clear();
         if(this.method6242(247831853)) {
            this.anAbstractQueue_Sub1_4371.clear();
         }

      }
   }

   void method6264(Class248 var1, boolean var2) {
      if(!var2) {
         this.anAbstractQueue_Sub1_4370.remove(var1);
         if(this.method6242(2134993074) && !this.anAbstractQueue_Sub1_4371.remove(var1)) {
            throw new IllegalStateException("");
         }
      }

      var1.aLong2962 = System.currentTimeMillis() * -807238943942863013L;
      if(this.method6242(1843920839)) {
         switch(-1809087925 * this.aClass339_4373.anInt4365) {
         case 0:
            var1.aLong2963 += 6523284144713514155L;
            break;
         case 1:
            var1.aLong2963 = 7562586425726550257L * var1.aLong2962;
         }

         this.anAbstractQueue_Sub1_4371.add(var1);
      }

      this.anAbstractQueue_Sub1_4370.add(var1);
   }

   static final void method6265(Class508 var0, int var1) {
      Class493.method8279(var0, Class5.aClass515_Sub1_Sub4_Sub4_Sub1_113, 833348341);
   }

   static final void method6266(Class508 var0, int var1) {
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = Class5.aClass515_Sub1_Sub4_Sub4_Sub1_113.aClass16_10774.method745(460268445) >> 3;
   }

   static final void method6267(Class508 var0, int var1) {
      Class505 var2 = var0.aBool6014?var0.aClass505_6011:var0.aClass505_6010;
      Class124 var3 = var2.aClass124_5977;
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = 437250785 * var3.anInt1383;
   }
}
