package com.strmr.ps.data.service;

import com.strmr.ps.data.model.debrid.DebridServiceSection;
import com.strmr.ps.data.repository.DebridLibraryRepository;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.ik2;
import defpackage.j43;
import defpackage.kq;
import defpackage.l43;
import defpackage.n89;
import defpackage.pw7;
import defpackage.s38;
import defpackage.uv1;
import defpackage.y41;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u0002*\b\u0012\u0004\u0012\u00020\u00010\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Ll43;", "Luv1;", "Le6a;", "<anonymous>", "(Ll43;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.data.service.DebridLibrarySearchService$searchForContent$1", f = "DebridLibrarySearchService.kt", i = {0, 1, 1, 3, 3, 4, 4, 4, 4, 5, 5, 6}, l = {54, 61, 63, 69, 77, 154, 163, 167}, m = "invokeSuspend", n = {"$this$flow", "$this$flow", "cleanTitle", "$this$flow", "cleanTitle", "$this$flow", "cleanTitle", "alternativeTitles", "allMatches", "$this$flow", "allMatches", "$this$flow"}, s = {"L$0", "L$0", "L$1", "L$0", "L$1", "L$0", "L$1", "L$2", "L$3", "L$0", "L$1", "L$0"})
final class v extends SuspendLambda implements gr3<l43<? super uv1>, Continuation<? super e6a>, Object> {
    public Object a;
    public List b;
    public ArrayList c;
    public int d;
    public /* synthetic */ Object e;
    public final /* synthetic */ String f;
    public final /* synthetic */ DebridLibrarySearchService i;
    public final /* synthetic */ int j;
    public final /* synthetic */ boolean k;
    public final /* synthetic */ Integer l;
    public final /* synthetic */ int m;
    public final /* synthetic */ int n;
    public final /* synthetic */ String o;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public v(String str, DebridLibrarySearchService debridLibrarySearchService, int i, boolean z, Integer num, int i2, int i3, String str2, Continuation continuation) {
        super(2, continuation);
        this.f = str;
        this.i = debridLibrarySearchService;
        this.j = i;
        this.k = z;
        this.l = num;
        this.m = i2;
        this.n = i3;
        this.o = str2;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        v vVar = new v(this.f, this.i, this.j, this.k, this.l, this.m, this.n, this.o, continuation);
        vVar.e = obj;
        return vVar;
    }

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

    /* JADX WARN: Code restructure failed: missing block: B:40:0x0109, code lost:
    
        if (r6.emit(r0, r23) == r5) goto L33;
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:143:0x02c0 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:167:0x012f A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:173:0x010c A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:189:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:190:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:191:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00f1 A[PHI: r6 r13 r14
      0x00f1: PHI (r6v6 l43) = (r6v3 l43), (r6v9 l43) binds: [B:35:0x00ee, B:29:0x009b] A[DONT_GENERATE, DONT_INLINE]
      0x00f1: PHI (r13v10 java.lang.String) = (r13v9 java.lang.String), (r13v16 java.lang.String) binds: [B:35:0x00ee, B:29:0x009b] A[DONT_GENERATE, DONT_INLINE]
      0x00f1: PHI (r14v8 java.lang.Object) = (r14v7 java.lang.Object), (r14v15 java.lang.Object) binds: [B:35:0x00ee, B:29:0x009b] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:39:0x00f9  */
    /* JADX WARN: Removed duplicated region for block: B:55:0x0166  */
    /* JADX WARN: Removed duplicated region for block: B:72:0x01a9  */
    /* JADX WARN: Removed duplicated region for block: B:84:0x01d9  */
    /* JADX WARN: Removed duplicated region for block: B:87:0x01e5 A[Catch: Exception -> 0x0201, TRY_LEAVE, TryCatch #22 {Exception -> 0x0201, blocks: (B:85:0x01da, B:87:0x01e5), top: B:187:0x01da }] */
    /* JADX WARN: Removed duplicated region for block: B:94:0x0205  */
    /* JADX WARN: Type inference failed for: r1v1 */
    /* JADX WARN: Type inference failed for: r1v11 */
    /* JADX WARN: Type inference failed for: r1v12 */
    /* JADX WARN: Type inference failed for: r1v16, types: [java.lang.Object, l43] */
    /* JADX WARN: Type inference failed for: r1v21 */
    /* JADX WARN: Type inference failed for: r1v23 */
    /* JADX WARN: Type inference failed for: r1v3, types: [l43] */
    /* JADX WARN: Type inference failed for: r1v5 */
    /* JADX WARN: Type inference failed for: r1v6 */
    /* JADX WARN: Type inference failed for: r1v9 */
    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var;
        ik2 ik2Var;
        boolean z;
        ArrayList arrayList;
        ?? r1;
        String str;
        Object obj2;
        uv1 uv1Var;
        l43 l43Var;
        String string;
        Object objHasAnyDebridAccount;
        Object objA;
        ik2 ik2Var2;
        String str2;
        List list;
        ArrayList arrayList2;
        j43<List<DebridServiceSection>> allServicesLibrary;
        ik2 ik2Var3;
        u uVar;
        String str3;
        String str4;
        boolean z2;
        DebridLibrarySearchService debridLibrarySearchService;
        ArrayList arrayList3;
        String str5;
        l43 l43Var2;
        ck1 ck1Var2;
        List list2;
        ArrayList arrayList4;
        boolean z3;
        ck1 ck1Var3;
        ik2 ik2Var4;
        String str6;
        String str7;
        Object objB;
        List list3;
        List list4;
        uv1 uv1Var2;
        DebridLibrarySearchService debridLibrarySearchService2 = this.i;
        DebridLibraryRepository debridLibraryRepository = debridLibrarySearchService2.a;
        ck1 ck1Var4 = ck1.a;
        int i = this.d;
        e6a e6aVar = e6a.a;
        String str8 = this.f;
        ik2 ik2Var5 = ik2.a;
        try {
        } catch (Exception e) {
            e = e;
            ck1Var = ck1Var4;
            obj2 = debridLibraryRepository;
        }
        switch (i) {
            case 0:
                s38.b(obj);
                l43Var = (l43) this.e;
                uv1 uv1Var3 = new uv1(ik2Var5, true);
                this.e = l43Var;
                this.d = 1;
                if (l43Var.emit(uv1Var3, this) != ck1Var4) {
                    string = n89.bg(new pw7("\\s+S\\d+E\\d+$").f("", str8)).toString();
                    this.e = l43Var;
                    this.a = string;
                    this.d = 2;
                    objHasAnyDebridAccount = debridLibraryRepository.hasAnyDebridAccount(this);
                    if (objHasAnyDebridAccount != ck1Var4) {
                        if (((Boolean) objHasAnyDebridAccount).booleanValue()) {
                            uv1 uv1Var4 = new uv1(ik2Var5, false);
                            this.e = null;
                            this.a = null;
                            this.d = 3;
                        } else {
                            try {
                                int i2 = this.j;
                                boolean z4 = this.k;
                                this.e = l43Var;
                                this.a = string;
                                try {
                                    this.d = 4;
                                    objA = DebridLibrarySearchService.a(debridLibrarySearchService2, i2, z4, this);
                                    break;
                                } catch (Exception e2) {
                                    e = e2;
                                    ck1Var = ck1Var4;
                                    ik2Var = ik2Var5;
                                    arrayList = null;
                                    z = false;
                                    str = "DebridLibrarySearch";
                                    r1 = l43Var;
                                    ExecutorService executorService = kq.a;
                                    kq.a(str, "Library search failed", e);
                                    uv1Var = new uv1(ik2Var, z);
                                    this.e = arrayList;
                                    this.a = arrayList;
                                    this.b = arrayList;
                                    this.c = arrayList;
                                    this.d = 8;
                                    if (r1.emit(uv1Var, this) != ck1Var) {
                                    }
                                }
                            } catch (Exception e3) {
                                e = e3;
                                ck1Var = ck1Var4;
                                z = false;
                                ik2Var = ik2Var5;
                                arrayList = null;
                            }
                            if (objA != ck1Var4) {
                                String str9 = string;
                                ik2Var2 = ik2Var5;
                                str2 = str9;
                                try {
                                    list = (List) objA;
                                    if (list.isEmpty()) {
                                        try {
                                            ExecutorService executorService2 = kq.a;
                                            kq.h("DebridLibrarySearch", "Got " + list.size() + " alternative titles for '" + str8 + "': " + y41.bk(list, 5));
                                            arrayList2 = null;
                                        } catch (Exception e4) {
                                            e = e4;
                                            r1 = l43Var;
                                            str = "DebridLibrarySearch";
                                            ik2Var = ik2Var2;
                                            arrayList = null;
                                            z = false;
                                            ck1Var = ck1Var4;
                                            ExecutorService executorService3 = kq.a;
                                            kq.a(str, "Library search failed", e);
                                            uv1Var = new uv1(ik2Var, z);
                                            this.e = arrayList;
                                            this.a = arrayList;
                                            this.b = arrayList;
                                            this.c = arrayList;
                                            this.d = 8;
                                            if (r1.emit(uv1Var, this) != ck1Var) {
                                            }
                                        }
                                    } else {
                                        arrayList2 = null;
                                    }
                                    try {
                                        ArrayList arrayList5 = new ArrayList();
                                        allServicesLibrary = debridLibraryRepository.getAllServicesLibrary();
                                        ik2Var3 = ik2Var2;
                                        try {
                                            str = "DebridLibrarySearch";
                                            try {
                                                try {
                                                    try {
                                                        try {
                                                            try {
                                                                str3 = "Total library matches: ";
                                                                str4 = str;
                                                                arrayList = null;
                                                                z2 = false;
                                                                debridLibrarySearchService = debridLibrarySearchService2;
                                                                try {
                                                                    uVar = new u(str2, this.l, this.k, list, this.m, this.n, this.o, arrayList5, debridLibrarySearchService);
                                                                    arrayList3 = arrayList5;
                                                                    this.e = l43Var;
                                                                    this.a = str2;
                                                                    this.b = list;
                                                                    this.c = arrayList3;
                                                                    this.d = 5;
                                                                    break;
                                                                } catch (Exception e5) {
                                                                    e = e5;
                                                                    z = false;
                                                                    ck1Var = ck1Var4;
                                                                    ik2Var = ik2Var3;
                                                                    str = str4;
                                                                    r1 = l43Var;
                                                                    ExecutorService executorService32 = kq.a;
                                                                    kq.a(str, "Library search failed", e);
                                                                    uv1Var = new uv1(ik2Var, z);
                                                                    this.e = arrayList;
                                                                    this.a = arrayList;
                                                                    this.b = arrayList;
                                                                    this.c = arrayList;
                                                                    this.d = 8;
                                                                    if (r1.emit(uv1Var, this) != ck1Var) {
                                                                    }
                                                                }
                                                            } catch (Exception e6) {
                                                                e = e6;
                                                                ck1Var = ck1Var4;
                                                                ik2Var = ik2Var3;
                                                                str = str;
                                                                arrayList = null;
                                                                z = false;
                                                                r1 = l43Var;
                                                                ExecutorService executorService322 = kq.a;
                                                                kq.a(str, "Library search failed", e);
                                                                uv1Var = new uv1(ik2Var, z);
                                                                this.e = arrayList;
                                                                this.a = arrayList;
                                                                this.b = arrayList;
                                                                this.c = arrayList;
                                                                this.d = 8;
                                                                if (r1.emit(uv1Var, this) != ck1Var) {
                                                                }
                                                            }
                                                        } catch (Exception e7) {
                                                            e = e7;
                                                            arrayList = arrayList2;
                                                            ck1Var = ck1Var4;
                                                            ik2Var = ik2Var3;
                                                            str = str;
                                                        }
                                                    } catch (Exception e8) {
                                                        e = e8;
                                                        arrayList = arrayList2;
                                                        ck1Var = ck1Var4;
                                                        str = str;
                                                        z = false;
                                                        ik2Var = ik2Var3;
                                                    }
                                                } catch (Exception e9) {
                                                    e = e9;
                                                    arrayList = arrayList2;
                                                    ck1Var = ck1Var4;
                                                    ik2Var = ik2Var3;
                                                    str = str;
                                                }
                                            } catch (Exception e10) {
                                                e = e10;
                                                arrayList = arrayList2;
                                                ck1Var = ck1Var4;
                                                ik2Var = ik2Var3;
                                            }
                                        } catch (Exception e11) {
                                            e = e11;
                                            arrayList = arrayList2;
                                            ck1Var = ck1Var4;
                                            ik2Var = ik2Var3;
                                            str = "DebridLibrarySearch";
                                        }
                                    } catch (Exception e12) {
                                        e = e12;
                                        arrayList = arrayList2;
                                        str = "DebridLibrarySearch";
                                        ik2Var = ik2Var2;
                                        z = false;
                                        ck1Var = ck1Var4;
                                    }
                                } catch (Exception e13) {
                                    e = e13;
                                    arrayList = null;
                                    ik2Var = ik2Var2;
                                    z = false;
                                    ck1Var = ck1Var4;
                                    str = "DebridLibrarySearch";
                                    r1 = l43Var;
                                    ExecutorService executorService3222 = kq.a;
                                    kq.a(str, "Library search failed", e);
                                    uv1Var = new uv1(ik2Var, z);
                                    this.e = arrayList;
                                    this.a = arrayList;
                                    this.b = arrayList;
                                    this.c = arrayList;
                                    this.d = 8;
                                    if (r1.emit(uv1Var, this) != ck1Var) {
                                    }
                                }
                                if (allServicesLibrary.collect(uVar, this) != ck1Var4) {
                                    str5 = str2;
                                    l43Var2 = l43Var;
                                    ck1Var2 = ck1Var4;
                                    list2 = list;
                                    arrayList4 = arrayList3;
                                    try {
                                        Integer num = this.l;
                                        int i3 = this.m;
                                        z3 = z2;
                                        try {
                                            int i4 = this.n;
                                            ck1Var3 = ck1Var2;
                                        } catch (Exception e14) {
                                            e = e14;
                                            ck1Var = ck1Var2;
                                            ik2Var = ik2Var3;
                                        }
                                    } catch (Exception e15) {
                                        e = e15;
                                        z = z2;
                                        ck1Var = ck1Var2;
                                        ik2Var = ik2Var3;
                                    }
                                    try {
                                        boolean z5 = this.k;
                                        ik2Var4 = ik2Var3;
                                        try {
                                            String str10 = this.o;
                                            this.e = l43Var2;
                                            this.a = arrayList4;
                                            this.b = arrayList;
                                            this.c = arrayList;
                                            this.d = 6;
                                            ik2Var = ik2Var4;
                                            z = z3;
                                            ck1Var = ck1Var3;
                                            str6 = "RD downloads matches: ";
                                            str7 = str3;
                                        } catch (Exception e16) {
                                            e = e16;
                                            ik2Var = ik2Var4;
                                            z = z3;
                                            ck1Var = ck1Var3;
                                            str = str4;
                                            r1 = l43Var2;
                                            ExecutorService executorService32222 = kq.a;
                                            kq.a(str, "Library search failed", e);
                                            uv1Var = new uv1(ik2Var, z);
                                            this.e = arrayList;
                                            this.a = arrayList;
                                            this.b = arrayList;
                                            this.c = arrayList;
                                            this.d = 8;
                                            if (r1.emit(uv1Var, this) != ck1Var) {
                                            }
                                        }
                                        try {
                                            objB = DebridLibrarySearchService.b(debridLibrarySearchService, str5, num, i3, i4, list2, z5, str10, this);
                                            break;
                                        } catch (Exception e17) {
                                            e = e17;
                                            str = str4;
                                            arrayList = null;
                                            r1 = l43Var2;
                                            ExecutorService executorService322222 = kq.a;
                                            kq.a(str, "Library search failed", e);
                                            uv1Var = new uv1(ik2Var, z);
                                            this.e = arrayList;
                                            this.a = arrayList;
                                            this.b = arrayList;
                                            this.c = arrayList;
                                            this.d = 8;
                                            if (r1.emit(uv1Var, this) != ck1Var) {
                                            }
                                        }
                                    } catch (Exception e18) {
                                        e = e18;
                                        ik2Var = ik2Var3;
                                        ck1Var = ck1Var3;
                                        z = z3;
                                        str = str4;
                                        r1 = l43Var2;
                                        ExecutorService executorService3222222 = kq.a;
                                        kq.a(str, "Library search failed", e);
                                        uv1Var = new uv1(ik2Var, z);
                                        this.e = arrayList;
                                        this.a = arrayList;
                                        this.b = arrayList;
                                        this.c = arrayList;
                                        this.d = 8;
                                        if (r1.emit(uv1Var, this) != ck1Var) {
                                        }
                                    }
                                    if (objB != ck1Var) {
                                        return ck1Var;
                                    }
                                    r1 = l43Var2;
                                    list3 = arrayList4;
                                    try {
                                        list4 = (List) objB;
                                        if (list4.isEmpty()) {
                                            ExecutorService executorService4 = kq.a;
                                            str = str4;
                                            try {
                                                kq.h(str, str6 + list4.size());
                                            } catch (Exception e19) {
                                                e = e19;
                                                arrayList = null;
                                                ExecutorService executorService32222222 = kq.a;
                                                kq.a(str, "Library search failed", e);
                                                uv1Var = new uv1(ik2Var, z);
                                                this.e = arrayList;
                                                this.a = arrayList;
                                                this.b = arrayList;
                                                this.c = arrayList;
                                                this.d = 8;
                                                if (r1.emit(uv1Var, this) != ck1Var) {
                                                }
                                            }
                                        } else {
                                            str = str4;
                                        }
                                        list3.addAll(list4);
                                        ExecutorService executorService5 = kq.a;
                                        kq.h(str, str7 + list3.size());
                                        uv1Var2 = new uv1(list3, z);
                                        this.e = r1;
                                        arrayList = null;
                                        try {
                                            this.a = null;
                                            this.d = 7;
                                            break;
                                        } catch (Exception e20) {
                                            e = e20;
                                            ExecutorService executorService322222222 = kq.a;
                                            kq.a(str, "Library search failed", e);
                                            uv1Var = new uv1(ik2Var, z);
                                            this.e = arrayList;
                                            this.a = arrayList;
                                            this.b = arrayList;
                                            this.c = arrayList;
                                            this.d = 8;
                                            if (r1.emit(uv1Var, this) != ck1Var) {
                                            }
                                        }
                                    } catch (Exception e21) {
                                        e = e21;
                                        str = str4;
                                    }
                                    return r1.emit(uv1Var2, this) != ck1Var ? ck1Var : e6aVar;
                                }
                            }
                        }
                    }
                    break;
                }
                return ck1Var4;
            case 1:
                l43Var = (l43) this.e;
                s38.b(obj);
                string = n89.bg(new pw7("\\s+S\\d+E\\d+$").f("", str8)).toString();
                this.e = l43Var;
                this.a = string;
                this.d = 2;
                objHasAnyDebridAccount = debridLibraryRepository.hasAnyDebridAccount(this);
                if (objHasAnyDebridAccount != ck1Var4) {
                }
                return ck1Var4;
            case 2:
                String str11 = (String) this.a;
                l43 l43Var3 = (l43) this.e;
                s38.b(obj);
                string = str11;
                l43Var = l43Var3;
                objHasAnyDebridAccount = obj;
                if (((Boolean) objHasAnyDebridAccount).booleanValue()) {
                }
                return ck1Var4;
            case 3:
                s38.b(obj);
                return e6aVar;
            case 4:
                String str12 = (String) this.a;
                l43 l43Var4 = (l43) this.e;
                try {
                    s38.b(obj);
                    str2 = str12;
                    l43Var = l43Var4;
                    ik2Var2 = ik2Var5;
                    objA = obj;
                    list = (List) objA;
                    if (list.isEmpty()) {
                    }
                    ArrayList arrayList52 = new ArrayList();
                    allServicesLibrary = debridLibraryRepository.getAllServicesLibrary();
                    ik2Var3 = ik2Var2;
                    str = "DebridLibrarySearch";
                    str3 = "Total library matches: ";
                    str4 = str;
                    arrayList = null;
                    z2 = false;
                    debridLibrarySearchService = debridLibrarySearchService2;
                    uVar = new u(str2, this.l, this.k, list, this.m, this.n, this.o, arrayList52, debridLibrarySearchService);
                    arrayList3 = arrayList52;
                    this.e = l43Var;
                    this.a = str2;
                    this.b = list;
                    this.c = arrayList3;
                    this.d = 5;
                    if (allServicesLibrary.collect(uVar, this) != ck1Var4) {
                    }
                    return ck1Var4;
                } catch (Exception e22) {
                    e = e22;
                    z = false;
                    ik2Var = ik2Var5;
                    arrayList = null;
                    r1 = l43Var4;
                    ck1Var = ck1Var4;
                    str = "DebridLibrarySearch";
                    ExecutorService executorService3222222222 = kq.a;
                    kq.a(str, "Library search failed", e);
                    uv1Var = new uv1(ik2Var, z);
                    this.e = arrayList;
                    this.a = arrayList;
                    this.b = arrayList;
                    this.c = arrayList;
                    this.d = 8;
                    if (r1.emit(uv1Var, this) != ck1Var) {
                        return ck1Var;
                    }
                }
            case 5:
                ArrayList arrayList6 = this.c;
                List list5 = this.b;
                String str13 = (String) this.a;
                l43 l43Var5 = (l43) this.e;
                try {
                    s38.b(obj);
                    arrayList4 = arrayList6;
                    str5 = str13;
                    ck1Var2 = ck1Var4;
                    list2 = list5;
                    z2 = false;
                    l43Var2 = l43Var5;
                    ik2Var3 = ik2Var5;
                    debridLibrarySearchService = debridLibrarySearchService2;
                    str3 = "Total library matches: ";
                    str4 = "DebridLibrarySearch";
                    arrayList = null;
                    Integer num2 = this.l;
                    int i32 = this.m;
                    z3 = z2;
                    int i42 = this.n;
                    ck1Var3 = ck1Var2;
                    boolean z52 = this.k;
                    ik2Var4 = ik2Var3;
                    String str102 = this.o;
                    this.e = l43Var2;
                    this.a = arrayList4;
                    this.b = arrayList;
                    this.c = arrayList;
                    this.d = 6;
                    ik2Var = ik2Var4;
                    z = z3;
                    ck1Var = ck1Var3;
                    str6 = "RD downloads matches: ";
                    str7 = str3;
                    objB = DebridLibrarySearchService.b(debridLibrarySearchService, str5, num2, i32, i42, list2, z52, str102, this);
                    if (objB != ck1Var) {
                    }
                } catch (Exception e23) {
                    e = e23;
                    ck1Var = ck1Var4;
                    obj2 = l43Var5;
                    z = false;
                    ik2Var = ik2Var5;
                    arrayList = null;
                    r1 = obj2;
                    str = "DebridLibrarySearch";
                    ExecutorService executorService32222222222 = kq.a;
                    kq.a(str, "Library search failed", e);
                    uv1Var = new uv1(ik2Var, z);
                    this.e = arrayList;
                    this.a = arrayList;
                    this.b = arrayList;
                    this.c = arrayList;
                    this.d = 8;
                    if (r1.emit(uv1Var, this) != ck1Var) {
                    }
                }
                break;
            case 6:
                List list6 = (List) this.a;
                l43 l43Var6 = (l43) this.e;
                s38.b(obj);
                str6 = "RD downloads matches: ";
                ck1Var = ck1Var4;
                z = false;
                ik2Var = ik2Var5;
                str4 = "DebridLibrarySearch";
                list3 = list6;
                str7 = "Total library matches: ";
                objB = obj;
                r1 = l43Var6;
                list4 = (List) objB;
                if (list4.isEmpty()) {
                }
                list3.addAll(list4);
                ExecutorService executorService52 = kq.a;
                kq.h(str, str7 + list3.size());
                uv1Var2 = new uv1(list3, z);
                this.e = r1;
                arrayList = null;
                this.a = null;
                this.d = 7;
                if (r1.emit(uv1Var2, this) != ck1Var) {
                }
                break;
            case 7:
                s38.b(obj);
                return e6aVar;
            case 8:
                s38.b(obj);
            default:
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
    }
}
