package mapped;

import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.util.Iterator;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;

@ObfuscatedName("ga")
public class class167 extends class160 {
   @ObfuscatedName("fb")
   @ObfuscatedSignature(
      descriptor = "Lro;"
   )
   static AbstractSocket js5Socket;
   @ObfuscatedName("at")
   String field1785;
   @ObfuscatedName("ah")
   byte field1781;
   @ObfuscatedName("ar")
   byte field1782;
   // $FF: synthetic field
   @ObfuscatedSignature(
      descriptor = "Lgi;"
   )
   final class161 this$0;

   @ObfuscatedSignature(
      descriptor = "(Lgi;)V"
   )
   class167(class161 var1) {
      this.this$0 = var1;
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Luj;I)V",
      garbageValue = "1810249387"
   )
   void vmethod3497(Buffer var1) {
      this.field1785 = var1.readStringCp1252NullTerminatedOrNull_base();
      if(this.field1785 != null) {
         var1.readUnsignedByte_base();
         this.field1781 = var1.readByte_base();
         this.field1782 = var1.readByte_base();
      }

   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(Lgn;B)V",
      garbageValue = "-75"
   )
   void vmethod3501(ClanChannel var1) {
      var1.name = this.field1785;
      if(this.field1785 != null) {
         var1.field1766 = this.field1781;
         var1.field1771 = this.field1782;
      }

   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(II)Ljava/lang/String;",
      garbageValue = "204658379"
   )
   static String colorStartTag_base(int var0) {
      return "<col=" + Integer.toHexString(var0) + ">";
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(IIIIB)I",
      garbageValue = "21"
   )
   static final int method3503_base(int var0, int var1, int var2, int var3) {
      return var3 * var0 + var2 * var1 >> 16;
   }

   @ObfuscatedName("bz")
   @ObfuscatedSignature(
      descriptor = "(I)I",
      garbageValue = "-139333947"
   )
   protected static int getGcDuration_base() {
      int var0 = 0;
      if(UserComparator10.garbageCollector == null || !UserComparator10.garbageCollector.isValid()) {
         try {
            Iterator var1 = ManagementFactory.getGarbageCollectorMXBeans().iterator();

            while(var1.hasNext()) {
               GarbageCollectorMXBean var2 = (GarbageCollectorMXBean)var1.next();
               if(var2.isValid()) {
                  UserComparator10.garbageCollector = var2;
                  GameEngine.garbageCollectorLastCheckTimeMs = -1L;
                  GameEngine.garbageCollectorLastCollectionTime = -1L;
               }
            }
         } catch (Throwable var11) {
            ;
         }
      }

      if(UserComparator10.garbageCollector != null) {
         long var9 = SpotAnimationDefinition.method3775_base();
         long var3 = UserComparator10.garbageCollector.getCollectionTime();
         if(-1L != GameEngine.garbageCollectorLastCollectionTime) {
            long var5 = var3 - GameEngine.garbageCollectorLastCollectionTime;
            long var7 = var9 - GameEngine.garbageCollectorLastCheckTimeMs;
            if(var7 != 0L) {
               var0 = (int)(var5 * 100L / var7);
            }
         }

         GameEngine.garbageCollectorLastCollectionTime = var3;
         GameEngine.garbageCollectorLastCheckTimeMs = var9;
      }

      return var0;
   }
}
