package com.l7tech.server.policy.assertion.credential;

import com.l7tech.common.http.GenericHttpClient;
import com.l7tech.common.http.GenericHttpClientFactory;
import com.l7tech.common.http.GenericHttpRequestParams;
import com.l7tech.gateway.common.audit.AssertionMessages;
import com.l7tech.message.SecurityKnob;
import com.l7tech.message.XmlKnob;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.assertion.credential.WsFederationPassiveTokenRequest;
import com.l7tech.security.token.HasUsernameAndPassword;
import com.l7tech.security.token.SecurityToken;
import com.l7tech.security.token.UsernameToken;
import com.l7tech.security.wsfederation.FederationPassiveClient;
import com.l7tech.security.wsfederation.InvalidHtmlException;
import com.l7tech.security.wsfederation.InvalidTokenException;
import com.l7tech.security.wsfederation.ResponseStatusException;
import com.l7tech.server.message.AuthenticationContext;
import com.l7tech.server.message.PolicyContextCache;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.xml.saml.SamlAssertion;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.util.logging.Level;
import org.springframework.context.ApplicationContext;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class ServerWsFederationPassiveTokenRequest extends AbstractServerWsFederationPassiveRequestProfile<WsFederationPassiveTokenRequest> {
   private static final String j;
   private final GenericHttpClient k;
   private final URL l;
   private static final String[] o;

   public ServerWsFederationPassiveTokenRequest(WsFederationPassiveTokenRequest var1, ApplicationContext var2) {
      super(var1, j, var2);
      String[] var4 = o;
      this.k = ((GenericHttpClientFactory)var2.getBean(var4[7], GenericHttpClientFactory.class)).createHttpClient();

      try {
         if (var1.getIpStsUrl() == null) {
            this.logger.warning(var4[0]);
            this.l = null;
         } else {
            try {
               this.l = new URL(var1.getIpStsUrl());
               if (this.l.getQuery() != null) {
                  throw new IllegalArgumentException(o[3]);
               }
            } catch (MalformedURLException var5) {
               throw b(var5);
            }
         }
      } catch (MalformedURLException var6) {
         throw new IllegalArgumentException(o[11], var6);
      }
   }

   @Override
   public AssertionStatus checkRequest(PolicyEnforcementContext var1) throws IOException, PolicyAssertionException {
      AssertionStatus var2 = AssertionStatus.FAILED;

      try {
         try {
            if (this.l == null) {
               throw new AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException(AssertionMessages.WSFEDPASS_CONFIG_INVALID);
            }
         } catch (AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException var4) {
            throw b(var4);
         }

         var2 = this.b(var1);
      } catch (AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException var5) {
         var2 = AssertionStatus.AUTH_REQUIRED;
      } catch (AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException var6) {
         this.logAndAudit(var6.getAssertionMessage(), null, var6.getCause());
      }

      return var2;
   }

   private UsernameToken a(SecurityKnob param1) throws AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException {
      // $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: aconst_null
      // 01: astore 2
      // 02: aload 1
      // 03: ifnull 60
      // 06: aload 1
      // 07: invokeinterface com/l7tech/message/SecurityKnob.getProcessorResult ()Lcom/l7tech/security/xml/processor/ProcessorResult; 1
      // 0c: astore 3
      // 0d: aload 3
      // 0e: ifnull 60
      // 11: aload 3
      // 12: invokeinterface com/l7tech/security/xml/processor/ProcessorResult.getXmlSecurityTokens ()[Lcom/l7tech/security/token/XmlSecurityToken; 1
      // 17: astore 4
      // 19: aload 4
      // 1b: astore 5
      // 1d: aload 5
      // 1f: arraylength
      // 20: istore 6
      // 22: bipush 0
      // 23: istore 7
      // 25: iload 7
      // 27: iload 6
      // 29: if_icmpge 60
      // 2c: aload 5
      // 2e: iload 7
      // 30: aaload
      // 31: astore 8
      // 33: aload 8
      // 35: instanceof com/l7tech/security/token/UsernameToken
      // 38: ifeq 5a
      // 3b: aload 2
      // 3c: ifnonnull 4f
      // 3f: goto 46
      // 42: invokestatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.b (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 45: athrow
      // 46: aload 8
      // 48: checkcast com/l7tech/security/token/UsernameToken
      // 4b: astore 2
      // 4c: goto 5a
      // 4f: new com/l7tech/server/policy/assertion/credential/AbstractServerWsFederationPassiveRequestProfile$StopAndAuditException
      // 52: dup
      // 53: getstatic com/l7tech/gateway/common/audit/AssertionMessages.WSFEDPASS_MULTI_TOKENS Lcom/l7tech/gateway/common/audit/Messages$M;
      // 56: invokespecial com/l7tech/server/policy/assertion/credential/AbstractServerWsFederationPassiveRequestProfile$StopAndAuditException.<init> (Lcom/l7tech/gateway/common/audit/Messages$M;)V
      // 59: athrow
      // 5a: iinc 7 1
      // 5d: goto 25
      // 60: aload 0
      // 61: getfield com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.logger Ljava/util/logging/Logger;
      // 64: getstatic java/util/logging/Level.FINEST Ljava/util/logging/Level;
      // 67: invokevirtual java/util/logging/Logger.isLoggable (Ljava/util/logging/Level;)Z
      // 6a: ifeq 94
      // 6d: aload 0
      // 6e: getfield com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.logger Ljava/util/logging/Logger;
      // 71: aload 2
      // 72: ifnull 84
      // 75: goto 7c
      // 78: invokestatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.b (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 7b: athrow
      // 7c: bipush 1
      // 7d: goto 85
      // 80: invokestatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.b (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 83: athrow
      // 84: bipush 0
      // 85: getstatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.o [Ljava/lang/String;
      // 88: bipush 10
      // 8a: aaload
      // 8b: swap
      // 8c: invokedynamic makeConcatWithConstants (Ljava/lang/String;Z)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" ]
      // 91: invokevirtual java/util/logging/Logger.finest (Ljava/lang/String;)V
      // 94: aload 2
      // 95: areturn
      // try (26 -> 31): 32 com/l7tech/server/policy/assertion/credential/AbstractServerWsFederationPassiveRequestProfile$StopAndAuditException
      // try (45 -> 54): 55 com/l7tech/server/policy/assertion/credential/AbstractServerWsFederationPassiveRequestProfile$StopAndAuditException
      // try (50 -> 59): 59 com/l7tech/server/policy/assertion/credential/AbstractServerWsFederationPassiveRequestProfile$StopAndAuditException
   }

   private UsernameToken a(AuthenticationContext 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: aconst_null
      // 01: astore 2
      // 02: aload 1
      // 03: invokevirtual com/l7tech/server/message/AuthenticationContext.getLastCredentials ()Lcom/l7tech/policy/assertion/credential/LoginCredentials;
      // 06: astore 3
      // 07: aload 3
      // 08: ifnull 4f
      // 0b: aload 3
      // 0c: invokevirtual com/l7tech/policy/assertion/credential/LoginCredentials.getFormat ()Lcom/l7tech/policy/assertion/credential/CredentialFormat;
      // 0f: getstatic com/l7tech/policy/assertion/credential/CredentialFormat.CLEARTEXT Lcom/l7tech/policy/assertion/credential/CredentialFormat;
      // 12: if_acmpne 2f
      // 15: goto 1c
      // 18: invokestatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.b (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1b: athrow
      // 1c: new com/l7tech/security/token/UsernameTokenImpl
      // 1f: dup
      // 20: aload 3
      // 21: invokevirtual com/l7tech/policy/assertion/credential/LoginCredentials.getLogin ()Ljava/lang/String;
      // 24: aload 3
      // 25: invokevirtual com/l7tech/policy/assertion/credential/LoginCredentials.getCredentials ()[C
      // 28: invokespecial com/l7tech/security/token/UsernameTokenImpl.<init> (Ljava/lang/String;[C)V
      // 2b: astore 2
      // 2c: goto 4f
      // 2f: aload 0
      // 30: getfield com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.logger Ljava/util/logging/Logger;
      // 33: getstatic java/util/logging/Level.FINEST Ljava/util/logging/Level;
      // 36: invokevirtual java/util/logging/Logger.isLoggable (Ljava/util/logging/Level;)Z
      // 39: ifeq 4f
      // 3c: aload 0
      // 3d: getfield com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.logger Ljava/util/logging/Logger;
      // 40: getstatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.o [Ljava/lang/String;
      // 43: bipush 5
      // 44: aaload
      // 45: invokevirtual java/util/logging/Logger.finest (Ljava/lang/String;)V
      // 48: goto 4f
      // 4b: invokestatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.b (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 4e: athrow
      // 4f: aload 0
      // 50: getfield com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.logger Ljava/util/logging/Logger;
      // 53: getstatic java/util/logging/Level.FINEST Ljava/util/logging/Level;
      // 56: invokevirtual java/util/logging/Logger.isLoggable (Ljava/util/logging/Level;)Z
      // 59: ifeq 83
      // 5c: aload 0
      // 5d: getfield com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.logger Ljava/util/logging/Logger;
      // 60: aload 2
      // 61: ifnull 73
      // 64: goto 6b
      // 67: invokestatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.b (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 6a: athrow
      // 6b: bipush 1
      // 6c: goto 74
      // 6f: invokestatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.b (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 72: athrow
      // 73: bipush 0
      // 74: getstatic com/l7tech/server/policy/assertion/credential/ServerWsFederationPassiveTokenRequest.o [Ljava/lang/String;
      // 77: bipush 9
      // 79: aaload
      // 7a: swap
      // 7b: invokedynamic makeConcatWithConstants (Ljava/lang/String;Z)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" ]
      // 80: invokevirtual java/util/logging/Logger.finest (Ljava/lang/String;)V
      // 83: aload 2
      // 84: areturn
      // try (5 -> 11): 12 java/lang/IllegalArgumentException
      // try (23 -> 34): 35 java/lang/IllegalArgumentException
      // try (37 -> 46): 47 java/lang/IllegalArgumentException
      // try (42 -> 51): 51 java/lang/IllegalArgumentException
   }

   private SamlAssertion a(SecurityToken var1) throws AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException, AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException {
      try {
         if (var1 instanceof HasUsernameAndPassword var5) {
            String var3 = var5.getUsername();
            char[] var4 = var5.getPassword();

            try {
               if (var4 == null) {
                  throw new InvalidTokenException(o[2]);
               }
            } catch (ResponseStatusException var8) {
               throw b(var8);
            }

            GenericHttpRequestParams var13 = new GenericHttpRequestParams(this.l);
            var13.setPasswordAuthentication(new PasswordAuthentication(var3, var4));
            if (FederationPassiveClient.obtainFederationToken(
               this.k, var13, this.assertion.getRealm(), this.assertion.getReplyUrl(), this.assertion.getContext(), this.assertion.isTimestamp()
            ) instanceof SamlAssertion var2) {
               return var2;
            } else {
               throw new InvalidTokenException(o[4]);
            }
         } else {
            String[] var7 = o;
            throw new InvalidTokenException(var7[1]);
         }
      } catch (ResponseStatusException var9) {
         this.logAndAudit(AssertionMessages.WSFEDPASS_RSTR_STATUS_NON_200);
         throw new AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException();
      } catch (InvalidHtmlException var10) {
         throw new AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException(
            AssertionMessages.WSFEDPASS_SERVER_HTML_INVALID, this.causeOrSelf(var10)
         );
      } catch (InvalidTokenException var11) {
         throw new AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException(AssertionMessages.WSFEDPASS_RSTR_BAD_TYPE, this.causeOrSelf(var11));
      } catch (IOException var12) {
         throw new AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException(
            AssertionMessages.WSFEDPASS_SERVER_HTTP_FAILED, this.causeOrSelf(var12)
         );
      }
   }

   private void a(PolicyEnforcementContext var1, SamlAssertion var2, boolean var3) throws AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException, AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException {
      this.doAuth(var1, this.k, var2, this.assertion.getReplyUrl(), this.assertion.getContext(), var3);
   }

   private void a(PolicyEnforcementContext var1, XmlKnob var2, UsernameToken var3, SamlAssertion var4, boolean var5) throws AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException {
      try {
         Document var6 = var2.getDocumentWritable();

         label34: {
            try {
               if (!var5) {
                  this.logAndAudit(AssertionMessages.WSFEDPASS_ORIGINAL_TOKEN_NOT_XML);
                  break label34;
               }
            } catch (Exception var10) {
               throw b(var10);
            }

            Element var7 = var3.asElement();
            Node var8 = var7.getParentNode();

            try {
               var8.removeChild(var7);
               if (var8.getFirstChild() == null) {
                  var8.getParentNode().removeChild(var8);
               }
            } catch (Exception var9) {
               throw b(var9);
            }
         }

         SecurityKnob var12 = var1.getRequest().getSecurityKnob();
         this.updateRequestXml(var1, var2, var12, var6, var4, this.assertion);
      } catch (Exception var11) {
         throw new AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException(AssertionMessages.WSFEDPASS_DECORATION_FAILED, var11);
      }
   }

   private AssertionStatus b(PolicyEnforcementContext var1) throws AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException, AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException {
      XmlKnob var2 = (XmlKnob)var1.getRequest().getKnob(XmlKnob.class);
      this.ensureXmlRequest(var2);
      SecurityKnob var3 = (SecurityKnob)var1.getRequest().getKnob(SecurityKnob.class);
      boolean var4 = true;
      UsernameToken var5 = this.a(var3);
      if (var5 == null) {
         var4 = false;
         var5 = this.a(var1.getAuthenticationContext(var1.getRequest()));
      }

      try {
         if (var5 == null) {
            throw new AbstractServerWsFederationPassiveRequestProfile.StopAndAuditException(AssertionMessages.WSFEDPASS_NO_SUITABLE_CREDENTIALS);
         }
      } catch (AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException var11) {
         throw b(var11);
      }

      PolicyContextCache var6 = var1.getCache();
      boolean var7 = true;
      SamlAssertion var8 = (SamlAssertion)this.getCachedSecurityToken(var6);
      if (var8 == null) {
         var7 = false;
         var8 = this.a(var5);
         this.setCachedSecurityToken(var6, var8, this.getSamlAssertionExpiry(var8));
      } else {
         try {
            if (this.logger.isLoggable(Level.FINE)) {
               this.logger.fine(o[8]);
            }
         } catch (AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException var9) {
            throw b(var9);
         }
      }

      try {
         this.a(var1, var2, var5, var8, var4);
         if (this.assertion.isAuthenticate()) {
            this.a(var1, var8, var7);
         }
      } catch (AbstractServerWsFederationPassiveRequestProfile.AuthRequiredException var10) {
         throw b(var10);
      }

      this.addCacheInvalidator(var1);
      this.addResponseAuthFailureDecorator(var1);
      return AssertionStatus.NONE;
   }

   static {
      String[] var5 = new String[12];
      int var3 = 0;
      String var2 = "+}r\u000e\u0011[2J[J1\u0011G0)$>\u0003Ba\u0007\u0017|w\r_2\u000b\u0016(p\r_?\u0004\u0010f}\u0016X}\f\u0004d$,fn\u0017E2\u0016\nc{\f\u0011e\u0003\u0016f9\u0016\u0011g\u0011\u0000zp\u0003\\wM\u0015im\u0011F}\u0010\u0001%,fn\u0017E2\u0016\nc{\f\u0011v\u000b\u0001f9\u0016\u0011q\r\u000b|\u007f\u000b_2\u0003Ex\u007f\u0011Be\r\u0017l\u001d,X11eAB0ZRBYs\u0011Ei>\u0013Dw\u0010\u001c(m\u0016C{\f\u0002\u00160fm\u0017Ab\r\u0017|{\u0006\u0011f\r\u000empBEk\u0012\u0000)&z{\u0006T|\u0016\fir\u0011\u0011s\u0010\u0000(p\rE2\u0001\tm\u007f\u0010\u0011f\u0007\u001d|2BXu\f\nzw\fV<\u0005K[_/}\u0018\u0004fq\fd`\u000e-|j\u0012r~\u000b\u0000fj$Pq\u0016\nzg\u001b0{w\fV2\u0001\u0004kv\u0007U21$ERBPa\u0011\u0000zj\u000b^|\u001d\"gjB_}\fHPS.\u0011a\u0007\u0006}l\u000bEkB\u0011gu\u0007_-XE";
      int var4 = "+}r\u000e\u0011[2J[J1\u0011G0)$>\u0003Ba\u0007\u0017|w\r_2\u000b\u0016(p\r_?\u0004\u0010f}\u0016X}\f\u0004d$,fn\u0017E2\u0016\nc{\f\u0011e\u0003\u0016f9\u0016\u0011g\u0011\u0000zp\u0003\\wM\u0015im\u0011F}\u0010\u0001%,fn\u0017E2\u0016\nc{\f\u0011v\u000b\u0001f9\u0016\u0011q\r\u000b|\u007f\u000b_2\u0003Ex\u007f\u0011Be\r\u0017l\u001d,X11eAB0ZRBYs\u0011Ei>\u0013Dw\u0010\u001c(m\u0016C{\f\u0002\u00160fm\u0017Ab\r\u0017|{\u0006\u0011f\r\u000empBEk\u0012\u0000)&z{\u0006T|\u0016\fir\u0011\u0011s\u0010\u0000(p\rE2\u0001\tm\u007f\u0010\u0011f\u0007\u001d|2BXu\f\nzw\fV<\u0005K[_/}\u0018\u0004fq\fd`\u000e-|j\u0012r~\u000b\u0000fj$Pq\u0016\nzg\u001b0{w\fV2\u0001\u0004kv\u0007U21$ERBPa\u0011\u0000zj\u000b^|\u001d\"gjB_}\fHPS.\u0011a\u0007\u0006}l\u000bEkB\u0011gu\u0007_-XE"
         .length();
      char var1 = ',';
      int var7 = -1;

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

         while (true) {
            String var8 = d(var10000, c(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     o = var5;
                     j = ServerWsFederationPassiveTokenRequest.class.getName() + o[6];
                     return;
                  }

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

                  var2 = "\\\u0019\u0014<\u0017!P;\u0005\u0005\u007f:\u001euo\u000f@h \u0007yuIZ<\u001aN\u0018\u0001~#\t<o\u0019@l.\u001eo~V)L`?HHV5N\u0003";
                  var4 = "\\\u0019\u0014<\u0017!P;\u0005\u0005\u007f:\u001euo\u000f@h \u0007yuIZ<\u001aN\u0018\u0001~#\t<o\u0019@l.\u001eo~V)L`?HHV5N\u0003"
                     .length();
                  var1 = 25;
                  var7 = -1;
            }

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

   private static Exception b(Exception var0) {
      return var0;
   }

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

      return var10000;
   }

   private static String d(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 -> 10;
            case 1 -> 103;
            case 2 -> 113;
            case 3 -> 13;
            case 4 -> 94;
            case 5 -> 125;
            default -> 13;
         });
      }

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