package vn.vinfast.paymentkit.repositories;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.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;", "", "Lvn/vinfast/paymentkitapi/models/autopayment/AutoPaymentModel;"}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "vn.vinfast.paymentkit.repositories.AutoPaymentRepoImpl$getVehiclesAutoPay$1", f = "AutoPaymentRepoImpl.kt", l = {17, 20}, m = "invokeSuspend", v = 1)
@kotlin.jvm.internal.SourceDebugExtension
final class AutoPaymentRepoImpl$getVehiclesAutoPay$1 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function2<kotlinx.coroutines.flow.FlowCollector<? super java.util.List<? extends vn.vinfast.paymentkitapi.models.autopayment.AutoPaymentModel>>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
    java.lang.Object n;
    int o;
    private /* synthetic */ java.lang.Object p;
    final /* synthetic */ vn.vinfast.paymentkit.repositories.AutoPaymentRepoImpl q;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    AutoPaymentRepoImpl$getVehiclesAutoPay$1(vn.vinfast.paymentkit.repositories.AutoPaymentRepoImpl autoPaymentRepoImpl, kotlin.coroutines.Continuation continuation) {
        super(2, continuation);
        this.q = autoPaymentRepoImpl;
    }

    /* 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) {
        vn.vinfast.paymentkit.repositories.AutoPaymentRepoImpl$getVehiclesAutoPay$1 autoPaymentRepoImpl$getVehiclesAutoPay$1 = new vn.vinfast.paymentkit.repositories.AutoPaymentRepoImpl$getVehiclesAutoPay$1(this.q, continuation);
        autoPaymentRepoImpl$getVehiclesAutoPay$1.p = obj;
        return autoPaymentRepoImpl$getVehiclesAutoPay$1;
    }

    /* JADX WARN: Code restructure failed: missing block: B:21:0x0082, code lost:
    
        if (r0.emit(r2, r6) == r1) goto L22;
     */
    /*
        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 r7) {
        /*
            r6 = this;
            java.lang.Object r0 = r6.p
            kotlinx.coroutines.flow.FlowCollector r0 = (kotlinx.coroutines.flow.FlowCollector) r0
            java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
            int r2 = r6.o
            r3 = 2
            r4 = 1
            if (r2 == 0) goto L26
            if (r2 == r4) goto L22
            if (r2 != r3) goto L1a
            java.lang.Object r6 = r6.n
            java.util.List r6 = (java.util.List) r6
            kotlin.ResultKt.b(r7)
            goto L85
        L1a:
            java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
            java.lang.String r7 = "call to 'resume' before 'invoke' with coroutine"
            r6.<init>(r7)
            throw r6
        L22:
            kotlin.ResultKt.b(r7)
            goto L3a
        L26:
            kotlin.ResultKt.b(r7)
            vn.vinfast.paymentkit.repositories.AutoPaymentRepoImpl r7 = r6.q
            vn.vinfast.paymentkit.datasources.remote.PaymentApi r7 = vn.vinfast.paymentkit.repositories.AutoPaymentRepoImpl.d(r7)
            r6.p = r0
            r6.o = r4
            java.lang.Object r7 = r7.g(r6)
            if (r7 != r1) goto L3a
            goto L84
        L3a:
            com.vinfast.companion.corenetwork.BaseResponse r7 = (com.vinfast.companion.corenetwork.BaseResponse) r7
            java.lang.Object r7 = r7.a()
            java.util.List r7 = (java.util.List) r7
            if (r7 == 0) goto L6c
            java.util.ArrayList r2 = new java.util.ArrayList
            r4 = 10
            int r4 = kotlin.collections.CollectionsKt.z(r7, r4)
            r2.<init>(r4)
            java.util.Iterator r7 = r7.iterator()
        L53:
            boolean r4 = r7.hasNext()
            if (r4 == 0) goto L70
            java.lang.Object r4 = r7.next()
            vn.vinfast.paymentkit.datasources.remote.responses.AutoPaymentModelDto r4 = (vn.vinfast.paymentkit.datasources.remote.responses.AutoPaymentModelDto) r4
            vn.vinfast.paymentkit.datasources.remote.responses.AutoPaymentModelDto$Companion r5 = vn.vinfast.paymentkit.datasources.remote.responses.AutoPaymentModelDto.INSTANCE
            vn.vinfast.paymentkitapi.models.autopayment.AutoPaymentModel r4 = r5.a(r4)
            kotlin.jvm.internal.Intrinsics.i(r4)
            r2.add(r4)
            goto L53
        L6c:
            java.util.List r2 = kotlin.collections.CollectionsKt.o()
        L70:
            java.lang.Object r7 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
            r6.p = r7
            java.lang.Object r7 = kotlin.coroutines.jvm.internal.SpillingKt.a(r2)
            r6.n = r7
            r6.o = r3
            java.lang.Object r6 = r0.emit(r2, r6)
            if (r6 != r1) goto L85
        L84:
            return r1
        L85:
            kotlin.Unit r6 = kotlin.Unit.a
            return r6
        */
        throw new UnsupportedOperationException("Method not decompiled: vn.vinfast.paymentkit.repositories.AutoPaymentRepoImpl$getVehiclesAutoPay$1.invokeSuspend(java.lang.Object):java.lang.Object");
    }
}
