package com.l7tech.policy;

import com.l7tech.policy.assertion.Assertion;
import java.io.Serializable;

public class AssertionPath implements Serializable {
   private final AssertionPath parentPath;
   private final Assertion lastPathComponent;
   private final int pathCount;
   private int pathOrder;
   private int hashCode;
   static final long serialVersionUID = 5067833844735268371L;
   private static final String[] a;

   // $VF: Handled exception range with multiple entry points by splitting it
   // $VF: Duplicated exception handlers to handle obfuscated exceptions
   public AssertionPath(Assertion[] var1) {
      label29:
      if (var1 != null) {
         try {
            if (var1.length == 0) {
               break label29;
            }
         } catch (IllegalArgumentException var4) {
            throw a(var4);
         }

         label23: {
            try {
               this.lastPathComponent = var1[var1.length - 1];
               if (var1.length > 1) {
                  this.parentPath = new AssertionPath(var1, var1.length - 1);
                  break label23;
               }
            } catch (IllegalArgumentException var3) {
               throw a(var3);
            }

            this.parentPath = null;
         }

         this.pathCount = var1.length;
         return;
      }

      try {
         throw new IllegalArgumentException();
      } catch (IllegalArgumentException var2) {
         throw a(var2);
      }
   }

   public AssertionPath(Assertion var1) {
      if (var1 == null) {
         throw new IllegalArgumentException(a[3]);
      }

      this.lastPathComponent = var1;
      this.parentPath = null;
      this.pathCount = 1;
   }

   public AssertionPath(AssertionPath var1) {
      this.parentPath = var1.parentPath;
      this.lastPathComponent = var1.lastPathComponent;
      this.pathCount = var1.pathCount;
   }

   protected AssertionPath(AssertionPath var1, Assertion var2) {
      this.parentPath = var1;
      this.lastPathComponent = var2;
      this.pathCount = var1.pathCount + 1;
   }

   protected AssertionPath(Assertion[] var1, int var2) {
      this.lastPathComponent = var1[var2 - 1];
      if (var2 > 1) {
         this.parentPath = new AssertionPath(var1, var2 - 1);
      } else {
         this.parentPath = null;
      }

      this.pathCount = var2;
   }

   public boolean containsSibling(Assertion param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: astore 2
      // 02: aload 2
      // 03: ifnull 26
      // 06: aload 2
      // 07: getfield com/l7tech/policy/AssertionPath.lastPathComponent Lcom/l7tech/policy/assertion/Assertion;
      // 0a: aload 1
      // 0b: invokestatic com/l7tech/policy/assertion/Assertion.isSibling (Lcom/l7tech/policy/assertion/Assertion;Lcom/l7tech/policy/assertion/Assertion;)Z
      // 0e: ifeq 1e
      // 11: goto 18
      // 14: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 17: athrow
      // 18: bipush 1
      // 19: ireturn
      // 1a: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 1d: athrow
      // 1e: aload 2
      // 1f: getfield com/l7tech/policy/AssertionPath.parentPath Lcom/l7tech/policy/AssertionPath;
      // 22: astore 2
      // 23: goto 02
      // 26: bipush 0
      // 27: ireturn
      // try (2 -> 9): 10 java/lang/IllegalArgumentException
      // try (4 -> 14): 14 java/lang/IllegalArgumentException
   }

   public AssertionPath addAssertion(Assertion var1) throws NullPointerException {
      return new AssertionPath(this, var1);
   }

   public boolean isDescendant(AssertionPath var1) {
      try {
         if (var1 == null) {
            return false;
         }
      } catch (IllegalArgumentException var5) {
         throw a(var5);
      }

      try {
         if (var1 == this) {
            return true;
         }
      } catch (IllegalArgumentException var6) {
         throw a(var6);
      }

      int var2 = this.getPathCount();
      int var3 = var1.getPathCount();

      try {
         if (var3 < var2) {
            return false;
         }
      } catch (IllegalArgumentException var4) {
         throw a(var4);
      }

      while (var3-- > var2) {
         var1 = var1.getParentPath();
      }

      return this.equals(var1);
   }

   public AssertionPath getParentPath() {
      return this.parentPath;
   }

   public int getPathCount() {
      int var1 = 0;

      for (AssertionPath var2 = this; var2 != null; var2 = var2.parentPath) {
         var1++;
      }

      return var1;
   }

   public Assertion getPathAssertion(int param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: invokevirtual com/l7tech/policy/AssertionPath.getPathCount ()I
      // 04: istore 2
      // 05: iload 1
      // 06: iflt 15
      // 09: iload 1
      // 0a: iload 2
      // 0b: if_icmplt 32
      // 0e: goto 15
      // 11: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 14: athrow
      // 15: new java/lang/IndexOutOfBoundsException
      // 18: dup
      // 19: iload 1
      // 1a: getstatic com/l7tech/policy/AssertionPath.a [Ljava/lang/String;
      // 1d: bipush 1
      // 1e: aaload
      // 1f: swap
      // 20: getstatic com/l7tech/policy/AssertionPath.a [Ljava/lang/String;
      // 23: bipush 0
      // 24: aaload
      // 25: invokedynamic makeConcatWithConstants (Ljava/lang/String;ILjava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001\u0001" ]
      // 2a: invokespecial java/lang/IndexOutOfBoundsException.<init> (Ljava/lang/String;)V
      // 2d: athrow
      // 2e: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 31: athrow
      // 32: aload 0
      // 33: astore 3
      // 34: iload 2
      // 35: bipush 1
      // 36: isub
      // 37: istore 4
      // 39: iload 4
      // 3b: iload 1
      // 3c: if_icmpeq 4a
      // 3f: aload 3
      // 40: getfield com/l7tech/policy/AssertionPath.parentPath Lcom/l7tech/policy/AssertionPath;
      // 43: astore 3
      // 44: iinc 4 -1
      // 47: goto 39
      // 4a: aload 3
      // 4b: getfield com/l7tech/policy/AssertionPath.lastPathComponent Lcom/l7tech/policy/assertion/Assertion;
      // 4e: areturn
      // try (3 -> 8): 9 java/lang/IllegalArgumentException
      // try (5 -> 24): 24 java/lang/IllegalArgumentException
   }

   public Assertion lastAssertion() {
      return this.lastPathComponent;
   }

   public Assertion[] getPath() {
      int var1 = this.getPathCount();
      Assertion[] var2 = new Assertion[var1--];

      for (AssertionPath var3 = this; var3 != null; var3 = var3.parentPath) {
         var2[var1--] = var3.lastPathComponent;
      }

      return var2;
   }

   public boolean contains(Assertion var1) {
      try {
         if (var1 == null) {
            return false;
         }
      } catch (IllegalArgumentException var8) {
         throw a(var8);
      }

      Assertion[] var2 = this.getPath();

      for (Assertion var6 : var2) {
         try {
            if (var1 == var6) {
               return true;
            }
         } catch (IllegalArgumentException var7) {
            throw a(var7);
         }
      }

      return false;
   }

   public boolean contains(Class var1) {
      try {
         if (var1 == null) {
            return false;
         }
      } catch (IllegalArgumentException var8) {
         throw a(var8);
      }

      Assertion[] var2 = this.getPath();

      for (Assertion var6 : var2) {
         try {
            if (var1 == var6.getClass()) {
               return true;
            }
         } catch (IllegalArgumentException var7) {
            throw a(var7);
         }
      }

      return false;
   }

   @Override
   public boolean equals(Object param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 1
      // 01: ifnonnull 0a
      // 04: bipush 0
      // 05: ireturn
      // 06: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 09: athrow
      // 0a: aload 1
      // 0b: aload 0
      // 0c: if_acmpne 15
      // 0f: bipush 1
      // 10: ireturn
      // 11: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 14: athrow
      // 15: aload 1
      // 16: instanceof com/l7tech/policy/AssertionPath
      // 19: ifeq 5f
      // 1c: aload 0
      // 1d: astore 2
      // 1e: aload 1
      // 1f: checkcast com/l7tech/policy/AssertionPath
      // 22: astore 3
      // 23: aload 0
      // 24: invokevirtual com/l7tech/policy/AssertionPath.getPathCount ()I
      // 27: aload 3
      // 28: invokevirtual com/l7tech/policy/AssertionPath.getPathCount ()I
      // 2b: if_icmpeq 34
      // 2e: bipush 0
      // 2f: ireturn
      // 30: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 33: athrow
      // 34: aload 2
      // 35: ifnull 5d
      // 38: aload 2
      // 39: getfield com/l7tech/policy/AssertionPath.lastPathComponent Lcom/l7tech/policy/assertion/Assertion;
      // 3c: aload 3
      // 3d: getfield com/l7tech/policy/AssertionPath.lastPathComponent Lcom/l7tech/policy/assertion/Assertion;
      // 40: if_acmpeq 50
      // 43: goto 4a
      // 46: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 49: athrow
      // 4a: bipush 0
      // 4b: ireturn
      // 4c: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 4f: athrow
      // 50: aload 2
      // 51: getfield com/l7tech/policy/AssertionPath.parentPath Lcom/l7tech/policy/AssertionPath;
      // 54: astore 2
      // 55: aload 3
      // 56: getfield com/l7tech/policy/AssertionPath.parentPath Lcom/l7tech/policy/AssertionPath;
      // 59: astore 3
      // 5a: goto 34
      // 5d: bipush 1
      // 5e: ireturn
      // 5f: bipush 0
      // 60: ireturn
      // try (0 -> 4): 4 java/lang/IllegalArgumentException
      // try (6 -> 11): 11 java/lang/IllegalArgumentException
      // try (21 -> 28): 28 java/lang/IllegalArgumentException
      // try (30 -> 37): 38 java/lang/IllegalArgumentException
      // try (32 -> 42): 42 java/lang/IllegalArgumentException
   }

   @Override
   public int hashCode() {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: getfield com/l7tech/policy/AssertionPath.hashCode I
      // 04: istore 1
      // 05: iload 1
      // 06: ifne 42
      // 09: aload 0
      // 0a: getfield com/l7tech/policy/AssertionPath.lastPathComponent Lcom/l7tech/policy/assertion/Assertion;
      // 0d: invokevirtual com/l7tech/policy/assertion/Assertion.hashCode ()I
      // 10: aload 0
      // 11: getfield com/l7tech/policy/AssertionPath.parentPath Lcom/l7tech/policy/AssertionPath;
      // 14: ifnonnull 26
      // 17: goto 1e
      // 1a: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 1d: athrow
      // 1e: bipush 0
      // 1f: goto 3b
      // 22: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 25: athrow
      // 26: bipush 17
      // 28: aload 0
      // 29: getfield com/l7tech/policy/AssertionPath.parentPath Lcom/l7tech/policy/AssertionPath;
      // 2c: invokevirtual com/l7tech/policy/AssertionPath.getPathCount ()I
      // 2f: imul
      // 30: bipush 13
      // 32: aload 0
      // 33: getfield com/l7tech/policy/AssertionPath.parentPath Lcom/l7tech/policy/AssertionPath;
      // 36: invokevirtual com/l7tech/policy/AssertionPath.hashCode ()I
      // 39: imul
      // 3a: iadd
      // 3b: iadd
      // 3c: istore 1
      // 3d: aload 0
      // 3e: iload 1
      // 3f: putfield com/l7tech/policy/AssertionPath.hashCode I
      // 42: iload 1
      // 43: ireturn
      // try (3 -> 11): 12 java/lang/IllegalArgumentException
      // try (5 -> 16): 16 java/lang/IllegalArgumentException
   }

   @Override
   public String toString() {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: new java/lang/StringBuffer
      // 03: dup
      // 04: ldc "["
      // 06: invokespecial java/lang/StringBuffer.<init> (Ljava/lang/String;)V
      // 09: astore 1
      // 0a: bipush 0
      // 0b: istore 2
      // 0c: aload 0
      // 0d: invokevirtual com/l7tech/policy/AssertionPath.getPathCount ()I
      // 10: istore 3
      // 11: iload 2
      // 12: iload 3
      // 13: if_icmpge 45
      // 16: iload 2
      // 17: ifle 32
      // 1a: goto 21
      // 1d: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 20: athrow
      // 21: aload 1
      // 22: getstatic com/l7tech/policy/AssertionPath.a [Ljava/lang/String;
      // 25: bipush 2
      // 26: aaload
      // 27: invokevirtual java/lang/StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer;
      // 2a: pop
      // 2b: goto 32
      // 2e: invokestatic com/l7tech/policy/AssertionPath.a (Ljava/lang/IllegalArgumentException;)Ljava/lang/IllegalArgumentException;
      // 31: athrow
      // 32: aload 1
      // 33: aload 0
      // 34: iload 2
      // 35: invokevirtual com/l7tech/policy/AssertionPath.getPathAssertion (I)Lcom/l7tech/policy/assertion/Assertion;
      // 38: invokevirtual java/lang/Object.getClass ()Ljava/lang/Class;
      // 3b: invokevirtual java/lang/StringBuffer.append (Ljava/lang/Object;)Ljava/lang/StringBuffer;
      // 3e: pop
      // 3f: iinc 2 1
      // 42: goto 11
      // 45: aload 1
      // 46: ldc "]"
      // 48: invokevirtual java/lang/StringBuffer.append (Ljava/lang/String;)Ljava/lang/StringBuffer;
      // 4b: pop
      // 4c: aload 1
      // 4d: invokevirtual java/lang/StringBuffer.toString ()Ljava/lang/String;
      // 50: areturn
      // try (10 -> 15): 16 java/lang/IllegalArgumentException
      // try (13 -> 24): 25 java/lang/IllegalArgumentException
   }

   public int getPathOrder() {
      return this.pathOrder;
   }

   public void setPathOrder(int var1) {
      this.pathOrder = var1;
   }

   private static IllegalArgumentException a(IllegalArgumentException var0) {
      return var0;
   }

   static {
      String[] var5 = new String[4];
      int var3 = 0;
      String var2 = "+\bq`WE_+\u000ed`LXN+\u0012r%[YMb\u0004f`JQEl\u0004\u0006B\u000ff%@\u0010";
      int var4 = "+\bq`WE_+\u000ed`LXN+\u0012r%[YMb\u0004f`JQEl\u0004\u0006B\u000ff%@\u0010".length();
      char var1 = 30;
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 61;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var8 = a(var10000, a(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     a = var5;
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var8;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = " F'|\u0007q/\u001f^B,'v4ZEXe\tk\u0017^CD,\u000bp4K\u0017NiFk(Q\u0017By\nii";
                  var4 = " F'|\u0007q/\u001f^B,'v4ZEXe\tk\u0017^CD,\u000bp4K\u0017NiFk(Q\u0017By\nii".length();
                  var1 = 2;
                  var7 = -1;
            }

            var10000 = 58;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

   private static char[] a(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 22);
      }

      return var10000;
   }

   private static String a(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 54;
            case 1 -> 92;
            case 2 -> 63;
            case 3 -> 125;
            case 4 -> 5;
            case 5 -> 13;
            default -> 22;
         });
      }

      return new String(var10001).intern();
   }
}
