package a0;

import J0.AbstractC0364i0;
import J0.C0361h;
import J0.InterfaceC0359g;
import V4.C0772m;
import android.os.Build;
import m3.AbstractC2467b;
import w4.C3137A;

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

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ I1 f9480b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ InterfaceC0359g f9481c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public K1(I1 i12, InterfaceC0359g interfaceC0359g, A4.d dVar) {
        super(2, dVar);
        this.f9480b = i12;
        this.f9481c = interfaceC0359g;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new K1(this.f9480b, this.f9481c, dVar);
    }

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

    /* JADX WARN: Removed duplicated region for block: B:32:0x0068  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x0071 A[RETURN] */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        long j4;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f9479a;
        I1 i12 = this.f9480b;
        if (i6 == 0) {
            AbstractC2467b.l(obj);
            if (i12 != null) {
                O1 o12 = ((N1) i12).f9569a;
                J1 j12 = o12.f9579b;
                o12.getClass();
                int iOrdinal = j12.ordinal();
                long j6 = Long.MAX_VALUE;
                if (iOrdinal == 0) {
                    j4 = 4000;
                } else if (iOrdinal == 1) {
                    j4 = 10000;
                } else {
                    if (iOrdinal != 2) {
                        throw new E3.v();
                    }
                    j4 = Long.MAX_VALUE;
                }
                InterfaceC0359g interfaceC0359g = this.f9481c;
                if (interfaceC0359g == null) {
                    j6 = j4;
                    this.f9479a = 1;
                    if (V4.E.l(j6, this) == aVar) {
                        return aVar;
                    }
                } else {
                    C0361h c0361h = (C0361h) interfaceC0359g;
                    if (j4 < 2147483647L && Build.VERSION.SDK_INT >= 29) {
                        int iA = AbstractC0364i0.a(c0361h.f3021a, (int) j4, 3);
                        if (iA != Integer.MAX_VALUE) {
                            j6 = iA;
                        }
                    }
                    this.f9479a = 1;
                    if (V4.E.l(j6, this) == aVar) {
                    }
                }
            }
            return C3137A.f25453a;
        }
        if (i6 != 1) {
            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        AbstractC2467b.l(obj);
        C0772m c0772m = ((N1) i12).f9570b;
        if (c0772m.isActive()) {
            c0772m.resumeWith(Y1.f9704a);
        }
        return C3137A.f25453a;
    }
}
