package com.vinfast.companion.corecompose;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\n"}, d2 = {"<anonymous>", "", "result", "Lcom/vinfast/companion/corecompose/BaseResult;"}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.corecompose.BaseViewModel$setupStateMachine$2", f = "BaseComposeViewModel.kt", l = {100, 101}, m = "invokeSuspend", v = 1)
final class BaseViewModel$setupStateMachine$2 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function2<com.vinfast.companion.corecompose.BaseResult, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
    int n;
    /* synthetic */ java.lang.Object o;
    final /* synthetic */ com.vinfast.companion.corecompose.BaseViewModel p;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    BaseViewModel$setupStateMachine$2(com.vinfast.companion.corecompose.BaseViewModel baseViewModel, kotlin.coroutines.Continuation continuation) {
        super(2, continuation);
        this.p = baseViewModel;
    }

    /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
    public final java.lang.Object invoke(com.vinfast.companion.corecompose.BaseResult baseResult, kotlin.coroutines.Continuation continuation) {
        return create(baseResult, continuation).invokeSuspend(kotlin.Unit.a);
    }

    public final kotlin.coroutines.Continuation create(java.lang.Object obj, kotlin.coroutines.Continuation continuation) {
        com.vinfast.companion.corecompose.BaseViewModel$setupStateMachine$2 baseViewModel$setupStateMachine$2 = new com.vinfast.companion.corecompose.BaseViewModel$setupStateMachine$2(this.p, continuation);
        baseViewModel$setupStateMachine$2.o = obj;
        return baseViewModel$setupStateMachine$2;
    }

    /* JADX WARN: Code restructure failed: missing block: B:13:0x0040, code lost:
    
        if (r6.emit(r2, r5) == r1) goto L19;
     */
    /* JADX WARN: Code restructure failed: missing block: B:18:0x0061, code lost:
    
        if (r6.emit(r2, r5) == r1) goto L19;
     */
    /* JADX WARN: Code restructure failed: missing block: B:19:0x0063, code lost:
    
        return r1;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object invokeSuspend(java.lang.Object r6) {
        /*
            r5 = this;
            java.lang.Object r0 = r5.o
            com.vinfast.companion.corecompose.BaseResult r0 = (com.vinfast.companion.corecompose.BaseResult) r0
            java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
            int r2 = r5.n
            r3 = 2
            r4 = 1
            if (r2 == 0) goto L1f
            if (r2 == r4) goto L1b
            if (r2 != r3) goto L13
            goto L1b
        L13:
            java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
            java.lang.String r6 = "call to 'resume' before 'invoke' with coroutine"
            r5.<init>(r6)
            throw r5
        L1b:
            kotlin.ResultKt.b(r6)
            goto L64
        L1f:
            kotlin.ResultKt.b(r6)
            boolean r6 = r0 instanceof com.vinfast.companion.corecompose.BaseEvent
            if (r6 == 0) goto L43
            com.vinfast.companion.corecompose.BaseViewModel r6 = r5.p
            kotlinx.coroutines.flow.MutableSharedFlow r6 = r6.getMutableEvent()
            java.lang.String r2 = "null cannot be cast to non-null type Event of com.vinfast.companion.corecompose.BaseViewModel"
            kotlin.jvm.internal.Intrinsics.j(r0, r2)
            r2 = r0
            com.vinfast.companion.corecompose.BaseEvent r2 = (com.vinfast.companion.corecompose.BaseEvent) r2
            java.lang.Object r0 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
            r5.o = r0
            r5.n = r4
            java.lang.Object r5 = r6.emit(r2, r5)
            if (r5 != r1) goto L64
            goto L63
        L43:
            boolean r6 = r0 instanceof com.vinfast.companion.corecompose.BaseState
            if (r6 == 0) goto L64
            com.vinfast.companion.corecompose.BaseViewModel r6 = r5.p
            kotlinx.coroutines.flow.MutableStateFlow r6 = r6.getMutableState()
            java.lang.String r2 = "null cannot be cast to non-null type State of com.vinfast.companion.corecompose.BaseViewModel"
            kotlin.jvm.internal.Intrinsics.j(r0, r2)
            r2 = r0
            com.vinfast.companion.corecompose.BaseState r2 = (com.vinfast.companion.corecompose.BaseState) r2
            java.lang.Object r0 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
            r5.o = r0
            r5.n = r3
            java.lang.Object r5 = r6.emit(r2, r5)
            if (r5 != r1) goto L64
        L63:
            return r1
        L64:
            kotlin.Unit r5 = kotlin.Unit.a
            return r5
        */
        throw new UnsupportedOperationException("Method not decompiled: com.vinfast.companion.corecompose.BaseViewModel$setupStateMachine$2.invokeSuspend(java.lang.Object):java.lang.Object");
    }
}
