package a.i.b.a.c.b;

import a.a.aj;
import a.i.b.a.c.b.c.af;
import a.i.b.a.c.i.d;
import a.i.b.a.c.i.e.a.e;
import a.i.b.a.c.i.e.a.g;
import a.i.b.a.c.n.a;
import com.google.android.gms.common.internal.ImagesContract;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.ServiceLoader;
import java.util.Set;

public final class ay {
    public static final az BeW = new 1("private");
    public static final az BeX = new az("private_to_this") {
        public final boolean b(e eVar, p pVar, l lVar) {
            AppMethodBeat.i(119305);
            if (ay.BeW.b(eVar, pVar, lVar)) {
                if (eVar == ay.Bfj) {
                    AppMethodBeat.o(119305);
                    return true;
                } else if (eVar == ay.Bfi) {
                    AppMethodBeat.o(119305);
                    return false;
                } else {
                    l a = d.a((l) pVar, e.class);
                    if (a != null && (eVar instanceof g)) {
                        boolean equals = ((g) eVar).dZR().dZm().equals(a.dZd());
                        AppMethodBeat.o(119305);
                        return equals;
                    }
                }
            }
            AppMethodBeat.o(119305);
            return false;
        }

        public final String getDisplayName() {
            return "private/*private to this*/";
        }
    };
    public static final az BeY = new 6("protected");
    public static final az BeZ = new 7("internal");
    public static final az Bfa = new 8("public");
    public static final az Bfb = new 9(ImagesContract.LOCAL);
    public static final az Bfc = new 10("inherited");
    public static final az Bfd = new 11("invisible_fake");
    public static final az Bfe = new 12("unknown");
    public static final Set<az> Bff = Collections.unmodifiableSet(aj.setOf(new az[]{BeW, BeX, BeZ, Bfb}));
    private static final Map<az, Integer> Bfg;
    public static final az Bfh = Bfa;
    private static final e Bfi = new 2();
    public static final e Bfj = new 3();
    @Deprecated
    public static final e Bfk = new 4();
    private static final a.i.b.a.c.m.g Bfl;

    static {
        AppMethodBeat.i(119315);
        HashMap UP = a.UP(4);
        UP.put(BeX, Integer.valueOf(0));
        UP.put(BeW, Integer.valueOf(0));
        UP.put(BeZ, Integer.valueOf(1));
        UP.put(BeY, Integer.valueOf(1));
        UP.put(Bfa, Integer.valueOf(2));
        Bfg = Collections.unmodifiableMap(UP);
        Iterator it = ServiceLoader.load(a.i.b.a.c.m.g.class, a.i.b.a.c.m.g.class.getClassLoader()).iterator();
        Bfl = it.hasNext() ? (a.i.b.a.c.m.g) it.next() : a.i.b.a.c.m.g.a.BLF;
        AppMethodBeat.o(119315);
    }

    public static boolean a(p pVar, l lVar) {
        AppMethodBeat.i(119310);
        if (a(Bfj, pVar, lVar) == null) {
            AppMethodBeat.o(119310);
            return true;
        }
        AppMethodBeat.o(119310);
        return false;
    }

    public static boolean a(l lVar, l lVar2) {
        AppMethodBeat.i(119311);
        an C = d.C(lVar2);
        if (C != an.BeS) {
            boolean equals = C.equals(d.C(lVar));
            AppMethodBeat.o(119311);
            return equals;
        }
        AppMethodBeat.o(119311);
        return false;
    }

    private static p a(e eVar, p pVar, l lVar) {
        p pVar2;
        AppMethodBeat.i(119312);
        l pVar22 = (p) pVar.dZd();
        while (pVar22 != null && pVar22.dYf() != Bfb) {
            if (pVar22.dYf().b(eVar, pVar22, lVar)) {
                pVar22 = (p) d.a(pVar22, p.class);
            } else {
                AppMethodBeat.o(119312);
                return pVar22;
            }
        }
        if (pVar instanceof af) {
            pVar22 = a(eVar, ((af) pVar).eaL(), lVar);
            if (pVar22 != null) {
                AppMethodBeat.o(119312);
                return pVar22;
            }
        }
        AppMethodBeat.o(119312);
        return null;
    }

    static Integer a(az azVar, az azVar2) {
        AppMethodBeat.i(119313);
        Integer valueOf;
        if (azVar == azVar2) {
            valueOf = Integer.valueOf(0);
            AppMethodBeat.o(119313);
            return valueOf;
        }
        valueOf = (Integer) Bfg.get(azVar);
        Integer num = (Integer) Bfg.get(azVar2);
        if (valueOf == null || num == null || valueOf.equals(num)) {
            AppMethodBeat.o(119313);
            return null;
        }
        valueOf = Integer.valueOf(valueOf.intValue() - num.intValue());
        AppMethodBeat.o(119313);
        return valueOf;
    }

    public static Integer b(az azVar, az azVar2) {
        AppMethodBeat.i(119314);
        Integer c = azVar.c(azVar2);
        if (c != null) {
            AppMethodBeat.o(119314);
            return c;
        }
        c = azVar2.c(azVar);
        if (c != null) {
            c = Integer.valueOf(-c.intValue());
            AppMethodBeat.o(119314);
            return c;
        }
        AppMethodBeat.o(119314);
        return null;
    }

    public static boolean b(az azVar) {
        return azVar == BeW || azVar == BeX;
    }
}
