package com.vinfast.companion.serviceskit.data.repository;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes6.dex */
@kotlin.Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00040\u00030\u0002H\n"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/flow/FlowCollector;", "", "Lcom/vinfast/companion/serviceskit/domain/model/gltestdrive/GlTestDriveAppointment;"}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1", f = "TestDriveRepositoryProviderStub.kt", l = {248, 256}, m = "invokeSuspend", v = 1)
@kotlin.jvm.internal.SourceDebugExtension
final class TestDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function2<kotlinx.coroutines.flow.FlowCollector<? super java.util.List<? extends com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlTestDriveAppointment>>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
    java.lang.Object n;
    java.lang.Object o;
    int p;
    private /* synthetic */ java.lang.Object q;
    final /* synthetic */ com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProviderStub r;
    final /* synthetic */ int s;
    final /* synthetic */ int t;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    TestDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1(com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProviderStub testDriveRepositoryProviderStub, int i, int i2, kotlin.coroutines.Continuation continuation) {
        super(2, continuation);
        this.r = testDriveRepositoryProviderStub;
        this.s = i;
        this.t = i2;
    }

    /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
    public final java.lang.Object invoke(kotlinx.coroutines.flow.FlowCollector flowCollector, kotlin.coroutines.Continuation continuation) {
        return create(flowCollector, continuation).invokeSuspend(kotlin.Unit.a);
    }

    public final kotlin.coroutines.Continuation create(java.lang.Object obj, kotlin.coroutines.Continuation continuation) {
        com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1 testDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1 = new com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1(this.r, this.s, this.t, continuation);
        testDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1.q = obj;
        return testDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1;
    }

    /* JADX WARN: Code restructure failed: missing block: B:23:0x0096, code lost:
    
        if (r0.emit(r4, r8) == r1) goto L24;
     */
    /*
        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 r9) {
        /*
            r8 = this;
            java.lang.Object r0 = r8.q
            kotlinx.coroutines.flow.FlowCollector r0 = (kotlinx.coroutines.flow.FlowCollector) r0
            java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
            int r2 = r8.p
            r3 = 2
            r4 = 1
            if (r2 == 0) goto L2b
            if (r2 == r4) goto L27
            if (r2 != r3) goto L1f
            java.lang.Object r0 = r8.o
            java.util.List r0 = (java.util.List) r0
            java.lang.Object r8 = r8.n
            com.vinfast.companion.core.base.BaseResponse r8 = (com.vinfast.companion.core.base.BaseResponse) r8
            kotlin.ResultKt.b(r9)
            goto L99
        L1f:
            java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
            java.lang.String r9 = "call to 'resume' before 'invoke' with coroutine"
            r8.<init>(r9)
            throw r8
        L27:
            kotlin.ResultKt.b(r9)
            goto L43
        L2b:
            kotlin.ResultKt.b(r9)
            com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProviderStub r9 = r8.r
            com.vinfast.companion.serviceskit.data.api.TestDriveApi r9 = com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProviderStub.a(r9)
            int r2 = r8.s
            int r5 = r8.t
            r8.q = r0
            r8.p = r4
            java.lang.Object r9 = r9.F(r2, r5, r8)
            if (r9 != r1) goto L43
            goto L98
        L43:
            com.vinfast.companion.core.base.BaseResponse r9 = (com.vinfast.companion.core.base.BaseResponse) r9
            java.lang.Object r2 = r9.a()
            com.vinfast.companion.serviceskit.domain.response.gltestdrive.GlTestDriveContentAppointmentDto r2 = (com.vinfast.companion.serviceskit.domain.response.gltestdrive.GlTestDriveContentAppointmentDto) r2
            if (r2 == 0) goto L7a
            java.util.List r2 = r2.getContents()
            if (r2 == 0) goto L7a
            java.util.ArrayList r4 = new java.util.ArrayList
            r5 = 10
            int r5 = kotlin.collections.CollectionsKt.z(r2, r5)
            r4.<init>(r5)
            java.util.Iterator r2 = r2.iterator()
        L62:
            boolean r5 = r2.hasNext()
            if (r5 == 0) goto L7e
            java.lang.Object r5 = r2.next()
            com.vinfast.companion.serviceskit.domain.response.gltestdrive.GlTestDriveAppointmentDto r5 = (com.vinfast.companion.serviceskit.domain.response.gltestdrive.GlTestDriveAppointmentDto) r5
            com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlTestDriveAppointment$CREATOR r6 = com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlTestDriveAppointment.INSTANCE
            com.vinfast.companion.serviceskit.domain.model.gltestdrive.TestDriverState$Upcoming r7 = com.vinfast.companion.serviceskit.domain.model.gltestdrive.TestDriverState.Upcoming.c
            com.vinfast.companion.serviceskit.domain.model.gltestdrive.GlTestDriveAppointment r5 = r6.a(r5, r7)
            r4.add(r5)
            goto L62
        L7a:
            java.util.List r4 = kotlin.collections.CollectionsKt.o()
        L7e:
            java.lang.Object r2 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
            r8.q = r2
            java.lang.Object r9 = kotlin.coroutines.jvm.internal.SpillingKt.a(r9)
            r8.n = r9
            java.lang.Object r9 = kotlin.coroutines.jvm.internal.SpillingKt.a(r4)
            r8.o = r9
            r8.p = r3
            java.lang.Object r8 = r0.emit(r4, r8)
            if (r8 != r1) goto L99
        L98:
            return r1
        L99:
            kotlin.Unit r8 = kotlin.Unit.a
            return r8
        */
        throw new UnsupportedOperationException("Method not decompiled: com.vinfast.companion.serviceskit.data.repository.TestDriveRepositoryProviderStub$getListUpcomingGlTestDrive$1.invokeSuspend(java.lang.Object):java.lang.Object");
    }
}
