import java.nio.ByteBuffer;

public class Class346 {

   Class341 aClass341_4409;
   Interface35 anInterface35_4410;
   Interface35 anInterface35_4411;
   Interface40 anInterface40_4412;
   int anInt4413 = 64;
   int anInt4414 = Class188.method3314(1600, 1836166398);
   int anInt4415 = 1600;
   int anInt4416 = 768;
   int anInt4417 = 0;
   int[] anIntArray4418 = new int[8191];
   int[] anIntArray4419 = new int[1600];
   int[] anIntArray4420 = new int[64];
   Class222_Sub1_Sub1[][] aClass222_Sub1_Sub1ArrayArray4421 = new Class222_Sub1_Sub1[1600][64];
   int anInt4422 = 64;
   Class222_Sub1_Sub1[][] aClass222_Sub1_Sub1ArrayArray4423 = new Class222_Sub1_Sub1[64][768];
   static float aFloat4424;


   void method6325(Class545_Sub2 var1) {
      this.anInterface35_4411.method220(786336, 24);
   }

   void method6326(Class545_Sub2 var1, Class222_Sub1 var2, int var3, int var4, int var5, Class70 var6) {
      Class222_Sub1 var7 = var2.aClass222_Sub1_8670;
      int var8 = 0;
      int var9 = -2;
      boolean var10 = true;

      for(boolean var11 = true; var7 != var2; this.method6331(var1, var3)) {
         this.anInt4417 = 0;

         int var12;
         for(var12 = 0; var12 < var3; ++var12) {
            this.anIntArray4419[var12] = 0;
         }

         for(var12 = 0; var12 < 64; ++var12) {
            this.anIntArray4420[var12] = 0;
         }

         while(var7 != var2) {
            Class222_Sub1_Sub1 var13 = (Class222_Sub1_Sub1)var7;
            if(var11) {
               var9 = var13.anInt10060;
               var10 = var13.aBool10068;
               var11 = false;
            }

            if(var8 > 0 && (var9 != var13.anInt10060 || var10 != var13.aBool10068)) {
               var11 = true;
               break;
            }

            this.method6330(this.anIntArray4418[var8++] - var4 >> var5, var13);
            var7 = var7.aClass222_Sub1_8670;
         }

         var6.anInterface33_683 = var9 >= 0?var1.aClass58_9721.method1269(var9):null;
         if(var10 && var1.aFloat9760 != aFloat4424) {
            var1.IA(aFloat4424);
         } else if(var1.aFloat9760 != 1.0F) {
            var1.IA(1.0F);
         }
      }

   }

   void method6327() {
      this.anInterface35_4411.method10();
   }

   void method6328(int var1, Class222_Sub1_Sub1 var2) {
      if(var1 < 1600) {
         if(this.anIntArray4419[var1] < 64) {
            this.aClass222_Sub1_Sub1ArrayArray4421[var1][this.anIntArray4419[var1]++] = var2;
         } else {
            if(this.anIntArray4419[var1] == 64) {
               if(this.anInt4417 == 64) {
                  return;
               }

               this.anIntArray4419[var1] += 1 + this.anInt4417++;
            }

            Class222_Sub1_Sub1[] var10000 = this.aClass222_Sub1_Sub1ArrayArray4423[this.anIntArray4419[var1] - 64 - 1];
            int var10002 = this.anIntArray4419[var1] - 64 - 1;
            int var10004 = this.anIntArray4420[this.anIntArray4419[var1] - 64 - 1];
            this.anIntArray4420[var10002] = this.anIntArray4420[this.anIntArray4419[var1] - 64 - 1] + 1;
            var10000[var10004] = var2;
         }
      }

   }

   void method6329() {
      this.anInterface35_4411.method10();
   }

   void method6330(int var1, Class222_Sub1_Sub1 var2) {
      if(var1 < 1600) {
         if(this.anIntArray4419[var1] < 64) {
            this.aClass222_Sub1_Sub1ArrayArray4421[var1][this.anIntArray4419[var1]++] = var2;
         } else {
            if(this.anIntArray4419[var1] == 64) {
               if(this.anInt4417 == 64) {
                  return;
               }

               this.anIntArray4419[var1] += 1 + this.anInt4417++;
            }

            Class222_Sub1_Sub1[] var10000 = this.aClass222_Sub1_Sub1ArrayArray4423[this.anIntArray4419[var1] - 64 - 1];
            int var10002 = this.anIntArray4419[var1] - 64 - 1;
            int var10004 = this.anIntArray4420[this.anIntArray4419[var1] - 64 - 1];
            this.anIntArray4420[var10002] = this.anIntArray4420[this.anIntArray4419[var1] - 64 - 1] + 1;
            var10000[var10004] = var2;
         }
      }

   }

   void method6331(Class545_Sub2 var1, int var2) {
      int var3 = 0;
      Class317 var4 = var1.aClass317_9766;
      float var5 = var4.aFloatArray4000[0];
      float var6 = var4.aFloatArray4000[4];
      float var7 = var4.aFloatArray4000[8];
      float var8 = var4.aFloatArray4000[1];
      float var9 = var4.aFloatArray4000[5];
      float var10 = var4.aFloatArray4000[9];
      float var11 = var5 + var8;
      float var12 = var6 + var9;
      float var13 = var7 + var10;
      float var14 = var5 - var8;
      float var15 = var6 - var9;
      float var16 = var7 - var10;
      float var17 = var8 - var5;
      float var18 = var9 - var6;
      float var19 = var10 - var7;
      float[] var20 = new float[3];
      float[] var21 = new float[3];
      var1.aClass317_9649.method5610(var1.aClass317_9695);
      ByteBuffer var22 = var1.aByteBuffer9763;
      var22.clear();

      for(int var23 = var2 - 1; var23 >= 0; --var23) {
         int var24 = this.anIntArray4419[var23] > 64?64:this.anIntArray4419[var23];
         if(var24 > 0) {
            int var25;
            byte var29;
            byte var31;
            byte var30;
            float var34;
            byte var32;
            float var33;
            for(var25 = var24 - 1; var25 >= 0; --var25) {
               Class222_Sub1_Sub1 var26 = this.aClass222_Sub1_Sub1ArrayArray4421[var23][var25];
               int var27 = var26.anInt10061;
               byte var28 = (byte)(var27 >> 16);
               var29 = (byte)(var27 >> 8);
               var30 = (byte)var27;
               var31 = (byte)(var27 >>> 24);
               if(var1.anInt9762 == 0) {
                  var32 = var28;
                  var28 = var30;
                  var30 = var32;
               }

               float var42 = (float)(var26.anInt10062 >> 12);
               var33 = (float)(var26.anInt10066 >> 12);
               var34 = (float)(var26.anInt10059 >> 12);
               int var35 = var26.anInt10065 >> 12;
               if(var26.aShort10064 != 0) {
                  var1.aClass317_9624.method5643(var26.aShort10064, var35, var35, 0.0F, 0.0F, 0.0F);
                  var1.aClass317_9624.method5612(var1.aClass317_9649);
                  var1.aClass317_9624.method5618(1.0F, 0.0F, 0.0F, var20);
                  var1.aClass317_9624.method5618(0.0F, 1.0F, 0.0F, var21);
                  var22.putFloat(var42 - var20[0] - var21[0]);
                  var22.putFloat(var33 - var20[1] - var21[1]);
                  var22.putFloat(var34 - var20[2] - var21[2]);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(0.0F);
                  var22.putFloat(0.0F);
                  var22.putFloat(var42 - var20[0] + var21[0]);
                  var22.putFloat(var33 - var20[1] + var21[1]);
                  var22.putFloat(var34 - var20[2] + var21[2]);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(0.0F);
                  var22.putFloat(1.0F);
                  var22.putFloat(var42 + var20[0] + var21[0]);
                  var22.putFloat(var33 + var20[1] + var21[1]);
                  var22.putFloat(var34 + var20[2] + var21[2]);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(1.0F);
                  var22.putFloat(1.0F);
                  var22.putFloat(var42 + var20[0] - var21[0]);
                  var22.putFloat(var33 + var20[1] - var21[1]);
                  var22.putFloat(var34 + var20[2] - var21[2]);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(1.0F);
                  var22.putFloat(0.0F);
               } else {
                  var22.putFloat(var42 + var11 * (float)(-var35));
                  var22.putFloat(var33 + var12 * (float)(-var35));
                  var22.putFloat(var34 + var13 * (float)(-var35));
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(0.0F);
                  var22.putFloat(0.0F);
                  var22.putFloat(var42 + var17 * (float)var35);
                  var22.putFloat(var33 + var18 * (float)var35);
                  var22.putFloat(var34 + var19 * (float)var35);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(0.0F);
                  var22.putFloat(1.0F);
                  var22.putFloat(var42 + var11 * (float)var35);
                  var22.putFloat(var33 + var12 * (float)var35);
                  var22.putFloat(var34 + var13 * (float)var35);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(1.0F);
                  var22.putFloat(1.0F);
                  var22.putFloat(var42 + var14 * (float)var35);
                  var22.putFloat(var33 + var15 * (float)var35);
                  var22.putFloat(var34 + var16 * (float)var35);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(1.0F);
                  var22.putFloat(0.0F);
               }

               ++var3;
            }

            if(this.anIntArray4419[var23] > 64) {
               var25 = this.anIntArray4419[var23] - 64 - 1;

               for(int var39 = this.anIntArray4420[var25] - 1; var39 >= 0; --var39) {
                  Class222_Sub1_Sub1 var40 = this.aClass222_Sub1_Sub1ArrayArray4423[var25][var39];
                  int var41 = var40.anInt10061;
                  var29 = (byte)(var41 >> 16);
                  var30 = (byte)(var41 >> 8);
                  var31 = (byte)var41;
                  var32 = (byte)(var41 >>> 24);
                  var33 = (float)(var40.anInt10062 >> 12);
                  var34 = (float)(var40.anInt10066 >> 12);
                  float var43 = (float)(var40.anInt10059 >> 12);
                  int var36 = var40.anInt10065 >> 12;
                  if(var1.anInt9762 == 0) {
                     byte var37 = var29;
                     var29 = var31;
                     var31 = var37;
                  }

                  if(var40.aShort10064 != 0) {
                     var1.aClass317_9624.method5643(var40.aShort10064, var36, var36, 0.0F, 0.0F, 0.0F);
                     var1.aClass317_9624.method5612(var1.aClass317_9649);
                     var1.aClass317_9624.method5618(1.0F, 0.0F, 0.0F, var20);
                     var1.aClass317_9624.method5618(0.0F, 1.0F, 0.0F, var21);
                     var22.putFloat(var33 - var20[0] - var21[0]);
                     var22.putFloat(var34 - var20[1] - var21[1]);
                     var22.putFloat(var43 - var20[2] - var21[2]);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(0.0F);
                     var22.putFloat(0.0F);
                     var22.putFloat(var33 - var20[0] + var21[0]);
                     var22.putFloat(var34 - var20[1] + var21[1]);
                     var22.putFloat(var43 - var20[2] + var21[2]);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(0.0F);
                     var22.putFloat(1.0F);
                     var22.putFloat(var33 + var20[0] + var21[0]);
                     var22.putFloat(var34 + var20[1] + var21[1]);
                     var22.putFloat(var43 + var20[2] + var21[2]);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(1.0F);
                     var22.putFloat(1.0F);
                     var22.putFloat(var33 + var20[0] - var21[0]);
                     var22.putFloat(var34 + var20[1] - var21[1]);
                     var22.putFloat(var43 + var20[2] - var21[2]);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(1.0F);
                     var22.putFloat(0.0F);
                  } else {
                     var22.putFloat(var33 + var11 * (float)(-var36));
                     var22.putFloat(var34 + var12 * (float)(-var36));
                     var22.putFloat(var43 + var13 * (float)(-var36));
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(0.0F);
                     var22.putFloat(0.0F);
                     var22.putFloat(var33 + var17 * (float)var36);
                     var22.putFloat(var34 + var18 * (float)var36);
                     var22.putFloat(var43 + var19 * (float)var36);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(0.0F);
                     var22.putFloat(1.0F);
                     var22.putFloat(var33 + var11 * (float)var36);
                     var22.putFloat(var34 + var12 * (float)var36);
                     var22.putFloat(var43 + var13 * (float)var36);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(1.0F);
                     var22.putFloat(1.0F);
                     var22.putFloat(var33 + var14 * (float)var36);
                     var22.putFloat(var34 + var15 * (float)var36);
                     var22.putFloat(var43 + var16 * (float)var36);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(1.0F);
                     var22.putFloat(0.0F);
                  }

                  ++var3;
               }
            }
         }
      }

      this.anInterface35_4411.method217(0, var22.position(), var1.aLong9730);
      var1.method15078(0, this.anInterface35_4411);
      var1.method15078(1, this.anInterface35_4410);
      var1.method14991(this.aClass341_4409);
      Class70 var38 = var1.aClass70_9707;
      var38.method1480(var3);
   }

   void method6332(Class545_Sub2 var1) {
      this.anInterface35_4411.method220(786336, 24);
   }

   void method6333(Class545_Sub2 var1, Class97 var2) {
      var1.RA(false);
      aFloat4424 = var1.aFloat9760;
      float var3 = var1.aClass317_9766.aFloatArray4000[2];
      float var4 = var1.aClass317_9766.aFloatArray4000[6];
      float var5 = var1.aClass317_9766.aFloatArray4000[10];
      float var6 = var1.aClass317_9766.aFloatArray4000[14];
      int var7 = 0;
      int var8 = Integer.MAX_VALUE;
      int var9 = 0;
      Class222_Sub1 var10 = var2.aClass478_981.aClass222_Sub1_5840;

      int var13;
      for(Class222_Sub1 var11 = var10.aClass222_Sub1_8670; var11 != var10; var11 = var11.aClass222_Sub1_8670) {
         Class222_Sub1_Sub1 var12 = (Class222_Sub1_Sub1)var11;
         var13 = (int)(var3 * (float)(var12.anInt10062 >> 12) + var4 * (float)(var12.anInt10066 >> 12) + var5 * (float)(var12.anInt10059 >> 12) + var6);
         if(var13 > var9) {
            var9 = var13;
         }

         if(var13 < var8) {
            var8 = var13;
         }

         this.anIntArray4418[var7++] = var13;
      }

      int var15 = var9 - var8;
      if(var15 + 2 > 1600) {
         var13 = 1 + Class188.method3314(var15, 1928512670) - this.anInt4414;
         var15 = (var15 >> var13) + 2;
      } else {
         var13 = 0;
         var15 += 2;
      }

      var1.method15079(this.anInterface40_4412);
      Class70 var14 = var1.aClass70_9707;
      var14.method1483(Class317.aClass317_3999);
      var14.aClass317_681.method5733();
      var14.anInt684 = -1;
      this.method6339(var1, var10, var15, var8, var13, var14);
      if(var1.aFloat9760 != aFloat4424) {
         var1.IA(aFloat4424);
      }

      var1.RA(true);
   }

   void method6334() {
      this.anInterface35_4411.method10();
   }

   void method6335() {
      this.anInterface35_4411.method10();
   }

   void method6336(Class545_Sub2 var1, Class97 var2) {
      var1.RA(false);
      aFloat4424 = var1.aFloat9760;
      float var3 = var1.aClass317_9766.aFloatArray4000[2];
      float var4 = var1.aClass317_9766.aFloatArray4000[6];
      float var5 = var1.aClass317_9766.aFloatArray4000[10];
      float var6 = var1.aClass317_9766.aFloatArray4000[14];
      int var7 = 0;
      int var8 = Integer.MAX_VALUE;
      int var9 = 0;
      Class222_Sub1 var10 = var2.aClass478_981.aClass222_Sub1_5840;

      int var13;
      for(Class222_Sub1 var11 = var10.aClass222_Sub1_8670; var11 != var10; var11 = var11.aClass222_Sub1_8670) {
         Class222_Sub1_Sub1 var12 = (Class222_Sub1_Sub1)var11;
         var13 = (int)(var3 * (float)(var12.anInt10062 >> 12) + var4 * (float)(var12.anInt10066 >> 12) + var5 * (float)(var12.anInt10059 >> 12) + var6);
         if(var13 > var9) {
            var9 = var13;
         }

         if(var13 < var8) {
            var8 = var13;
         }

         this.anIntArray4418[var7++] = var13;
      }

      int var15 = var9 - var8;
      if(var15 + 2 > 1600) {
         var13 = 1 + Class188.method3314(var15, -1450917004) - this.anInt4414;
         var15 = (var15 >> var13) + 2;
      } else {
         var13 = 0;
         var15 += 2;
      }

      var1.method15079(this.anInterface40_4412);
      Class70 var14 = var1.aClass70_9707;
      var14.method1483(Class317.aClass317_3999);
      var14.aClass317_681.method5733();
      var14.anInt684 = -1;
      this.method6339(var1, var10, var15, var8, var13, var14);
      if(var1.aFloat9760 != aFloat4424) {
         var1.IA(aFloat4424);
      }

      var1.RA(true);
   }

   void method6337(Class545_Sub2 var1, Class97 var2) {
      var1.RA(false);
      aFloat4424 = var1.aFloat9760;
      float var3 = var1.aClass317_9766.aFloatArray4000[2];
      float var4 = var1.aClass317_9766.aFloatArray4000[6];
      float var5 = var1.aClass317_9766.aFloatArray4000[10];
      float var6 = var1.aClass317_9766.aFloatArray4000[14];
      int var7 = 0;
      int var8 = Integer.MAX_VALUE;
      int var9 = 0;
      Class222_Sub1 var10 = var2.aClass478_981.aClass222_Sub1_5840;

      int var13;
      for(Class222_Sub1 var11 = var10.aClass222_Sub1_8670; var11 != var10; var11 = var11.aClass222_Sub1_8670) {
         Class222_Sub1_Sub1 var12 = (Class222_Sub1_Sub1)var11;
         var13 = (int)(var3 * (float)(var12.anInt10062 >> 12) + var4 * (float)(var12.anInt10066 >> 12) + var5 * (float)(var12.anInt10059 >> 12) + var6);
         if(var13 > var9) {
            var9 = var13;
         }

         if(var13 < var8) {
            var8 = var13;
         }

         this.anIntArray4418[var7++] = var13;
      }

      int var15 = var9 - var8;
      if(var15 + 2 > 1600) {
         var13 = 1 + Class188.method3314(var15, 1412046031) - this.anInt4414;
         var15 = (var15 >> var13) + 2;
      } else {
         var13 = 0;
         var15 += 2;
      }

      var1.method15079(this.anInterface40_4412);
      Class70 var14 = var1.aClass70_9707;
      var14.method1483(Class317.aClass317_3999);
      var14.aClass317_681.method5733();
      var14.anInt684 = -1;
      this.method6339(var1, var10, var15, var8, var13, var14);
      if(var1.aFloat9760 != aFloat4424) {
         var1.IA(aFloat4424);
      }

      var1.RA(true);
   }

   Class346(Class545_Sub2 var1) {
      this.aClass341_4409 = var1.method15076(new Class348[]{new Class348(new Class347[]{Class347.aClass347_4429, Class347.aClass347_4445, Class347.aClass347_4440}), new Class348(Class347.aClass347_4435)});
      this.anInterface35_4411 = var1.method15237(true);
      this.anInterface35_4410 = var1.method15237(false);
      this.anInterface35_4410.method220(393168, 12);
      this.anInterface40_4412 = var1.method15075(false);
      this.anInterface40_4412.method232('\ubffa');
      ByteBuffer var2 = var1.aByteBuffer9763;
      var2.clear();

      int var3;
      for(var3 = 0; var3 < 8191; ++var3) {
         int var4 = var3 * 4;
         var2.putShort((short)var4);
         var2.putShort((short)(var4 + 1));
         var2.putShort((short)(var4 + 2));
         var2.putShort((short)(var4 + 2));
         var2.putShort((short)(var4 + 3));
         var2.putShort((short)var4);
      }

      this.anInterface40_4412.method217(0, var2.position(), var1.aLong9730);
      var2.clear();

      for(var3 = 0; var3 < 8191; ++var3) {
         var2.putFloat(0.0F);
         var2.putFloat(-1.0F);
         var2.putFloat(0.0F);
         var2.putFloat(0.0F);
         var2.putFloat(-1.0F);
         var2.putFloat(0.0F);
         var2.putFloat(0.0F);
         var2.putFloat(-1.0F);
         var2.putFloat(0.0F);
         var2.putFloat(0.0F);
         var2.putFloat(-1.0F);
         var2.putFloat(0.0F);
      }

      this.anInterface35_4410.method217(0, var2.position(), var1.aLong9730);
   }

   void method6338(Class545_Sub2 var1, Class222_Sub1 var2, int var3, int var4, int var5, Class70 var6) {
      Class222_Sub1 var7 = var2.aClass222_Sub1_8670;
      int var8 = 0;
      int var9 = -2;
      boolean var10 = true;

      for(boolean var11 = true; var7 != var2; this.method6331(var1, var3)) {
         this.anInt4417 = 0;

         int var12;
         for(var12 = 0; var12 < var3; ++var12) {
            this.anIntArray4419[var12] = 0;
         }

         for(var12 = 0; var12 < 64; ++var12) {
            this.anIntArray4420[var12] = 0;
         }

         while(var7 != var2) {
            Class222_Sub1_Sub1 var13 = (Class222_Sub1_Sub1)var7;
            if(var11) {
               var9 = var13.anInt10060;
               var10 = var13.aBool10068;
               var11 = false;
            }

            if(var8 > 0 && (var9 != var13.anInt10060 || var10 != var13.aBool10068)) {
               var11 = true;
               break;
            }

            this.method6330(this.anIntArray4418[var8++] - var4 >> var5, var13);
            var7 = var7.aClass222_Sub1_8670;
         }

         var6.anInterface33_683 = var9 >= 0?var1.aClass58_9721.method1269(var9):null;
         if(var10 && var1.aFloat9760 != aFloat4424) {
            var1.IA(aFloat4424);
         } else if(var1.aFloat9760 != 1.0F) {
            var1.IA(1.0F);
         }
      }

   }

   void method6339(Class545_Sub2 var1, Class222_Sub1 var2, int var3, int var4, int var5, Class70 var6) {
      Class222_Sub1 var7 = var2.aClass222_Sub1_8670;
      int var8 = 0;
      int var9 = -2;
      boolean var10 = true;

      for(boolean var11 = true; var7 != var2; this.method6331(var1, var3)) {
         this.anInt4417 = 0;

         int var12;
         for(var12 = 0; var12 < var3; ++var12) {
            this.anIntArray4419[var12] = 0;
         }

         for(var12 = 0; var12 < 64; ++var12) {
            this.anIntArray4420[var12] = 0;
         }

         while(var7 != var2) {
            Class222_Sub1_Sub1 var13 = (Class222_Sub1_Sub1)var7;
            if(var11) {
               var9 = var13.anInt10060;
               var10 = var13.aBool10068;
               var11 = false;
            }

            if(var8 > 0 && (var9 != var13.anInt10060 || var10 != var13.aBool10068)) {
               var11 = true;
               break;
            }

            this.method6330(this.anIntArray4418[var8++] - var4 >> var5, var13);
            var7 = var7.aClass222_Sub1_8670;
         }

         var6.anInterface33_683 = var9 >= 0?var1.aClass58_9721.method1269(var9):null;
         if(var10 && var1.aFloat9760 != aFloat4424) {
            var1.IA(aFloat4424);
         } else if(var1.aFloat9760 != 1.0F) {
            var1.IA(1.0F);
         }
      }

   }

   void method6340(int var1, Class222_Sub1_Sub1 var2) {
      if(var1 < 1600) {
         if(this.anIntArray4419[var1] < 64) {
            this.aClass222_Sub1_Sub1ArrayArray4421[var1][this.anIntArray4419[var1]++] = var2;
         } else {
            if(this.anIntArray4419[var1] == 64) {
               if(this.anInt4417 == 64) {
                  return;
               }

               this.anIntArray4419[var1] += 1 + this.anInt4417++;
            }

            Class222_Sub1_Sub1[] var10000 = this.aClass222_Sub1_Sub1ArrayArray4423[this.anIntArray4419[var1] - 64 - 1];
            int var10002 = this.anIntArray4419[var1] - 64 - 1;
            int var10004 = this.anIntArray4420[this.anIntArray4419[var1] - 64 - 1];
            this.anIntArray4420[var10002] = this.anIntArray4420[this.anIntArray4419[var1] - 64 - 1] + 1;
            var10000[var10004] = var2;
         }
      }

   }

   void method6341(int var1, Class222_Sub1_Sub1 var2) {
      if(var1 < 1600) {
         if(this.anIntArray4419[var1] < 64) {
            this.aClass222_Sub1_Sub1ArrayArray4421[var1][this.anIntArray4419[var1]++] = var2;
         } else {
            if(this.anIntArray4419[var1] == 64) {
               if(this.anInt4417 == 64) {
                  return;
               }

               this.anIntArray4419[var1] += 1 + this.anInt4417++;
            }

            Class222_Sub1_Sub1[] var10000 = this.aClass222_Sub1_Sub1ArrayArray4423[this.anIntArray4419[var1] - 64 - 1];
            int var10002 = this.anIntArray4419[var1] - 64 - 1;
            int var10004 = this.anIntArray4420[this.anIntArray4419[var1] - 64 - 1];
            this.anIntArray4420[var10002] = this.anIntArray4420[this.anIntArray4419[var1] - 64 - 1] + 1;
            var10000[var10004] = var2;
         }
      }

   }

   void method6342(Class545_Sub2 var1, int var2) {
      int var3 = 0;
      Class317 var4 = var1.aClass317_9766;
      float var5 = var4.aFloatArray4000[0];
      float var6 = var4.aFloatArray4000[4];
      float var7 = var4.aFloatArray4000[8];
      float var8 = var4.aFloatArray4000[1];
      float var9 = var4.aFloatArray4000[5];
      float var10 = var4.aFloatArray4000[9];
      float var11 = var5 + var8;
      float var12 = var6 + var9;
      float var13 = var7 + var10;
      float var14 = var5 - var8;
      float var15 = var6 - var9;
      float var16 = var7 - var10;
      float var17 = var8 - var5;
      float var18 = var9 - var6;
      float var19 = var10 - var7;
      float[] var20 = new float[3];
      float[] var21 = new float[3];
      var1.aClass317_9649.method5610(var1.aClass317_9695);
      ByteBuffer var22 = var1.aByteBuffer9763;
      var22.clear();

      for(int var23 = var2 - 1; var23 >= 0; --var23) {
         int var24 = this.anIntArray4419[var23] > 64?64:this.anIntArray4419[var23];
         if(var24 > 0) {
            int var25;
            byte var29;
            byte var31;
            byte var30;
            float var34;
            byte var32;
            float var33;
            for(var25 = var24 - 1; var25 >= 0; --var25) {
               Class222_Sub1_Sub1 var26 = this.aClass222_Sub1_Sub1ArrayArray4421[var23][var25];
               int var27 = var26.anInt10061;
               byte var28 = (byte)(var27 >> 16);
               var29 = (byte)(var27 >> 8);
               var30 = (byte)var27;
               var31 = (byte)(var27 >>> 24);
               if(var1.anInt9762 == 0) {
                  var32 = var28;
                  var28 = var30;
                  var30 = var32;
               }

               float var42 = (float)(var26.anInt10062 >> 12);
               var33 = (float)(var26.anInt10066 >> 12);
               var34 = (float)(var26.anInt10059 >> 12);
               int var35 = var26.anInt10065 >> 12;
               if(var26.aShort10064 != 0) {
                  var1.aClass317_9624.method5643(var26.aShort10064, var35, var35, 0.0F, 0.0F, 0.0F);
                  var1.aClass317_9624.method5612(var1.aClass317_9649);
                  var1.aClass317_9624.method5618(1.0F, 0.0F, 0.0F, var20);
                  var1.aClass317_9624.method5618(0.0F, 1.0F, 0.0F, var21);
                  var22.putFloat(var42 - var20[0] - var21[0]);
                  var22.putFloat(var33 - var20[1] - var21[1]);
                  var22.putFloat(var34 - var20[2] - var21[2]);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(0.0F);
                  var22.putFloat(0.0F);
                  var22.putFloat(var42 - var20[0] + var21[0]);
                  var22.putFloat(var33 - var20[1] + var21[1]);
                  var22.putFloat(var34 - var20[2] + var21[2]);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(0.0F);
                  var22.putFloat(1.0F);
                  var22.putFloat(var42 + var20[0] + var21[0]);
                  var22.putFloat(var33 + var20[1] + var21[1]);
                  var22.putFloat(var34 + var20[2] + var21[2]);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(1.0F);
                  var22.putFloat(1.0F);
                  var22.putFloat(var42 + var20[0] - var21[0]);
                  var22.putFloat(var33 + var20[1] - var21[1]);
                  var22.putFloat(var34 + var20[2] - var21[2]);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(1.0F);
                  var22.putFloat(0.0F);
               } else {
                  var22.putFloat(var42 + var11 * (float)(-var35));
                  var22.putFloat(var33 + var12 * (float)(-var35));
                  var22.putFloat(var34 + var13 * (float)(-var35));
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(0.0F);
                  var22.putFloat(0.0F);
                  var22.putFloat(var42 + var17 * (float)var35);
                  var22.putFloat(var33 + var18 * (float)var35);
                  var22.putFloat(var34 + var19 * (float)var35);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(0.0F);
                  var22.putFloat(1.0F);
                  var22.putFloat(var42 + var11 * (float)var35);
                  var22.putFloat(var33 + var12 * (float)var35);
                  var22.putFloat(var34 + var13 * (float)var35);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(1.0F);
                  var22.putFloat(1.0F);
                  var22.putFloat(var42 + var14 * (float)var35);
                  var22.putFloat(var33 + var15 * (float)var35);
                  var22.putFloat(var34 + var16 * (float)var35);
                  var22.put(var28);
                  var22.put(var29);
                  var22.put(var30);
                  var22.put(var31);
                  var22.putFloat(1.0F);
                  var22.putFloat(0.0F);
               }

               ++var3;
            }

            if(this.anIntArray4419[var23] > 64) {
               var25 = this.anIntArray4419[var23] - 64 - 1;

               for(int var39 = this.anIntArray4420[var25] - 1; var39 >= 0; --var39) {
                  Class222_Sub1_Sub1 var40 = this.aClass222_Sub1_Sub1ArrayArray4423[var25][var39];
                  int var41 = var40.anInt10061;
                  var29 = (byte)(var41 >> 16);
                  var30 = (byte)(var41 >> 8);
                  var31 = (byte)var41;
                  var32 = (byte)(var41 >>> 24);
                  var33 = (float)(var40.anInt10062 >> 12);
                  var34 = (float)(var40.anInt10066 >> 12);
                  float var43 = (float)(var40.anInt10059 >> 12);
                  int var36 = var40.anInt10065 >> 12;
                  if(var1.anInt9762 == 0) {
                     byte var37 = var29;
                     var29 = var31;
                     var31 = var37;
                  }

                  if(var40.aShort10064 != 0) {
                     var1.aClass317_9624.method5643(var40.aShort10064, var36, var36, 0.0F, 0.0F, 0.0F);
                     var1.aClass317_9624.method5612(var1.aClass317_9649);
                     var1.aClass317_9624.method5618(1.0F, 0.0F, 0.0F, var20);
                     var1.aClass317_9624.method5618(0.0F, 1.0F, 0.0F, var21);
                     var22.putFloat(var33 - var20[0] - var21[0]);
                     var22.putFloat(var34 - var20[1] - var21[1]);
                     var22.putFloat(var43 - var20[2] - var21[2]);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(0.0F);
                     var22.putFloat(0.0F);
                     var22.putFloat(var33 - var20[0] + var21[0]);
                     var22.putFloat(var34 - var20[1] + var21[1]);
                     var22.putFloat(var43 - var20[2] + var21[2]);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(0.0F);
                     var22.putFloat(1.0F);
                     var22.putFloat(var33 + var20[0] + var21[0]);
                     var22.putFloat(var34 + var20[1] + var21[1]);
                     var22.putFloat(var43 + var20[2] + var21[2]);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(1.0F);
                     var22.putFloat(1.0F);
                     var22.putFloat(var33 + var20[0] - var21[0]);
                     var22.putFloat(var34 + var20[1] - var21[1]);
                     var22.putFloat(var43 + var20[2] - var21[2]);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(1.0F);
                     var22.putFloat(0.0F);
                  } else {
                     var22.putFloat(var33 + var11 * (float)(-var36));
                     var22.putFloat(var34 + var12 * (float)(-var36));
                     var22.putFloat(var43 + var13 * (float)(-var36));
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(0.0F);
                     var22.putFloat(0.0F);
                     var22.putFloat(var33 + var17 * (float)var36);
                     var22.putFloat(var34 + var18 * (float)var36);
                     var22.putFloat(var43 + var19 * (float)var36);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(0.0F);
                     var22.putFloat(1.0F);
                     var22.putFloat(var33 + var11 * (float)var36);
                     var22.putFloat(var34 + var12 * (float)var36);
                     var22.putFloat(var43 + var13 * (float)var36);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(1.0F);
                     var22.putFloat(1.0F);
                     var22.putFloat(var33 + var14 * (float)var36);
                     var22.putFloat(var34 + var15 * (float)var36);
                     var22.putFloat(var43 + var16 * (float)var36);
                     var22.put(var29);
                     var22.put(var30);
                     var22.put(var31);
                     var22.put(var32);
                     var22.putFloat(1.0F);
                     var22.putFloat(0.0F);
                  }

                  ++var3;
               }
            }
         }
      }

      this.anInterface35_4411.method217(0, var22.position(), var1.aLong9730);
      var1.method15078(0, this.anInterface35_4411);
      var1.method15078(1, this.anInterface35_4410);
      var1.method14991(this.aClass341_4409);
      Class70 var38 = var1.aClass70_9707;
      var38.method1480(var3);
   }
}
