/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.siteminder.SiteMinderContext$SessionDef
 *  com.l7tech.util.Functions$Unary
 */
package com.l7tech.server.policy.variable;

import com.l7tech.gateway.common.siteminder.SiteMinderContext;
import com.l7tech.server.policy.variable.ExpandVariables;
import com.l7tech.server.policy.variable.SiteMinderContextSelector;
import com.l7tech.util.Functions;

class fu
implements Functions.Unary<ExpandVariables.Selector.Selection, String> {
    final SiteMinderContext.SessionDef val$sessionDef;
    private static final String[] a;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    fu(SiteMinderContextSelector siteMinderContextSelector, SiteMinderContext.SessionDef sessionDef) {
        this.val$sessionDef = sessionDef;
    }

    public ExpandVariables.Selector.Selection call(String string) {
        String string2 = string;
        int n2 = -1;
        switch (string2.hashCode()) {
            case 3355: {
                String[] stringArray = a;
                if (!string2.equals(stringArray[4])) break;
                n2 = 0;
                break;
            }
            case 3536827: {
                String[] stringArray = a;
                if (!string2.equals(stringArray[3])) break;
                n2 = 1;
                break;
            }
            case -1193126131: {
                String[] stringArray = a;
                if (!string2.equals(stringArray[5])) break;
                n2 = 2;
                break;
            }
            case -1804628099: {
                String[] stringArray = a;
                if (!string2.equals(stringArray[2])) break;
                n2 = 3;
                break;
            }
            case -934964668: {
                String[] stringArray = a;
                if (!string2.equals(stringArray[0])) break;
                n2 = 4;
                break;
            }
            case -2128341457: {
                String[] stringArray = a;
                if (!string2.equals(stringArray[1])) break;
                n2 = 5;
                break;
            }
            case -1458460061: {
                String[] stringArray = a;
                if (!string2.equals(stringArray[7])) break;
                n2 = 6;
                break;
            }
            case 602188742: {
                if (!string2.equals(a[6])) break;
                n2 = 7;
            }
        }
        switch (n2) {
            case 0: {
                return new ExpandVariables.Selector.Selection(this.val$sessionDef.getId());
            }
            case 1: {
                return new ExpandVariables.Selector.Selection(this.val$sessionDef.getSpec());
            }
            case 2: {
                return new ExpandVariables.Selector.Selection(Integer.toString(this.val$sessionDef.getIdleTimeout()));
            }
            case 3: {
                return new ExpandVariables.Selector.Selection(Integer.toString(this.val$sessionDef.getMaxTimeout()));
            }
            case 4: {
                return new ExpandVariables.Selector.Selection(Integer.toString(this.val$sessionDef.getReason()));
            }
            case 5: {
                return new ExpandVariables.Selector.Selection(Integer.toString(this.val$sessionDef.getSessionStartTime()));
            }
            case 6: {
                return new ExpandVariables.Selector.Selection(Integer.toString(this.val$sessionDef.getSessionLastTime()));
            }
            case 7: {
                return new ExpandVariables.Selector.Selection(Integer.toString(this.val$sessionDef.getCurrentServerTime()));
            }
        }
        return null;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[8];
                var3_1 = 0;
                var2_2 = ",8K\u0016\u0010\n\t-)K\u0017\u000b\u0010\u001138\n3<R\u0011\u0016\t\u001d1(^\u0004--O\u0006\u000279\u000b79F\u0000\u000b\r\u0015;2_\u0011";
                var4_3 = ",8K\u0016\u0010\n\t-)K\u0017\u000b\u0010\u001138\n3<R\u0011\u0016\t\u001d1(^\u0004--O\u0006\u000279\u000b79F\u0000\u000b\r\u0015;2_\u0011".length();
                var1_4 = 6;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 56;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = fu.a(v0, fu.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "*?O\u0000\r\u001d\u001b=#P\u0017\b%+N\u0006\u001c\u001a\u0002,";
                    var4_3 = "*?O\u0000\r\u001d\u001b=#P\u0017\b%+N\u0006\u001c\u001a\u0002,".length();
                    var1_4 = 11;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 47;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = fu.a(v0, fu.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        fu.a = var5;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x40);
        }
        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 -> 102;
                    case 1 -> 101;
                    case 2 -> 18;
                    case 3 -> 93;
                    case 4 -> 71;
                    case 5 -> 92;
                    default -> 64;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

