package K;

import I0.AbstractC0303l;
import V4.AbstractC0771l0;
import Z0.C0860a;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import n.C2569D;
import n2.AbstractC2612c;
import o0.C2631b;
import v.AbstractC3045r;
import v.C3033l;
import v.C3035m;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class G0 extends kotlin.jvm.internal.l implements J4.c {

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ G0(int i6, Object obj, Class cls, String str, String str2, int i7, int i8) {
        super(i6, i7, cls, obj, str, str2);
        this.f3638a = i8;
    }

    /* JADX WARN: Removed duplicated region for block: B:23:0x0073  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x0158  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x016c  */
    @Override // J4.c
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invoke(Object obj) throws Throwable {
        C0860a c0860a;
        EnumC0446c0 enumC0446c0A;
        Integer numValueOf;
        int i6;
        switch (this.f3638a) {
            case 0:
                KeyEvent keyEvent = ((A0.c) obj).f76a;
                E0 e0 = (E0) this.receiver;
                e0.getClass();
                boolean z6 = true;
                if (keyEvent.getAction() != 0 || Character.isISOControl(keyEvent.getUnicodeChar())) {
                    c0860a = null;
                } else {
                    W w6 = e0.f3605i;
                    w6.getClass();
                    int unicodeChar = keyEvent.getUnicodeChar();
                    if ((Integer.MIN_VALUE & unicodeChar) != 0) {
                        w6.f3756a = Integer.valueOf(unicodeChar & Integer.MAX_VALUE);
                        numValueOf = null;
                    } else {
                        Integer num = w6.f3756a;
                        if (num != null) {
                            w6.f3756a = null;
                            int deadChar = KeyCharacterMap.getDeadChar(num.intValue(), unicodeChar);
                            Integer numValueOf2 = Integer.valueOf(deadChar);
                            if (deadChar == 0) {
                                numValueOf2 = null;
                            }
                            if (numValueOf2 != null) {
                                unicodeChar = numValueOf2.intValue();
                            }
                            numValueOf = Integer.valueOf(unicodeChar);
                        } else {
                            numValueOf = Integer.valueOf(unicodeChar);
                        }
                    }
                    if (numValueOf != null) {
                        c0860a = new C0860a(new StringBuilder().appendCodePoint(numValueOf.intValue()).toString(), 1);
                    }
                }
                V.r0 r0Var = e0.f3602f;
                boolean z7 = e0.f3600d;
                if (c0860a != null) {
                    if (z7) {
                        e0.a(AbstractC2612c.q(c0860a));
                        r0Var.f7152a = null;
                    } else {
                        z6 = false;
                    }
                } else if (A0.d.c(keyEvent) == 2 && (enumC0446c0A = e0.f3606j.a(keyEvent)) != null && (!enumC0446c0A.f3848a || z7)) {
                    kotlin.jvm.internal.y yVar = new kotlin.jvm.internal.y();
                    yVar.f20130a = true;
                    C0463l c0463l = new C0463l(enumC0446c0A, e0, yVar, 4);
                    S0 s0D = e0.f3597a.d();
                    Z0.y yVar2 = e0.f3599c;
                    V.W w7 = new V.W(yVar2, e0.f3603g, s0D, r0Var);
                    c0463l.invoke(w7);
                    if (!T0.N.b(w7.f7012f, yVar2.f9137b) || !kotlin.jvm.internal.o.c(w7.f7013g, yVar2.f9136a)) {
                        e0.f3607k.invoke(Z0.y.a(yVar2, w7.f7013g, w7.f7012f, 4));
                    }
                    Y0 y02 = e0.f3604h;
                    if (y02 != null) {
                        y02.f3773e = true;
                    }
                    z6 = yVar.f20130a;
                }
                break;
            case 1:
                long j4 = ((C2631b) obj).f21785a;
                Q.h hVar = (Q.h) this.receiver;
                hVar.getClass();
                R.f fVar = (R.f) AbstractC0303l.h(hVar, R.g.f6000a);
                if (fVar != null) {
                    V4.E.y(hVar.getCoroutineScope(), null, null, new Q.g(hVar, j4, fVar, new Q.f(hVar, j4), null), 3);
                }
                break;
            case 2:
                ((M.a) this.receiver).f4196b.g((J4.c) obj);
                break;
            case 3:
                ((AbstractC0771l0) this.receiver).j((Throwable) obj);
                break;
            default:
                boolean zBooleanValue = ((Boolean) obj).booleanValue();
                AbstractC3045r abstractC3045r = (AbstractC3045r) this.receiver;
                if (zBooleanValue) {
                    abstractC3045r.D0();
                } else {
                    z.l lVar = abstractC3045r.f24920c;
                    C2569D c2569d = abstractC3045r.f24932s;
                    if (lVar != null) {
                        Object[] objArr = c2569d.f21321c;
                        long[] jArr = c2569d.f21319a;
                        int length = jArr.length - 2;
                        if (length >= 0) {
                            int i7 = 0;
                            while (true) {
                                long j6 = jArr[i7];
                                if ((((~j6) << 7) & j6 & (-9187201950435737472L)) != -9187201950435737472L) {
                                    int i8 = 8;
                                    int i9 = 8 - ((~(i7 - length)) >>> 31);
                                    int i10 = 0;
                                    while (i10 < i9) {
                                        if ((255 & j6) < 128) {
                                            i6 = i8;
                                            V4.E.y(abstractC3045r.getCoroutineScope(), null, null, new C3033l(abstractC3045r, (z.o) objArr[(i7 << 3) + i10], null), 3);
                                        } else {
                                            i6 = i8;
                                        }
                                        j6 >>= i6;
                                        i10++;
                                        i8 = i6;
                                    }
                                    if (i9 == i8) {
                                        if (i7 != length) {
                                            i7++;
                                        }
                                    }
                                }
                            }
                        }
                        z.o oVar = abstractC3045r.f24934u;
                        if (oVar != null) {
                            V4.E.y(abstractC3045r.getCoroutineScope(), null, null, new C3035m(abstractC3045r, oVar, null), 3);
                        }
                    }
                    c2569d.a();
                    abstractC3045r.f24934u = null;
                    abstractC3045r.E0();
                }
                break;
        }
        return C3137A.f25453a;
    }
}
