package a3;

import a0.C0932r0;
import com.revenuecat.purchases.common.Constants;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import m3.AbstractC2467b;
import okhttp3.OkHttpClient;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class A extends C4.j implements J4.e {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public e5.e f10417b;

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

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public /* synthetic */ Object f10421f;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ int f10422j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ List f10423k;
    public final /* synthetic */ C0963b l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final /* synthetic */ String f10424m;

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

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final /* synthetic */ Integer f10426o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final /* synthetic */ boolean f10427p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ Map f10428q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final /* synthetic */ N2.r f10429r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final /* synthetic */ OkHttpClient f10430s;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public A(int i6, List list, C0963b c0963b, String str, Integer num, Integer num2, boolean z6, Map map, N2.r rVar, OkHttpClient okHttpClient, A4.d dVar) {
        super(2, dVar);
        this.f10422j = i6;
        this.f10423k = list;
        this.l = c0963b;
        this.f10424m = str;
        this.f10425n = num;
        this.f10426o = num2;
        this.f10427p = z6;
        this.f10428q = map;
        this.f10429r = rVar;
        this.f10430s = okHttpClient;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        A a6 = new A(this.f10422j, this.f10423k, this.l, this.f10424m, this.f10425n, this.f10426o, this.f10427p, this.f10428q, this.f10429r, this.f10430s, dVar);
        a6.f10421f = obj;
        return a6;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((A) create((V4.C) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    /* JADX WARN: Path cross not found for [B:31:0x010f, B:46:0x0130], limit reached: 58 */
    /* JADX WARN: Path cross not found for [B:46:0x0130, B:31:0x010f], limit reached: 58 */
    /* JADX WARN: Removed duplicated region for block: B:14:0x005f  */
    /* JADX WARN: Removed duplicated region for block: B:20:0x008b  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x010f  */
    /* JADX WARN: Removed duplicated region for block: B:52:0x0144  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:28:0x0104 -> B:29:0x010b). Please report as a decompilation issue!!! */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:47:0x0132 -> B:48:0x0139). Please report as a decompilation issue!!! */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        e5.e eVarA;
        V4.C c6;
        int i6;
        Set set;
        int i7;
        N2.f fVarI0;
        boolean zAdd;
        char c7;
        int i8;
        int i9;
        A a6 = this;
        B4.a aVar = B4.a.f492a;
        int i10 = a6.f10420e;
        char c8 = 2;
        int i11 = 1;
        if (i10 == 0) {
            AbstractC2467b.l(obj);
            V4.C c9 = (V4.C) a6.f10421f;
            Set setSynchronizedSet = Collections.synchronizedSet(new HashSet());
            eVarA = e5.j.a(2);
            c6 = c9;
            i6 = 0;
            set = setSynchronizedSet;
            i7 = 0;
            if (i6 < a6.f10422j) {
            }
        } else if (i10 == 1) {
            i6 = a6.f10419d;
            i7 = a6.f10418c;
            eVarA = a6.f10417b;
            set = a6.f10416a;
            c6 = (V4.C) a6.f10421f;
            AbstractC2467b.l(obj);
            Set set2 = set;
            fVarI0 = W.a.i0(a6.f10423k, i6, a6.l);
            if (fVarI0 != null) {
            }
            c7 = c8;
            i8 = i11;
            c6 = c6;
            i9 = i6;
            set = set2;
            eVarA = eVarA;
            i7 = i7;
            i6 = i9 + i8;
            i11 = i8;
            c8 = c7;
            a6 = this;
            if (i6 < a6.f10422j) {
            }
        } else {
            if (i10 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            i9 = a6.f10419d;
            int i12 = a6.f10418c;
            eVarA = a6.f10417b;
            set = a6.f10416a;
            c6 = (V4.C) a6.f10421f;
            AbstractC2467b.l(obj);
            c7 = 2;
            i8 = 1;
            int i13 = i12;
            Object objP = obj;
            P p6 = (P) objP;
            if (p6 != null) {
                if (p6.f10579f && W.a.t0()) {
                    return P.a(p6);
                }
                if (p6.f10579f) {
                    i7 = i8;
                    i6 = i9 + i8;
                    i11 = i8;
                    c8 = c7;
                    a6 = this;
                    if (i6 < a6.f10422j) {
                        a6.f10421f = c6;
                        a6.f10416a = set;
                        a6.f10417b = eVarA;
                        a6.f10418c = i7;
                        a6.f10419d = i6;
                        a6.f10420e = i11;
                        if (V4.E.K(a6) != aVar) {
                            Set set22 = set;
                            fVarI0 = W.a.i0(a6.f10423k, i6, a6.l);
                            if (fVarI0 != null) {
                                String str = fVarI0.f5143a + Constants.SUBS_ID_BASE_PLAN_ID_SEPARATOR + fVarI0.f5144b;
                                kotlin.jvm.internal.o.e(set22);
                                synchronized (set22) {
                                    zAdd = set22.add(str);
                                }
                                if (zAdd) {
                                    List list = a6.f10423k;
                                    int i14 = a6.f10422j;
                                    C0963b c0963b = a6.l;
                                    String str2 = a6.f10424m;
                                    Integer num = a6.f10425n;
                                    Integer num2 = a6.f10426o;
                                    boolean z6 = a6.f10427p;
                                    Map map = a6.f10428q;
                                    N2.r rVar = a6.f10429r;
                                    OkHttpClient okHttpClient = a6.f10430s;
                                    C0932r0 c0932r0 = new C0932r0(14);
                                    a6.f10421f = c6;
                                    a6.f10416a = set22;
                                    a6.f10417b = eVarA;
                                    a6.f10418c = i7;
                                    a6.f10419d = i6;
                                    a6.f10420e = 2;
                                    c7 = 2;
                                    e5.e eVar = eVarA;
                                    int i15 = i6;
                                    V4.C c10 = c6;
                                    int i16 = i7;
                                    A a7 = a6;
                                    i8 = 1;
                                    objP = W.a.P(c10, fVarI0, i15, list, i14, c0963b, str2, num, num2, z6, map, rVar, okHttpClient, set22, eVar, null, i14, c0932r0, a7);
                                    if (objP != aVar) {
                                        c6 = c10;
                                        i9 = i15;
                                        set = set22;
                                        eVarA = eVar;
                                        i13 = i16;
                                        P p62 = (P) objP;
                                        if (p62 != null) {
                                        }
                                    }
                                }
                            }
                            c7 = c8;
                            i8 = i11;
                            c6 = c6;
                            i9 = i6;
                            set = set22;
                            eVarA = eVarA;
                            i7 = i7;
                            i6 = i9 + i8;
                            i11 = i8;
                            c8 = c7;
                            a6 = this;
                            if (i6 < a6.f10422j) {
                                return (i7 == 0 || W.a.t0()) ? new P(null, null, null, null, null, 96) : new P(null, null, null, null, null, true, true);
                            }
                        }
                        return aVar;
                    }
                } else {
                    String str3 = p62.f10574a;
                    if (str3 != null && !S4.p.Q0(str3)) {
                        return p62;
                    }
                }
            }
            i7 = i13;
            i6 = i9 + i8;
            i11 = i8;
            c8 = c7;
            a6 = this;
            if (i6 < a6.f10422j) {
            }
        }
    }
}
