package mapped;

import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;

@ObfuscatedName("ss")
public class class478 {
   @ObfuscatedName("au")
   static int[] field4835;
   @ObfuscatedName("aa")
   public static int[] field4836;
   @ObfuscatedName("ti")
   @ObfuscatedSignature(
      descriptor = "Lfc;"
   )
   static ClanSettings guestClanSettings;

   static {
      field4835 = new int['耀'];

      for(int var0 = 0; var0 < 32768; ++var0) {
         field4835[var0] = method8600_base(var0);
      }

      if(field4836 == null) {
         field4836 = new int[65536];
         double var25 = 0.949999988079071D;

         for(int var2 = 0; var2 < 65536; ++var2) {
            double var3 = 0.0078125D + (double)(var2 >> 10 & 63) / 64.0D;
            double var5 = (double)(var2 >> 7 & 7) / 8.0D + 0.0625D;
            double var7 = (double)(var2 & 127) / 128.0D;
            double var9 = var7;
            double var11 = var7;
            double var13 = var7;
            if(var5 != 0.0D) {
               double var15;
               if(var7 < 0.5D) {
                  var15 = (1.0D + var5) * var7;
               } else {
                  var15 = var5 + var7 - var7 * var5;
               }

               double var17 = var7 * 2.0D - var15;
               double var19 = var3 + 0.3333333333333333D;
               if(var19 > 1.0D) {
                  --var19;
               }

               double var23 = var3 - 0.3333333333333333D;
               if(var23 < 0.0D) {
                  ++var23;
               }

               if(var19 * 6.0D < 1.0D) {
                  var9 = var17 + var19 * (var15 - var17) * 6.0D;
               } else if(2.0D * var19 < 1.0D) {
                  var9 = var15;
               } else if(3.0D * var19 < 2.0D) {
                  var9 = var17 + (0.6666666666666666D - var19) * (var15 - var17) * 6.0D;
               } else {
                  var9 = var17;
               }

               if(var3 * 6.0D < 1.0D) {
                  var11 = var17 + var3 * (var15 - var17) * 6.0D;
               } else if(2.0D * var3 < 1.0D) {
                  var11 = var15;
               } else if(3.0D * var3 < 2.0D) {
                  var11 = var17 + (0.6666666666666666D - var3) * (var15 - var17) * 6.0D;
               } else {
                  var11 = var17;
               }

               if(6.0D * var23 < 1.0D) {
                  var13 = var17 + var23 * (var15 - var17) * 6.0D;
               } else if(var23 * 2.0D < 1.0D) {
                  var13 = var15;
               } else if(var23 * 3.0D < 2.0D) {
                  var13 = var17 + (var15 - var17) * (0.6666666666666666D - var23) * 6.0D;
               } else {
                  var13 = var17;
               }
            }

            var9 = Math.pow(var9, var25);
            var11 = Math.pow(var11, var25);
            var13 = Math.pow(var13, var25);
            int var27 = (int)(var9 * 256.0D);
            int var16 = (int)(var11 * 256.0D);
            int var28 = (int)(256.0D * var13);
            int var18 = var28 + (var16 << 8) + (var27 << 16);
            field4836[var2] = var18 & 16777215;
         }
      }

   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(II)I",
      garbageValue = "-2145901051"
   )
   static final int method8600_base(int var0) {
      double var1 = (double)(var0 >> 10 & 31) / 31.0D;
      double var3 = (double)(var0 >> 5 & 31) / 31.0D;
      double var5 = (double)(var0 & 31) / 31.0D;
      double var7 = var1;
      if(var3 < var1) {
         var7 = var3;
      }

      if(var5 < var7) {
         var7 = var5;
      }

      double var9 = var1;
      if(var3 > var1) {
         var9 = var3;
      }

      if(var5 > var9) {
         var9 = var5;
      }

      double var11 = 0.0D;
      double var13 = 0.0D;
      double var15 = (var9 + var7) / 2.0D;
      if(var9 != var7) {
         if(var15 < 0.5D) {
            var13 = (var9 - var7) / (var7 + var9);
         }

         if(var15 >= 0.5D) {
            var13 = (var9 - var7) / (2.0D - var9 - var7);
         }

         if(var1 == var9) {
            var11 = (var3 - var5) / (var9 - var7);
         } else if(var9 == var3) {
            var11 = 2.0D + (var5 - var1) / (var9 - var7);
         } else if(var5 == var9) {
            var11 = (var1 - var3) / (var9 - var7) + 4.0D;
         }
      }

      int var17 = (int)(var11 * 256.0D / 6.0D);
      var17 &= 255;
      double var18 = 256.0D * var13;
      if(var18 < 0.0D) {
         var18 = 0.0D;
      } else if(var18 > 255.0D) {
         var18 = 255.0D;
      }

      if(var15 > 0.7D) {
         var18 /= 2.0D;
         var18 = Math.floor(var18);
      }

      if(var15 > 0.75D) {
         var18 /= 2.0D;
         var18 = Math.floor(var18);
      }

      if(var15 > 0.85D) {
         var18 /= 2.0D;
         var18 = Math.floor(var18);
      }

      if(var15 > 0.95D) {
         var18 /= 2.0D;
         var18 = Math.floor(var18);
      }

      if(var15 > 0.995D) {
         var15 = 0.995D;
      }

      int var20 = (int)((double)(var17 / 4 * 8) + var18 / 32.0D);
      return (int)(128.0D * var15) + (var20 << 7);
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(IB)I",
      garbageValue = "124"
   )
   public static int method8602_base(int var0) {
      return 255 - (var0 & 255);
   }

   @ObfuscatedName("al")
   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "930574871"
   )
   static void method8609_base() {
      Login.Login_username = Login.Login_username.trim();
      Client.onUsernameChanged(-1);
      if(Login.Login_username.length() == 0) {
         class139.setLoginResponseString_base("", "Please enter your email address.", "");
      } else if(Login.Login_password.length() == 0) {
         class139.setLoginResponseString_base("", "Please enter your password.", "");
      } else {
         class139.setLoginResponseString_base("", "Connecting to server...", "");
         VerticalAlignment.method3754_base(false);
         WorldMapSection2.updateGameState_base(20);
      }
   }

   @ObfuscatedName("kp")
   @ObfuscatedSignature(
      descriptor = "(III)V",
      garbageValue = "-1143986054"
   )
   static final void method8608_base(int var0, int var1) {
      if(Client.menuOptionsCount >= 2 || Client.isItemSelected != 0 || Client.isSpellSelected) {
         if(Client.showMouseOverText) {
            int var2 = Client.menuOptionsCount - 1;
            String var4;
            if(Client.isItemSelected == 1 && Client.menuOptionsCount < 2) {
               var4 = "Use" + " " + Client.field767 + " " + "->";
            } else if(Client.isSpellSelected && Client.menuOptionsCount < 2) {
               var4 = Client.selectedSpellActionName + " " + Client.selectedSpellName + " " + "->";
            } else {
               var4 = ReflectionCheck.method711_base(var2);
            }

            if(Client.menuOptionsCount > 2) {
               var4 = var4 + class167.colorStartTag_base(16777215) + " " + '/' + " " + (Client.menuOptionsCount - 2) + " more options";
            }

            GrandExchangeOfferTotalQuantityComparator.fontBold12.drawRandomAlphaAndSpacing_base(var4, var0 + 4, var1 + 15, 16777215, 0, Client.cycle / 1000);
         }
      }
   }
}
