package com.l7tech.common.io;

import java.io.IOException;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

class ac implements EntityResolver {
   private final EntityResolver a;
   private static final String c;

   private ac(EntityResolver var1) {
      this.a = var1;
   }

   protected final InputSource checkResolved(InputSource param1, boolean param2, String param3) throws IOException {
      // $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: iload 2
      // 01: ifne 0f
      // 04: aload 1
      // 05: ifnull 36
      // 08: goto 0f
      // 0b: invokestatic com/l7tech/common/io/ac.a (Ljava/io/IOException;)Ljava/io/IOException;
      // 0e: athrow
      // 0f: aload 1
      // 10: ifnull 4e
      // 13: goto 1a
      // 16: invokestatic com/l7tech/common/io/ac.a (Ljava/io/IOException;)Ljava/io/IOException;
      // 19: athrow
      // 1a: aload 1
      // 1b: invokevirtual org/xml/sax/InputSource.getByteStream ()Ljava/io/InputStream;
      // 1e: ifnonnull 4e
      // 21: goto 28
      // 24: invokestatic com/l7tech/common/io/ac.a (Ljava/io/IOException;)Ljava/io/IOException;
      // 27: athrow
      // 28: aload 1
      // 29: invokevirtual org/xml/sax/InputSource.getCharacterStream ()Ljava/io/Reader;
      // 2c: ifnonnull 4e
      // 2f: goto 36
      // 32: invokestatic com/l7tech/common/io/ac.a (Ljava/io/IOException;)Ljava/io/IOException;
      // 35: athrow
      // 36: new java/io/IOException
      // 39: dup
      // 3a: aload 3
      // 3b: getstatic com/l7tech/common/io/ac.c Ljava/lang/String;
      // 3e: swap
      // 3f: ldc "'"
      // 41: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/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" ]
      // 46: invokespecial java/io/IOException.<init> (Ljava/lang/String;)V
      // 49: athrow
      // 4a: invokestatic com/l7tech/common/io/ac.a (Ljava/io/IOException;)Ljava/io/IOException;
      // 4d: athrow
      // 4e: aload 1
      // 4f: areturn
      // try (0 -> 4): 5 java/io/IOException
      // try (2 -> 9): 10 java/io/IOException
      // try (7 -> 15): 16 java/io/IOException
      // try (12 -> 21): 22 java/io/IOException
      // try (18 -> 33): 33 java/io/IOException
   }

   @Override
   public final InputSource resolveEntity(String var1, String var2) throws SAXException, IOException {
      return this.checkResolved(this.a.resolveEntity(var1, var2), false, var2);
   }

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

   static {
      String var10002 = a(120, a("eA-\u0015j)\u001aIZx\u000bkz\u001bJX=Y)"));
      byte var10001 = -1;
      c = var10002;
   }

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

      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 -> 94;
            case 1 -> 86;
            case 2 -> 32;
            case 3 -> 1;
            case 4 -> 118;
            case 5 -> 113;
            default -> 12;
         });
      }

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