
public final class Class501 {

   public static int anInt5954;


   public static int method8364(CharSequence var0) {
      int var1 = var0.length();
      int var2 = 0;

      for(int var3 = 0; var3 < var1; ++var3) {
         char var4 = var0.charAt(var3);
         if(var4 <= 127) {
            ++var2;
         } else if(var4 <= 2047) {
            var2 += 2;
         } else {
            var2 += 3;
         }
      }

      return var2;
   }

   public static String method8365(byte[] var0, int var1, int var2) {
      char[] var3 = new char[var2];
      int var4 = 0;
      int var5 = var1;

      int var8;
      for(int var6 = var2 + var1; var5 < var6; var3[var4++] = (char)var8) {
         int var7 = var0[var5++] & 255;
         if(var7 < 128) {
            if(0 == var7) {
               var8 = '\ufffd';
            } else {
               var8 = var7;
            }
         } else if(var7 < 192) {
            var8 = '\ufffd';
         } else if(var7 < 224) {
            if(var5 < var6 && (var0[var5] & 192) == 128) {
               var8 = (var7 & 31) << 6 | var0[var5++] & 63;
               if(var8 < 128) {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else if(var7 < 240) {
            if(var5 + 1 < var6 && (var0[var5] & 192) == 128 && (var0[var5 + 1] & 192) == 128) {
               var8 = (var7 & 15) << 12 | (var0[var5++] & 63) << 6 | var0[var5++] & 63;
               if(var8 < 2048) {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else if(var7 < 248) {
            if(2 + var5 < var6 && 128 == (var0[var5] & 192) && 128 == (var0[1 + var5] & 192) && (var0[2 + var5] & 192) == 128) {
               var8 = (var7 & 7) << 18 | (var0[var5++] & 63) << 12 | (var0[var5++] & 63) << 6 | var0[var5++] & 63;
               if(var8 >= 65536 && var8 <= 1114111) {
                  var8 = '\ufffd';
               } else {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else {
            var8 = '\ufffd';
         }
      }

      return new String(var3, 0, var4);
   }

   public static int method8366(CharSequence var0) {
      int var1 = var0.length();
      int var2 = 0;

      for(int var3 = 0; var3 < var1; ++var3) {
         char var4 = var0.charAt(var3);
         if(var4 <= 127) {
            ++var2;
         } else if(var4 <= 2047) {
            var2 += 2;
         } else {
            var2 += 3;
         }
      }

      return var2;
   }

   public static int method8367(CharSequence var0) {
      int var1 = var0.length();
      int var2 = 0;

      for(int var3 = 0; var3 < var1; ++var3) {
         char var4 = var0.charAt(var3);
         if(var4 <= 127) {
            ++var2;
         } else if(var4 <= 2047) {
            var2 += 2;
         } else {
            var2 += 3;
         }
      }

      return var2;
   }

   public static int method8368(CharSequence var0) {
      int var1 = var0.length();
      int var2 = 0;

      for(int var3 = 0; var3 < var1; ++var3) {
         char var4 = var0.charAt(var3);
         if(var4 <= 127) {
            ++var2;
         } else if(var4 <= 2047) {
            var2 += 2;
         } else {
            var2 += 3;
         }
      }

      return var2;
   }

   public static int method8369(byte[] var0, int var1, CharSequence var2) {
      int var3 = var2.length();
      int var4 = var1;

      for(int var5 = 0; var5 < var3; ++var5) {
         char var6 = var2.charAt(var5);
         if(var6 <= 127) {
            var0[var4++] = (byte)var6;
         } else if(var6 <= 2047) {
            var0[var4++] = (byte)(192 | var6 >> 6);
            var0[var4++] = (byte)(128 | var6 & 63);
         } else {
            var0[var4++] = (byte)(224 | var6 >> 12);
            var0[var4++] = (byte)(128 | var6 >> 6 & 63);
            var0[var4++] = (byte)(128 | var6 & 63);
         }
      }

      return var4 - var1;
   }

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

   public static String method8370(byte[] var0, int var1, int var2) {
      char[] var3 = new char[var2];
      int var4 = 0;
      int var5 = var1;

      int var8;
      for(int var6 = var2 + var1; var5 < var6; var3[var4++] = (char)var8) {
         int var7 = var0[var5++] & 255;
         if(var7 < 128) {
            if(0 == var7) {
               var8 = '\ufffd';
            } else {
               var8 = var7;
            }
         } else if(var7 < 192) {
            var8 = '\ufffd';
         } else if(var7 < 224) {
            if(var5 < var6 && (var0[var5] & 192) == 128) {
               var8 = (var7 & 31) << 6 | var0[var5++] & 63;
               if(var8 < 128) {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else if(var7 < 240) {
            if(var5 + 1 < var6 && (var0[var5] & 192) == 128 && (var0[var5 + 1] & 192) == 128) {
               var8 = (var7 & 15) << 12 | (var0[var5++] & 63) << 6 | var0[var5++] & 63;
               if(var8 < 2048) {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else if(var7 < 248) {
            if(2 + var5 < var6 && 128 == (var0[var5] & 192) && 128 == (var0[1 + var5] & 192) && (var0[2 + var5] & 192) == 128) {
               var8 = (var7 & 7) << 18 | (var0[var5++] & 63) << 12 | (var0[var5++] & 63) << 6 | var0[var5++] & 63;
               if(var8 >= 65536 && var8 <= 1114111) {
                  var8 = '\ufffd';
               } else {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else {
            var8 = '\ufffd';
         }
      }

      return new String(var3, 0, var4);
   }

   public static String method8371(byte[] var0, int var1, int var2) {
      char[] var3 = new char[var2];
      int var4 = 0;
      int var5 = var1;

      int var8;
      for(int var6 = var2 + var1; var5 < var6; var3[var4++] = (char)var8) {
         int var7 = var0[var5++] & 255;
         if(var7 < 128) {
            if(0 == var7) {
               var8 = '\ufffd';
            } else {
               var8 = var7;
            }
         } else if(var7 < 192) {
            var8 = '\ufffd';
         } else if(var7 < 224) {
            if(var5 < var6 && (var0[var5] & 192) == 128) {
               var8 = (var7 & 31) << 6 | var0[var5++] & 63;
               if(var8 < 128) {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else if(var7 < 240) {
            if(var5 + 1 < var6 && (var0[var5] & 192) == 128 && (var0[var5 + 1] & 192) == 128) {
               var8 = (var7 & 15) << 12 | (var0[var5++] & 63) << 6 | var0[var5++] & 63;
               if(var8 < 2048) {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else if(var7 < 248) {
            if(2 + var5 < var6 && 128 == (var0[var5] & 192) && 128 == (var0[1 + var5] & 192) && (var0[2 + var5] & 192) == 128) {
               var8 = (var7 & 7) << 18 | (var0[var5++] & 63) << 12 | (var0[var5++] & 63) << 6 | var0[var5++] & 63;
               if(var8 >= 65536 && var8 <= 1114111) {
                  var8 = '\ufffd';
               } else {
                  var8 = '\ufffd';
               }
            } else {
               var8 = '\ufffd';
            }
         } else {
            var8 = '\ufffd';
         }
      }

      return new String(var3, 0, var4);
   }

   static final void method8372(Class508 var0, byte var1) {
      int var2 = var0.anIntArray6027[(var0.anInt6003 -= 98312473) * -937710807];
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = (int)(Math.random() * (double)(1 + var2));
   }

   static final void method8373(Class508 var0, int var1) {
      if(1881519639 * client.anInt7734 == 7) {
         Class225_Sub15 var2 = Class543.method11415(OutgoingOpcode.aClass302_3848, client.aClass180_7703.aClass433_2184, (byte)1);
         client.aClass180_7703.method3191(var2, (byte)-94);
      }
   }

   public static Class550 method8374(int var0, int var1, int var2) {
      Class235.aClass550_Sub2_2792.anInt7426 = -1970438059 * var0;
      Class235.aClass550_Sub2_2792.anInt7424 = -779311591 * var1;
      Class235.aClass550_Sub2_2792.anInt7425 = 1221545435;
      Class235.aClass550_Sub2_2792.anInt7423 = 1177895915;
      return Class235.aClass550_Sub2_2792;
   }

   static final void method8375(Class508 var0, int var1) {
      Class441.method7415(var0.aClass515_Sub1_Sub1_Sub1_6017, var0.anIntArray6027[(var0.anInt6003 -= 98312473) * -937710807], 1347766832);
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = (int)client.aFloatArray7680[0];
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = (int)client.aFloatArray7680[1];
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = (int)client.aFloatArray7680[2];
   }
}
