package g.e.b.g0;

import java.io.IOException;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public final class s implements g.e.b.e0, Cloneable {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final s f4134f = new s();

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public List<g.e.b.a> f4135m = Collections.emptyList();

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public List<g.e.b.a> f4136n = Collections.emptyList();

    /* JADX INFO: Add missing generic type declarations: [T] */
    public class a<T> extends g.e.b.d0<T> {
        public g.e.b.d0<T> a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final /* synthetic */ boolean f4137b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public final /* synthetic */ boolean f4138c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public final /* synthetic */ g.e.b.j f4139d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public final /* synthetic */ g.e.b.h0.a f4140e;

        public a(boolean z2, boolean z3, g.e.b.j jVar, g.e.b.h0.a aVar) {
            this.f4137b = z2;
            this.f4138c = z3;
            this.f4139d = jVar;
            this.f4140e = aVar;
        }

        @Override // g.e.b.d0
        public T a(g.e.b.i0.a aVar) throws IOException {
            if (this.f4137b) {
                aVar.N();
                return null;
            }
            g.e.b.d0<T> d0VarE = this.a;
            if (d0VarE == null) {
                d0VarE = this.f4139d.e(s.this, this.f4140e);
                this.a = d0VarE;
            }
            return d0VarE.a(aVar);
        }

        @Override // g.e.b.d0
        public void b(g.e.b.i0.c cVar, T t2) {
            if (this.f4138c) {
                cVar.m();
                return;
            }
            g.e.b.d0<T> d0VarE = this.a;
            if (d0VarE == null) {
                d0VarE = this.f4139d.e(s.this, this.f4140e);
                this.a = d0VarE;
            }
            d0VarE.b(cVar, t2);
        }
    }

    @Override // g.e.b.e0
    public <T> g.e.b.d0<T> b(g.e.b.j jVar, g.e.b.h0.a<T> aVar) {
        Class<? super T> cls = aVar.a;
        boolean zD = d(cls);
        boolean z2 = zD || c(cls, true);
        boolean z3 = zD || c(cls, false);
        if (z2 || z3) {
            return new a(z3, z2, jVar, aVar);
        }
        return null;
    }

    public final boolean c(Class<?> cls, boolean z2) {
        Iterator<g.e.b.a> it = (z2 ? this.f4135m : this.f4136n).iterator();
        while (it.hasNext()) {
            if (it.next().b(cls)) {
                return true;
            }
        }
        return false;
    }

    public Object clone() {
        try {
            return (s) super.clone();
        } catch (CloneNotSupportedException e2) {
            throw new AssertionError(e2);
        }
    }

    public final boolean d(Class<?> cls) {
        if (!Enum.class.isAssignableFrom(cls)) {
            if (!((cls.getModifiers() & 8) != 0) && (cls.isAnonymousClass() || cls.isLocalClass())) {
                return true;
            }
        }
        return false;
    }
}
