import java.nio.ByteBuffer;
import sun.misc.Unsafe;

public class Class225_Sub47 extends Class225 {

   Class225_Sub40 aClass225_Sub40_8815;
   Class400_Sub2 aClass400_Sub2_8816;
   int anInt8817 = 0;
   int anInt8818;
   Class545_Sub2 aClass545_Sub2_8819;
   int anInt8820;
   int anInt8821;
   Interface40 anInterface40_8822;
   int anInt8823 = 0;
   int anInt8824;
   float[][] aFloatArrayArray8825;
   Interface35 anInterface35_8826;
   int anInt8827 = 0;
   float[][] aFloatArrayArray8828;
   float[][] aFloatArrayArray8829;
   Class423 aClass423_8830;
   ByteBuffer aByteBuffer8831;


   void method14210(int var1, int var2, int var3, int var4, int var5, int var6) {
      long var7 = -1L;
      int var9 = var5 + (var3 << this.aClass400_Sub2_8816.anInt4909 * -1451148795);
      int var10 = var6 + (var4 << this.aClass400_Sub2_8816.anInt4909 * -1451148795);
      int var11 = this.aClass400_Sub2_8816.method6791(var9, var10, 701663251);
      if((var5 & 127) == 0 || (var6 & 127) == 0) {
         var7 = ((long)var10 & 65535L) << 16 | (long)var9 & 65535L;
         Class225 var12 = this.aClass423_8830.method7211(var7);
         if(var12 != null) {
            Unsafe var31 = this.aClass545_Sub2_8819.anUnsafe9632;
            var31.putShort(this.aClass545_Sub2_8819.aLong9730 + 2097152L + (long)(this.anInt8817 * 2), ((Class225_Sub18)var12).aShort8562);
            ++this.anInt8817;
            return;
         }
      }

      short var30 = (short)this.anInt8827;
      if(var7 != -1L) {
         this.aClass423_8830.method7206(new Class225_Sub18(var30), var7);
      }

      float var13;
      float var14;
      float var15;
      float var17;
      float var16;
      float var19;
      float var18;
      float var21;
      float var20;
      float var23;
      float var22;
      if(var5 == 0 && var6 == 0) {
         var13 = this.aFloatArrayArray8825[var1][var2];
         var14 = this.aFloatArrayArray8828[var1][var2];
         var15 = this.aFloatArrayArray8829[var1][var2];
      } else if(var5 == this.aClass400_Sub2_8816.anInt4910 * 2111724147 && var6 == 0) {
         var13 = this.aFloatArrayArray8825[var1 + 1][var2];
         var14 = this.aFloatArrayArray8828[var1 + 1][var2];
         var15 = this.aFloatArrayArray8829[var1 + 1][var2];
      } else if(var5 == this.aClass400_Sub2_8816.anInt4910 * 2111724147 && var6 == this.aClass400_Sub2_8816.anInt4910 * 2111724147) {
         var13 = this.aFloatArrayArray8825[var1 + 1][var2 + 1];
         var14 = this.aFloatArrayArray8828[var1 + 1][var2 + 1];
         var15 = this.aFloatArrayArray8829[var1 + 1][var2 + 1];
      } else if(var5 == 0 && var6 == this.aClass400_Sub2_8816.anInt4910 * 2111724147) {
         var13 = this.aFloatArrayArray8825[var1][var2 + 1];
         var14 = this.aFloatArrayArray8828[var1][var2 + 1];
         var15 = this.aFloatArrayArray8829[var1][var2 + 1];
      } else {
         var16 = (float)var5 / (float)(this.aClass400_Sub2_8816.anInt4910 * 2111724147);
         var17 = (float)var6 / (float)(this.aClass400_Sub2_8816.anInt4910 * 2111724147);
         var18 = this.aFloatArrayArray8825[var1][var2];
         var19 = this.aFloatArrayArray8828[var1][var2];
         var20 = this.aFloatArrayArray8829[var1][var2];
         var21 = this.aFloatArrayArray8825[var1 + 1][var2];
         var22 = this.aFloatArrayArray8828[var1 + 1][var2];
         var23 = this.aFloatArrayArray8829[var1 + 1][var2];
         var18 += (this.aFloatArrayArray8825[var1][var2 + 1] - var18) * var16;
         var19 += (this.aFloatArrayArray8828[var1][var2 + 1] - var19) * var16;
         var20 += (this.aFloatArrayArray8829[var1][var2 + 1] - var20) * var16;
         var21 += (this.aFloatArrayArray8825[var1 + 1][var2 + 1] - var21) * var16;
         var22 += (this.aFloatArrayArray8828[var1 + 1][var2 + 1] - var22) * var16;
         var23 += (this.aFloatArrayArray8829[var1 + 1][var2 + 1] - var23) * var16;
         var13 = var18 + (var21 - var18) * var17;
         var14 = var19 + (var22 - var19) * var17;
         var15 = var20 + (var23 - var20) * var17;
      }

      var16 = (float)(this.aClass225_Sub40_8815.method14103(-1926095137) - var9);
      var17 = (float)(this.aClass225_Sub40_8815.method14104(-1360984011) - var11);
      var18 = (float)(this.aClass225_Sub40_8815.method14105((byte)53) - var10);
      var19 = (float)Math.sqrt((double)(var16 * var16 + var17 * var17 + var18 * var18));
      var20 = 1.0F / var19;
      var16 *= var20;
      var17 *= var20;
      var18 *= var20;
      var21 = var19 / (float)this.aClass225_Sub40_8815.method14113(1850112173);
      var22 = 1.0F - var21 * var21;
      if(var22 < 0.0F) {
         var22 = 0.0F;
      }

      var23 = var16 * var13 + var17 * var14 + var18 * var15;
      if(var23 < 0.0F) {
         var23 = 0.0F;
      }

      float var24 = var23 * var22 * 2.0F;
      if(var24 > 1.0F) {
         var24 = 1.0F;
      }

      int var25 = this.aClass225_Sub40_8815.method14107(-1312785693);
      int var26 = (int)(var24 * (float)(var25 >> 16 & 255));
      if(var26 > 255) {
         var26 = 255;
      }

      int var27 = (int)(var24 * (float)(var25 >> 8 & 255));
      if(var27 > 255) {
         var27 = 255;
      }

      int var28 = (int)(var24 * (float)(var25 & 255));
      if(var28 > 255) {
         var28 = 255;
      }

      Unsafe var29 = this.aClass545_Sub2_8819.anUnsafe9632;
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16), (float)var9);
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 4L, (float)var11);
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 8L, (float)var10);
      if(this.aClass545_Sub2_8819.anInt9762 == 0) {
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 12L, (byte)var28);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 13L, (byte)var27);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 14L, (byte)var26);
      } else {
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 12L, (byte)var26);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 13L, (byte)var27);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 14L, (byte)var28);
      }

      var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 15L, (byte)-1);
      ++this.anInt8827;
      var29.putShort(this.aClass545_Sub2_8819.aLong9730 + 2097152L + (long)(this.anInt8817 * 2), var30);
      ++this.anInt8817;
   }

   void method14211() {
      this.anInterface40_8822 = this.aClass545_Sub2_8819.method15075(false);
      this.anInterface40_8822.method232(this.anInt8817);
      this.anInterface35_8826 = this.aClass545_Sub2_8819.method15237(false);
      this.anInterface35_8826.method220(this.anInt8827 * 16, 16);
      this.anInterface35_8826.method217(0, this.anInt8827 * 16, this.aClass545_Sub2_8819.aLong9730);
      this.anInterface40_8822.method217(0, this.anInt8817 * 2, this.aClass545_Sub2_8819.aLong9730 + 2097152L);
   }

   void method14212(int var1, int var2, int var3, int var4, int var5, int var6) {
      long var7 = -1L;
      int var9 = var5 + (var3 << this.aClass400_Sub2_8816.anInt4909 * -1451148795);
      int var10 = var6 + (var4 << this.aClass400_Sub2_8816.anInt4909 * -1451148795);
      int var11 = this.aClass400_Sub2_8816.method6791(var9, var10, 701663251);
      if((var5 & 127) == 0 || (var6 & 127) == 0) {
         var7 = ((long)var10 & 65535L) << 16 | (long)var9 & 65535L;
         Class225 var12 = this.aClass423_8830.method7211(var7);
         if(var12 != null) {
            Unsafe var31 = this.aClass545_Sub2_8819.anUnsafe9632;
            var31.putShort(this.aClass545_Sub2_8819.aLong9730 + 2097152L + (long)(this.anInt8817 * 2), ((Class225_Sub18)var12).aShort8562);
            ++this.anInt8817;
            return;
         }
      }

      short var30 = (short)this.anInt8827;
      if(var7 != -1L) {
         this.aClass423_8830.method7206(new Class225_Sub18(var30), var7);
      }

      float var13;
      float var14;
      float var15;
      float var17;
      float var16;
      float var19;
      float var18;
      float var21;
      float var20;
      float var23;
      float var22;
      if(var5 == 0 && var6 == 0) {
         var13 = this.aFloatArrayArray8825[var1][var2];
         var14 = this.aFloatArrayArray8828[var1][var2];
         var15 = this.aFloatArrayArray8829[var1][var2];
      } else if(var5 == this.aClass400_Sub2_8816.anInt4910 * 2111724147 && var6 == 0) {
         var13 = this.aFloatArrayArray8825[var1 + 1][var2];
         var14 = this.aFloatArrayArray8828[var1 + 1][var2];
         var15 = this.aFloatArrayArray8829[var1 + 1][var2];
      } else if(var5 == this.aClass400_Sub2_8816.anInt4910 * 2111724147 && var6 == this.aClass400_Sub2_8816.anInt4910 * 2111724147) {
         var13 = this.aFloatArrayArray8825[var1 + 1][var2 + 1];
         var14 = this.aFloatArrayArray8828[var1 + 1][var2 + 1];
         var15 = this.aFloatArrayArray8829[var1 + 1][var2 + 1];
      } else if(var5 == 0 && var6 == this.aClass400_Sub2_8816.anInt4910 * 2111724147) {
         var13 = this.aFloatArrayArray8825[var1][var2 + 1];
         var14 = this.aFloatArrayArray8828[var1][var2 + 1];
         var15 = this.aFloatArrayArray8829[var1][var2 + 1];
      } else {
         var16 = (float)var5 / (float)(this.aClass400_Sub2_8816.anInt4910 * 2111724147);
         var17 = (float)var6 / (float)(this.aClass400_Sub2_8816.anInt4910 * 2111724147);
         var18 = this.aFloatArrayArray8825[var1][var2];
         var19 = this.aFloatArrayArray8828[var1][var2];
         var20 = this.aFloatArrayArray8829[var1][var2];
         var21 = this.aFloatArrayArray8825[var1 + 1][var2];
         var22 = this.aFloatArrayArray8828[var1 + 1][var2];
         var23 = this.aFloatArrayArray8829[var1 + 1][var2];
         var18 += (this.aFloatArrayArray8825[var1][var2 + 1] - var18) * var16;
         var19 += (this.aFloatArrayArray8828[var1][var2 + 1] - var19) * var16;
         var20 += (this.aFloatArrayArray8829[var1][var2 + 1] - var20) * var16;
         var21 += (this.aFloatArrayArray8825[var1 + 1][var2 + 1] - var21) * var16;
         var22 += (this.aFloatArrayArray8828[var1 + 1][var2 + 1] - var22) * var16;
         var23 += (this.aFloatArrayArray8829[var1 + 1][var2 + 1] - var23) * var16;
         var13 = var18 + (var21 - var18) * var17;
         var14 = var19 + (var22 - var19) * var17;
         var15 = var20 + (var23 - var20) * var17;
      }

      var16 = (float)(this.aClass225_Sub40_8815.method14103(96316914) - var9);
      var17 = (float)(this.aClass225_Sub40_8815.method14104(-1458451745) - var11);
      var18 = (float)(this.aClass225_Sub40_8815.method14105((byte)122) - var10);
      var19 = (float)Math.sqrt((double)(var16 * var16 + var17 * var17 + var18 * var18));
      var20 = 1.0F / var19;
      var16 *= var20;
      var17 *= var20;
      var18 *= var20;
      var21 = var19 / (float)this.aClass225_Sub40_8815.method14113(1764797642);
      var22 = 1.0F - var21 * var21;
      if(var22 < 0.0F) {
         var22 = 0.0F;
      }

      var23 = var16 * var13 + var17 * var14 + var18 * var15;
      if(var23 < 0.0F) {
         var23 = 0.0F;
      }

      float var24 = var23 * var22 * 2.0F;
      if(var24 > 1.0F) {
         var24 = 1.0F;
      }

      int var25 = this.aClass225_Sub40_8815.method14107(-1971161551);
      int var26 = (int)(var24 * (float)(var25 >> 16 & 255));
      if(var26 > 255) {
         var26 = 255;
      }

      int var27 = (int)(var24 * (float)(var25 >> 8 & 255));
      if(var27 > 255) {
         var27 = 255;
      }

      int var28 = (int)(var24 * (float)(var25 & 255));
      if(var28 > 255) {
         var28 = 255;
      }

      Unsafe var29 = this.aClass545_Sub2_8819.anUnsafe9632;
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16), (float)var9);
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 4L, (float)var11);
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 8L, (float)var10);
      if(this.aClass545_Sub2_8819.anInt9762 == 0) {
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 12L, (byte)var28);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 13L, (byte)var27);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 14L, (byte)var26);
      } else {
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 12L, (byte)var26);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 13L, (byte)var27);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 14L, (byte)var28);
      }

      var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 15L, (byte)-1);
      ++this.anInt8827;
      var29.putShort(this.aClass545_Sub2_8819.aLong9730 + 2097152L + (long)(this.anInt8817 * 2), var30);
      ++this.anInt8817;
   }

   Class225_Sub47(Class545_Sub2 var1, Class400_Sub2 var2, Class225_Sub40 var3, int[] var4) {
      this.aClass545_Sub2_8819 = var1;
      this.aClass225_Sub40_8815 = var3;
      this.aClass400_Sub2_8816 = var2;
      int var5 = this.aClass225_Sub40_8815.method14113(1003703857) - (var2.anInt4910 * 2111724147 >> 1);
      this.anInt8818 = this.aClass225_Sub40_8815.method14103(-10416486) - var5 >> var2.anInt4909 * -1451148795;
      this.anInt8824 = this.aClass225_Sub40_8815.method14103(-748631533) + var5 >> var2.anInt4909 * -1451148795;
      this.anInt8820 = this.aClass225_Sub40_8815.method14105((byte)115) - var5 >> var2.anInt4909 * -1451148795;
      this.anInt8821 = this.aClass225_Sub40_8815.method14105((byte)11) + var5 >> var2.anInt4909 * -1451148795;
      int var6 = this.anInt8824 - this.anInt8818 + 1;
      int var7 = this.anInt8821 - this.anInt8820 + 1;
      this.aFloatArrayArray8825 = new float[var6 + 1][var7 + 1];
      this.aFloatArrayArray8828 = new float[var6 + 1][var7 + 1];
      this.aFloatArrayArray8829 = new float[var6 + 1][var7 + 1];

      int var8;
      int var9;
      int var10;
      int var11;
      int var12;
      int var13;
      for(var8 = 0; var8 <= var7; ++var8) {
         var9 = var8 + this.anInt8820;
         if(var9 > 0 && var9 < this.aClass400_Sub2_8816.anInt4908 * 1696648095 - 1) {
            for(var10 = 0; var10 <= var6; ++var10) {
               var11 = var10 + this.anInt8818;
               if(var11 > 0 && var11 < this.aClass400_Sub2_8816.anInt4911 * 1724373523 - 1) {
                  var12 = var2.method6789(var11 + 1, var9, (byte)3) - var2.method6789(var11 - 1, var9, (byte)3);
                  var13 = var2.method6789(var11, var9 + 1, (byte)3) - var2.method6789(var11, var9 - 1, (byte)3);
                  float var14 = (float)(1.0D / Math.sqrt((double)(var12 * var12 + 65536 + var13 * var13)));
                  this.aFloatArrayArray8825[var10][var8] = (float)var12 * var14;
                  this.aFloatArrayArray8828[var10][var8] = -256.0F * var14;
                  this.aFloatArrayArray8829[var10][var8] = (float)var13 * var14;
               }
            }
         }
      }

      var8 = 0;

      for(var9 = this.anInt8820; var9 <= this.anInt8821; ++var9) {
         if(var9 >= 0 && var9 < var2.anInt4908 * 1696648095) {
            for(var10 = this.anInt8818; var10 <= this.anInt8824; ++var10) {
               if(var10 >= 0 && var10 < var2.anInt4911 * 1724373523) {
                  var11 = var4[var8];
                  int[] var18 = var2.anIntArrayArrayArray9435[var10][var9];
                  if(var18 != null && var11 != 0) {
                     if(var11 == 1) {
                        for(var13 = 0; var13 < var18.length; var13 += 3) {
                           if(var18[var13] != -1 && var18[var13 + 1] != -1 && var18[var13 + 2] != -1) {
                              this.anInt8823 += 3;
                           }
                        }
                     } else {
                        this.anInt8823 += 3;
                     }
                  }
               }

               ++var8;
            }
         } else {
            var8 += this.anInt8824 - this.anInt8818;
         }
      }

      if(this.anInt8823 > 0) {
         this.aClass423_8830 = new Class423(Class468.method7880(this.anInt8823, (byte)-101));
         this.aByteBuffer8831 = this.aClass545_Sub2_8819.aByteBuffer9763;
         this.aByteBuffer8831.clear();
         this.aByteBuffer8831.position(2097152);
         this.aByteBuffer8831.slice();
         this.aByteBuffer8831.position(0);
         this.aByteBuffer8831.limit(2097152);
         var9 = 0;
         var8 = 0;

         for(var10 = this.anInt8820; var10 <= this.anInt8821; ++var10) {
            if(var10 >= 0 && var10 < var2.anInt4908 * 1696648095) {
               var11 = 0;

               for(var12 = this.anInt8818; var12 <= this.anInt8824; ++var12) {
                  if(var12 >= 0 && var12 < var2.anInt4911 * 1724373523) {
                     var13 = var4[var8];
                     int[] var19 = var2.anIntArrayArrayArray9435[var12][var10];
                     if(var19 != null && var13 != 0) {
                        if(var13 == 1) {
                           int[] var15 = var2.anIntArrayArrayArray9437[var12][var10];
                           int[] var16 = var2.anIntArrayArrayArray9463[var12][var10];
                           int var17 = 0;

                           while(var17 < var19.length) {
                              if(var19[var17] != -1 && var19[var17 + 1] != -1 && var19[var17 + 2] != -1) {
                                 this.method14212(var11, var9, var12, var10, var15[var17], var16[var17]);
                                 ++var17;
                                 this.method14212(var11, var9, var12, var10, var15[var17], var16[var17]);
                                 ++var17;
                                 this.method14212(var11, var9, var12, var10, var15[var17], var16[var17]);
                                 ++var17;
                              } else {
                                 var17 += 3;
                              }
                           }
                        } else if(var13 == 3) {
                           this.method14212(var11, var9, var12, var10, 0, 0);
                           this.method14212(var11, var9, var12, var10, var2.anInt4910 * 2111724147, 0);
                           this.method14212(var11, var9, var12, var10, 0, var2.anInt4910 * 2111724147);
                        } else if(var13 == 2) {
                           this.method14212(var11, var9, var12, var10, var2.anInt4910 * 2111724147, 0);
                           this.method14212(var11, var9, var12, var10, var2.anInt4910 * 2111724147, var2.anInt4910 * 2111724147);
                           this.method14212(var11, var9, var12, var10, 0, 0);
                        } else if(var13 == 5) {
                           this.method14212(var11, var9, var12, var10, var2.anInt4910 * 2111724147, var2.anInt4910 * 2111724147);
                           this.method14212(var11, var9, var12, var10, 0, var2.anInt4910 * 2111724147);
                           this.method14212(var11, var9, var12, var10, var2.anInt4910 * 2111724147, 0);
                        } else if(var13 == 4) {
                           this.method14212(var11, var9, var12, var10, 0, var2.anInt4910 * 2111724147);
                           this.method14212(var11, var9, var12, var10, 0, 0);
                           this.method14212(var11, var9, var12, var10, var2.anInt4910 * 2111724147, var2.anInt4910 * 2111724147);
                        }
                     }
                  }

                  ++var8;
                  ++var11;
               }
            } else {
               var8 += this.anInt8824 - this.anInt8818;
            }

            ++var9;
         }

         this.method14211();
      } else {
         this.anInterface35_8826 = null;
         this.anInterface40_8822 = null;
      }

      this.aClass423_8830 = null;
      this.aFloatArrayArray8829 = (float[][])null;
      this.aFloatArrayArray8828 = (float[][])null;
      this.aFloatArrayArray8825 = (float[][])null;
   }

   void method14213() {
      this.anInterface40_8822 = this.aClass545_Sub2_8819.method15075(false);
      this.anInterface40_8822.method232(this.anInt8817);
      this.anInterface35_8826 = this.aClass545_Sub2_8819.method15237(false);
      this.anInterface35_8826.method220(this.anInt8827 * 16, 16);
      this.anInterface35_8826.method217(0, this.anInt8827 * 16, this.aClass545_Sub2_8819.aLong9730);
      this.anInterface40_8822.method217(0, this.anInt8817 * 2, this.aClass545_Sub2_8819.aLong9730 + 2097152L);
   }

   void method14214(int var1, int var2, int var3, int var4, int var5, int var6) {
      long var7 = -1L;
      int var9 = var5 + (var3 << this.aClass400_Sub2_8816.anInt4909 * -1451148795);
      int var10 = var6 + (var4 << this.aClass400_Sub2_8816.anInt4909 * -1451148795);
      int var11 = this.aClass400_Sub2_8816.method6791(var9, var10, 701663251);
      if((var5 & 127) == 0 || (var6 & 127) == 0) {
         var7 = ((long)var10 & 65535L) << 16 | (long)var9 & 65535L;
         Class225 var12 = this.aClass423_8830.method7211(var7);
         if(var12 != null) {
            Unsafe var31 = this.aClass545_Sub2_8819.anUnsafe9632;
            var31.putShort(this.aClass545_Sub2_8819.aLong9730 + 2097152L + (long)(this.anInt8817 * 2), ((Class225_Sub18)var12).aShort8562);
            ++this.anInt8817;
            return;
         }
      }

      short var30 = (short)this.anInt8827;
      if(var7 != -1L) {
         this.aClass423_8830.method7206(new Class225_Sub18(var30), var7);
      }

      float var13;
      float var14;
      float var15;
      float var17;
      float var16;
      float var19;
      float var18;
      float var21;
      float var20;
      float var23;
      float var22;
      if(var5 == 0 && var6 == 0) {
         var13 = this.aFloatArrayArray8825[var1][var2];
         var14 = this.aFloatArrayArray8828[var1][var2];
         var15 = this.aFloatArrayArray8829[var1][var2];
      } else if(var5 == this.aClass400_Sub2_8816.anInt4910 * 2111724147 && var6 == 0) {
         var13 = this.aFloatArrayArray8825[var1 + 1][var2];
         var14 = this.aFloatArrayArray8828[var1 + 1][var2];
         var15 = this.aFloatArrayArray8829[var1 + 1][var2];
      } else if(var5 == this.aClass400_Sub2_8816.anInt4910 * 2111724147 && var6 == this.aClass400_Sub2_8816.anInt4910 * 2111724147) {
         var13 = this.aFloatArrayArray8825[var1 + 1][var2 + 1];
         var14 = this.aFloatArrayArray8828[var1 + 1][var2 + 1];
         var15 = this.aFloatArrayArray8829[var1 + 1][var2 + 1];
      } else if(var5 == 0 && var6 == this.aClass400_Sub2_8816.anInt4910 * 2111724147) {
         var13 = this.aFloatArrayArray8825[var1][var2 + 1];
         var14 = this.aFloatArrayArray8828[var1][var2 + 1];
         var15 = this.aFloatArrayArray8829[var1][var2 + 1];
      } else {
         var16 = (float)var5 / (float)(this.aClass400_Sub2_8816.anInt4910 * 2111724147);
         var17 = (float)var6 / (float)(this.aClass400_Sub2_8816.anInt4910 * 2111724147);
         var18 = this.aFloatArrayArray8825[var1][var2];
         var19 = this.aFloatArrayArray8828[var1][var2];
         var20 = this.aFloatArrayArray8829[var1][var2];
         var21 = this.aFloatArrayArray8825[var1 + 1][var2];
         var22 = this.aFloatArrayArray8828[var1 + 1][var2];
         var23 = this.aFloatArrayArray8829[var1 + 1][var2];
         var18 += (this.aFloatArrayArray8825[var1][var2 + 1] - var18) * var16;
         var19 += (this.aFloatArrayArray8828[var1][var2 + 1] - var19) * var16;
         var20 += (this.aFloatArrayArray8829[var1][var2 + 1] - var20) * var16;
         var21 += (this.aFloatArrayArray8825[var1 + 1][var2 + 1] - var21) * var16;
         var22 += (this.aFloatArrayArray8828[var1 + 1][var2 + 1] - var22) * var16;
         var23 += (this.aFloatArrayArray8829[var1 + 1][var2 + 1] - var23) * var16;
         var13 = var18 + (var21 - var18) * var17;
         var14 = var19 + (var22 - var19) * var17;
         var15 = var20 + (var23 - var20) * var17;
      }

      var16 = (float)(this.aClass225_Sub40_8815.method14103(-1509078582) - var9);
      var17 = (float)(this.aClass225_Sub40_8815.method14104(-1800590081) - var11);
      var18 = (float)(this.aClass225_Sub40_8815.method14105((byte)62) - var10);
      var19 = (float)Math.sqrt((double)(var16 * var16 + var17 * var17 + var18 * var18));
      var20 = 1.0F / var19;
      var16 *= var20;
      var17 *= var20;
      var18 *= var20;
      var21 = var19 / (float)this.aClass225_Sub40_8815.method14113(1870774436);
      var22 = 1.0F - var21 * var21;
      if(var22 < 0.0F) {
         var22 = 0.0F;
      }

      var23 = var16 * var13 + var17 * var14 + var18 * var15;
      if(var23 < 0.0F) {
         var23 = 0.0F;
      }

      float var24 = var23 * var22 * 2.0F;
      if(var24 > 1.0F) {
         var24 = 1.0F;
      }

      int var25 = this.aClass225_Sub40_8815.method14107(-2013654562);
      int var26 = (int)(var24 * (float)(var25 >> 16 & 255));
      if(var26 > 255) {
         var26 = 255;
      }

      int var27 = (int)(var24 * (float)(var25 >> 8 & 255));
      if(var27 > 255) {
         var27 = 255;
      }

      int var28 = (int)(var24 * (float)(var25 & 255));
      if(var28 > 255) {
         var28 = 255;
      }

      Unsafe var29 = this.aClass545_Sub2_8819.anUnsafe9632;
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16), (float)var9);
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 4L, (float)var11);
      var29.putFloat(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 8L, (float)var10);
      if(this.aClass545_Sub2_8819.anInt9762 == 0) {
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 12L, (byte)var28);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 13L, (byte)var27);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 14L, (byte)var26);
      } else {
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 12L, (byte)var26);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 13L, (byte)var27);
         var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 14L, (byte)var28);
      }

      var29.putByte(this.aClass545_Sub2_8819.aLong9730 + (long)(this.anInt8827 * 16) + 15L, (byte)-1);
      ++this.anInt8827;
      var29.putShort(this.aClass545_Sub2_8819.aLong9730 + 2097152L + (long)(this.anInt8817 * 2), var30);
      ++this.anInt8817;
   }
}
