package o;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.CommonStatusCodes;
import java.util.Collections;
import java.util.List;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final /* synthetic */ class K00 implements OC {
    public final /* synthetic */ int l;
    public final /* synthetic */ int m;
    public final /* synthetic */ Object n;

    /* renamed from: o, reason: collision with root package name */
    public final /* synthetic */ Object f184o;

    public /* synthetic */ K00(int i, int i2, Object obj, Object obj2) {
        this.l = i2;
        this.n = obj;
        this.m = i;
        this.f184o = obj2;
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Multi-variable type inference failed */
    @Override // o.OC
    public final Object g(Object obj) {
        InterfaceC0399Pk interfaceC0399Pk;
        InterfaceC0399Pk interfaceC0399Pk2;
        int i;
        int i2;
        Integer numD;
        Integer numE;
        Integer numE2;
        Integer numD2;
        Ne0 ne0;
        Ne0 ne02;
        Oe0 oe0;
        Oe0 oe02;
        Integer numD3;
        Integer numE3;
        Integer numE4;
        Integer numD4;
        Ne0 ne03;
        Ne0 ne04;
        Oe0 oe03;
        Oe0 oe04;
        C3040yr c3040yr;
        int i3 = this.l;
        int i4 = 2;
        int i5 = 7;
        Oh0 oh0 = Oh0.a;
        int i6 = 0;
        int i7 = this.m;
        Object obj2 = this.f184o;
        Object obj3 = this.n;
        switch (i3) {
            case 0:
                L00 l00 = (L00) obj3;
                QQ qq = (QQ) obj2;
                InterfaceC0399Pk interfaceC0399Pk3 = (InterfaceC0399Pk) obj;
                if (l00.e == i7 && F3.c(qq, l00.f) && (interfaceC0399Pk3 instanceof C0555Vk)) {
                    long[] jArr = qq.a;
                    int length = jArr.length - 2;
                    if (length >= 0) {
                        int i8 = 0;
                        while (true) {
                            long j = jArr[i8];
                            if ((((~j) << i5) & j & (-9187201950435737472L)) != -9187201950435737472L) {
                                int i9 = 8;
                                int i10 = 8 - ((~(i8 - length)) >>> 31);
                                int i11 = i6;
                                while (i11 < i10) {
                                    if ((j & 255) < 128) {
                                        int i12 = (i8 << 3) + i11;
                                        Object obj4 = qq.b[i12];
                                        i2 = i9;
                                        boolean z = qq.c[i12] != i7;
                                        if (z) {
                                            C0555Vk c0555Vk = (C0555Vk) interfaceC0399Pk3;
                                            interfaceC0399Pk2 = interfaceC0399Pk3;
                                            ZQ zq = c0555Vk.r;
                                            AbstractC2001nt0.C(zq, obj4, l00);
                                            i = i11;
                                            if (obj4 instanceof C0095Dr) {
                                                C0095Dr c0095Dr = (C0095Dr) obj4;
                                                if (!zq.c(c0095Dr)) {
                                                    AbstractC2001nt0.D(c0555Vk.u, c0095Dr);
                                                }
                                                ZQ zq2 = l00.g;
                                                if (zq2 != null) {
                                                    zq2.k(obj4);
                                                }
                                            }
                                        } else {
                                            interfaceC0399Pk2 = interfaceC0399Pk3;
                                            i = i11;
                                        }
                                        if (z) {
                                            qq.g(i12);
                                        }
                                    } else {
                                        interfaceC0399Pk2 = interfaceC0399Pk3;
                                        i = i11;
                                        i2 = i9;
                                    }
                                    j >>= i2;
                                    i11 = i + 1;
                                    i9 = i2;
                                    interfaceC0399Pk3 = interfaceC0399Pk2;
                                }
                                interfaceC0399Pk = interfaceC0399Pk3;
                                if (i10 == i9) {
                                }
                            } else {
                                interfaceC0399Pk = interfaceC0399Pk3;
                            }
                            if (i8 != length) {
                                i8++;
                                interfaceC0399Pk3 = interfaceC0399Pk;
                                i5 = 7;
                                i6 = 0;
                            }
                        }
                    }
                }
                return oh0;
            case 1:
                V40 v40 = (V40) obj3;
                VW vw = (VW) obj2;
                UW uw = (UW) obj;
                int iG = v40.z.a.g();
                if (iG < 0) {
                    iG = 0;
                }
                if (iG <= i7) {
                    i7 = iG;
                }
                int i13 = -i7;
                boolean z2 = v40.A;
                int i14 = z2 ? 0 : i13;
                if (!z2) {
                    i13 = 0;
                }
                uw.l = true;
                UW.j(uw, vw, i14, i13);
                uw.l = false;
                return oh0;
            case 2:
                Sd0 sd0 = (Sd0) obj3;
                C2773w10 c2773w10 = (C2773w10) obj2;
                Yd0 yd0 = (Yd0) obj;
                int i15 = 4;
                int i16 = 13;
                switch (i7 == 0 ? -1 : Rd0.a[AbstractC2462sn.w(i7)]) {
                    case 1:
                        sd0.b.d(false);
                        return oh0;
                    case 2:
                        sd0.b.o();
                        return oh0;
                    case 3:
                        sd0.b.f();
                        return oh0;
                    case 4:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            if (Ue0.c(yd0.f)) {
                                yd0.i();
                            } else if (yd0.f()) {
                                int iF = Ue0.f(yd0.f);
                                yd0.q(iF, iF);
                            } else {
                                int iE = Ue0.e(yd0.f);
                                yd0.q(iE, iE);
                            }
                        }
                        return oh0;
                    case 5:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            if (Ue0.c(yd0.f)) {
                                yd0.m();
                            } else if (yd0.f()) {
                                int iE2 = Ue0.e(yd0.f);
                                yd0.q(iE2, iE2);
                            } else {
                                int iF2 = Ue0.f(yd0.f);
                                yd0.q(iF2, iF2);
                            }
                        }
                        return oh0;
                    case 6:
                        Te0 te0 = yd0.e;
                        te0.a = null;
                        C0977d7 c0977d7 = yd0.g;
                        String str = c0977d7.m;
                        String str2 = c0977d7.m;
                        if (str.length() > 0) {
                            if (yd0.f()) {
                                te0.a = null;
                                if (str2.length() > 0 && (numE = yd0.e()) != null) {
                                    int iIntValue = numE.intValue();
                                    yd0.q(iIntValue, iIntValue);
                                }
                            } else {
                                te0.a = null;
                                if (str2.length() > 0 && (numD = yd0.d()) != null) {
                                    int iIntValue2 = numD.intValue();
                                    yd0.q(iIntValue2, iIntValue2);
                                }
                            }
                        }
                        return oh0;
                    case 7:
                        Te0 te02 = yd0.e;
                        te02.a = null;
                        C0977d7 c0977d72 = yd0.g;
                        String str3 = c0977d72.m;
                        String str4 = c0977d72.m;
                        if (str3.length() > 0) {
                            if (yd0.f()) {
                                te02.a = null;
                                if (str4.length() > 0 && (numD2 = yd0.d()) != null) {
                                    int iIntValue3 = numD2.intValue();
                                    yd0.q(iIntValue3, iIntValue3);
                                }
                            } else {
                                te02.a = null;
                                if (str4.length() > 0 && (numE2 = yd0.e()) != null) {
                                    int iIntValue4 = numE2.intValue();
                                    yd0.q(iIntValue4, iIntValue4);
                                }
                            }
                        }
                        return oh0;
                    case 8:
                        yd0.l();
                        return oh0;
                    case ConnectionResult.SERVICE_INVALID /* 9 */:
                        yd0.j();
                        return oh0;
                    case 10:
                        if (yd0.g.m.length() > 0 && (ne0 = yd0.c) != null) {
                            int iG2 = yd0.g(ne0, -1);
                            yd0.q(iG2, iG2);
                        }
                        return oh0;
                    case ConnectionResult.LICENSE_CHECK_FAILED /* 11 */:
                        if (yd0.g.m.length() > 0 && (ne02 = yd0.c) != null) {
                            int iG3 = yd0.g(ne02, 1);
                            yd0.q(iG3, iG3);
                        }
                        return oh0;
                    case 12:
                        if (yd0.g.m.length() > 0 && (oe0 = yd0.i) != null) {
                            int iH = yd0.h(oe0, -1);
                            yd0.q(iH, iH);
                        }
                        return oh0;
                    case 13:
                        if (yd0.g.m.length() > 0 && (oe02 = yd0.i) != null) {
                            int iH2 = yd0.h(oe02, 1);
                            yd0.q(iH2, iH2);
                        }
                        return oh0;
                    case 14:
                        yd0.o();
                        return oh0;
                    case 15:
                        yd0.n();
                        return oh0;
                    case 16:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            if (yd0.f()) {
                                yd0.o();
                            } else {
                                yd0.n();
                            }
                        }
                        return oh0;
                    case 17:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            if (yd0.f()) {
                                yd0.n();
                            } else {
                                yd0.o();
                            }
                        }
                        return oh0;
                    case ConnectionResult.SERVICE_UPDATING /* 18 */:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            yd0.q(0, 0);
                        }
                        return oh0;
                    case 19:
                        yd0.e.a = null;
                        C0977d7 c0977d73 = yd0.g;
                        if (c0977d73.m.length() > 0) {
                            int length2 = c0977d73.m.length();
                            yd0.q(length2, length2);
                        }
                        return oh0;
                    case 20:
                        List listA = yd0.a(new C2694v90(i4));
                        if (listA != null) {
                            sd0.a(listA);
                        }
                        return oh0;
                    case CommonStatusCodes.RECONNECTION_TIMED_OUT_DURING_UPDATE /* 21 */:
                        List listA2 = yd0.a(new C2694v90(3));
                        if (listA2 != null) {
                            sd0.a(listA2);
                        }
                        return oh0;
                    case 22:
                        List listA3 = yd0.a(new C2694v90(i15));
                        if (listA3 != null) {
                            sd0.a(listA3);
                        }
                        return oh0;
                    case ConnectionResult.API_DISABLED /* 23 */:
                        List listA4 = yd0.a(new C2694v90(5));
                        if (listA4 != null) {
                            sd0.a(listA4);
                        }
                        return oh0;
                    case ConnectionResult.API_DISABLED_FOR_CONNECTION /* 24 */:
                        List listA5 = yd0.a(new C2694v90(6));
                        if (listA5 != null) {
                            sd0.a(listA5);
                        }
                        return oh0;
                    case 25:
                        List listA6 = yd0.a(new C2694v90(i5));
                        if (listA6 != null) {
                            sd0.a(listA6);
                        }
                        return oh0;
                    case 26:
                        if (sd0.e) {
                            c2773w10.l = sd0.a.x.m.r.a(sd0.l);
                        } else {
                            sd0.a(Collections.singletonList(new C1314gj("\n", 1)));
                        }
                        return oh0;
                    case 27:
                        if (sd0.e) {
                            c2773w10.l = false;
                        } else {
                            sd0.a(Collections.singletonList(new C1314gj("\t", 1)));
                        }
                        return oh0;
                    case 28:
                        yd0.e.a = null;
                        C0977d7 c0977d74 = yd0.g;
                        if (c0977d74.m.length() > 0) {
                            yd0.q(0, c0977d74.m.length());
                        }
                        return oh0;
                    case 29:
                        yd0.i();
                        yd0.p();
                        return oh0;
                    case 30:
                        yd0.m();
                        yd0.p();
                        return oh0;
                    case 31:
                        Te0 te03 = yd0.e;
                        te03.a = null;
                        C0977d7 c0977d75 = yd0.g;
                        String str5 = c0977d75.m;
                        String str6 = c0977d75.m;
                        if (str5.length() > 0) {
                            if (yd0.f()) {
                                te03.a = null;
                                if (str6.length() > 0 && (numE3 = yd0.e()) != null) {
                                    int iIntValue5 = numE3.intValue();
                                    yd0.q(iIntValue5, iIntValue5);
                                }
                            } else {
                                te03.a = null;
                                if (str6.length() > 0 && (numD3 = yd0.d()) != null) {
                                    int iIntValue6 = numD3.intValue();
                                    yd0.q(iIntValue6, iIntValue6);
                                }
                            }
                        }
                        yd0.p();
                        return oh0;
                    case 32:
                        Te0 te04 = yd0.e;
                        te04.a = null;
                        C0977d7 c0977d76 = yd0.g;
                        String str7 = c0977d76.m;
                        String str8 = c0977d76.m;
                        if (str7.length() > 0) {
                            if (yd0.f()) {
                                te04.a = null;
                                if (str8.length() > 0 && (numD4 = yd0.d()) != null) {
                                    int iIntValue7 = numD4.intValue();
                                    yd0.q(iIntValue7, iIntValue7);
                                }
                            } else {
                                te04.a = null;
                                if (str8.length() > 0 && (numE4 = yd0.e()) != null) {
                                    int iIntValue8 = numE4.intValue();
                                    yd0.q(iIntValue8, iIntValue8);
                                }
                            }
                        }
                        yd0.p();
                        return oh0;
                    case 33:
                        yd0.l();
                        yd0.p();
                        return oh0;
                    case 34:
                        yd0.j();
                        yd0.p();
                        return oh0;
                    case 35:
                        yd0.o();
                        yd0.p();
                        return oh0;
                    case 36:
                        yd0.n();
                        yd0.p();
                        return oh0;
                    case 37:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            if (yd0.f()) {
                                yd0.o();
                            } else {
                                yd0.n();
                            }
                        }
                        yd0.p();
                        return oh0;
                    case 38:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            if (yd0.f()) {
                                yd0.n();
                            } else {
                                yd0.o();
                            }
                        }
                        yd0.p();
                        return oh0;
                    case 39:
                        if (yd0.g.m.length() > 0 && (ne03 = yd0.c) != null) {
                            int iG4 = yd0.g(ne03, -1);
                            yd0.q(iG4, iG4);
                        }
                        yd0.p();
                        return oh0;
                    case 40:
                        if (yd0.g.m.length() > 0 && (ne04 = yd0.c) != null) {
                            int iG5 = yd0.g(ne04, 1);
                            yd0.q(iG5, iG5);
                        }
                        yd0.p();
                        return oh0;
                    case 41:
                        if (yd0.g.m.length() > 0 && (oe03 = yd0.i) != null) {
                            int iH3 = yd0.h(oe03, -1);
                            yd0.q(iH3, iH3);
                        }
                        yd0.p();
                        return oh0;
                    case 42:
                        if (yd0.g.m.length() > 0 && (oe04 = yd0.i) != null) {
                            int iH4 = yd0.h(oe04, 1);
                            yd0.q(iH4, iH4);
                        }
                        yd0.p();
                        return oh0;
                    case 43:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            yd0.q(0, 0);
                        }
                        yd0.p();
                        return oh0;
                    case 44:
                        yd0.e.a = null;
                        C0977d7 c0977d77 = yd0.g;
                        if (c0977d77.m.length() > 0) {
                            int length3 = c0977d77.m.length();
                            yd0.q(length3, length3);
                        }
                        yd0.p();
                        return oh0;
                    case 45:
                        yd0.e.a = null;
                        if (yd0.g.m.length() > 0) {
                            long j2 = yd0.f;
                            int i17 = Ue0.c;
                            int i18 = (int) (j2 & 4294967295L);
                            yd0.q(i18, i18);
                        }
                        return oh0;
                    case 46:
                        Kh0 kh0 = sd0.h;
                        if (kh0 != null) {
                            kh0.a(C2730ve0.a(yd0.h, yd0.g, yd0.f, 4));
                        }
                        Kh0 kh02 = sd0.h;
                        if (kh02 != null) {
                            C3040yr c3040yr2 = kh02.a;
                            if (c3040yr2 != null && (c3040yr = (C3040yr) c3040yr2.m) != null) {
                                kh02.a = c3040yr;
                                kh02.c -= ((C2730ve0) c3040yr2.n).a.m.length();
                                kh02.b = new C3040yr(i16, kh02.b, (C2730ve0) c3040yr2.n);
                                obj = (C2730ve0) c3040yr.n;
                            }
                            if (obj != null) {
                                sd0.k.g(obj);
                            }
                        }
                        return oh0;
                    case 47:
                        Kh0 kh03 = sd0.h;
                        if (kh03 != null) {
                            C3040yr c3040yr3 = kh03.b;
                            if (c3040yr3 != null) {
                                kh03.b = (C3040yr) c3040yr3.m;
                                C2730ve0 c2730ve0 = (C2730ve0) c3040yr3.n;
                                kh03.a = new C3040yr(i16, kh03.a, c2730ve0);
                                kh03.c = c2730ve0.a.m.length() + kh03.c;
                                obj = (C2730ve0) c3040yr3.n;
                            }
                            if (obj != null) {
                                sd0.k.g(obj);
                            }
                        }
                        return oh0;
                    case 48:
                    case 49:
                        return oh0;
                    default:
                        throw new C2170pj();
                }
            default:
                C2930xj0 c2930xj0 = (C2930xj0) obj3;
                VW vw2 = (VW) obj2;
                UW uw2 = (UW) obj;
                int i19 = c2930xj0.b;
                C1113ee0 c1113ee0 = c2930xj0.a;
                C1785lg0 c1785lg0 = c2930xj0.c;
                Oe0 oe05 = (Oe0) c2930xj0.d.a();
                c1113ee0.a(OU.l, AbstractC2461sm0.a(uw2, i19, c1785lg0, oe05 != null ? oe05.a : null, false, vw2.l), i7, vw2.m);
                UW.i(uw2, vw2, 0, Math.round(-c1113ee0.a.g()));
                return oh0;
        }
    }

    public /* synthetic */ K00(int i, Sd0 sd0, C2773w10 c2773w10) {
        this.l = 2;
        this.m = i;
        this.n = sd0;
        this.f184o = c2773w10;
    }

    public /* synthetic */ K00(C2930xj0 c2930xj0, VW vw, int i) {
        this.l = 3;
        this.n = c2930xj0;
        this.f184o = vw;
        this.m = i;
    }
}
