/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.encass.EncapsulatedAssertionConfig
 */
package com.l7tech.server.polback;

import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.encass.EncapsulatedAssertionConfig;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.polback.PolicyBackedServiceRegistry;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

class b
implements InvocationHandler {
    final Method val$method;
    final Goid val$policyGoid;
    final EncapsulatedAssertionConfig val$templateOperation;
    final PolicyEnforcementContext val$pec;
    final PolicyBackedServiceRegistry this$0;
    private static final String a = b.a(7, b.a("\u001bG!\u000ew\u0010z8M!Fk\u0001*&M'\u0012}\u0010z4[u\u0016j\u001b\"/\u0018u"));

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    b(PolicyBackedServiceRegistry policyBackedServiceRegistry, Method method, Goid goid, EncapsulatedAssertionConfig encapsulatedAssertionConfig, PolicyEnforcementContext policyEnforcementContext) {
        this.this$0 = policyBackedServiceRegistry;
        this.val$method = method;
        this.val$policyGoid = goid;
        this.val$templateOperation = encapsulatedAssertionConfig;
        this.val$pec = policyEnforcementContext;
    }

    @Override
    public Object invoke(Object object, Method method, Object[] objectArray) throws Throwable {
        try {
            if (!method.equals(this.val$method)) {
                throw new UnsupportedOperationException(a + method.getName());
            }
        }
        catch (Throwable throwable) {
            throw b.a(throwable);
        }
        String string = this.val$method.getName();
        return this.this$0.a(this.val$method, objectArray, this.val$policyGoid, string, this.val$templateOperation.getArgumentDescriptors(), this.val$templateOperation.getResultDescriptors(), this.val$pec);
    }

    private static Throwable a(Throwable throwable) {
        return throwable;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x5D);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 81;
                    case 1 -> 37;
                    case 2 -> 82;
                    case 3 -> 97;
                    case 4 -> 31;
                    case 5 -> 115;
                    default -> 93;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

