package r;

import androidx.datastore.preferences.protobuf.b0;
import e4.AbstractC0564h;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/* JADX INFO: renamed from: r.e, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0966e extends j implements Map {

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public b0 f9598n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public C0963b f9599o;
    public C0965d p;

    public C0966e() {
        super(0);
    }

    @Override // java.util.Map
    public final Set entrySet() {
        b0 b0Var = this.f9598n;
        if (b0Var != null) {
            return b0Var;
        }
        b0 b0Var2 = new b0(2, this);
        this.f9598n = b0Var2;
        return b0Var2;
    }

    public final boolean j(Collection collection) {
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            if (!super.containsKey(it.next())) {
                return false;
            }
        }
        return true;
    }

    public final boolean k(Collection collection) {
        int i = this.f9618m;
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            super.remove(it.next());
        }
        return i != this.f9618m;
    }

    @Override // java.util.Map
    public final Set keySet() {
        C0963b c0963b = this.f9599o;
        if (c0963b != null) {
            return c0963b;
        }
        C0963b c0963b2 = new C0963b(this);
        this.f9599o = c0963b2;
        return c0963b2;
    }

    public final boolean l(Collection collection) {
        int i = this.f9618m;
        for (int i5 = i - 1; i5 >= 0; i5--) {
            if (!collection.contains(f(i5))) {
                g(i5);
            }
        }
        return i != this.f9618m;
    }

    @Override // java.util.Map
    public final void putAll(Map map) {
        b(map.size() + this.f9618m);
        for (Map.Entry entry : map.entrySet()) {
            put(entry.getKey(), entry.getValue());
        }
    }

    @Override // java.util.Map
    public final Collection values() {
        C0965d c0965d = this.p;
        if (c0965d != null) {
            return c0965d;
        }
        C0965d c0965d2 = new C0965d(this);
        this.p = c0965d2;
        return c0965d2;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0966e(j jVar) {
        super(0);
        int i = jVar.f9618m;
        b(this.f9618m + i);
        if (this.f9618m != 0) {
            for (int i5 = 0; i5 < i; i5++) {
                put(jVar.f(i5), jVar.i(i5));
            }
        } else if (i > 0) {
            AbstractC0564h.N(0, 0, i, jVar.f9616k, this.f9616k);
            AbstractC0564h.O(0, 0, i << 1, jVar.f9617l, this.f9617l);
            this.f9618m = i;
        }
    }
}
