package mapped;

import java.util.ArrayList;
import java.util.Iterator;
import javax.imageio.ImageIO;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;

@ObfuscatedName("bv")
public class class30 {
   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "Lol;"
   )
   public static AbstractArchive VarcInt_archive;

   static {
      ImageIO.setUseCache(false);
   }

   @ObfuscatedName("az")
   @ObfuscatedSignature(
      descriptor = "(Ljava/util/ArrayList;ZI)V",
      garbageValue = "358922906"
   )
   static void method463_base(ArrayList var0, boolean var1) {
      if(!var1) {
         class316.field3424.clear();
      }

      Iterator var2 = var0.iterator();

      while(var2.hasNext()) {
         MusicSong var3 = (MusicSong)var2.next();
         if(var3.musicTrackGroupId != -1 && var3.musicTrackFileId != -1) {
            if(!var1) {
               class316.field3424.add(var3);
            }

            class316.field3416.add(var3);
         }
      }

   }

   @ObfuscatedName("ak")
   @ObfuscatedSignature(
      descriptor = "(ILdt;ZI)I",
      garbageValue = "-2029161315"
   )
   static int method462(int var0, Script var1, boolean var2) {
      Widget var3 = var2?Interpreter.scriptDotWidget:HealthBar.scriptActiveWidget;
      if(var0 == 1700) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.itemId;
         return 1;
      } else if(var0 == 1701) {
         if(var3.itemId != -1) {
            Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.itemQuantity;
         } else {
            Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = 0;
         }

         return 1;
      } else if(var0 == 1702) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.childIndex;
         return 1;
      } else if(var0 == 1707) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.method6682_base()?1:0;
         return 1;
      } else {
         return var0 == 1708?class310.method5940(var3):(var0 == 1709?GrandExchangeOfferTotalQuantityComparator.method7082(var3):2);
      }
   }

   @ObfuscatedName("ck")
   @ObfuscatedSignature(
      descriptor = "([BI)[B",
      garbageValue = "469313133"
   )
   static final byte[] decompressBytes_base(byte[] var0) {
      Buffer var1 = new Buffer(var0);
      int var2 = var1.readUnsignedByte_base();
      int var3 = var1.readInt_base();
      if(var3 < 0 || AbstractArchive.field4303 != 0 && var3 > AbstractArchive.field4303) {
         throw new RuntimeException();
      } else if(var2 == 0) {
         byte[] var4 = new byte[var3];
         var1.readBytes_base(var4, 0, var3);
         return var4;
      } else {
         int var6 = var1.readInt_base();
         if(var6 < 0 || AbstractArchive.field4303 != 0 && var6 > AbstractArchive.field4303) {
            throw new RuntimeException();
         } else {
            byte[] var5 = new byte[var6];
            if(var2 == 1) {
               BZip2Decompressor.BZip2Decompressor_decompress_base(var5, var6, var0, var3, 9);
            } else {
               AbstractArchive.gzipDecompressor.method9935(var1, var5);
            }

            return var5;
         }
      }
   }

   @ObfuscatedName("nj")
   @ObfuscatedSignature(
      descriptor = "(III)V",
      garbageValue = "1125993888"
   )
   static final void method465_base(int var0, int var1) {
      ClanChannel var2 = var0 >= 0?Client.currentClanChannels[var0]:ItemContainer.guestClanChannel;
      if(var2 != null && var1 >= 0 && var1 < var2.method3479_base()) {
         ClanChannelMember var3 = (ClanChannelMember)var2.members.get(var1);
         if(var3.rank == -1) {
            String var4 = var3.username.getName_base();
            PacketBufferNode var5 = class113.method2919(ClientPacket.CLANCHANNEL_KICKUSER, Client.packetWriter.isaacCipher);
            var5.packetBuffer.writeByte_base(3 + ClanChannel.stringCp1252NullTerminatedByteSize_base(var4));
            var5.packetBuffer.writeByte_base(var0);
            var5.packetBuffer.writeShort_base(var1);
            var5.packetBuffer.writeStringCp1252NullTerminated_base(var4);
            Client.packetWriter.method2867(var5);
         }
      }
   }
}
