package defpackage;

import android.database.SQLException;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;

/* JADX INFO: renamed from: ᵸʦ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4950 extends AbstractC2498 implements InterfaceC0321 {

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public /* synthetic */ Object f18790;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final /* synthetic */ C2939 f18791;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final /* synthetic */ int f18792;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public int f18793;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ C4950(C2939 c2939, InterfaceC2643 interfaceC2643, int i) {
        super(2, interfaceC2643);
        this.f18792 = i;
        this.f18791 = c2939;
    }

    @Override // defpackage.AbstractC1090
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    public final Object mo1078(Object obj) {
        InterfaceC4862 interfaceC4862;
        Object objMo2789;
        Object objMo2793;
        InterfaceC4862 interfaceC48622;
        Object objMo27892;
        EnumC2645[] enumC2645Arr;
        EnumC2645 enumC2645;
        int i = this.f18792;
        EnumC3677 enumC3677 = EnumC3677.f13991;
        boolean z = false;
        EnumC0111 enumC0111 = EnumC0111.f1384;
        boolean z2 = true;
        C2939 c2939 = this.f18791;
        InterfaceC2643 interfaceC2643 = null;
        switch (i) {
            case 0:
                int i2 = this.f18793;
                if (i2 != 0) {
                    if (i2 == 1) {
                        ᵟˌᵫ.ˊˌˊ(obj);
                        return obj;
                    }
                    ᵕᵩʽᵲ.ᵪᵹᵥᵻ("call to 'resume' before 'invoke' with coroutine");
                    return null;
                }
                ᵟˌᵫ.ˊˌˊ(obj);
                C5105 c5105 = (C5105) this.f18790;
                this.f18793 = 1;
                Object objM7027 = C2939.m7027(c2939, c5105, this);
                return objM7027 == enumC0111 ? enumC0111 : objM7027;
            case 1:
                int i3 = this.f18793;
                try {
                    if (i3 == 0) {
                        ᵟˌᵫ.ˊˌˊ(obj);
                        interfaceC4862 = (InterfaceC4862) this.f18790;
                        this.f18790 = interfaceC4862;
                        this.f18793 = 1;
                        objMo2789 = interfaceC4862.mo2789(this);
                        if (objMo2789 == enumC0111) {
                            return enumC0111;
                        }
                    } else {
                        if (i3 != 1) {
                            if (i3 != 2) {
                                ᵕᵩʽᵲ.ᵪᵹᵥᵻ("call to 'resume' before 'invoke' with coroutine");
                                return null;
                            }
                            ᵟˌᵫ.ˊˌˊ(obj);
                            objMo2793 = obj;
                            return (Set) objMo2793;
                        }
                        interfaceC4862 = (InterfaceC4862) this.f18790;
                        ᵟˌᵫ.ˊˌˊ(obj);
                        objMo2789 = obj;
                    }
                    if (!((Boolean) objMo2789).booleanValue()) {
                        C4950 c4950 = new C4950(c2939, interfaceC2643, 0);
                        this.f18790 = null;
                        this.f18793 = 2;
                        objMo2793 = interfaceC4862.mo2793(enumC3677, c4950, this);
                        if (objMo2793 == enumC0111) {
                            return enumC0111;
                        }
                        return (Set) objMo2793;
                    }
                } catch (SQLException unused) {
                }
                return C2817.f10823;
            default:
                int i4 = this.f18793;
                C5063 c5063 = C5063.f19112;
                if (i4 == 0) {
                    ᵟˌᵫ.ˊˌˊ(obj);
                    interfaceC48622 = (InterfaceC4862) this.f18790;
                    this.f18790 = interfaceC48622;
                    this.f18793 = 1;
                    objMo27892 = interfaceC48622.mo2789(this);
                    if (objMo27892 == enumC0111) {
                        return enumC0111;
                    }
                } else {
                    if (i4 != 1) {
                        if (i4 == 2) {
                            ᵟˌᵫ.ˊˌˊ(obj);
                            return c5063;
                        }
                        ᵕᵩʽᵲ.ᵪᵹᵥᵻ("call to 'resume' before 'invoke' with coroutine");
                        return null;
                    }
                    interfaceC48622 = (InterfaceC4862) this.f18790;
                    ᵟˌᵫ.ˊˌˊ(obj);
                    objMo27892 = obj;
                }
                if (!((Boolean) objMo27892).booleanValue()) {
                    C0764 c0764 = (C0764) c2939.f11318;
                    long[] jArr = (long[]) c0764.f3427;
                    ReentrantLock reentrantLock = (ReentrantLock) c0764.f3428;
                    reentrantLock.lock();
                    try {
                        if (c0764.f3426) {
                            c0764.f3426 = false;
                            int length = jArr.length;
                            enumC2645Arr = new EnumC2645[length];
                            int i5 = 0;
                            boolean z3 = false;
                            while (i5 < length) {
                                if (jArr[i5] > 0) {
                                    z = z2;
                                }
                                boolean[] zArr = (boolean[]) c0764.f3429;
                                if (z != zArr[i5]) {
                                    zArr[i5] = z;
                                    enumC2645 = z ? EnumC2645.f10254 : EnumC2645.f10253;
                                    z3 = true;
                                } else {
                                    enumC2645 = EnumC2645.f10252;
                                }
                                enumC2645Arr[i5] = enumC2645;
                                i5++;
                                z = false;
                                z2 = true;
                            }
                            if (!z3) {
                                enumC2645Arr = null;
                            }
                            reentrantLock.unlock();
                        } else {
                            reentrantLock.unlock();
                            enumC2645Arr = null;
                        }
                        if (enumC2645Arr != null) {
                            C5582 c5582 = new C5582(enumC2645Arr, c2939, interfaceC48622, (InterfaceC2643) null);
                            this.f18790 = null;
                            this.f18793 = 2;
                            if (interfaceC48622.mo2793(enumC3677, c5582, this) == enumC0111) {
                                return enumC0111;
                            }
                        }
                    } catch (Throwable th) {
                        reentrantLock.unlock();
                        throw th;
                    }
                }
                return c5063;
        }
    }

    @Override // defpackage.InterfaceC0321
    /* JADX INFO: renamed from: ᵝᵶ */
    public final Object mo1564(Object obj, Object obj2) {
        int i = this.f18792;
        C5063 c5063 = C5063.f19112;
        switch (i) {
            case 0:
                return ((C4950) mo1565((InterfaceC2643) obj2, (C5105) obj)).mo1078(c5063);
            case 1:
                return ((C4950) mo1565((InterfaceC2643) obj2, (InterfaceC4862) obj)).mo1078(c5063);
            default:
                return ((C4950) mo1565((InterfaceC2643) obj2, (InterfaceC4862) obj)).mo1078(c5063);
        }
    }

    @Override // defpackage.AbstractC1090
    /* JADX INFO: renamed from: ᵟᵹᵙ */
    public final InterfaceC2643 mo1565(InterfaceC2643 interfaceC2643, Object obj) {
        int i = this.f18792;
        C2939 c2939 = this.f18791;
        switch (i) {
            case 0:
                C4950 c4950 = new C4950(c2939, interfaceC2643, 0);
                c4950.f18790 = obj;
                return c4950;
            case 1:
                C4950 c49502 = new C4950(c2939, interfaceC2643, 1);
                c49502.f18790 = obj;
                return c49502;
            default:
                C4950 c49503 = new C4950(c2939, interfaceC2643, 2);
                c49503.f18790 = obj;
                return c49503;
        }
    }
}
