package m4;

import java.net.SocketAddress;
import java.util.List;
import k4.C2411y;

/* JADX INFO: renamed from: m4.r0, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public final class C2539r0 {

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

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

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

    public SocketAddress a() {
        if (c()) {
            return (SocketAddress) ((C2411y) this.f21140a.get(this.f21141b)).f19985a.get(this.f21142c);
        }
        throw new IllegalStateException("Index is past the end of the address group list");
    }

    public boolean b() {
        if (c()) {
            C2411y c2411y = (C2411y) this.f21140a.get(this.f21141b);
            int i6 = this.f21142c + 1;
            this.f21142c = i6;
            if (i6 >= c2411y.f19985a.size()) {
                int i7 = this.f21141b + 1;
                this.f21141b = i7;
                this.f21142c = 0;
                if (i7 < this.f21140a.size()) {
                }
            }
            return true;
        }
        return false;
    }

    public boolean c() {
        return this.f21141b < this.f21140a.size();
    }

    public void d() {
        this.f21141b = 0;
        this.f21142c = 0;
    }

    public boolean e(SocketAddress socketAddress) {
        for (int i6 = 0; i6 < this.f21140a.size(); i6++) {
            int iIndexOf = ((C2411y) this.f21140a.get(i6)).f19985a.indexOf(socketAddress);
            if (iIndexOf != -1) {
                this.f21141b = i6;
                this.f21142c = iIndexOf;
                return true;
            }
        }
        return false;
    }
}
