package kotlin.reflect.jvm.internal.impl.descriptors.annotations;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import kotlin.jvm.internal.t;

/* loaded from: classes3.dex */
public final class l implements g {

    /* renamed from: p, reason: collision with root package name */
    private final g f26232p;

    /* renamed from: q, reason: collision with root package name */
    private final boolean f26233q;

    /* renamed from: r, reason: collision with root package name */
    private final dn.l f26234r;

    public l(g delegate, boolean z10, dn.l fqNameFilter) {
        t.g(delegate, "delegate");
        t.g(fqNameFilter, "fqNameFilter");
        this.f26232p = delegate;
        this.f26233q = z10;
        this.f26234r = fqNameFilter;
    }

    private final boolean e(c cVar) {
        ro.c d10 = cVar.d();
        return d10 != null && ((Boolean) this.f26234r.invoke(d10)).booleanValue();
    }

    @Override // kotlin.reflect.jvm.internal.impl.descriptors.annotations.g
    public boolean isEmpty() {
        boolean z10;
        g gVar = this.f26232p;
        if (!(gVar instanceof Collection) || !((Collection) gVar).isEmpty()) {
            Iterator it = gVar.iterator();
            while (it.hasNext()) {
                if (e((c) it.next())) {
                    z10 = true;
                    break;
                }
            }
        }
        z10 = false;
        return this.f26233q ? !z10 : z10;
    }

    @Override // java.lang.Iterable
    public Iterator iterator() {
        g gVar = this.f26232p;
        ArrayList arrayList = new ArrayList();
        for (Object obj : gVar) {
            if (e((c) obj)) {
                arrayList.add(obj);
            }
        }
        return arrayList.iterator();
    }

    @Override // kotlin.reflect.jvm.internal.impl.descriptors.annotations.g
    public c j(ro.c fqName) {
        t.g(fqName, "fqName");
        if (((Boolean) this.f26234r.invoke(fqName)).booleanValue()) {
            return this.f26232p.j(fqName);
        }
        return null;
    }

    @Override // kotlin.reflect.jvm.internal.impl.descriptors.annotations.g
    public boolean p0(ro.c fqName) {
        t.g(fqName, "fqName");
        if (((Boolean) this.f26234r.invoke(fqName)).booleanValue()) {
            return this.f26232p.p0(fqName);
        }
        return false;
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public l(g delegate, dn.l fqNameFilter) {
        this(delegate, false, fqNameFilter);
        t.g(delegate, "delegate");
        t.g(fqNameFilter, "fqNameFilter");
    }
}
