import java.nio.ByteBuffer;

public class Class225_Sub13 extends Class225 {

   int anInt8539 = 0;
   Class545_Sub2 aClass545_Sub2_8540;
   float aFloat8541;
   long aLong8542;
   Class153 aClass153_8543;
   Interface35 anInterface35_8544;
   int anInt8545 = 0;
   int[] anIntArray8546;
   Class400_Sub2 aClass400_Sub2_8547;
   int anInt8548;
   int anInt8549 = 0;
   int anInt8550 = 0;


   void method13585(int[] var1, int var2) {
      this.anInt8539 = 0;
      this.anInt8550 = 32767;
      this.anInt8549 = -32768;
      ByteBuffer var3 = this.aClass545_Sub2_8540.aByteBuffer9763;

      for(int var4 = 0; var4 < var2; ++var4) {
         int var5 = var1[var4];
         short[] var6 = this.aClass400_Sub2_8547.aShortArrayArray9431[var5];
         int var7 = this.anIntArray8546[var5];
         if(var7 != 0 && var6 != null) {
            int var8 = 0;
            int var9 = 0;

            while(var9 < var6.length) {
               if((var7 & 1 << var8++) != 0) {
                  for(int var10 = 0; var10 < 3; ++var10) {
                     int var11 = var6[var9++] & '\uffff';
                     if(var11 > this.anInt8549) {
                        this.anInt8549 = var11;
                     }

                     if(var11 < this.anInt8550) {
                        this.anInt8550 = var11;
                     }

                     var3.putShort((short)var11);
                  }

                  this.anInt8539 += 3;
               } else {
                  var9 += 3;
               }
            }
         }
      }

   }

   void method13586(int var1) {
      this.anInterface35_8544 = this.aClass545_Sub2_8540.method15237(false);
      this.anInterface35_8544.method220(var1 * 4, 4);
      this.anInterface35_8544.method217(0, var1 * 4, this.aLong8542);
      this.aClass545_Sub2_8540.anUnsafe9632.freeMemory(this.aLong8542);
   }

   void method13587(int var1) {
      this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 3L, (byte)-1);
   }

   void method13588(int var1, int var2, int var3) {
      this.anIntArray8546[var2 * this.aClass400_Sub2_8547.anInt4911 * 1724373523 + var1] |= 1 << var3;
      ++this.anInt8545;
   }

   void method13589(int var1, int var2, int var3, float var4) {
      int var6;
      int var7;
      if(this.anInt8548 != -1) {
         Class161 var5 = this.aClass545_Sub2_8540.anInterface24_7370.method113(this.anInt8548, 1635511282);
         var6 = var5.aByte1990 & 255;
         int var9;
         if(var6 != 0 && var5.aByte1986 != 4) {
            if(var3 < 0) {
               var7 = 0;
            } else if(var3 > 127) {
               var7 = 16777215;
            } else {
               var7 = 131586 * var3;
            }

            if(var6 == 256) {
               var2 = var7;
            } else {
               var9 = 256 - var6;
               var2 = ((var7 & 16711935) * var6 + (var2 & 16711935) * var9 & -16711936) + ((var7 & '\uff00') * var6 + (var2 & '\uff00') * var9 & 16711680) >> 8;
            }
         }

         var7 = var5.aByte1991 & 255;
         if(var7 != 0) {
            var7 += 256;
            int var8 = ((var2 & 16711680) >> 16) * var7;
            if(var8 > '\uffff') {
               var8 = '\uffff';
            }

            var9 = ((var2 & '\uff00') >> 8) * var7;
            if(var9 > '\uffff') {
               var9 = '\uffff';
            }

            int var10 = (var2 & 255) * var7;
            if(var10 > '\uffff') {
               var10 = '\uffff';
            }

            var2 = (var8 << 8 & 16711680) + (var9 & '\uff00') + (var10 >> 8);
         }
      }

      if(var4 != 1.0F) {
         int var11 = var2 >> 16 & 255;
         var6 = var2 >> 8 & 255;
         var7 = var2 & 255;
         var11 = (int)((float)var11 * var4);
         if(var11 < 0) {
            var11 = 0;
         } else if(var11 > 255) {
            var11 = 255;
         }

         var6 = (int)((float)var6 * var4);
         if(var6 < 0) {
            var6 = 0;
         } else if(var6 > 255) {
            var6 = 255;
         }

         var7 = (int)((float)var7 * var4);
         if(var7 < 0) {
            var7 = 0;
         } else if(var7 > 255) {
            var7 = 255;
         }

         var2 = var11 << 16 | var6 << 8 | var7;
      }

      if(this.aClass545_Sub2_8540.anInt9762 == 0) {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 0L, (byte)(var2 >> 16));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 1L, (byte)(var2 >> 8));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 2L, (byte)var2);
      } else {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 0L, (byte)var2);
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 1L, (byte)(var2 >> 8));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 2L, (byte)(var2 >> 16));
      }

   }

   Class225_Sub13(Class400_Sub2 var1, int var2, int var3, Class153 var4) {
      this.aClass400_Sub2_8547 = var1;
      this.aClass545_Sub2_8540 = this.aClass400_Sub2_8547.aClass545_Sub2_9457;
      this.anInt8548 = var2;
      this.aFloat8541 = (float)var3;
      this.aClass153_8543 = var4;
      this.anIntArray8546 = new int[this.aClass400_Sub2_8547.anInt4911 * 1724373523 * this.aClass400_Sub2_8547.anInt4908 * 1696648095];
      byte var5 = 10;
      if(var2 >= 0) {
         Class161 var6 = this.aClass545_Sub2_8540.anInterface24_7370.method113(var2, -1598931250);
         if(var6.aByte1986 > 0) {
            var5 = var6.aByte1986;
         }
      }

      this.aClass545_Sub2_8540.method14974(var5);
      this.aClass545_Sub2_8540.method14974(3);
   }

   void method13590(int var1) {
      this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 3L, (byte)-1);
   }

   void method13591(int var1) {
      this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 3L, (byte)-1);
   }

   void method13592(int var1) {
      this.aLong8542 = this.aClass545_Sub2_8540.anUnsafe9632.allocateMemory((long)(var1 * 4));

      for(int var2 = 3; var2 < var1 * 4; var2 += 4) {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)var2, (byte)0);
      }

   }

   void method13593(int var1) {
      this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 3L, (byte)-1);
   }

   void method13594(int var1) {
      this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 3L, (byte)-1);
   }

   void method13595(int var1) {
      this.aLong8542 = this.aClass545_Sub2_8540.anUnsafe9632.allocateMemory((long)(var1 * 4));

      for(int var2 = 3; var2 < var1 * 4; var2 += 4) {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)var2, (byte)0);
      }

   }

   void method13596(int var1, int var2, int var3) {
      this.anIntArray8546[var2 * this.aClass400_Sub2_8547.anInt4911 * 1724373523 + var1] |= 1 << var3;
      ++this.anInt8545;
   }

   void method13597(int var1, int var2, int var3) {
      this.anIntArray8546[var2 * this.aClass400_Sub2_8547.anInt4911 * 1724373523 + var1] |= 1 << var3;
      ++this.anInt8545;
   }

   void method13598(int var1, int var2, int var3, float var4) {
      int var6;
      int var7;
      if(this.anInt8548 != -1) {
         Class161 var5 = this.aClass545_Sub2_8540.anInterface24_7370.method113(this.anInt8548, 1774544581);
         var6 = var5.aByte1990 & 255;
         int var9;
         if(var6 != 0 && var5.aByte1986 != 4) {
            if(var3 < 0) {
               var7 = 0;
            } else if(var3 > 127) {
               var7 = 16777215;
            } else {
               var7 = 131586 * var3;
            }

            if(var6 == 256) {
               var2 = var7;
            } else {
               var9 = 256 - var6;
               var2 = ((var7 & 16711935) * var6 + (var2 & 16711935) * var9 & -16711936) + ((var7 & '\uff00') * var6 + (var2 & '\uff00') * var9 & 16711680) >> 8;
            }
         }

         var7 = var5.aByte1991 & 255;
         if(var7 != 0) {
            var7 += 256;
            int var8 = ((var2 & 16711680) >> 16) * var7;
            if(var8 > '\uffff') {
               var8 = '\uffff';
            }

            var9 = ((var2 & '\uff00') >> 8) * var7;
            if(var9 > '\uffff') {
               var9 = '\uffff';
            }

            int var10 = (var2 & 255) * var7;
            if(var10 > '\uffff') {
               var10 = '\uffff';
            }

            var2 = (var8 << 8 & 16711680) + (var9 & '\uff00') + (var10 >> 8);
         }
      }

      if(var4 != 1.0F) {
         int var11 = var2 >> 16 & 255;
         var6 = var2 >> 8 & 255;
         var7 = var2 & 255;
         var11 = (int)((float)var11 * var4);
         if(var11 < 0) {
            var11 = 0;
         } else if(var11 > 255) {
            var11 = 255;
         }

         var6 = (int)((float)var6 * var4);
         if(var6 < 0) {
            var6 = 0;
         } else if(var6 > 255) {
            var6 = 255;
         }

         var7 = (int)((float)var7 * var4);
         if(var7 < 0) {
            var7 = 0;
         } else if(var7 > 255) {
            var7 = 255;
         }

         var2 = var11 << 16 | var6 << 8 | var7;
      }

      if(this.aClass545_Sub2_8540.anInt9762 == 0) {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 0L, (byte)(var2 >> 16));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 1L, (byte)(var2 >> 8));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 2L, (byte)var2);
      } else {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 0L, (byte)var2);
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 1L, (byte)(var2 >> 8));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 2L, (byte)(var2 >> 16));
      }

   }

   void method13599(int var1, int var2, int var3, float var4) {
      int var6;
      int var7;
      if(this.anInt8548 != -1) {
         Class161 var5 = this.aClass545_Sub2_8540.anInterface24_7370.method113(this.anInt8548, 1671792023);
         var6 = var5.aByte1990 & 255;
         int var9;
         if(var6 != 0 && var5.aByte1986 != 4) {
            if(var3 < 0) {
               var7 = 0;
            } else if(var3 > 127) {
               var7 = 16777215;
            } else {
               var7 = 131586 * var3;
            }

            if(var6 == 256) {
               var2 = var7;
            } else {
               var9 = 256 - var6;
               var2 = ((var7 & 16711935) * var6 + (var2 & 16711935) * var9 & -16711936) + ((var7 & '\uff00') * var6 + (var2 & '\uff00') * var9 & 16711680) >> 8;
            }
         }

         var7 = var5.aByte1991 & 255;
         if(var7 != 0) {
            var7 += 256;
            int var8 = ((var2 & 16711680) >> 16) * var7;
            if(var8 > '\uffff') {
               var8 = '\uffff';
            }

            var9 = ((var2 & '\uff00') >> 8) * var7;
            if(var9 > '\uffff') {
               var9 = '\uffff';
            }

            int var10 = (var2 & 255) * var7;
            if(var10 > '\uffff') {
               var10 = '\uffff';
            }

            var2 = (var8 << 8 & 16711680) + (var9 & '\uff00') + (var10 >> 8);
         }
      }

      if(var4 != 1.0F) {
         int var11 = var2 >> 16 & 255;
         var6 = var2 >> 8 & 255;
         var7 = var2 & 255;
         var11 = (int)((float)var11 * var4);
         if(var11 < 0) {
            var11 = 0;
         } else if(var11 > 255) {
            var11 = 255;
         }

         var6 = (int)((float)var6 * var4);
         if(var6 < 0) {
            var6 = 0;
         } else if(var6 > 255) {
            var6 = 255;
         }

         var7 = (int)((float)var7 * var4);
         if(var7 < 0) {
            var7 = 0;
         } else if(var7 > 255) {
            var7 = 255;
         }

         var2 = var11 << 16 | var6 << 8 | var7;
      }

      if(this.aClass545_Sub2_8540.anInt9762 == 0) {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 0L, (byte)(var2 >> 16));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 1L, (byte)(var2 >> 8));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 2L, (byte)var2);
      } else {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 0L, (byte)var2);
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 1L, (byte)(var2 >> 8));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 2L, (byte)(var2 >> 16));
      }

   }

   void method13600(int var1, int var2, int var3, float var4) {
      int var6;
      int var7;
      if(this.anInt8548 != -1) {
         Class161 var5 = this.aClass545_Sub2_8540.anInterface24_7370.method113(this.anInt8548, 1569330971);
         var6 = var5.aByte1990 & 255;
         int var9;
         if(var6 != 0 && var5.aByte1986 != 4) {
            if(var3 < 0) {
               var7 = 0;
            } else if(var3 > 127) {
               var7 = 16777215;
            } else {
               var7 = 131586 * var3;
            }

            if(var6 == 256) {
               var2 = var7;
            } else {
               var9 = 256 - var6;
               var2 = ((var7 & 16711935) * var6 + (var2 & 16711935) * var9 & -16711936) + ((var7 & '\uff00') * var6 + (var2 & '\uff00') * var9 & 16711680) >> 8;
            }
         }

         var7 = var5.aByte1991 & 255;
         if(var7 != 0) {
            var7 += 256;
            int var8 = ((var2 & 16711680) >> 16) * var7;
            if(var8 > '\uffff') {
               var8 = '\uffff';
            }

            var9 = ((var2 & '\uff00') >> 8) * var7;
            if(var9 > '\uffff') {
               var9 = '\uffff';
            }

            int var10 = (var2 & 255) * var7;
            if(var10 > '\uffff') {
               var10 = '\uffff';
            }

            var2 = (var8 << 8 & 16711680) + (var9 & '\uff00') + (var10 >> 8);
         }
      }

      if(var4 != 1.0F) {
         int var11 = var2 >> 16 & 255;
         var6 = var2 >> 8 & 255;
         var7 = var2 & 255;
         var11 = (int)((float)var11 * var4);
         if(var11 < 0) {
            var11 = 0;
         } else if(var11 > 255) {
            var11 = 255;
         }

         var6 = (int)((float)var6 * var4);
         if(var6 < 0) {
            var6 = 0;
         } else if(var6 > 255) {
            var6 = 255;
         }

         var7 = (int)((float)var7 * var4);
         if(var7 < 0) {
            var7 = 0;
         } else if(var7 > 255) {
            var7 = 255;
         }

         var2 = var11 << 16 | var6 << 8 | var7;
      }

      if(this.aClass545_Sub2_8540.anInt9762 == 0) {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 0L, (byte)(var2 >> 16));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 1L, (byte)(var2 >> 8));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 2L, (byte)var2);
      } else {
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 0L, (byte)var2);
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 1L, (byte)(var2 >> 8));
         this.aClass545_Sub2_8540.anUnsafe9632.putByte(this.aLong8542 + (long)(var1 * 4) + 2L, (byte)(var2 >> 16));
      }

   }

   void method13601(int var1) {
      this.anInterface35_8544 = this.aClass545_Sub2_8540.method15237(false);
      this.anInterface35_8544.method220(var1 * 4, 4);
      this.anInterface35_8544.method217(0, var1 * 4, this.aLong8542);
      this.aClass545_Sub2_8540.anUnsafe9632.freeMemory(this.aLong8542);
   }
}
