package 㿎.ሽ.ඓ;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.ProxySelector;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import 㿎.AbstractC2533;
import 㿎.AbstractC2537;
import 㿎.C2531;
import 㿎.C2539;
import 㿎.C2640;
import 㿎.ሽ.C2540;

/* renamed from: 㿎.ሽ.ඓ.ඓ  reason: contains not printable characters */
/* compiled from: RouteSelector */
public final class C2544 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final AbstractC2537 f8593;

    /* renamed from: ඓ  reason: contains not printable characters */
    public List<Proxy> f8594 = Collections.emptyList();

    /* renamed from: ῲ  reason: contains not printable characters */
    public final C2550 f8595;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public List<InetSocketAddress> f8596 = Collections.emptyList();

    /* renamed from: K  reason: contains not printable characters */
    public final C2640 f8597;

    /* renamed from: 㴹  reason: contains not printable characters */
    public int f8598;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final AbstractC2533 f8599;

    /* renamed from: 㿎  reason: contains not printable characters */
    public final List<C2539> f8600 = new ArrayList();

    /* renamed from: 㿎.ሽ.ඓ.ඓ$K  reason: contains not printable characters */
    /* compiled from: RouteSelector */
    public static final class C2545 {

        /* renamed from: ῲ  reason: contains not printable characters */
        public int f8601 = 0;

        /* renamed from: K  reason: contains not printable characters */
        public final List<C2539> f8602;

        public C2545(List<C2539> list) {
            this.f8602 = list;
        }

        /* renamed from: ῲ  reason: contains not printable characters */
        public boolean m6672() {
            return this.f8601 < this.f8602.size();
        }

        /* renamed from: K  reason: contains not printable characters */
        public List<C2539> m6673() {
            return new ArrayList(this.f8602);
        }
    }

    public C2544(C2640 k, C2550 r3, AbstractC2537 r4, AbstractC2533 r5) {
        List<Proxy> list;
        this.f8597 = k;
        this.f8595 = r3;
        this.f8593 = r4;
        this.f8599 = r5;
        C2531 r32 = k.f8969;
        Proxy proxy = k.f8973;
        if (proxy != null) {
            this.f8594 = Collections.singletonList(proxy);
        } else {
            List<Proxy> select = this.f8597.f8968.select(r32.m6599());
            if (select == null || select.isEmpty()) {
                list = C2540.m6647(Proxy.NO_PROXY);
            } else {
                list = C2540.m6646(select);
            }
            this.f8594 = list;
        }
        this.f8598 = 0;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final boolean m6669() {
        return this.f8598 < this.f8594.size();
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m6670(C2539 r4, IOException iOException) {
        C2640 k;
        ProxySelector proxySelector;
        if (!(r4.f8558.type() == Proxy.Type.DIRECT || (proxySelector = (k = this.f8597).f8968) == null)) {
            proxySelector.connectFailed(k.f8969.m6599(), r4.f8558.address(), iOException);
        }
        this.f8595.m6689(r4);
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m6671() {
        return m6669() || !this.f8600.isEmpty();
    }
}
