package defpackage;

import j$.util.DesugarCollections;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

/* JADX INFO: renamed from: ᵭᵮᵩ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4172 implements InterfaceC3305, InterfaceC3368 {

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public int f15914;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final RunnableC4693 f15915;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public volatile C0529 f15916;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public C3063 f15917;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public int f15918;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final C5155 f15919;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public int f15920 = -1;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public InterfaceC0883 f15921;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public List f15922;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public File f15923;

    public C4172(C5155 c5155, RunnableC4693 runnableC4693) {
        this.f15919 = c5155;
        this.f15915 = runnableC4693;
    }

    @Override // defpackage.InterfaceC3305
    public final void cancel() {
        C0529 c0529 = this.f15916;
        if (c0529 != null) {
            c0529.f2716.cancel();
        }
    }

    @Override // defpackage.InterfaceC3368
    /* JADX INFO: renamed from: ˊᵫᵗ */
    public final void mo1312(Object obj) {
        this.f15915.mo2883(this.f15921, obj, this.f15916.f2716, 4, this.f15917);
    }

    @Override // defpackage.InterfaceC3368
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final void mo1313(Exception exc) {
        this.f15915.mo2884(this.f15917, exc, this.f15916.f2716, 4);
    }

    @Override // defpackage.InterfaceC3305
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final boolean mo5327() {
        List list;
        boolean z;
        List list2;
        boolean z2;
        ArrayList arrayListM10662 = this.f15919.m10662();
        if (arrayListM10662.isEmpty()) {
            return false;
        }
        C5155 c5155 = this.f15919;
        C0790 c0790M5115 = c5155.f19373.m5115();
        Class<?> cls = c5155.f19384.getClass();
        Class cls2 = c5155.f19382;
        Class cls3 = c5155.f19383;
        C3714 c3714 = c0790M5115.f3539;
        C3472 c3472 = (C3472) ((AtomicReference) c3714.f14143).getAndSet(null);
        if (c3472 == null) {
            c3472 = new C3472(cls, cls2, cls3);
        } else {
            c3472.f13377 = cls;
            c3472.f13375 = cls2;
            c3472.f13376 = cls3;
        }
        synchronized (((C3310) c3714.f14142)) {
            list = (List) ((C3310) c3714.f14142).get(c3472);
        }
        ((AtomicReference) c3714.f14143).set(c3472);
        if (list == null) {
            ArrayList arrayList = new ArrayList();
            ArrayList arrayListM4735 = c0790M5115.f3543.m4735(cls);
            int size = arrayListM4735.size();
            int i = 0;
            while (i < size) {
                Object obj = arrayListM4735.get(i);
                i++;
                ArrayList arrayListM8362 = c0790M5115.f3540.m8362((Class) obj, cls2);
                int size2 = arrayListM8362.size();
                int i2 = 0;
                while (i2 < size2) {
                    Object obj2 = arrayListM8362.get(i2);
                    i2++;
                    Class cls4 = (Class) obj2;
                    if (!c0790M5115.f3547.m1406(cls4, cls3).isEmpty() && !arrayList.contains(cls4)) {
                        arrayList.add(cls4);
                    }
                }
            }
            z = false;
            c0790M5115.f3539.m8366(cls, cls2, cls3, DesugarCollections.unmodifiableList(arrayList));
            list2 = arrayList;
        } else {
            z = false;
            list2 = list;
        }
        if (list2.isEmpty()) {
            if (File.class.equals(this.f15919.f19383)) {
                return z;
            }
            StringBuilder sb = new StringBuilder("Failed to find any load path from ");
            sb.append(this.f15919.f19384.getClass());
            Class cls5 = this.f15919.f19383;
            sb.append(" to ");
            sb.append(cls5);
            throw new IllegalStateException(sb.toString());
        }
        while (true) {
            List list3 = this.f15922;
            if (list3 != null && this.f15914 < list3.size()) {
                this.f15916 = null;
                boolean z3 = z;
                while (!z3 && this.f15914 < this.f15922.size()) {
                    List list4 = this.f15922;
                    int i3 = this.f15914;
                    this.f15914 = i3 + 1;
                    InterfaceC0713 interfaceC0713 = (InterfaceC0713) list4.get(i3);
                    File file = this.f15923;
                    C5155 c51552 = this.f15919;
                    this.f15916 = interfaceC0713.mo1492(file, c51552.f19376, c51552.f19386, c51552.f19385);
                    if (this.f15916 != null && this.f15919.m10660(this.f15916.f2716.mo1311()) != null) {
                        this.f15916.f2716.mo1314(this.f15919.f19377, this);
                        z3 = true;
                    }
                }
                return z3;
            }
            int i4 = this.f15920 + 1;
            this.f15920 = i4;
            if (i4 >= list2.size()) {
                int i5 = this.f15918 + 1;
                this.f15918 = i5;
                if (i5 >= arrayListM10662.size()) {
                    return z;
                }
                this.f15920 = z ? 1 : 0;
            }
            InterfaceC0883 interfaceC0883 = (InterfaceC0883) arrayListM10662.get(this.f15918);
            Class cls6 = (Class) list2.get(this.f15920);
            InterfaceC0214 interfaceC0214M10661 = this.f15919.m10661(cls6);
            C5155 c51553 = this.f15919;
            this.f15917 = new C3063(c51553.f19373.f7470, interfaceC0883, c51553.f19372, c51553.f19376, c51553.f19386, interfaceC0214M10661, cls6, c51553.f19385);
            File fileMo10107 = c51553.f19371.m10223().mo10107(this.f15917);
            this.f15923 = fileMo10107;
            if (fileMo10107 != null) {
                this.f15921 = interfaceC0883;
                this.f15922 = this.f15919.f19373.m5115().m2853(fileMo10107);
                z2 = false;
                this.f15914 = 0;
            } else {
                z2 = false;
            }
            z = z2;
        }
    }
}
