package defpackage;

import defpackage.dw7;
import defpackage.if8;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: renamed from: f83, reason: from Kotlin metadata and case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u0004\"\u0004\b\u0000\u0010\u0000*\u00020\u00012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"T", "Lak1;", "Ll43;", "downstream", "Le6a;", "<anonymous>", "(Lak1;Ll43;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "kotlinx.coroutines.flow.FlowKt__DelayKt$debounceInternal$1", f = "Delay.kt", i = {0, 0, 0, 0, 1, 1, 1}, l = {215, 415}, m = "invokeSuspend", n = {"downstream", "values", "lastValue", "timeoutMillis", "downstream", "values", "lastValue"}, s = {"L$0", "L$1", "L$2", "L$3", "L$0", "L$1", "L$2"})
@vx8
final class C0547f83 extends SuspendLambda implements ir3<ak1, l43<Object>, Continuation<? super e6a>, Object> {
    public dw7.h a;
    public dw7.g b;
    public int c;
    public /* synthetic */ Object d;
    public /* synthetic */ Object e;
    public final /* synthetic */ r2 f;
    public final /* synthetic */ j43 i;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0547f83(r2 r2Var, j43 j43Var, Continuation continuation) {
        super(3, continuation);
        this.f = r2Var;
        this.i = j43Var;
    }

    @Override // defpackage.ir3
    public final Object invoke(Object obj, Object obj2, Object obj3) {
        C0547f83 c0547f83 = new C0547f83(this.f, this.i, (Continuation) obj3);
        c0547f83.d = (ak1) obj;
        c0547f83.e = (l43) obj2;
        return c0547f83.invokeSuspend(e6a.a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:34:0x00f7, code lost:
    
        if (r11.g(r18) == r1) goto L35;
     */
    /* JADX WARN: Removed duplicated region for block: B:14:0x005e  */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0097 A[PHI: r6 r7 r8 r9
      0x0097: PHI (r6v3 dw7$h) = (r6v5 dw7$h), (r6v6 dw7$h), (r6v6 dw7$h) binds: [B:26:0x0094, B:15:0x0063, B:18:0x0079] A[DONT_GENERATE, DONT_INLINE]
      0x0097: PHI (r7v3 bv7) = (r7v5 bv7), (r7v6 bv7), (r7v6 bv7) binds: [B:26:0x0094, B:15:0x0063, B:18:0x0079] A[DONT_GENERATE, DONT_INLINE]
      0x0097: PHI (r8v3 l43) = (r8v11 l43), (r8v12 l43), (r8v12 l43) binds: [B:26:0x0094, B:15:0x0063, B:18:0x0079] A[DONT_GENERATE, DONT_INLINE]
      0x0097: PHI (r9v1 dw7$g) = (r9v5 dw7$g), (r9v7 dw7$g), (r9v7 dw7$g) binds: [B:26:0x0094, B:15:0x0063, B:18:0x0079] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:32:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x00fa  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:34:0x00f7 -> B:7:0x001c). Please report as a decompilation issue!!! */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        l43 l43Var;
        dw7.h hVar;
        bv7 bv7Var;
        dw7.g gVar;
        dw7.h hVar2;
        bv7 bv7Var2;
        l43 l43Var2;
        dw7.g gVar2;
        Object obj2;
        ck1 ck1Var = ck1.a;
        int i = this.c;
        if (i == 0) {
            s38.b(obj);
            ak1 ak1Var = (ak1) this.d;
            l43 l43Var3 = (l43) this.e;
            bv7 bv7VarC = wi7.c(ak1Var, 0, new e83(this.i, null), 3);
            l43Var = l43Var3;
            hVar = new dw7.h();
            bv7Var = bv7VarC;
            obj2 = hVar.a;
            if (obj2 != kq6.c) {
            }
        } else if (i == 1) {
            gVar2 = this.b;
            hVar = this.a;
            bv7Var = (bv7) this.e;
            l43Var = (l43) this.d;
            s38.b(obj);
            hVar.a = null;
            gVar = gVar2;
            hVar2 = hVar;
            bv7Var2 = bv7Var;
            l43Var2 = l43Var;
            if8 if8Var = new if8(getB());
            if (hVar2.a != null) {
            }
            if8Var.j(bv7Var2.o(), new b83(l43Var2, hVar2, null));
            this.d = l43Var2;
            this.e = bv7Var2;
            this.a = hVar2;
            this.b = null;
            this.c = 2;
        } else {
            if (i != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            hVar2 = this.a;
            bv7Var2 = (bv7) this.e;
            l43Var2 = (l43) this.d;
            s38.b(obj);
            l43Var = l43Var2;
            bv7Var = bv7Var2;
            hVar = hVar2;
            obj2 = hVar.a;
            if (obj2 != kq6.c) {
                gVar = new dw7.g();
                if (obj2 != null) {
                    long jLongValue = Long.valueOf(this.f.b).longValue();
                    gVar.a = jLongValue;
                    if (jLongValue < 0) {
                        throw new IllegalArgumentException("Debounce timeout should not be negative");
                    }
                    if (jLongValue != 0) {
                        hVar2 = hVar;
                        bv7Var2 = bv7Var;
                        l43Var2 = l43Var;
                        if8 if8Var2 = new if8(getB());
                        if (hVar2.a != null) {
                            long j = gVar.a;
                            a83 a83Var = new a83(l43Var2, hVar2, null);
                            yv6 yv6Var = new yv6(j);
                            xv6 xv6Var = xv6.a;
                            hz9.e(3, xv6Var);
                            cf8 cf8Var = new cf8(yv6Var);
                            if8Var2.k(new if8.a(cf8Var.a, xv6Var, cf8Var.c, nf8.f, a83Var, null), false);
                        }
                        if8Var2.j(bv7Var2.o(), new b83(l43Var2, hVar2, null));
                        this.d = l43Var2;
                        this.e = bv7Var2;
                        this.a = hVar2;
                        this.b = null;
                        this.c = 2;
                    } else {
                        Object obj3 = hVar.a;
                        if (obj3 == kq6.a) {
                            obj3 = null;
                        }
                        this.d = l43Var;
                        this.e = bv7Var;
                        this.a = hVar;
                        this.b = gVar;
                        this.c = 1;
                        if (l43Var.emit(obj3, this) != ck1Var) {
                            gVar2 = gVar;
                            hVar.a = null;
                            gVar = gVar2;
                            hVar2 = hVar;
                            bv7Var2 = bv7Var;
                            l43Var2 = l43Var;
                            if8 if8Var22 = new if8(getB());
                            if (hVar2.a != null) {
                            }
                            if8Var22.j(bv7Var2.o(), new b83(l43Var2, hVar2, null));
                            this.d = l43Var2;
                            this.e = bv7Var2;
                            this.a = hVar2;
                            this.b = null;
                            this.c = 2;
                        }
                    }
                    return ck1Var;
                }
                obj2 = hVar.a;
                if (obj2 != kq6.c) {
                    return e6a.a;
                }
            }
        }
    }
}
