package mapped;

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

@ObfuscatedName("fz")
public class class150 extends class160 {
   @ObfuscatedName("at")
   @ObfuscatedGetter(
      intValue = -1503644171
   )
   int field1674;
   @ObfuscatedName("ah")
   byte field1675;
   @ObfuscatedName("ar")
   @ObfuscatedGetter(
      intValue = -1825811703
   )
   int field1672;
   @ObfuscatedName("ao")
   String field1673;
   // $FF: synthetic field
   @ObfuscatedSignature(
      descriptor = "Lgi;"
   )
   final class161 this$0;

   @ObfuscatedSignature(
      descriptor = "(Lgi;)V"
   )
   class150(class161 var1) {
      this.this$0 = var1;
      this.field1674 = -1;
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Luj;I)V",
      garbageValue = "1810249387"
   )
   void vmethod3497(Buffer var1) {
      this.field1674 = var1.readUnsignedShort_base();
      this.field1675 = var1.readByte_base();
      this.field1672 = var1.readUnsignedShort_base();
      var1.readLong_base();
      this.field1673 = var1.readStringCp1252NullTerminated_base();
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(Lgn;B)V",
      garbageValue = "-75"
   )
   void vmethod3501(ClanChannel var1) {
      ClanChannelMember var2 = (ClanChannelMember)var1.members.get(this.field1674);
      var2.rank = this.field1675;
      var2.world = this.field1672;
      var2.username = new Username(this.field1673);
   }

   @ObfuscatedName("aa")
   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "1617233063"
   )
   static void method3281_base() {
      if(Client.Login_isUsernameRemembered && Login.Login_username != null && Login.Login_username.length() > 0) {
         Login.currentLoginField = 1;
      } else {
         Login.currentLoginField = 0;
      }

   }

   @ObfuscatedName("ac")
   @ObfuscatedSignature(
      descriptor = "(Ljava/lang/CharSequence;I)I",
      garbageValue = "2016181091"
   )
   public static int hashString_base(CharSequence var0) {
      int var1 = var0.length();
      int var2 = 0;

      for(int var3 = 0; var3 < var1; ++var3) {
         var2 = (var2 << 5) - var2 + class137.charToByteCp1252_base(var0.charAt(var3));
      }

      return var2;
   }

   @ObfuscatedName("ac")
   @ObfuscatedSignature(
      descriptor = "([BIII)Z",
      garbageValue = "-851651370"
   )
   static final boolean method3283_base(byte[] var0, int var1, int var2) {
      boolean var3 = true;
      Buffer var4 = new Buffer(var0);
      int var5 = -1;

      label68:
      while(true) {
         int var6 = var4.readIncrSmallSmart_base();
         if(var6 == 0) {
            return var3;
         }

         var5 += var6;
         int var7 = 0;
         boolean var8 = false;

         while(true) {
            int var9;
            while(!var8) {
               var9 = var4.readUShortSmart_base();
               if(var9 == 0) {
                  continue label68;
               }

               var7 += var9 - 1;
               int var10 = var7 & 63;
               int var11 = var7 >> 6 & 63;
               int var12 = var4.readUnsignedByte_base() >> 2;
               int var13 = var11 + var1;
               int var14 = var10 + var2;
               if(var13 > 0 && var14 > 0 && var13 < 103 && var14 < 103) {
                  ObjectComposition var15 = WorldMapSection2.method4515(var5);
                  if(var12 != 22 || !Client.isLowDetail || var15.int1 != 0 || var15.interactType == 1 || var15.boolean2) {
                     if(!var15.needsModelFiles_base()) {
                        ++Client.field521;
                        var3 = false;
                     }

                     var8 = true;
                  }
               }
            }

            var9 = var4.readUShortSmart_base();
            if(var9 == 0) {
               break;
            }

            var4.readUnsignedByte_base();
         }
      }
   }
}
