package defpackage;

import java.util.concurrent.locks.ReentrantLock;
import kotlin.KotlinNothingValueException;

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

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final /* synthetic */ Object f8594;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public final /* synthetic */ boolean f8595;

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

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public /* synthetic */ Object f8597;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final /* synthetic */ Object f8598;

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

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

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public Object f8601;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C2161(String str, String str2, boolean z, boolean z2, ˌʿʿᵜ r6, ᵭᵕᵘʽ r7, InterfaceC2643 interfaceC2643) {
        super(2, interfaceC2643);
        this.f8601 = str;
        this.f8597 = str2;
        this.f8595 = z;
        this.f8596 = z2;
        this.f8594 = r6;
        this.f8598 = r7;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C2161(C2557 c2557, int[] iArr, boolean z, boolean z2, String[] strArr, InterfaceC2643 interfaceC2643) {
        super(2, interfaceC2643);
        this.f8601 = c2557;
        this.f8594 = iArr;
        this.f8595 = z;
        this.f8596 = z2;
        this.f8598 = strArr;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C2161(InterfaceC2643 interfaceC2643, InterfaceC0321 interfaceC0321, AbstractC3904 abstractC3904, boolean z, boolean z2) {
        super(2, interfaceC2643);
        this.f8595 = z;
        this.f8596 = z2;
        this.f8594 = abstractC3904;
        this.f8598 = interfaceC0321;
    }

    /* JADX WARN: Code restructure failed: missing block: B:119:0x023d, code lost:
    
        if (r1 == r10) goto L130;
     */
    /* JADX WARN: Finally extract failed */
    /* JADX WARN: Removed duplicated region for block: B:114:0x0221 A[PHI: r2 r5
      0x0221: PHI (r2v5 ᵫᵦᵽ) = (r2v2 ᵫᵦᵽ), (r2v4 ᵫᵦᵽ), (r2v6 ᵫᵦᵽ) binds: [B:97:0x01ee, B:102:0x0204, B:113:0x0220] A[DONT_GENERATE, DONT_INLINE]
      0x0221: PHI (r5v5 ᵨˀᵝ) = (r5v2 ᵨˀᵝ), (r5v4 ᵨˀᵝ), (r5v6 ᵨˀᵝ) binds: [B:97:0x01ee, B:102:0x0204, B:113:0x0220] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:117:0x0233 A[PHI: r0 r5
      0x0233: PHI (r0v6 java.lang.Object) = (r0v4 java.lang.Object), (r0v10 java.lang.Object) binds: [B:115:0x0230, B:89:0x01b6] A[DONT_GENERATE, DONT_INLINE]
      0x0233: PHI (r5v7 ᵨˀᵝ) = (r5v5 ᵨˀᵝ), (r5v10 ᵨˀᵝ) binds: [B:115:0x0230, B:89:0x01b6] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:118:0x0235  */
    /* JADX WARN: Removed duplicated region for block: B:151:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:53:0x00fc A[Catch: all -> 0x010e, TryCatch #3 {all -> 0x010e, blocks: (B:51:0x00f8, B:53:0x00fc, B:55:0x010a, B:58:0x0110, B:60:0x0115, B:62:0x0119), top: B:138:0x00f8 }] */
    @Override // defpackage.AbstractC1090
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object mo1078(Object obj) throws Throwable {
        InterfaceC3725 interfaceC3725;
        EnumC3995 enumC3995;
        Object objMo8387;
        InterfaceC3725 interfaceC37252;
        Object objMo8388;
        Object objMo83872;
        Object obj2;
        InterfaceC4965 interfaceC4965;
        ReentrantLock reentrantLock;
        long j;
        boolean z;
        InterfaceC4965 interfaceC49652;
        Object obj3;
        InterfaceC4965 interfaceC49653;
        C5220 c5220;
        boolean z2;
        switch (this.f8599) {
            case 0:
                InterfaceC0321 interfaceC0321 = (InterfaceC0321) this.f8598;
                AbstractC3904 abstractC3904 = (AbstractC3904) this.f8594;
                boolean z3 = this.f8596;
                EnumC0111 enumC0111 = EnumC0111.f1384;
                int i = this.f8600;
                if (i == 0) {
                    ᵟˌᵫ.ˊˌˊ(obj);
                    interfaceC3725 = (InterfaceC3725) this.f8597;
                    if (this.f8595) {
                        enumC3995 = z3 ? EnumC3995.f15296 : EnumC3995.f15298;
                        if (z3) {
                            C1934 c1934 = new C1934(null, interfaceC0321);
                            this.f8597 = interfaceC3725;
                            this.f8601 = null;
                            this.f8600 = 3;
                            objMo8388 = interfaceC3725.mo8388(enumC3995, c1934, this);
                            if (objMo8388 != enumC0111) {
                            }
                        } else {
                            this.f8597 = interfaceC3725;
                            this.f8601 = enumC3995;
                            this.f8600 = 1;
                            objMo8387 = interfaceC3725.mo8387(this);
                            if (objMo8387 != enumC0111) {
                            }
                        }
                    } else {
                        C1934 c19342 = new C1934(interfaceC0321, null, 0);
                        this.f8600 = 5;
                        Object objMo6979 = ((InterfaceC2914) interfaceC3725).mo6979(c19342, this);
                        if (objMo6979 != enumC0111) {
                            return objMo6979;
                        }
                    }
                    return enumC0111;
                }
                if (i != 1) {
                    if (i == 2) {
                        enumC3995 = (EnumC3995) this.f8601;
                        interfaceC37252 = (InterfaceC3725) this.f8597;
                        ᵟˌᵫ.ˊˌˊ(obj);
                        interfaceC3725 = interfaceC37252;
                        C1934 c19343 = new C1934(null, interfaceC0321);
                        this.f8597 = interfaceC3725;
                        this.f8601 = null;
                        this.f8600 = 3;
                        objMo8388 = interfaceC3725.mo8388(enumC3995, c19343, this);
                        if (objMo8388 != enumC0111) {
                            if (!z3) {
                            }
                        }
                        return enumC0111;
                    }
                    if (i != 3) {
                        if (i != 4) {
                            if (i == 5) {
                                ᵟˌᵫ.ˊˌˊ(obj);
                                return obj;
                            }
                            ᵕᵩʽᵲ.ᵪᵹᵥᵻ("call to 'resume' before 'invoke' with coroutine");
                            return null;
                        }
                        objMo8388 = this.f8597;
                        ᵟˌᵫ.ˊˌˊ(obj);
                        objMo83872 = obj;
                        if (((Boolean) objMo83872).booleanValue()) {
                            return objMo8388;
                        }
                        C3812 c3812 = abstractC3904.f14917;
                        (c3812 != null ? c3812 : null).m8509();
                        return objMo8388;
                    }
                    InterfaceC3725 interfaceC37253 = (InterfaceC3725) this.f8597;
                    ᵟˌᵫ.ˊˌˊ(obj);
                    interfaceC3725 = interfaceC37253;
                    objMo8388 = obj;
                    if (!z3) {
                        return objMo8388;
                    }
                    this.f8597 = objMo8388;
                    this.f8600 = 4;
                    objMo83872 = interfaceC3725.mo8387(this);
                } else {
                    enumC3995 = (EnumC3995) this.f8601;
                    interfaceC3725 = (InterfaceC3725) this.f8597;
                    ᵟˌᵫ.ˊˌˊ(obj);
                    objMo8387 = obj;
                }
                break;
                if (!((Boolean) objMo8387).booleanValue()) {
                    C3812 c38122 = abstractC3904.f14917;
                    if (c38122 == null) {
                        c38122 = null;
                    }
                    this.f8597 = interfaceC3725;
                    this.f8601 = enumC3995;
                    this.f8600 = 2;
                    Object objM6286 = c38122.f14455.m6286(this);
                    if (objM6286 != enumC0111) {
                        objM6286 = C5063.f19112;
                    }
                    if (objM6286 != enumC0111) {
                        interfaceC37252 = interfaceC3725;
                        interfaceC3725 = interfaceC37252;
                        C1934 c193432 = new C1934(null, interfaceC0321);
                        this.f8597 = interfaceC3725;
                        this.f8601 = null;
                        this.f8600 = 3;
                        objMo8388 = interfaceC3725.mo8388(enumC3995, c193432, this);
                        if (objMo8388 != enumC0111) {
                        }
                    }
                }
                return enumC0111;
            case 1:
                EnumC0111 enumC01112 = EnumC0111.f1384;
                int i2 = this.f8600;
                if (i2 == 0) {
                    ᵟˌᵫ.ˊˌˊ(obj);
                    ᵣᵨˏᵢ r2 = ᵣᵨˏᵢ.ᵲᵶᵳˈ;
                    String str = (String) this.f8601;
                    String str2 = (String) this.f8597;
                    boolean z4 = this.f8595;
                    boolean z5 = this.f8596;
                    ˌʿʿᵜ r12 = (ˌʿʿᵜ) this.f8594;
                    this.f8600 = 1;
                    ʿʾᵾ r22 = ʿʾᵾ.ᵲᵶᵳˈ;
                    C4681 c4681 = AbstractC0307.f1986;
                    obj2 = ᵲᵧˇ.ᵠˏˏ(ᵝˉː.ˈᵲᵢ(ExecutorC1834.f7291, C3752.f14260), new ᵾᵤ(str, str2, z4, z5, r12, (InterfaceC2643) null), this);
                    if (obj2 == enumC01112) {
                        return enumC01112;
                    }
                } else {
                    if (i2 != 1) {
                        ᵕᵩʽᵲ.ᵪᵹᵥᵻ("call to 'resume' before 'invoke' with coroutine");
                        return null;
                    }
                    ᵟˌᵫ.ˊˌˊ(obj);
                    obj2 = obj;
                }
                ((ᵭᵕᵘʽ) this.f8598).ʽˈˋ.ᵶᵥᵝ(new ᵢᵖᵙ(((Boolean) obj2).booleanValue()));
                return C5063.f19112;
            default:
                EnumC0111 enumC01113 = EnumC0111.f1384;
                int i3 = this.f8600;
                if (i3 == 0) {
                    ᵟˌᵫ.ˊˌˊ(obj);
                    interfaceC4965 = (InterfaceC4965) this.f8597;
                    C5220 c52202 = ((C2557) this.f8601).f9886;
                    int[] iArr = (int[]) this.f8594;
                    reentrantLock = c52202.f19659;
                    reentrantLock.lock();
                    try {
                        boolean z6 = false;
                        for (int i4 : iArr) {
                            long[] jArr = c52202.f19656;
                            long j2 = jArr[i4];
                            jArr[i4] = j2 + 1;
                            if (j2 == 0) {
                                c52202.f19660 = true;
                                z6 = true;
                            }
                        }
                        j = 1;
                        if (!z6 && !c52202.f19660) {
                            if (!c52202.f19661) {
                                z = false;
                            }
                            reentrantLock.unlock();
                            if (!this.f8595 && z) {
                                AbstractC3904 abstractC39042 = ((C2557) this.f8601).f9885;
                                this.f8597 = interfaceC4965;
                                this.f8600 = 1;
                                obj3 = ᵗʓ.ᵟᵹᵙ(abstractC39042, this);
                                if (obj3 != enumC01113) {
                                }
                                return enumC01113;
                            }
                            interfaceC49652 = interfaceC4965;
                            C2761 c2761 = new C2761();
                            C0607 c0607 = ((C2557) this.f8601).f9881;
                            C0498 c0498 = new C0498(c2761, this.f8596, interfaceC49652, (String[]) this.f8598, (int[]) this.f8594);
                            this.f8597 = null;
                            this.f8600 = 3;
                            c0607.m2238(c0498, this);
                            return enumC01113;
                        }
                        z = true;
                        reentrantLock.unlock();
                        if (!this.f8595) {
                        }
                        interfaceC49652 = interfaceC4965;
                        C2761 c27612 = new C2761();
                        C0607 c06072 = ((C2557) this.f8601).f9881;
                        C0498 c04982 = new C0498(c27612, this.f8596, interfaceC49652, (String[]) this.f8598, (int[]) this.f8594);
                        this.f8597 = null;
                        this.f8600 = 3;
                        c06072.m2238(c04982, this);
                        return enumC01113;
                    } catch (Throwable th) {
                        throw th;
                    }
                }
                if (i3 != 1) {
                    if (i3 != 2) {
                        if (i3 != 3) {
                            ᵕᵩʽᵲ.ᵪᵹᵥᵻ("call to 'resume' before 'invoke' with coroutine");
                            return null;
                        }
                        try {
                            ᵟˌᵫ.ˊˌˊ(obj);
                            throw new KotlinNothingValueException();
                        } catch (Throwable th2) {
                            th = th2;
                            j = 1;
                            c5220 = ((C2557) this.f8601).f9886;
                            int[] iArr2 = (int[]) this.f8594;
                            reentrantLock = c5220.f19659;
                            reentrantLock.lock();
                            try {
                                z2 = false;
                                while (i < r5) {
                                }
                                if (!z2) {
                                    boolean z7 = c5220.f19661;
                                    break;
                                }
                                reentrantLock.unlock();
                                throw th;
                            } finally {
                                reentrantLock.unlock();
                            }
                        }
                    }
                    interfaceC49653 = (InterfaceC4965) this.f8597;
                    ᵟˌᵫ.ˊˌˊ(obj);
                    j = 1;
                    interfaceC49652 = interfaceC49653;
                    try {
                        C2761 c276122 = new C2761();
                        C0607 c060722 = ((C2557) this.f8601).f9881;
                        C0498 c049822 = new C0498(c276122, this.f8596, interfaceC49652, (String[]) this.f8598, (int[]) this.f8594);
                        this.f8597 = null;
                        this.f8600 = 3;
                        c060722.m2238(c049822, this);
                        return enumC01113;
                    } catch (Throwable th3) {
                        th = th3;
                        c5220 = ((C2557) this.f8601).f9886;
                        int[] iArr22 = (int[]) this.f8594;
                        reentrantLock = c5220.f19659;
                        reentrantLock.lock();
                        z2 = false;
                        for (int i5 : iArr22) {
                            long[] jArr2 = c5220.f19656;
                            long j3 = jArr2[i5];
                            jArr2[i5] = j3 - j;
                            if (j3 == j) {
                                c5220.f19660 = true;
                                z2 = true;
                            }
                        }
                        if (!z2 && !c5220.f19660) {
                            boolean z72 = c5220.f19661;
                            break;
                        }
                        reentrantLock.unlock();
                        throw th;
                    }
                }
                interfaceC4965 = (InterfaceC4965) this.f8597;
                ᵟˌᵫ.ˊˌˊ(obj);
                obj3 = obj;
                j = 1;
                ᵮʧᵤ r9 = new ᵮʧᵤ((C2557) this.f8601, (InterfaceC2643) null, 9);
                this.f8597 = interfaceC4965;
                this.f8600 = 2;
                if (ᵲᵧˇ.ᵠˏˏ((InterfaceC3822) obj3, r9, this) != enumC01113) {
                    interfaceC49653 = interfaceC4965;
                    interfaceC49652 = interfaceC49653;
                    C2761 c2761222 = new C2761();
                    C0607 c0607222 = ((C2557) this.f8601).f9881;
                    C0498 c0498222 = new C0498(c2761222, this.f8596, interfaceC49652, (String[]) this.f8598, (int[]) this.f8594);
                    this.f8597 = null;
                    this.f8600 = 3;
                    c0607222.m2238(c0498222, this);
                    break;
                }
                return enumC01113;
        }
    }

    @Override // defpackage.InterfaceC0321
    /* JADX INFO: renamed from: ᵝᵶ */
    public final Object mo1564(Object obj, Object obj2) throws Throwable {
        int i = this.f8599;
        C5063 c5063 = C5063.f19112;
        switch (i) {
            case 0:
                return ((C2161) mo1565((InterfaceC2643) obj2, (InterfaceC3725) obj)).mo1078(c5063);
            case 1:
                return ((C2161) mo1565((InterfaceC2643) obj2, (InterfaceC4057) obj)).mo1078(c5063);
            default:
                ((C2161) mo1565((InterfaceC2643) obj2, (InterfaceC4965) obj)).mo1078(c5063);
                return EnumC0111.f1384;
        }
    }

    @Override // defpackage.AbstractC1090
    /* JADX INFO: renamed from: ᵟᵹᵙ */
    public final InterfaceC2643 mo1565(InterfaceC2643 interfaceC2643, Object obj) {
        int i = this.f8599;
        Object obj2 = this.f8598;
        Object obj3 = this.f8594;
        switch (i) {
            case 0:
                C2161 c2161 = new C2161(interfaceC2643, (InterfaceC0321) obj2, (AbstractC3904) obj3, this.f8595, this.f8596);
                c2161.f8597 = obj;
                return c2161;
            case 1:
                return new C2161((String) this.f8601, (String) this.f8597, this.f8595, this.f8596, (ˌʿʿᵜ) obj3, (ᵭᵕᵘʽ) obj2, interfaceC2643);
            default:
                C2161 c21612 = new C2161((C2557) this.f8601, (int[]) obj3, this.f8595, this.f8596, (String[]) obj2, interfaceC2643);
                c21612.f8597 = obj;
                return c21612;
        }
    }
}
