package p138.p145.p146.p151.p154;

import com.bumptech.glide.Registry;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import p138.p139.p143.p144.C2803;
import p138.p145.p146.p151.EnumC2840;
import p138.p145.p146.p151.InterfaceC2844;
import p138.p145.p146.p151.InterfaceC2852;
import p138.p145.p146.p151.p152.InterfaceC2856;
import p138.p145.p146.p151.p154.InterfaceC2892;
import p138.p145.p146.p151.p158.InterfaceC3028;

/* JADX INFO: renamed from: ދ.ؠ.֏.ތ.ފ.ޔ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C2933 implements InterfaceC2892, InterfaceC2856.InterfaceC2857<Object> {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final InterfaceC2892.InterfaceC2893 f9046;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final C2894<?> f9047;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public int f9048;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public int f9049 = -1;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public InterfaceC2844 f9050;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public List<InterfaceC3028<File, ?>> f9051;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public int f9052;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public volatile InterfaceC3028.C3029<?> f9053;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public File f9054;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public C2934 f9055;

    public C2933(C2894<?> c2894, InterfaceC2892.InterfaceC2893 interfaceC2893) {
        this.f9047 = c2894;
        this.f9046 = interfaceC2893;
    }

    @Override // p138.p145.p146.p151.p154.InterfaceC2892
    public void cancel() {
        InterfaceC3028.C3029<?> c3029 = this.f9053;
        if (c3029 != null) {
            c3029.f9201.cancel();
        }
    }

    @Override // p138.p145.p146.p151.p152.InterfaceC2856.InterfaceC2857
    /* JADX INFO: renamed from: ֏ */
    public void mo4989(Exception exc) {
        this.f9046.mo5007(this.f9055, exc, this.f9053.f9201, EnumC2840.RESOURCE_DISK_CACHE);
    }

    @Override // p138.p145.p146.p151.p152.InterfaceC2856.InterfaceC2857
    /* JADX INFO: renamed from: ֏ */
    public void mo4990(Object obj) {
        this.f9046.mo5008(this.f9050, obj, this.f9053.f9201, EnumC2840.RESOURCE_DISK_CACHE, this.f9055);
    }

    @Override // p138.p145.p146.p151.p154.InterfaceC2892
    /* JADX INFO: renamed from: ֏ */
    public boolean mo5006() {
        List<InterfaceC2844> listM5010 = this.f9047.m5010();
        if (listM5010.isEmpty()) {
            return false;
        }
        C2894<?> c2894 = this.f9047;
        Registry registry = c2894.f8888.f8659;
        Class<?> cls = c2894.f8889.getClass();
        Class<?> cls2 = c2894.f8892;
        Class<?> cls3 = c2894.f8896;
        List<Class<?>> listM5254 = registry.f1514.m5254(cls, cls2, cls3);
        List list = listM5254;
        if (listM5254 == null) {
            ArrayList arrayList = new ArrayList();
            Iterator<Class<?>> it = registry.f1507.m5148(cls).iterator();
            while (it.hasNext()) {
                for (Class cls4 : (ArrayList) registry.f1509.m5260(it.next(), cls2)) {
                    if (!((ArrayList) registry.f1512.m5225(cls4, cls3)).isEmpty() && !arrayList.contains(cls4)) {
                        arrayList.add(cls4);
                    }
                }
            }
            registry.f1514.m5255(cls, cls2, cls3, Collections.unmodifiableList(arrayList));
            list = arrayList;
        }
        if (list.isEmpty()) {
            if (File.class.equals(this.f9047.f8896)) {
                return false;
            }
            StringBuilder sbM4889 = C2803.m4889("Failed to find any load path from ");
            sbM4889.append(this.f9047.f8889.getClass());
            sbM4889.append(" to ");
            sbM4889.append(this.f9047.f8896);
            throw new IllegalStateException(sbM4889.toString());
        }
        while (true) {
            List<InterfaceC3028<File, ?>> list2 = this.f9051;
            if (list2 != null) {
                if (this.f9052 < list2.size()) {
                    this.f9053 = null;
                    boolean z = false;
                    while (!z) {
                        if (!(this.f9052 < this.f9051.size())) {
                            break;
                        }
                        List<InterfaceC3028<File, ?>> list3 = this.f9051;
                        int i = this.f9052;
                        this.f9052 = i + 1;
                        InterfaceC3028<File, ?> interfaceC3028 = list3.get(i);
                        File file = this.f9054;
                        C2894<?> c28942 = this.f9047;
                        this.f9053 = interfaceC3028.mo2519(file, c28942.f8890, c28942.f8891, c28942.f8894);
                        if (this.f9053 != null && this.f9047.m5015(this.f9053.f9201.mo4969())) {
                            this.f9053.f9201.mo4970(this.f9047.f8900, this);
                            z = true;
                        }
                    }
                    return z;
                }
            }
            int i2 = this.f9049 + 1;
            this.f9049 = i2;
            if (i2 >= list.size()) {
                int i3 = this.f9048 + 1;
                this.f9048 = i3;
                if (i3 >= listM5010.size()) {
                    return false;
                }
                this.f9049 = 0;
            }
            InterfaceC2844 interfaceC2844 = listM5010.get(this.f9048);
            Class cls5 = (Class) list.get(this.f9049);
            InterfaceC2852<Z> interfaceC2852M5012 = this.f9047.m5012(cls5);
            C2894<?> c28943 = this.f9047;
            this.f9055 = new C2934(c28943.f8888.f8658, interfaceC2844, c28943.f8899, c28943.f8890, c28943.f8891, interfaceC2852M5012, cls5, c28943.f8894);
            File fileMo5115 = this.f9047.m5013().mo5115(this.f9055);
            this.f9054 = fileMo5115;
            if (fileMo5115 != null) {
                this.f9050 = interfaceC2844;
                this.f9051 = this.f9047.f8888.f8659.m1035(fileMo5115);
                this.f9052 = 0;
            }
        }
    }
}
