import java.awt.Component;
import java.io.File;
import java.io.IOException;

public class Class197 {

   Class253 aClass253_2349;
   Class423 aClass423_2350 = new Class423(256);
   Class423 aClass423_2351 = new Class423(256);
   Class423 aClass423_2352 = new Class423(256);
   Class253 aClass253_2353;


   Class225_Sub26_Sub1_Sub2 method3371(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4 ^ 4294967296L;
      Class225_Sub26_Sub1_Sub2 var7 = (Class225_Sub26_Sub1_Sub2)this.aClass423_2352.method7211(var5);
      if(var7 != null) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class225_Sub20 var8 = (Class225_Sub20)this.aClass423_2351.method7211(var5);
         if(null == var8) {
            var8 = Class225_Sub20.method13651(this.aClass253_2353, var1, var2);
            if(null == var8) {
               return null;
            }

            this.aClass423_2351.method7206(var8, var5);
         }

         var7 = var8.method13666();
         if(null == var7) {
            return null;
         } else {
            var8.method3857(1000871148);
            this.aClass423_2352.method7206(var7, var5);
            return var7;
         }
      }
   }

   Class225_Sub26_Sub1_Sub1 method3372(int var1, int var2, int[] var3, byte var4) {
      int var5 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var5 |= var1 << 16;
      long var6 = (long)var5;
      Class225_Sub26_Sub1_Sub1 var8 = (Class225_Sub26_Sub1_Sub1)this.aClass423_2350.method7211(var6);
      if(null != var8) {
         return var8;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class196 var9 = Class196.method3369(this.aClass253_2349, var1, var2);
         if(null == var9) {
            return null;
         } else {
            var8 = var9.method3362();
            this.aClass423_2350.method7206(var8, var6);
            if(null != var3) {
               var3[0] -= var8.aByteArray10639.length;
            }

            return var8;
         }
      }
   }

   public Class225_Sub26_Sub1_Sub2 method3373(int var1, int[] var2) {
      if(this.aClass253_2353.method4515(-1413257874) == 1) {
         return this.method3379(0, var1, var2, (byte)1);
      } else if(this.aClass253_2353.method4514(var1, -1669972550) == 1) {
         return this.method3379(var1, 0, var2, (byte)1);
      } else {
         throw new RuntimeException();
      }
   }

   public Class225_Sub26_Sub1_Sub1 method3374(int var1, int[] var2, int var3) {
      if(this.aClass253_2349.method4515(-2116479953) == 1) {
         return this.method3372(0, var1, var2, (byte)-126);
      } else if(this.aClass253_2349.method4514(var1, 1808732813) == 1) {
         return this.method3372(var1, 0, var2, (byte)-78);
      } else {
         throw new RuntimeException();
      }
   }

   Class225_Sub26_Sub1_Sub1 method3375(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4;
      Class225_Sub26_Sub1_Sub1 var7 = (Class225_Sub26_Sub1_Sub1)this.aClass423_2350.method7211(var5);
      if(null != var7) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class196 var8 = Class196.method3369(this.aClass253_2349, var1, var2);
         if(null == var8) {
            return null;
         } else {
            var7 = var8.method3362();
            this.aClass423_2350.method7206(var7, var5);
            if(null != var3) {
               var3[0] -= var7.aByteArray10639.length;
            }

            return var7;
         }
      }
   }

   public Class225_Sub26_Sub1_Sub2 method3376(int var1, int[] var2, int var3) {
      if(this.aClass253_2353.method4515(-1801087853) == 1) {
         return this.method3379(0, var1, var2, (byte)1);
      } else if(this.aClass253_2353.method4514(var1, 414953376) == 1) {
         return this.method3379(var1, 0, var2, (byte)1);
      } else {
         throw new RuntimeException();
      }
   }

   Class225_Sub26_Sub1_Sub1 method3377(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4;
      Class225_Sub26_Sub1_Sub1 var7 = (Class225_Sub26_Sub1_Sub1)this.aClass423_2350.method7211(var5);
      if(null != var7) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class196 var8 = Class196.method3369(this.aClass253_2349, var1, var2);
         if(null == var8) {
            return null;
         } else {
            var7 = var8.method3362();
            this.aClass423_2350.method7206(var7, var5);
            if(null != var3) {
               var3[0] -= var7.aByteArray10639.length;
            }

            return var7;
         }
      }
   }

   Class225_Sub26_Sub1_Sub1 method3378(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4;
      Class225_Sub26_Sub1_Sub1 var7 = (Class225_Sub26_Sub1_Sub1)this.aClass423_2350.method7211(var5);
      if(null != var7) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class196 var8 = Class196.method3369(this.aClass253_2349, var1, var2);
         if(null == var8) {
            return null;
         } else {
            var7 = var8.method3362();
            this.aClass423_2350.method7206(var7, var5);
            if(null != var3) {
               var3[0] -= var7.aByteArray10639.length;
            }

            return var7;
         }
      }
   }

   Class225_Sub26_Sub1_Sub2 method3379(int var1, int var2, int[] var3, byte var4) {
      int var5 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var5 |= var1 << 16;
      long var6 = (long)var5 ^ 4294967296L;
      Class225_Sub26_Sub1_Sub2 var8 = (Class225_Sub26_Sub1_Sub2)this.aClass423_2352.method7211(var6);
      if(var8 != null) {
         return var8;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class225_Sub20 var9 = (Class225_Sub20)this.aClass423_2351.method7211(var6);
         if(null == var9) {
            var9 = Class225_Sub20.method13651(this.aClass253_2353, var1, var2);
            if(null == var9) {
               return null;
            }

            this.aClass423_2351.method7206(var9, var6);
         }

         var8 = var9.method13666();
         if(null == var8) {
            return null;
         } else {
            var9.method3857(1404268265);
            this.aClass423_2352.method7206(var8, var6);
            return var8;
         }
      }
   }

   Class225_Sub26_Sub1_Sub1 method3380(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4;
      Class225_Sub26_Sub1_Sub1 var7 = (Class225_Sub26_Sub1_Sub1)this.aClass423_2350.method7211(var5);
      if(null != var7) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class196 var8 = Class196.method3369(this.aClass253_2349, var1, var2);
         if(null == var8) {
            return null;
         } else {
            var7 = var8.method3362();
            this.aClass423_2350.method7206(var7, var5);
            if(null != var3) {
               var3[0] -= var7.aByteArray10639.length;
            }

            return var7;
         }
      }
   }

   Class225_Sub26_Sub1_Sub2 method3381(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4 ^ 4294967296L;
      Class225_Sub26_Sub1_Sub2 var7 = (Class225_Sub26_Sub1_Sub2)this.aClass423_2352.method7211(var5);
      if(var7 != null) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class225_Sub20 var8 = (Class225_Sub20)this.aClass423_2351.method7211(var5);
         if(null == var8) {
            var8 = Class225_Sub20.method13651(this.aClass253_2353, var1, var2);
            if(null == var8) {
               return null;
            }

            this.aClass423_2351.method7206(var8, var5);
         }

         var7 = var8.method13666();
         if(null == var7) {
            return null;
         } else {
            var8.method3857(1416342601);
            this.aClass423_2352.method7206(var7, var5);
            return var7;
         }
      }
   }

   Class225_Sub26_Sub1_Sub2 method3382(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4 ^ 4294967296L;
      Class225_Sub26_Sub1_Sub2 var7 = (Class225_Sub26_Sub1_Sub2)this.aClass423_2352.method7211(var5);
      if(var7 != null) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class225_Sub20 var8 = (Class225_Sub20)this.aClass423_2351.method7211(var5);
         if(null == var8) {
            var8 = Class225_Sub20.method13651(this.aClass253_2353, var1, var2);
            if(null == var8) {
               return null;
            }

            this.aClass423_2351.method7206(var8, var5);
         }

         var7 = var8.method13666();
         if(null == var7) {
            return null;
         } else {
            var8.method3857(2114518245);
            this.aClass423_2352.method7206(var7, var5);
            return var7;
         }
      }
   }

   Class225_Sub26_Sub1_Sub1 method3383(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4;
      Class225_Sub26_Sub1_Sub1 var7 = (Class225_Sub26_Sub1_Sub1)this.aClass423_2350.method7211(var5);
      if(null != var7) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class196 var8 = Class196.method3369(this.aClass253_2349, var1, var2);
         if(null == var8) {
            return null;
         } else {
            var7 = var8.method3362();
            this.aClass423_2350.method7206(var7, var5);
            if(null != var3) {
               var3[0] -= var7.aByteArray10639.length;
            }

            return var7;
         }
      }
   }

   Class225_Sub26_Sub1_Sub2 method3384(int var1, int var2, int[] var3) {
      int var4 = var2 ^ (var1 << 4 & '\uffff' | var1 >>> 12);
      var4 |= var1 << 16;
      long var5 = (long)var4 ^ 4294967296L;
      Class225_Sub26_Sub1_Sub2 var7 = (Class225_Sub26_Sub1_Sub2)this.aClass423_2352.method7211(var5);
      if(var7 != null) {
         return var7;
      } else if(var3 != null && var3[0] <= 0) {
         return null;
      } else {
         Class225_Sub20 var8 = (Class225_Sub20)this.aClass423_2351.method7211(var5);
         if(null == var8) {
            var8 = Class225_Sub20.method13651(this.aClass253_2353, var1, var2);
            if(null == var8) {
               return null;
            }

            this.aClass423_2351.method7206(var8, var5);
         }

         var7 = var8.method13666();
         if(null == var7) {
            return null;
         } else {
            var8.method3857(-1339653217);
            this.aClass423_2352.method7206(var7, var5);
            return var7;
         }
      }
   }

   public Class225_Sub26_Sub1_Sub1 method3385(int var1, int[] var2) {
      if(this.aClass253_2349.method4515(-1095662409) == 1) {
         return this.method3372(0, var1, var2, (byte)-41);
      } else if(this.aClass253_2349.method4514(var1, -1292581600) == 1) {
         return this.method3372(var1, 0, var2, (byte)-92);
      } else {
         throw new RuntimeException();
      }
   }

   public Class225_Sub26_Sub1_Sub1 method3386(int var1, int[] var2) {
      if(this.aClass253_2349.method4515(-1351236122) == 1) {
         return this.method3372(0, var1, var2, (byte)-116);
      } else if(this.aClass253_2349.method4514(var1, 1031075861) == 1) {
         return this.method3372(var1, 0, var2, (byte)-106);
      } else {
         throw new RuntimeException();
      }
   }

   public Class225_Sub26_Sub1_Sub2 method3387(int var1, int[] var2) {
      if(this.aClass253_2353.method4515(-1882684375) == 1) {
         return this.method3379(0, var1, var2, (byte)1);
      } else if(this.aClass253_2353.method4514(var1, 2145716444) == 1) {
         return this.method3379(var1, 0, var2, (byte)1);
      } else {
         throw new RuntimeException();
      }
   }

   public Class197(Class253 var1, Class253 var2) {
      this.aClass253_2349 = var1;
      this.aClass253_2353 = var2;
   }

   public static Class242 method3388(Component var0, boolean var1, int var2) {
      return new Class242_Sub1(var0, var1);
   }

   static final void method3389(Class508 var0, int var1) {
      long var2 = Class339.method6240(-57684611);
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = Class442.method7421(var2);
   }

   static final void method3390(Class508 var0, byte var1) {
      var0.anInt6003 -= 196624946;
      int var2 = var0.anIntArray6027[var0.anInt6003 * -937710807];
      int var3 = var0.anIntArray6027[-937710807 * var0.anInt6003 + 1];
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = Class178.method3164(var2, var3, false, 1545170242);
   }

   public static Class431 method3391(String var0, String var1, boolean var2, int var3) {
      File var4 = new File(Class97.aFile984, "preferences" + var0 + ".dat");
      if(var4.exists()) {
         try {
            Class431 var11 = new Class431(var4, "rw", 10000L);
            return var11;
         } catch (IOException var10) {
            ;
         }
      }

      String var5 = "";
      if(-1906909781 * Class566.anInt7510 == 33) {
         var5 = "_rc";
      } else if(-1906909781 * Class566.anInt7510 == 34) {
         var5 = "_wip";
      }

      File var6 = new File(Class466.aString5747, "jagex_" + var1 + "_preferences" + var0 + var5 + ".dat");
      Class431 var7;
      if(!var2 && var6.exists()) {
         try {
            var7 = new Class431(var6, "rw", 10000L);
            return var7;
         } catch (IOException var9) {
            ;
         }
      }

      try {
         var7 = new Class431(var4, "rw", 10000L);
         return var7;
      } catch (IOException var8) {
         throw new RuntimeException();
      }
   }

   static void method3392(Class225_Sub15 var0, int var1, int var2, int var3, byte var4) {
      var0.buffer.writeLEShortA(var3, (byte)1);
      var0.buffer.writeShortA(var2, -594177384);
      var0.buffer.writeInt2(var1, (byte)-53);
   }
}
