import java.util.Random;

public class Class408 {

   static Random aRandom5004;
   static Object anObject5005 = new Object();
   static int anInt5006;


   public static boolean method6957(int var0) {
      return (var0 & -var0) == var0;
   }

   public static int method6958(int var0) {
      int var1 = var0 >>> 1;
      var1 |= var1 >>> 1;
      var1 |= var1 >>> 2;
      var1 |= var1 >>> 4;
      var1 |= var1 >>> 8;
      var1 |= var1 >>> 16;
      return var0 & ~var1;
   }

   public static int method6959(int var0, int var1) {
      int var2;
      if(var1 > var0) {
         var2 = var0;
         var0 = var1;
         var1 = var2;
      }

      while(0 != var1) {
         var2 = var0 % var1;
         var0 = var1;
         var1 = var2;
      }

      return var0;
   }

   public static int method6960(int var0, int var1) {
      int var2;
      for(var2 = 0; var1 > 0; --var1) {
         var2 = var2 << 1 | var0 & 1;
         var0 >>>= 1;
      }

      return var2;
   }

   public static int method6961(int var0, int var1) {
      int var2;
      if(var1 > var0) {
         var2 = var0;
         var0 = var1;
         var1 = var2;
      }

      while(0 != var1) {
         var2 = var0 % var1;
         var0 = var1;
         var1 = var2;
      }

      return var0;
   }

   public static int method6962(int var0) {
      var0 = (var0 & 1431655765) + (var0 >>> 1 & 1431655765);
      var0 = (var0 >>> 2 & 858993459) + (var0 & 858993459);
      var0 = (var0 >>> 4) + var0 & 252645135;
      var0 += var0 >>> 8;
      var0 += var0 >>> 16;
      return var0 & 255;
   }

   public static int method6963(int var0) {
      var0 = (var0 & 1431655765) + (var0 >>> 1 & 1431655765);
      var0 = (var0 >>> 2 & 858993459) + (var0 & 858993459);
      var0 = (var0 >>> 4) + var0 & 252645135;
      var0 += var0 >>> 8;
      var0 += var0 >>> 16;
      return var0 & 255;
   }

   Class408() throws Throwable {
      throw new Error();
   }

   public static boolean method6964(int var0) {
      return (var0 & -var0) == var0;
   }

   static int method6965(int var0, int var1) {
      int var2 = var0 >> 31 & var1 - 1;
      return var2 + (var0 + (var0 >>> 31)) % var1;
   }

   public static int method6966(int var0) {
      --var0;
      var0 |= var0 >>> 1;
      var0 |= var0 >>> 2;
      var0 |= var0 >>> 4;
      var0 |= var0 >>> 8;
      var0 |= var0 >>> 16;
      return 1 + var0;
   }

   public static int method6967(int var0, int var1) {
      int var2;
      if(var1 > var0) {
         var2 = var0;
         var0 = var1;
         var1 = var2;
      }

      while(0 != var1) {
         var2 = var0 % var1;
         var0 = var1;
         var1 = var2;
      }

      return var0;
   }

   static int method6968(int var0, int var1) {
      int var2 = var0 >> 31 & var1 - 1;
      return var2 + (var0 + (var0 >>> 31)) % var1;
   }

   public static int method6969(int var0, int var1) {
      int var2;
      for(var2 = 0; var1 > 0; --var1) {
         var2 = var2 << 1 | var0 & 1;
         var0 >>>= 1;
      }

      return var2;
   }

   public static int method6970(int var0) {
      int var1 = 0;
      if(var0 < 0 || var0 >= 65536) {
         var0 >>>= 16;
         var1 += 16;
      }

      if(var0 >= 256) {
         var0 >>>= 8;
         var1 += 8;
      }

      if(var0 >= 16) {
         var0 >>>= 4;
         var1 += 4;
      }

      if(var0 >= 4) {
         var0 >>>= 2;
         var1 += 2;
      }

      if(var0 >= 1) {
         var0 >>>= 1;
         ++var1;
      }

      return var1 + var0;
   }

   public static int method6971(int var0, int var1) {
      int var2;
      for(var2 = 0; var1 > 0; --var1) {
         var2 = var2 << 1 | var0 & 1;
         var0 >>>= 1;
      }

      return var2;
   }

   public static int method6972(int var0) {
      int var1 = var0 >>> 1;
      var1 |= var1 >>> 1;
      var1 |= var1 >>> 2;
      var1 |= var1 >>> 4;
      var1 |= var1 >>> 8;
      var1 |= var1 >>> 16;
      return var0 & ~var1;
   }

   public static int method6973(int var0, int var1) {
      int var2;
      for(var2 = 0; var1 > 0; --var1) {
         var2 = var2 << 1 | var0 & 1;
         var0 >>>= 1;
      }

      return var2;
   }

   public static int method6974(int var0) {
      --var0;
      var0 |= var0 >>> 1;
      var0 |= var0 >>> 2;
      var0 |= var0 >>> 4;
      var0 |= var0 >>> 8;
      var0 |= var0 >>> 16;
      return 1 + var0;
   }

   public static int method6975(int var0, int var1) {
      int var2 = var0 >>> 31;
      return (var2 + var0) / var1 - var2;
   }

   public static int method6976(int var0, int var1) {
      int var2 = var0 >>> 31;
      return (var2 + var0) / var1 - var2;
   }

   public static int method6977(int var0, int var1) {
      int var2 = var0 >>> 31;
      return (var2 + var0) / var1 - var2;
   }

   static int method6978(int var0, int var1) {
      int var2 = var0 >> 31 & var1 - 1;
      return var2 + (var0 + (var0 >>> 31)) % var1;
   }

   public static int method6979(int var0) {
      int var1 = var0 >>> 1;
      var1 |= var1 >>> 1;
      var1 |= var1 >>> 2;
      var1 |= var1 >>> 4;
      var1 |= var1 >>> 8;
      var1 |= var1 >>> 16;
      return var0 & ~var1;
   }

   static int method6980(int var0, int var1) {
      int var2 = var0 >> 31 & var1 - 1;
      return var2 + (var0 + (var0 >>> 31)) % var1;
   }

   public static int method6981(int var0, int var1) {
      int var2;
      for(var2 = 1; var1 > 1; var1 >>= 1) {
         if(0 != (var1 & 1)) {
            var2 *= var0;
         }

         var0 *= var0;
      }

      if(var1 == 1) {
         return var0 * var2;
      } else {
         return var2;
      }
   }

   public static int method6982(Random var0, int var1) {
      if(null == var0) {
         var0 = aRandom5004;
         if(null == var0) {
            Object var2 = anObject5005;
            synchronized(var2) {
               if(aRandom5004 == null) {
                  aRandom5004 = new Random();
               }

               var0 = aRandom5004;
            }
         }
      }

      if(var1 <= 0) {
         throw new IllegalArgumentException();
      } else if(Class75.method1618(var1, 98312473)) {
         return (int)(((long)var0.nextInt() & 4294967295L) * (long)var1 >> 32);
      } else {
         int var5 = Integer.MIN_VALUE - (int)(4294967296L % (long)var1);

         int var3;
         do {
            var3 = var0.nextInt();
         } while(var3 >= var5);

         return Class527.method11099(var3, var1, -76882541);
      }
   }

   static final void method6983(int var0, int var1, int var2, int var3, int var4, boolean var5, int var6) {
      if(!var5 && (var1 < 512 || var2 < 512 || var1 > (client.aClass279_7807.method4910(1874318216) - 2) * 512 || var2 > (client.aClass279_7807.method4911((byte)-56) - 2) * 512)) {
         float[] var8 = client.aFloatArray7680;
         client.aFloatArray7680[1] = -1.0F;
         var8[0] = -1.0F;
      } else {
         int var7 = Class419.method7167(var1, var2, var0, (byte)-5) - var4;
         client.aClass328_7939.method5991(Class428.aClass545_5383.method11498());
         client.aClass328_7939.method6005((float)var3, 0.0F, 0.0F);
         Class428.aClass545_5383.method11603(client.aClass328_7939);
         if(var5) {
            Class428.aClass545_5383.method11650((float)var1, (float)var7, (float)var2, client.aFloatArray7680);
         } else {
            Class428.aClass545_5383.method11519((float)var1, (float)var7, (float)var2, client.aFloatArray7680);
         }

         client.aClass328_7939.method6005((float)(-var3), 0.0F, 0.0F);
         Class428.aClass545_5383.method11603(client.aClass328_7939);
         client.aFloatArray7680[0] -= (float)(-1155664305 * client.anInt7923);
         client.aFloatArray7680[1] -= (float)(client.anInt7924 * -1886265357);
      }
   }

   static final void method6984(Class508 var0, int var1) {
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = -867096999 * client.anInt7763 == var0.aClass515_Sub1_Sub4_Sub4_6021.method16691((byte)79)?1:0;
   }

   static final void method6985(Class508 var0, int var1) {
      Class505 var2 = var0.aBool6014?var0.aClass505_6011:var0.aClass505_6010;
      Class124 var3 = var2.aClass124_5977;
      Class121 var4 = var2.aClass121_5978;
      Class98.method1904(var3, var4, var0, (byte)118);
   }
}
