package com.google.common.collect;

import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: loaded from: classes2.dex */
public final class i0 implements Iterator {

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

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

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

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ j0 f23684e;

    public i0(j0 j0Var) {
        this.f23684e = j0Var;
        HashBiMap hashBiMap = j0Var.f23686a;
        this.f23680a = hashBiMap.f23592i;
        this.f23681b = -1;
        this.f23682c = hashBiMap.f23587d;
        this.f23683d = hashBiMap.f23586c;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        if (this.f23684e.f23686a.f23587d == this.f23682c) {
            return this.f23680a != -2 && this.f23683d > 0;
        }
        throw new ConcurrentModificationException();
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        int i10 = this.f23680a;
        j0 j0Var = this.f23684e;
        Object objC = j0Var.c(i10);
        int i11 = this.f23680a;
        this.f23681b = i11;
        this.f23680a = j0Var.f23686a.f23595l[i11];
        this.f23683d--;
        return objC;
    }

    @Override // java.util.Iterator
    public final void remove() {
        j0 j0Var = this.f23684e;
        if (j0Var.f23686a.f23587d != this.f23682c) {
            throw new ConcurrentModificationException();
        }
        com.google.common.base.h.i(this.f23681b != -1, "no calls to next() since the last call to remove()");
        HashBiMap hashBiMap = j0Var.f23686a;
        int i10 = this.f23681b;
        hashBiMap.r(i10, z0.x(hashBiMap.f23584a[i10]));
        int i11 = this.f23680a;
        HashBiMap hashBiMap2 = j0Var.f23686a;
        if (i11 == hashBiMap2.f23586c) {
            this.f23680a = this.f23681b;
        }
        this.f23681b = -1;
        this.f23682c = hashBiMap2.f23587d;
    }
}
