package com.google.common.collect;

import java.util.Map;
import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
public final class r0 extends v1 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final v1 f23716a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f23717b = null;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public v1 f23718c = x0.f23744d;

    public r0(ImmutableMultimap immutableMultimap) {
        this.f23716a = immutableMultimap.f23605e.entrySet().iterator();
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        return this.f23718c.hasNext() || this.f23716a.hasNext();
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (!this.f23718c.hasNext()) {
            Map.Entry entry = (Map.Entry) this.f23716a.next();
            this.f23717b = entry.getKey();
            this.f23718c = ((ImmutableCollection) entry.getValue()).iterator();
        }
        Object obj = this.f23717b;
        Objects.requireNonNull(obj);
        return new ImmutableEntry(obj, this.f23718c.next());
    }
}
