package defpackage;

import androidx.media3.extractor.ts.TsExtractor;
import androidx.room.RoomDatabase;
import java.util.concurrent.Callable;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: renamed from: fk1, reason: from Kotlin metadata and case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"R", "Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {1, 8, 0})
@DebugMetadata(c = "androidx.room.CoroutinesRoom$Companion$createFlow$1$1$1", f = "CoroutinesRoom.kt", i = {}, l = {128, TsExtractor.TS_STREAM_TYPE_HDMV_DTS}, m = "invokeSuspend", n = {}, s = {})
final class C0550fk1 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public lv0 a;
    public int b;
    public final /* synthetic */ RoomDatabase c;
    public final /* synthetic */ gk1 d;
    public final /* synthetic */ zg0 e;
    public final /* synthetic */ Callable f;
    public final /* synthetic */ zg0 i;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0550fk1(RoomDatabase roomDatabase, gk1 gk1Var, zg0 zg0Var, Callable callable, zg0 zg0Var2, Continuation continuation) {
        super(2, continuation);
        this.c = roomDatabase;
        this.d = gk1Var;
        this.e = zg0Var;
        this.f = callable;
        this.i = zg0Var2;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new C0550fk1(this.c, this.d, this.e, this.f, this.i, continuation);
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((C0550fk1) create((ak1) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:25:0x0060, code lost:
    
        if (r6.s(r9, r8) == r0) goto L26;
     */
    /* JADX WARN: Removed duplicated region for block: B:20:0x0041  */
    /* JADX WARN: Removed duplicated region for block: B:21:0x0042  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x004d A[Catch: all -> 0x0017, TRY_LEAVE, TryCatch #0 {all -> 0x0017, blocks: (B:7:0x0012, B:18:0x0037, B:22:0x0045, B:24:0x004d, B:14:0x0023, B:17:0x0031), top: B:31:0x000a }] */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0063  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:25:0x0060 -> B:8:0x0015). 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) {
        lv0 it;
        lv0 lv0Var;
        Object objB;
        ck1 ck1Var = ck1.a;
        int i = this.b;
        gk1 gk1Var = this.d;
        RoomDatabase roomDatabase = this.c;
        try {
            if (i == 0) {
                s38.b(obj);
                roomDatabase.getInvalidationTracker().a(gk1Var);
                it = this.e.iterator();
                this.a = it;
                this.b = 1;
                objB = it.b(this);
                if (objB != ck1Var) {
                }
            } else if (i == 1) {
                lv0Var = this.a;
                s38.b(obj);
                if (((Boolean) obj).booleanValue()) {
                }
            } else {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                lv0Var = this.a;
                s38.b(obj);
                it = lv0Var;
                this.a = it;
                this.b = 1;
                objB = it.b(this);
                if (objB != ck1Var) {
                    return ck1Var;
                }
                lv0Var = it;
                obj = objB;
                if (((Boolean) obj).booleanValue()) {
                    roomDatabase.getInvalidationTracker().c(gk1Var);
                    return e6a.a;
                }
                lv0Var.next();
                Object objCall = this.f.call();
                zg0 zg0Var = this.i;
                this.a = lv0Var;
                this.b = 2;
            }
        } catch (Throwable th) {
            roomDatabase.getInvalidationTracker().c(gk1Var);
            throw th;
        }
    }
}
