package com.bumptech.glide.load.engine;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public final class c0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final p0.e f5649a;

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

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

    public c0(Class cls, Class cls2, Class cls3, List list, xyz.stream.utils.t tVar) {
        this.f5649a = tVar;
        if (list.isEmpty()) {
            throw new IllegalArgumentException("Must not be empty.");
        }
        this.f5650b = list;
        this.f5651c = "Failed LoadPath{" + cls.getSimpleName() + "->" + cls2.getSimpleName() + "->" + cls3.getSimpleName() + "}";
    }

    public final e0 a(int i10, int i11, a5.l lVar, com.bumptech.glide.load.data.g gVar, xyz.stream.utils.e0 e0Var) {
        p0.e eVar = this.f5649a;
        List list = (List) t5.n.checkNotNull(eVar.acquire());
        try {
            List list2 = this.f5650b;
            int size = list2.size();
            e0 e0VarA = null;
            for (int i12 = 0; i12 < size; i12++) {
                try {
                    e0VarA = ((m) list2.get(i12)).a(i10, i11, lVar, gVar, e0Var);
                } catch (GlideException e10) {
                    list.add(e10);
                }
                if (e0VarA != null) {
                    break;
                }
            }
            if (e0VarA != null) {
                return e0VarA;
            }
            throw new GlideException(this.f5651c, new ArrayList(list));
        } finally {
            eVar.a(list);
        }
    }

    public final String toString() {
        return "LoadPath{decodePaths=" + Arrays.toString(this.f5650b.toArray()) + '}';
    }
}
