package r;

import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import r4.AbstractC0983h;

/* JADX INFO: renamed from: r.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0964c implements Iterator, Map.Entry {

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f9593k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public int f9594l = -1;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f9595m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final /* synthetic */ C0966e f9596n;

    public C0964c(C0966e c0966e) {
        this.f9596n = c0966e;
        this.f9593k = c0966e.f9618m - 1;
    }

    @Override // java.util.Map.Entry
    public final boolean equals(Object obj) {
        if (!this.f9595m) {
            throw new IllegalStateException("This container does not support retaining Map.Entry objects");
        }
        if (!(obj instanceof Map.Entry)) {
            return false;
        }
        Map.Entry entry = (Map.Entry) obj;
        Object key = entry.getKey();
        int i = this.f9594l;
        C0966e c0966e = this.f9596n;
        return AbstractC0983h.a(key, c0966e.f(i)) && AbstractC0983h.a(entry.getValue(), c0966e.i(this.f9594l));
    }

    @Override // java.util.Map.Entry
    public final Object getKey() {
        if (this.f9595m) {
            return this.f9596n.f(this.f9594l);
        }
        throw new IllegalStateException("This container does not support retaining Map.Entry objects");
    }

    @Override // java.util.Map.Entry
    public final Object getValue() {
        if (this.f9595m) {
            return this.f9596n.i(this.f9594l);
        }
        throw new IllegalStateException("This container does not support retaining Map.Entry objects");
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        return this.f9594l < this.f9593k;
    }

    @Override // java.util.Map.Entry
    public final int hashCode() {
        if (!this.f9595m) {
            throw new IllegalStateException("This container does not support retaining Map.Entry objects");
        }
        int i = this.f9594l;
        C0966e c0966e = this.f9596n;
        Object objF = c0966e.f(i);
        Object objI = c0966e.i(this.f9594l);
        return (objF == null ? 0 : objF.hashCode()) ^ (objI != null ? objI.hashCode() : 0);
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        this.f9594l++;
        this.f9595m = true;
        return this;
    }

    @Override // java.util.Iterator
    public final void remove() {
        if (!this.f9595m) {
            throw new IllegalStateException();
        }
        this.f9596n.g(this.f9594l);
        this.f9594l--;
        this.f9593k--;
        this.f9595m = false;
    }

    @Override // java.util.Map.Entry
    public final Object setValue(Object obj) {
        if (this.f9595m) {
            return this.f9596n.h(this.f9594l, obj);
        }
        throw new IllegalStateException("This container does not support retaining Map.Entry objects");
    }

    public final String toString() {
        return getKey() + "=" + getValue();
    }
}
