package kotlin.reflect.w.internal.y0.n;

import java.util.ArrayDeque;
import java.util.Set;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.o;
import kotlin.reflect.w.internal.y0.n.b2.i;
import kotlin.reflect.w.internal.y0.n.b2.k;
import kotlin.reflect.w.internal.y0.n.b2.p;
import kotlin.reflect.w.internal.y0.p.i;

/* JADX INFO: loaded from: classes2.dex */
public class d1 {
    public final boolean a;

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final p f8897d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final l f8898e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final m f8899f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f8900g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f8901h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public ArrayDeque<k> f8902i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public Set<k> f8903j;

    public interface a {

        /* JADX INFO: renamed from: r.i0.w.b.y0.n.d1$a$a, reason: collision with other inner class name */
        public static final class C0174a implements a {
            public boolean a;

            @Override // r.i0.w.b.y0.n.d1.a
            public void a(Function0<Boolean> function0) {
                o.f(function0, "block");
                if (this.a) {
                    return;
                }
                this.a = ((Boolean) ((f) function0).invoke()).booleanValue();
            }
        }

        void a(Function0<Boolean> function0);
    }

    public static abstract class b {

        public static abstract class a extends b {
            public a() {
                super(null);
            }
        }

        /* JADX INFO: renamed from: r.i0.w.b.y0.n.d1$b$b, reason: collision with other inner class name */
        public static final class C0175b extends b {
            public static final C0175b a = new C0175b();

            public C0175b() {
                super(null);
            }

            @Override // r.i0.w.b.y0.n.d1.b
            public k a(d1 d1Var, i iVar) {
                o.f(d1Var, "state");
                o.f(iVar, "type");
                return d1Var.f8897d.a0(iVar);
            }
        }

        public static final class c extends b {
            public static final c a = new c();

            public c() {
                super(null);
            }

            @Override // r.i0.w.b.y0.n.d1.b
            public k a(d1 d1Var, i iVar) {
                o.f(d1Var, "state");
                o.f(iVar, "type");
                throw new UnsupportedOperationException("Should not be called");
            }
        }

        public static final class d extends b {
            public static final d a = new d();

            public d() {
                super(null);
            }

            @Override // r.i0.w.b.y0.n.d1.b
            public k a(d1 d1Var, i iVar) {
                o.f(d1Var, "state");
                o.f(iVar, "type");
                return d1Var.f8897d.O(iVar);
            }
        }

        public b(DefaultConstructorMarker defaultConstructorMarker) {
        }

        public abstract k a(d1 d1Var, i iVar);
    }

    public d1(boolean z2, boolean z3, boolean z4, p pVar, l lVar, m mVar) {
        o.f(pVar, "typeSystemContext");
        o.f(lVar, "kotlinTypePreparator");
        o.f(mVar, "kotlinTypeRefiner");
        this.a = z2;
        this.f8895b = z3;
        this.f8896c = z4;
        this.f8897d = pVar;
        this.f8898e = lVar;
        this.f8899f = mVar;
    }

    public Boolean a(i iVar, i iVar2) {
        o.f(iVar, "subType");
        o.f(iVar2, "superType");
        return null;
    }

    public final void b() {
        ArrayDeque<k> arrayDeque = this.f8902i;
        o.c(arrayDeque);
        arrayDeque.clear();
        Set<k> set = this.f8903j;
        o.c(set);
        set.clear();
        this.f8901h = false;
    }

    public boolean c(i iVar, i iVar2) {
        o.f(iVar, "subType");
        o.f(iVar2, "superType");
        return true;
    }

    public final void d() {
        this.f8901h = true;
        if (this.f8902i == null) {
            this.f8902i = new ArrayDeque<>(4);
        }
        if (this.f8903j == null) {
            this.f8903j = i.b.a();
        }
    }

    public final kotlin.reflect.w.internal.y0.n.b2.i e(kotlin.reflect.w.internal.y0.n.b2.i iVar) {
        o.f(iVar, "type");
        return this.f8898e.a(iVar);
    }

    public final kotlin.reflect.w.internal.y0.n.b2.i f(kotlin.reflect.w.internal.y0.n.b2.i iVar) {
        o.f(iVar, "type");
        return this.f8899f.a(iVar);
    }
}
