package defpackage;

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

/* renamed from: ᵲᵴᵛ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4527 extends AbstractC2162 implements InterfaceC3759 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public /* synthetic */ Object f16852;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final /* synthetic */ C0744 f16853;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public int f16854;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final /* synthetic */ int f16855;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ C4527(C0744 c0744, InterfaceC4943 interfaceC4943, int i) {
        super(2, interfaceC4943);
        this.f16855 = i;
        this.f16853 = c0744;
    }

    @Override // defpackage.AbstractC1297
    /* renamed from: ˌʾˀ */
    public final InterfaceC4943 mo1245(InterfaceC4943 interfaceC4943, Object obj) {
        int i = this.f16855;
        C0744 c0744 = this.f16853;
        switch (i) {
            case 0:
                C4527 c4527 = new C4527(c0744, interfaceC4943, 0);
                c4527.f16852 = obj;
                return c4527;
            case 1:
                C4527 c45272 = new C4527(c0744, interfaceC4943, 1);
                c45272.f16852 = obj;
                return c45272;
            default:
                C4527 c45273 = new C4527(c0744, interfaceC4943, 2);
                c45273.f16852 = obj;
                return c45273;
        }
    }

    @Override // defpackage.InterfaceC3759
    /* renamed from: ᵯٴᵦ */
    public final Object mo1246(Object obj, Object obj2) {
        int i = this.f16855;
        C3637 c3637 = C3637.f13536;
        switch (i) {
            case 0:
                return ((C4527) mo1245((InterfaceC4943) obj2, (C2180) obj)).mo1109(c3637);
            case 1:
                return ((C4527) mo1245((InterfaceC4943) obj2, (InterfaceC4793) obj)).mo1109(c3637);
            default:
                return ((C4527) mo1245((InterfaceC4943) obj2, (InterfaceC4793) obj)).mo1109(c3637);
        }
    }

    @Override // defpackage.AbstractC1297
    /* renamed from: ᵸʓᵠ */
    public final Object mo1109(Object obj) {
        InterfaceC4793 interfaceC4793;
        Object objMo6416;
        Object objMo6417;
        InterfaceC4793 interfaceC47932;
        Object objMo64162;
        EnumC1184[] enumC1184Arr;
        EnumC1184 enumC1184;
        int i = this.f16855;
        EnumC1015 enumC1015 = EnumC1015.f4457;
        boolean z = false;
        EnumC3346 enumC3346 = EnumC3346.f12524;
        boolean z2 = true;
        C0744 c0744 = this.f16853;
        InterfaceC4943 interfaceC4943 = null;
        switch (i) {
            case 0:
                int i2 = this.f16854;
                if (i2 != 0) {
                    if (i2 == 1) {
                        ʼٴ.ᵺᵠ(obj);
                        return obj;
                    }
                    ᵹˉᵞ.ᵳٴᵶ("call to 'resume' before 'invoke' with coroutine");
                    return null;
                }
                ʼٴ.ᵺᵠ(obj);
                C2180 c2180 = (C2180) this.f16852;
                this.f16854 = 1;
                Object objM2806 = C0744.m2806(c0744, c2180, this);
                return objM2806 == enumC3346 ? enumC3346 : objM2806;
            case 1:
                int i3 = this.f16854;
                try {
                    if (i3 == 0) {
                        ʼٴ.ᵺᵠ(obj);
                        interfaceC4793 = (InterfaceC4793) this.f16852;
                        this.f16852 = interfaceC4793;
                        this.f16854 = 1;
                        objMo6416 = interfaceC4793.mo6416(this);
                        if (objMo6416 == enumC3346) {
                            return enumC3346;
                        }
                    } else {
                        if (i3 != 1) {
                            if (i3 != 2) {
                                ᵹˉᵞ.ᵳٴᵶ("call to 'resume' before 'invoke' with coroutine");
                                return null;
                            }
                            ʼٴ.ᵺᵠ(obj);
                            objMo6417 = obj;
                            return (Set) objMo6417;
                        }
                        interfaceC4793 = (InterfaceC4793) this.f16852;
                        ʼٴ.ᵺᵠ(obj);
                        objMo6416 = obj;
                    }
                    if (!((Boolean) objMo6416).booleanValue()) {
                        C4527 c4527 = new C4527(c0744, interfaceC4943, 0);
                        this.f16852 = null;
                        this.f16854 = 2;
                        objMo6417 = interfaceC4793.mo6417(enumC1015, c4527, this);
                        if (objMo6417 == enumC3346) {
                            return enumC3346;
                        }
                        return (Set) objMo6417;
                    }
                } catch (SQLException unused) {
                }
                return C2388.f9327;
            default:
                int i4 = this.f16854;
                C3637 c3637 = C3637.f13536;
                if (i4 == 0) {
                    ʼٴ.ᵺᵠ(obj);
                    interfaceC47932 = (InterfaceC4793) this.f16852;
                    this.f16852 = interfaceC47932;
                    this.f16854 = 1;
                    objMo64162 = interfaceC47932.mo6416(this);
                    if (objMo64162 == enumC3346) {
                        return enumC3346;
                    }
                } else {
                    if (i4 != 1) {
                        if (i4 == 2) {
                            ʼٴ.ᵺᵠ(obj);
                            return c3637;
                        }
                        ᵹˉᵞ.ᵳٴᵶ("call to 'resume' before 'invoke' with coroutine");
                        return null;
                    }
                    interfaceC47932 = (InterfaceC4793) this.f16852;
                    ʼٴ.ᵺᵠ(obj);
                    objMo64162 = obj;
                }
                if (!((Boolean) objMo64162).booleanValue()) {
                    C4699 c4699 = (C4699) c0744.f3579;
                    long[] jArr = (long[]) c4699.f17375;
                    ReentrantLock reentrantLock = (ReentrantLock) c4699.f17372;
                    reentrantLock.lock();
                    try {
                        if (c4699.f17373) {
                            c4699.f17373 = false;
                            int length = jArr.length;
                            enumC1184Arr = new EnumC1184[length];
                            int i5 = 0;
                            boolean z3 = false;
                            while (i5 < length) {
                                if (jArr[i5] > 0) {
                                    z = z2;
                                }
                                boolean[] zArr = (boolean[]) c4699.f17374;
                                if (z != zArr[i5]) {
                                    zArr[i5] = z;
                                    enumC1184 = z ? EnumC1184.f5030 : EnumC1184.f5033;
                                    z3 = true;
                                } else {
                                    enumC1184 = EnumC1184.f5031;
                                }
                                enumC1184Arr[i5] = enumC1184;
                                i5++;
                                z = false;
                                z2 = true;
                            }
                            if (!z3) {
                                enumC1184Arr = null;
                            }
                            reentrantLock.unlock();
                        } else {
                            reentrantLock.unlock();
                            enumC1184Arr = null;
                        }
                        if (enumC1184Arr != null) {
                            C1693 c1693 = new C1693(enumC1184Arr, c0744, interfaceC47932, (InterfaceC4943) null);
                            this.f16852 = null;
                            this.f16854 = 2;
                            if (interfaceC47932.mo6417(enumC1015, c1693, this) == enumC3346) {
                                return enumC3346;
                            }
                        }
                    } catch (Throwable th) {
                        reentrantLock.unlock();
                        throw th;
                    }
                }
                return c3637;
        }
    }
}
