import java.nio.ByteBuffer;
import java.util.Arrays;

public abstract class Class482 {

   static Class124[] aClass124Array5861;


   public static byte[] method8097(Object var0, boolean var1) {
      if(var0 == null) {
         return null;
      } else if(var0 instanceof byte[]) {
         byte[] var4 = (byte[])((byte[])var0);
         return var1?Arrays.copyOf(var4, var4.length):var4;
      } else if(var0 instanceof ByteBuffer) {
         ByteBuffer var2 = (ByteBuffer)var0;
         byte[] var3 = new byte[var2.capacity()];
         var2.position(0);
         var2.get(var3);
         return var3;
      } else {
         throw new IllegalArgumentException();
      }
   }

   public static Object method8098(byte[] var0, boolean var1) {
      if(var0 == null) {
         return null;
      } else if(var0.length > 136) {
         ByteBuffer var2 = ByteBuffer.allocateDirect(var0.length);
         var2.position(0);
         var2.put(var0);
         return var2;
      } else {
         return var1?Arrays.copyOf(var0, var0.length):var0;
      }
   }

   public static Object method8099(byte[] var0, boolean var1) {
      if(var0 == null) {
         return null;
      } else if(var0.length > 136) {
         ByteBuffer var2 = ByteBuffer.allocateDirect(var0.length);
         var2.position(0);
         var2.put(var0);
         return var2;
      } else {
         return var1?Arrays.copyOf(var0, var0.length):var0;
      }
   }

   public static byte[] method8100(Object var0, boolean var1) {
      if(var0 == null) {
         return null;
      } else if(var0 instanceof byte[]) {
         byte[] var4 = (byte[])((byte[])var0);
         return var1?Arrays.copyOf(var4, var4.length):var4;
      } else if(var0 instanceof ByteBuffer) {
         ByteBuffer var2 = (ByteBuffer)var0;
         byte[] var3 = new byte[var2.capacity()];
         var2.position(0);
         var2.get(var3);
         return var3;
      } else {
         throw new IllegalArgumentException();
      }
   }

   public static byte[] method8101(Object var0, int var1, int var2) {
      if(var0 == null) {
         return null;
      } else if(var0 instanceof byte[]) {
         byte[] var5 = (byte[])((byte[])var0);
         return Arrays.copyOfRange(var5, var1, var2 + var1);
      } else if(var0 instanceof ByteBuffer) {
         ByteBuffer var3 = (ByteBuffer)var0;
         byte[] var4 = new byte[var2];
         var3.position(var1);
         var3.get(var4, 0, var2);
         return var4;
      } else {
         throw new IllegalArgumentException();
      }
   }

   public static byte[] method8102(Object var0, boolean var1) {
      if(var0 == null) {
         return null;
      } else if(var0 instanceof byte[]) {
         byte[] var4 = (byte[])((byte[])var0);
         return var1?Arrays.copyOf(var4, var4.length):var4;
      } else if(var0 instanceof ByteBuffer) {
         ByteBuffer var2 = (ByteBuffer)var0;
         byte[] var3 = new byte[var2.capacity()];
         var2.position(0);
         var2.get(var3);
         return var3;
      } else {
         throw new IllegalArgumentException();
      }
   }

   public static byte[] method8103(Object var0, boolean var1) {
      if(var0 == null) {
         return null;
      } else if(var0 instanceof byte[]) {
         byte[] var4 = (byte[])((byte[])var0);
         return var1?Arrays.copyOf(var4, var4.length):var4;
      } else if(var0 instanceof ByteBuffer) {
         ByteBuffer var2 = (ByteBuffer)var0;
         byte[] var3 = new byte[var2.capacity()];
         var2.position(0);
         var2.get(var3);
         return var3;
      } else {
         throw new IllegalArgumentException();
      }
   }

   public static byte[] method8104(Object var0, int var1, int var2) {
      if(var0 == null) {
         return null;
      } else if(var0 instanceof byte[]) {
         byte[] var5 = (byte[])((byte[])var0);
         return Arrays.copyOfRange(var5, var1, var2 + var1);
      } else if(var0 instanceof ByteBuffer) {
         ByteBuffer var3 = (ByteBuffer)var0;
         byte[] var4 = new byte[var2];
         var3.position(var1);
         var3.get(var4, 0, var2);
         return var4;
      } else {
         throw new IllegalArgumentException();
      }
   }

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

   public static byte[] method8105(Object var0, int var1, int var2) {
      if(var0 == null) {
         return null;
      } else if(var0 instanceof byte[]) {
         byte[] var5 = (byte[])((byte[])var0);
         return Arrays.copyOfRange(var5, var1, var2 + var1);
      } else if(var0 instanceof ByteBuffer) {
         ByteBuffer var3 = (ByteBuffer)var0;
         byte[] var4 = new byte[var2];
         var3.position(var1);
         var3.get(var4, 0, var2);
         return var4;
      } else {
         throw new IllegalArgumentException();
      }
   }

   static final void method8106(Class508 var0, byte var1) {
      int var2 = var0.anIntArray6027[(var0.anInt6003 -= 98312473) * -937710807];
      Class505 var3;
      if(var0.aBool6014) {
         var3 = var0.aClass505_6011;
      } else {
         var3 = var0.aClass505_6010;
      }

      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = var3.method8432(var0.aClass515_Sub1_Sub4_Sub4_6021.aClass121_10789, var2, -1, -1659673467)?1:0;
   }

   public static final void method8107(byte var0) {
      for(int var1 = 0; var1 < 5; ++var1) {
         client.aBoolArray7910[var1] = false;
      }

      client.anInt7762 = -1356994629;
      client.anInt7732 = 661003371;
      Class554.anInt7440 = 0;
      Class355.anInt4476 = 0;
      Class225_Sub21_Sub5.anInt10087 = 1108306535;
      Class118_Sub2.anInt8212 = 110956583;
      Class109.anInt1086 = -887729361;
   }
}
