package defpackage;

import java.util.concurrent.CancellationException;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import java.util.concurrent.atomic.AtomicReferenceArray;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import kotlinx.coroutines.DispatchException;
import kotlinx.coroutines.channels.ClosedReceiveChannelException;
import kotlinx.coroutines.channels.ClosedSendChannelException;
import sun.misc.Unsafe;

/* renamed from: ᵫʖˏ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public class C3920 implements InterfaceC2817 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public static final /* synthetic */ AtomicReferenceFieldUpdater f14790;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public static final /* synthetic */ AtomicReferenceFieldUpdater f14791;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public static final /* synthetic */ AtomicReferenceFieldUpdater f14792;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public static final /* synthetic */ long f14793;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public static final /* synthetic */ AtomicReferenceFieldUpdater f14794;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public static final /* synthetic */ long f14798;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public static final /* synthetic */ long f14799;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public static final /* synthetic */ long f14800;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public static final /* synthetic */ long f14801;
    private volatile /* synthetic */ Object _closeCause$volatile;
    private volatile /* synthetic */ long bufferEnd$volatile;
    private volatile /* synthetic */ Object bufferEndSegment$volatile;
    private volatile /* synthetic */ Object closeHandler$volatile;
    private volatile /* synthetic */ long completedExpandBuffersAndPauseFlag$volatile;
    private volatile /* synthetic */ Object receiveSegment$volatile;
    private volatile /* synthetic */ long receivers$volatile;
    private volatile /* synthetic */ Object sendSegment$volatile;
    private volatile /* synthetic */ long sendersAndCloseStatus$volatile;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final int f14804;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public static final /* synthetic */ AtomicLongFieldUpdater f14796 = AtomicLongFieldUpdater.newUpdater(C3920.class, "sendersAndCloseStatus$volatile");

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public static final /* synthetic */ AtomicLongFieldUpdater f14803 = AtomicLongFieldUpdater.newUpdater(C3920.class, "receivers$volatile");

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public static final /* synthetic */ AtomicLongFieldUpdater f14802 = AtomicLongFieldUpdater.newUpdater(C3920.class, "bufferEnd$volatile");

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public static final /* synthetic */ AtomicLongFieldUpdater f14797 = AtomicLongFieldUpdater.newUpdater(C3920.class, "completedExpandBuffersAndPauseFlag$volatile");

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public static final /* synthetic */ AtomicReferenceFieldUpdater f14795 = AtomicReferenceFieldUpdater.newUpdater(C3920.class, Object.class, "sendSegment$volatile");

    static {
        Unsafe unsafe = AbstractC3747.f13986;
        f14800 = unsafe.objectFieldOffset(C3920.class.getDeclaredField("sendSegment$volatile"));
        f14790 = AtomicReferenceFieldUpdater.newUpdater(C3920.class, Object.class, "receiveSegment$volatile");
        f14793 = unsafe.objectFieldOffset(C3920.class.getDeclaredField("receiveSegment$volatile"));
        f14794 = AtomicReferenceFieldUpdater.newUpdater(C3920.class, Object.class, "bufferEndSegment$volatile");
        f14798 = unsafe.objectFieldOffset(C3920.class.getDeclaredField("bufferEndSegment$volatile"));
        f14792 = AtomicReferenceFieldUpdater.newUpdater(C3920.class, Object.class, "_closeCause$volatile");
        f14799 = unsafe.objectFieldOffset(C3920.class.getDeclaredField("_closeCause$volatile"));
        f14791 = AtomicReferenceFieldUpdater.newUpdater(C3920.class, Object.class, "closeHandler$volatile");
        f14801 = unsafe.objectFieldOffset(C3920.class.getDeclaredField("closeHandler$volatile"));
    }

    public C3920(int i) {
        this.f14804 = i;
        if (i < 0) {
            ᵹˉᵞ.ᵸˑ(AbstractC3915.m8596(i, "Invalid channel capacity: ", ", should be >=0"));
            throw null;
        }
        C1215 c1215 = AbstractC2710.f10511;
        this.bufferEnd$volatile = i != 0 ? i != Integer.MAX_VALUE ? i : Long.MAX_VALUE : 0L;
        this.completedExpandBuffersAndPauseFlag$volatile = f14802.get(this);
        C1215 c12152 = new C1215(0L, null, this, 3);
        this.sendSegment$volatile = c12152;
        this.receiveSegment$volatile = c12152;
        this.bufferEndSegment$volatile = m8680() ? AbstractC2710.f10511 : c12152;
        this._closeCause$volatile = AbstractC2710.f10509;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public static final void m8665(C3920 c3920, Object obj, C4385 c4385) throws DispatchException {
        c4385.mo2134(new C2952(c3920.m8683()));
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0014  */
    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static java.lang.Object m8666(defpackage.C3920 r13, defpackage.AbstractC1989 r14) throws kotlinx.coroutines.DispatchException {
        /*
            boolean r0 = r14 instanceof defpackage.C0882
            if (r0 == 0) goto L14
            r0 = r14
            ˆᵰ r0 = (defpackage.C0882) r0
            int r1 = r0.f4018
            r2 = -2147483648(0xffffffff80000000, float:-0.0)
            r3 = r1 & r2
            if (r3 == 0) goto L14
            int r1 = r1 - r2
            r0.f4018 = r1
        L12:
            r6 = r0
            goto L1a
        L14:
            ˆᵰ r0 = new ˆᵰ
            r0.<init>(r13, r14)
            goto L12
        L1a:
            java.lang.Object r14 = r6.f4020
            int r0 = r6.f4018
            r1 = 0
            r2 = 1
            if (r0 == 0) goto L32
            if (r0 != r2) goto L2c
            ʼٴ.ᵺᵠ(r14)
            ᵮˉʢ r14 = (defpackage.C4189) r14
            java.lang.Object r13 = r14.f15662
            return r13
        L2c:
            java.lang.String r13 = "call to 'resume' before 'invoke' with coroutine"
            ᵹˉᵞ.ᵳٴᵶ(r13)
            return r1
        L32:
            ʼٴ.ᵺᵠ(r14)
            java.util.concurrent.atomic.AtomicReferenceFieldUpdater r14 = defpackage.C3920.f14790
            r14.getClass()
            sun.misc.Unsafe r14 = defpackage.AbstractC3747.f13986
            long r3 = defpackage.C3920.f14793
            java.lang.Object r14 = r14.getObjectVolatile(r13, r3)
            ˉᵫ r14 = (defpackage.C1215) r14
        L44:
            boolean r0 = r13.m8671()
            if (r0 == 0) goto L54
            java.lang.Throwable r13 = r13.m8684()
            ᵽʾʿ r14 = new ᵽʾʿ
            r14.<init>(r13)
            return r14
        L54:
            java.util.concurrent.atomic.AtomicLongFieldUpdater r0 = defpackage.C3920.f14803
            long r4 = r0.getAndIncrement(r13)
            int r0 = defpackage.AbstractC2710.f10515
            long r7 = (long) r0
            long r9 = r4 / r7
            long r7 = r4 % r7
            int r3 = (int) r7
            long r7 = r14.f11081
            int r0 = (r7 > r9 ? 1 : (r7 == r9 ? 0 : -1))
            if (r0 == 0) goto L71
            ˉᵫ r0 = r13.m8685(r9, r14)
            if (r0 != 0) goto L6f
            goto L44
        L6f:
            r8 = r0
            goto L72
        L71:
            r8 = r14
        L72:
            r12 = 0
            r7 = r13
            r9 = r3
            r10 = r4
            java.lang.Object r13 = r7.m8676(r8, r9, r10, r12)
            ʿᵝ r14 = defpackage.AbstractC2710.f10513
            if (r13 == r14) goto La6
            ʿᵝ r14 = defpackage.AbstractC2710.f10514
            if (r13 != r14) goto L90
            long r13 = r7.m8692()
            int r13 = (r4 > r13 ? 1 : (r4 == r13 ? 0 : -1))
            if (r13 >= 0) goto L8d
            r8.m10146()
        L8d:
            r13 = r7
            r14 = r8
            goto L44
        L90:
            ʿᵝ r14 = defpackage.AbstractC2710.f10512
            if (r13 != r14) goto La2
            r6.f4018 = r2
            r1 = r7
            r2 = r8
            java.lang.Object r13 = r1.m8698(r2, r3, r4, r6)
            ᵣˊᵛ r14 = defpackage.EnumC3346.f12524
            if (r13 != r14) goto La1
            return r14
        La1:
            return r13
        La2:
            r8.m10146()
            return r13
        La6:
            java.lang.String r13 = "unexpected"
            ᵹˉᵞ.ᵳٴᵶ(r13)
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.m8666(ᵫʖˏ, ːᵱ):java.lang.Object");
    }

    /* JADX WARN: Code restructure failed: missing block: B:101:0x0173, code lost:
    
        return r13;
     */
    /* JADX WARN: Removed duplicated region for block: B:131:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:91:0x015e  */
    /* JADX WARN: Removed duplicated region for block: B:93:0x0161 A[RETURN] */
    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static java.lang.Object m8667(defpackage.C3920 r26, java.lang.Object r27, defpackage.InterfaceC4943 r28) throws kotlinx.coroutines.DispatchException {
        /*
            Method dump skipped, instructions count: 377
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.m8667(ᵫʖˏ, java.lang.Object, ᵸʚˑ):java.lang.Object");
    }

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public static Object m8668(C3920 c3920, ˁᵳˆ r14) throws Throwable {
        C1215 c1215;
        Throwable th;
        C1215 c12152;
        AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = f14790;
        atomicReferenceFieldUpdater.getClass();
        if (c3920 == null) {
            C0910.m3050();
            return null;
        }
        C1215 c12153 = (C1215) AbstractC3747.f13986.getObjectVolatile(c3920, f14793);
        while (!c3920.m8671()) {
            AtomicLongFieldUpdater atomicLongFieldUpdater = f14803;
            long andIncrement = atomicLongFieldUpdater.getAndIncrement(c3920);
            long j = AbstractC2710.f10515;
            long j2 = andIncrement / j;
            int i = (int) (andIncrement % j);
            if (c12153.f11081 != j2) {
                C1215 c1215M8685 = c3920.m8685(j2, c12153);
                if (c1215M8685 == null) {
                    continue;
                } else {
                    c1215 = c1215M8685;
                }
            } else {
                c1215 = c12153;
            }
            C3920 c39202 = c3920;
            Object objM8676 = c39202.m8676(c1215, i, andIncrement, null);
            C0434 c0434 = AbstractC2710.f10513;
            if (objM8676 == c0434) {
                ᵹˉᵞ.ᵳٴᵶ("unexpected");
                return null;
            }
            C0434 c04342 = AbstractC2710.f10514;
            if (objM8676 == c04342) {
                if (andIncrement < c39202.m8692()) {
                    c1215.m10146();
                }
                c3920 = c39202;
                c12153 = c1215;
            } else {
                if (objM8676 != AbstractC2710.f10512) {
                    c1215.m10146();
                    return objM8676;
                }
                C4385 c4385 = ˁـᵛ.ᵡʠ(ᵱᵞᵪ.ᵞʡ(r14));
                try {
                    Object objM86762 = c39202.m8676(c1215, i, andIncrement, c4385);
                    if (objM86762 == c0434) {
                        c4385.mo2137(c1215, i);
                    } else {
                        if (objM86762 == c04342) {
                            if (andIncrement < c39202.m8692()) {
                                c1215.m10146();
                            }
                            C1215 c12154 = (C1215) atomicReferenceFieldUpdater.get(c39202);
                            while (true) {
                                if (c39202.m8671()) {
                                    c4385.mo2134(new C2952(c39202.m8693()));
                                    break;
                                }
                                C4385 c43852 = c4385;
                                try {
                                    long andIncrement2 = atomicLongFieldUpdater.getAndIncrement(c39202);
                                    long j3 = AbstractC2710.f10515;
                                    long j4 = andIncrement2 / j3;
                                    int i2 = (int) (andIncrement2 % j3);
                                    if (c12154.f11081 != j4) {
                                        try {
                                            C1215 c1215M86852 = c39202.m8685(j4, c12154);
                                            if (c1215M86852 == null) {
                                                c4385 = c43852;
                                            } else {
                                                c12152 = c1215M86852;
                                            }
                                        } catch (Throwable th2) {
                                            th = th2;
                                            c4385 = c43852;
                                            c4385.m9396();
                                            throw th;
                                        }
                                    } else {
                                        c12152 = c12154;
                                    }
                                    C3920 c39203 = c39202;
                                    objM86762 = c39203.m8676(c12152, i2, andIncrement2, c43852);
                                    c39202 = c39203;
                                    C1215 c12155 = c12152;
                                    c4385 = c43852;
                                    if (objM86762 == AbstractC2710.f10513) {
                                        c4385.mo2137(c12155, i2);
                                        break;
                                    }
                                    if (objM86762 == AbstractC2710.f10514) {
                                        if (andIncrement2 < c39202.m8692()) {
                                            c12155.m10146();
                                        }
                                        c12154 = c12155;
                                    } else {
                                        if (objM86762 == AbstractC2710.f10512) {
                                            throw new IllegalStateException("unexpected");
                                        }
                                        c12155.m10146();
                                    }
                                } catch (Throwable th3) {
                                    th = th3;
                                    c4385 = c43852;
                                    th = th;
                                    c4385.m9396();
                                    throw th;
                                }
                            }
                        } else {
                            c1215.m10146();
                        }
                        c4385.mo2138(objM86762, null);
                    }
                    return c4385.m9405();
                } catch (Throwable th4) {
                    th = th4;
                }
            }
        }
        Throwable thM8693 = c3920.m8693();
        int i3 = AbstractC3909.f14653;
        throw thM8693;
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public static final int m8669(C3920 c3920, C1215 c1215, int i, Object obj, long j, Object obj2, boolean z) {
        c1215.m3752(i, obj);
        if (z) {
            return c3920.m8672(c1215, i, obj, j, obj2, z);
        }
        Object objM3753 = c1215.m3753(i);
        if (objM3753 == null) {
            if (c3920.m8675(j)) {
                if (c1215.m3751(null, i, AbstractC2710.f10520)) {
                    return 1;
                }
            } else {
                if (obj2 == null) {
                    return 3;
                }
                if (c1215.m3751(null, i, obj2)) {
                    return 2;
                }
            }
        } else if (objM3753 instanceof InterfaceC5233) {
            c1215.m3752(i, null);
            if (c3920.m8687(objM3753, obj)) {
                c1215.m3754(i, AbstractC2710.f10508);
                return 0;
            }
            C0434 c0434 = AbstractC2710.f10518;
            if (c1215.f5143.getAndSet((i * 2) + 1, c0434) == c0434) {
                return 5;
            }
            c1215.m3755(i, true);
            return 5;
        }
        return c3920.m8672(c1215, i, obj, j, obj2, z);
    }

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public static void m8670(C3920 c3920) {
        AtomicLongFieldUpdater atomicLongFieldUpdater = f14797;
        if ((atomicLongFieldUpdater.addAndGet(c3920, 1L) & 4611686018427387904L) != 0) {
            while ((atomicLongFieldUpdater.get(c3920) & 4611686018427387904L) != 0) {
            }
        }
    }

    @Override // defpackage.InterfaceC2817
    public final C2200 iterator() {
        return new C2200(this);
    }

    /* JADX WARN: Code restructure failed: missing block: B:87:0x01c9, code lost:
    
        r15 = r8;
        r3 = (defpackage.C1215) r3.m10149();
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x01d1, code lost:
    
        if (r3 != null) goto L94;
     */
    /* JADX WARN: Multi-variable type inference failed */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.String toString() {
        /*
            Method dump skipped, instructions count: 500
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.toString():java.lang.String");
    }

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final boolean m8671() {
        return m8688(true, f14796.get(this));
    }

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public final int m8672(C1215 c1215, int i, Object obj, long j, Object obj2, boolean z) {
        while (true) {
            Object objM3753 = c1215.m3753(i);
            if (objM3753 == null) {
                if (!m8675(j) || z) {
                    if (z) {
                        if (c1215.m3751(null, i, AbstractC2710.f10516)) {
                            c1215.m6989();
                            return 4;
                        }
                    } else {
                        if (obj2 == null) {
                            return 3;
                        }
                        if (c1215.m3751(null, i, obj2)) {
                            return 2;
                        }
                    }
                } else if (c1215.m3751(null, i, AbstractC2710.f10520)) {
                    break;
                }
            } else {
                if (objM3753 != AbstractC2710.f10502) {
                    C0434 c0434 = AbstractC2710.f10518;
                    if (objM3753 == c0434) {
                        c1215.m3752(i, null);
                        return 5;
                    }
                    if (objM3753 == AbstractC2710.f10519) {
                        c1215.m3752(i, null);
                        return 5;
                    }
                    if (objM3753 == AbstractC2710.f10504) {
                        c1215.m3752(i, null);
                        m8686();
                        return 4;
                    }
                    c1215.m3752(i, null);
                    if (objM3753 instanceof C5122) {
                        objM3753 = ((C5122) objM3753).f19084;
                    }
                    if (m8687(objM3753, obj)) {
                        c1215.m3754(i, AbstractC2710.f10508);
                        return 0;
                    }
                    if (c1215.f5143.getAndSet((i * 2) + 1, c0434) != c0434) {
                        c1215.m3755(i, true);
                    }
                    return 5;
                }
                if (c1215.m3751(objM3753, i, AbstractC2710.f10520)) {
                    break;
                }
            }
        }
        return 1;
    }

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final void m8673(C3707 c3707) {
        C1215 c1215;
        C3920 c3920;
        C3707 c37072;
        int i;
        f14790.getClass();
        C1215 c12152 = (C1215) AbstractC3747.f13986.getObjectVolatile(this, f14793);
        while (!this.m8671()) {
            long andIncrement = f14803.getAndIncrement(this);
            long j = AbstractC2710.f10515;
            long j2 = andIncrement / j;
            int i2 = (int) (andIncrement % j);
            if (c12152.f11081 != j2) {
                C1215 c1215M8685 = this.m8685(j2, c12152);
                if (c1215M8685 == null) {
                    continue;
                } else {
                    c1215 = c1215M8685;
                    c37072 = c3707;
                    i = i2;
                    c3920 = this;
                }
            } else {
                c1215 = c12152;
                c3920 = this;
                c37072 = c3707;
                i = i2;
            }
            Object objM8676 = c3920.m8676(c1215, i, andIncrement, c37072);
            c12152 = c1215;
            if (objM8676 == AbstractC2710.f10513) {
                C3707 c37073 = c37072 != null ? c37072 : null;
                if (c37073 != null) {
                    c37073.f13851 = c12152;
                    c37073.f13850 = i;
                    return;
                }
                return;
            }
            if (objM8676 != AbstractC2710.f10514) {
                if (objM8676 == AbstractC2710.f10512) {
                    ᵹˉᵞ.ᵳٴᵶ("unexpected");
                    return;
                } else {
                    c12152.m10146();
                    c37072.f13848 = objM8676;
                    return;
                }
            }
            if (andIncrement < c3920.m8692()) {
                c12152.m10146();
            }
            this = c3920;
            c3707 = c37072;
        }
        c3707.f13848 = AbstractC2710.f10504;
    }

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public final void m8674(long j) {
        AtomicLongFieldUpdater atomicLongFieldUpdater;
        C3920 c3920 = this;
        if (c3920.m8680()) {
            return;
        }
        while (true) {
            atomicLongFieldUpdater = f14802;
            if (atomicLongFieldUpdater.get(c3920) > j) {
                break;
            } else {
                c3920 = this;
            }
        }
        int i = AbstractC2710.f10507;
        int i2 = 0;
        while (true) {
            AtomicLongFieldUpdater atomicLongFieldUpdater2 = f14797;
            if (i2 < i) {
                long j2 = atomicLongFieldUpdater.get(c3920);
                if (j2 == (4611686018427387903L & atomicLongFieldUpdater2.get(c3920)) && j2 == atomicLongFieldUpdater.get(c3920)) {
                    return;
                } else {
                    i2++;
                }
            } else {
                while (true) {
                    long j3 = atomicLongFieldUpdater2.get(c3920);
                    if (atomicLongFieldUpdater2.compareAndSet(c3920, j3, (j3 & 4611686018427387903L) + 4611686018427387904L)) {
                        break;
                    } else {
                        c3920 = this;
                    }
                }
                while (true) {
                    long j4 = atomicLongFieldUpdater.get(c3920);
                    long j5 = atomicLongFieldUpdater2.get(c3920);
                    long j6 = j5 & 4611686018427387903L;
                    boolean z = (j5 & 4611686018427387904L) != 0;
                    if (j4 == j6 && j4 == atomicLongFieldUpdater.get(c3920)) {
                        break;
                    }
                    if (z) {
                        c3920 = this;
                    } else {
                        c3920 = this;
                        atomicLongFieldUpdater2.compareAndSet(c3920, j5, 4611686018427387904L + j6);
                    }
                }
                while (true) {
                    long j7 = atomicLongFieldUpdater2.get(c3920);
                    if (atomicLongFieldUpdater2.compareAndSet(c3920, j7, j7 & 4611686018427387903L)) {
                        return;
                    } else {
                        c3920 = this;
                    }
                }
            }
        }
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final boolean m8675(long j) {
        return j < f14802.get(this) || j < f14803.get(this) + ((long) this.f14804);
    }

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public final Object m8676(C1215 c1215, int i, long j, Object obj) {
        Object objM3753 = c1215.m3753(i);
        AtomicReferenceArray atomicReferenceArray = c1215.f5143;
        AtomicLongFieldUpdater atomicLongFieldUpdater = f14796;
        if (objM3753 == null) {
            if (j >= (atomicLongFieldUpdater.get(this) & 1152921504606846975L)) {
                if (obj == null) {
                    return AbstractC2710.f10512;
                }
                if (c1215.m3751(objM3753, i, obj)) {
                    m8697();
                    return AbstractC2710.f10513;
                }
            }
        } else if (objM3753 == AbstractC2710.f10520 && c1215.m3751(objM3753, i, AbstractC2710.f10508)) {
            m8697();
            Object obj2 = atomicReferenceArray.get(i * 2);
            c1215.m3752(i, null);
            return obj2;
        }
        while (true) {
            Object objM37532 = c1215.m3753(i);
            if (objM37532 == null || objM37532 == AbstractC2710.f10502) {
                if (j < (atomicLongFieldUpdater.get(this) & 1152921504606846975L)) {
                    if (c1215.m3751(objM37532, i, AbstractC2710.f10519)) {
                        m8697();
                        return AbstractC2710.f10514;
                    }
                } else {
                    if (obj == null) {
                        return AbstractC2710.f10512;
                    }
                    if (c1215.m3751(objM37532, i, obj)) {
                        m8697();
                        return AbstractC2710.f10513;
                    }
                }
            } else {
                if (objM37532 != AbstractC2710.f10520) {
                    C0434 c0434 = AbstractC2710.f10516;
                    if (objM37532 != c0434 && objM37532 != AbstractC2710.f10519) {
                        if (objM37532 == AbstractC2710.f10504) {
                            m8697();
                            return AbstractC2710.f10514;
                        }
                        if (objM37532 != AbstractC2710.f10505 && c1215.m3751(objM37532, i, AbstractC2710.f10506)) {
                            boolean z = objM37532 instanceof C5122;
                            if (z) {
                                objM37532 = ((C5122) objM37532).f19084;
                            }
                            if (m8681(objM37532, c1215, i)) {
                                c1215.m3754(i, AbstractC2710.f10508);
                                m8697();
                                Object obj3 = atomicReferenceArray.get(i * 2);
                                c1215.m3752(i, null);
                                return obj3;
                            }
                            c1215.m3754(i, c0434);
                            c1215.m6989();
                            if (z) {
                                m8697();
                            }
                            return AbstractC2710.f10514;
                        }
                    }
                    return AbstractC2710.f10514;
                }
                if (c1215.m3751(objM37532, i, AbstractC2710.f10508)) {
                    m8697();
                    Object obj4 = atomicReferenceArray.get(i * 2);
                    c1215.m3752(i, null);
                    return obj4;
                }
            }
        }
    }

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final C1215 m8677(long j, C1215 c1215, long j2) {
        Object objM8185;
        Unsafe unsafe;
        C1215 c12152 = AbstractC2710.f10511;
        C1565 c1565 = C1565.f6224;
        loop0: while (true) {
            objM8185 = AbstractC3575.m8185(c1215, j, c1565);
            if (!ᵿᵧ.ᵤᵙᵷ(objM8185)) {
                AbstractC2858 abstractC2858 = ᵿᵧ.ˑᵱ(objM8185);
                while (true) {
                    f14794.getClass();
                    Unsafe unsafe2 = AbstractC3747.f13986;
                    long j3 = f14798;
                    AbstractC2858 abstractC28582 = (AbstractC2858) unsafe2.getObjectVolatile(this, j3);
                    if (abstractC28582.f11081 >= abstractC2858.f11081) {
                        break loop0;
                    }
                    if (!abstractC2858.m6990()) {
                        break;
                    }
                    do {
                        unsafe = AbstractC3747.f13986;
                        if (unsafe.compareAndSwapObject(this, f14798, abstractC28582, abstractC2858)) {
                            if (abstractC28582.m6991()) {
                                abstractC28582.m10145();
                            }
                        }
                    } while (unsafe.getObjectVolatile(this, j3) == abstractC28582);
                    if (abstractC2858.m6991()) {
                        abstractC2858.m10145();
                    }
                }
            } else {
                break;
            }
        }
        if (ᵿᵧ.ᵤᵙᵷ(objM8185)) {
            m8686();
            m8695(j, c1215);
            m8670(this);
            return null;
        }
        C1215 c12153 = (C1215) ᵿᵧ.ˑᵱ(objM8185);
        long j4 = c12153.f11081;
        if (j4 <= j) {
            return c12153;
        }
        long j5 = AbstractC2710.f10515;
        if (!f14802.compareAndSet(this, j2 + 1, j4 * j5)) {
            m8670(this);
            return null;
        }
        AtomicLongFieldUpdater atomicLongFieldUpdater = f14797;
        if ((atomicLongFieldUpdater.addAndGet(this, (j4 * j5) - j2) & 4611686018427387904L) != 0) {
            while ((atomicLongFieldUpdater.get(this) & 4611686018427387904L) != 0) {
            }
        }
        return null;
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final boolean m8678(Throwable th, boolean z) {
        C3920 c3920;
        boolean z2;
        long j;
        long j2;
        long j3;
        AtomicLongFieldUpdater atomicLongFieldUpdater = f14796;
        if (z) {
            while (true) {
                long j4 = atomicLongFieldUpdater.get(this);
                if (((int) (j4 >> 60)) != 0) {
                    break;
                }
                C1215 c1215 = AbstractC2710.f10511;
                c3920 = this;
                if (atomicLongFieldUpdater.compareAndSet(c3920, j4, (j4 & 1152921504606846975L) + 1152921504606846976L)) {
                    break;
                }
                this = c3920;
            }
        } else {
            c3920 = this;
        }
        C0434 c0434 = AbstractC2710.f10509;
        while (true) {
            f14792.getClass();
            C3920 c39202 = c3920;
            Unsafe unsafe = AbstractC3747.f13986;
            long j5 = f14799;
            Throwable th2 = th;
            boolean zCompareAndSwapObject = unsafe.compareAndSwapObject(c39202, j5, c0434, th2);
            c3920 = c39202;
            if (zCompareAndSwapObject) {
                z2 = true;
                break;
            }
            if (unsafe.getObjectVolatile(c3920, j5) != c0434) {
                z2 = false;
                break;
            }
            th = th2;
        }
        if (z) {
            do {
                j3 = atomicLongFieldUpdater.get(c3920);
            } while (!atomicLongFieldUpdater.compareAndSet(c3920, j3, 3458764513820540928L + (j3 & 1152921504606846975L)));
        } else {
            do {
                j = atomicLongFieldUpdater.get(c3920);
                int i = (int) (j >> 60);
                if (i == 0) {
                    j2 = (j & 1152921504606846975L) + 2305843009213693952L;
                } else {
                    if (i != 1) {
                        break;
                    }
                    j2 = (j & 1152921504606846975L) + 3458764513820540928L;
                }
            } while (!atomicLongFieldUpdater.compareAndSet(c3920, j, j2));
        }
        c3920.m8686();
        if (z2) {
            c3920.m8701();
        }
        return z2;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final boolean m8679(Throwable th) {
        return m8678(th, false);
    }

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final boolean m8680() {
        long j = f14802.get(this);
        return j == 0 || j == Long.MAX_VALUE;
    }

    @Override // defpackage.InterfaceC3642
    /* renamed from: ˏˋٴ */
    public Object mo5180(InterfaceC4943 interfaceC4943, Object obj) {
        return m8667(this, obj, interfaceC4943);
    }

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public final boolean m8681(Object obj, C1215 c1215, int i) {
        char c;
        boolean z = obj instanceof InterfaceC0719;
        C3637 c3637 = C3637.f13536;
        if (z) {
            return AbstractC2710.m6715((InterfaceC0719) obj, c3637, null);
        }
        if (!(obj instanceof C3707)) {
            C4069.m8939(obj, "Unexpected waiter: ");
            return false;
        }
        int iM8338 = ((C3707) obj).m8338(this, c3637);
        if (iM8338 == 0) {
            c = 1;
        } else if (iM8338 != 1) {
            c = 3;
            if (iM8338 != 2) {
                if (iM8338 != 3) {
                    ᵨᴵᵺ.ˎˏʜʾ(iM8338, "Unexpected internal result: ");
                    return false;
                }
                c = 4;
            }
        } else {
            c = 2;
        }
        if (c == 2) {
            c1215.m3752(i, null);
        }
        return c == 1;
    }

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public boolean mo8682() {
        return false;
    }

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public final Throwable m8683() {
        Throwable thM8684 = m8684();
        return thM8684 == null ? new ClosedSendChannelException("Channel was closed") : thM8684;
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x006f  */
    /* JADX WARN: Removed duplicated region for block: B:56:0x00c3 A[SYNTHETIC] */
    @Override // defpackage.InterfaceC3642
    /* renamed from: ᵝᵵᵺ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public java.lang.Object mo5181(java.lang.Object r16) throws kotlinx.coroutines.DispatchException {
        /*
            r15 = this;
            java.util.concurrent.atomic.AtomicLongFieldUpdater r8 = defpackage.C3920.f14796
            long r1 = r8.get(r15)
            r9 = 0
            boolean r3 = r15.m8688(r9, r1)
            r10 = 1
            r11 = 1152921504606846975(0xfffffffffffffff, double:1.2882297539194265E-231)
            if (r3 == 0) goto L15
            r1 = r9
            goto L1b
        L15:
            long r1 = r1 & r11
            boolean r1 = r15.m8675(r1)
            r1 = r1 ^ r10
        L1b:
            ᵯᵕˀˌ r13 = defpackage.C4189.f15661
            if (r1 == 0) goto L20
            return r13
        L20:
            ʿᵝ r6 = defpackage.AbstractC2710.f10516
            java.util.concurrent.atomic.AtomicReferenceFieldUpdater r1 = defpackage.C3920.f14795
            r1.getClass()
            sun.misc.Unsafe r1 = defpackage.AbstractC3747.f13986
            long r2 = defpackage.C3920.f14800
            java.lang.Object r1 = r1.getObjectVolatile(r15, r2)
            ˉᵫ r1 = (defpackage.C1215) r1
        L31:
            long r2 = r8.getAndIncrement(r15)
            long r4 = r2 & r11
            boolean r7 = r15.m8688(r9, r2)
            int r14 = defpackage.AbstractC2710.f10515
            long r2 = (long) r14
            long r11 = r4 / r2
            long r2 = r4 % r2
            int r2 = (int) r2
            long r9 = r1.f11081
            int r3 = (r9 > r11 ? 1 : (r9 == r11 ? 0 : -1))
            if (r3 == 0) goto L64
            ˉᵫ r3 = r15.m8699(r11, r1)
            if (r3 != 0) goto L63
            if (r7 == 0) goto L5b
            java.lang.Throwable r0 = r15.m8683()
            ᵽʾʿ r1 = new ᵽʾʿ
            r1.<init>(r0)
            return r1
        L5b:
            r9 = 0
            r10 = 1
        L5d:
            r11 = 1152921504606846975(0xfffffffffffffff, double:1.2882297539194265E-231)
            goto L31
        L63:
            r1 = r3
        L64:
            r0 = r15
            r3 = r16
            int r9 = m8669(r0, r1, r2, r3, r4, r6, r7)
            ᵧˈᵽᵰ r3 = defpackage.C3637.f13536
            if (r9 == 0) goto Lc3
            r10 = 1
            if (r9 == r10) goto Lc2
            r3 = 2
            r11 = 0
            if (r9 == r3) goto La2
            r2 = 3
            if (r9 == r2) goto L9c
            r2 = 4
            if (r9 == r2) goto L85
            r2 = 5
            if (r9 == r2) goto L80
            goto L83
        L80:
            r1.m10146()
        L83:
            r9 = 0
            goto L5d
        L85:
            java.util.concurrent.atomic.AtomicLongFieldUpdater r2 = defpackage.C3920.f14803
            long r2 = r2.get(r15)
            int r2 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1))
            if (r2 >= 0) goto L92
            r1.m10146()
        L92:
            java.lang.Throwable r0 = r15.m8683()
            ᵽʾʿ r1 = new ᵽʾʿ
            r1.<init>(r0)
            return r1
        L9c:
            java.lang.String r0 = "unexpected"
            ᵹˉᵞ.ᵳٴᵶ(r0)
            return r11
        La2:
            if (r7 == 0) goto Lb1
            r1.m6989()
            java.lang.Throwable r0 = r15.m8683()
            ᵽʾʿ r1 = new ᵽʾʿ
            r1.<init>(r0)
            return r1
        Lb1:
            boolean r0 = r6 instanceof defpackage.InterfaceC5233
            if (r0 == 0) goto Lb8
            r11 = r6
            ᵻᵾᵾʿ r11 = (defpackage.InterfaceC5233) r11
        Lb8:
            if (r11 == 0) goto Lbe
            int r2 = r2 + r14
            r11.mo2137(r1, r2)
        Lbe:
            r1.m6989()
            return r13
        Lc2:
            return r3
        Lc3:
            r1.m10146()
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.mo5181(java.lang.Object):java.lang.Object");
    }

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public final Throwable m8684() {
        f14792.getClass();
        return (Throwable) AbstractC3747.f13986.getObjectVolatile(this, f14799);
    }

    /* JADX WARN: Code restructure failed: missing block: B:44:0x00d0, code lost:
    
        if (r8.m6991() == false) goto L76;
     */
    /* JADX WARN: Code restructure failed: missing block: B:45:0x00d2, code lost:
    
        r8.m10145();
     */
    /* JADX WARN: Removed duplicated region for block: B:51:0x00de  */
    /* JADX WARN: Removed duplicated region for block: B:61:0x0107 A[RETURN] */
    /* renamed from: ᵡʠ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final defpackage.C1215 m8685(long r16, defpackage.C1215 r18) {
        /*
            Method dump skipped, instructions count: 264
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.m8685(long, ˉᵫ):ˉᵫ");
    }

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final boolean m8686() {
        return m8688(false, f14796.get(this));
    }

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public final boolean m8687(Object obj, Object obj2) {
        if (obj instanceof C3707) {
            return ((C3707) obj).m8338(this, obj2) == 0;
        }
        if (obj instanceof C2075) {
            return AbstractC2710.m6715(((C2075) obj).f8258, new C4189(obj2), null);
        }
        if (!(obj instanceof C2200)) {
            if (obj instanceof InterfaceC0719) {
                return AbstractC2710.m6715((InterfaceC0719) obj, obj2, null);
            }
            C4069.m8939(obj, "Unexpected receiver type: ");
            return false;
        }
        C2200 c2200 = (C2200) obj;
        C4385 c4385 = c2200.f8636;
        c2200.f8636 = null;
        c2200.f8637 = obj2;
        return AbstractC2710.m6715(c4385, Boolean.TRUE, null);
    }

    /* JADX WARN: Code restructure failed: missing block: B:53:0x00a3, code lost:
    
        r10 = (defpackage.C1215) r10.m10143();
     */
    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m8688(boolean r10, long r11) throws kotlinx.coroutines.DispatchException {
        /*
            Method dump skipped, instructions count: 234
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.m8688(boolean, long):boolean");
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final boolean m8689() {
        while (true) {
            f14790.getClass();
            Unsafe unsafe = AbstractC3747.f13986;
            long j = f14793;
            C1215 c1215M8685 = (C1215) unsafe.getObjectVolatile(this, j);
            AtomicLongFieldUpdater atomicLongFieldUpdater = f14803;
            long j2 = atomicLongFieldUpdater.get(this);
            if (m8692() <= j2) {
                return false;
            }
            long j3 = AbstractC2710.f10515;
            long j4 = j2 / j3;
            if (c1215M8685.f11081 == j4 || (c1215M8685 = m8685(j4, c1215M8685)) != null) {
                c1215M8685.m10146();
                int i = (int) (j2 % j3);
                while (true) {
                    Object objM3753 = c1215M8685.m3753(i);
                    if (objM3753 == null || objM3753 == AbstractC2710.f10502) {
                        if (c1215M8685.m3751(objM3753, i, AbstractC2710.f10519)) {
                            m8697();
                            break;
                        }
                    } else {
                        if (objM3753 == AbstractC2710.f10520) {
                            return true;
                        }
                        if (objM3753 != AbstractC2710.f10516 && objM3753 != AbstractC2710.f10504 && objM3753 != AbstractC2710.f10508 && objM3753 != AbstractC2710.f10519) {
                            if (objM3753 == AbstractC2710.f10505) {
                                return true;
                            }
                            if (objM3753 != AbstractC2710.f10506 && j2 == atomicLongFieldUpdater.get(this)) {
                                return true;
                            }
                        }
                    }
                }
                f14803.compareAndSet(this, j2, j2 + 1);
            } else if (((C1215) unsafe.getObjectVolatile(this, j)).f11081 < j4) {
                return false;
            }
        }
    }

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final void m8690(C2413 c2413) {
        Unsafe unsafe;
        while (true) {
            f14791.getClass();
            Unsafe unsafe2 = AbstractC3747.f13986;
            C3920 c3920 = this;
            if (unsafe2.compareAndSwapObject(c3920, f14801, (Object) null, c2413)) {
                return;
            }
            long j = f14801;
            if (unsafe2.getObjectVolatile(c3920, j) != null) {
                while (true) {
                    Object objectVolatile = AbstractC3747.f13986.getObjectVolatile(c3920, j);
                    C0434 c0434 = AbstractC2710.f10510;
                    if (objectVolatile != c0434) {
                        if (objectVolatile == AbstractC2710.f10517) {
                            ᵹˉᵞ.ᵳٴᵶ("Another handler was already registered and successfully invoked");
                            return;
                        } else {
                            C4069.m8939(objectVolatile, "Another handler is already registered: ");
                            return;
                        }
                    }
                    C0434 c04342 = AbstractC2710.f10517;
                    do {
                        C3920 c39202 = c3920;
                        unsafe = AbstractC3747.f13986;
                        boolean zCompareAndSwapObject = unsafe.compareAndSwapObject(c39202, f14801, c0434, c04342);
                        c3920 = c39202;
                        if (zCompareAndSwapObject) {
                            c2413.mo1588(c3920.m8684());
                            return;
                        }
                    } while (unsafe.getObjectVolatile(c3920, j) == c0434);
                }
            } else {
                this = c3920;
            }
        }
    }

    @Override // defpackage.InterfaceC2817
    /* renamed from: ᵥᵯˎ */
    public final void mo6912(CancellationException cancellationException) {
        if (cancellationException == null) {
            cancellationException = new CancellationException("Channel was cancelled");
        }
        m8678(cancellationException, true);
    }

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final Object m8691(InterfaceC4943 interfaceC4943, Object obj) throws DispatchException {
        C4385 c4385 = new C4385(1, ᵱᵞᵪ.ᵞʡ(interfaceC4943));
        c4385.m9415();
        c4385.mo2134(new C2952(m8683()));
        Object objM9405 = c4385.m9405();
        return objM9405 == EnumC3346.f12524 ? objM9405 : C3637.f13536;
    }

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final long m8692() {
        return f14796.get(this) & 1152921504606846975L;
    }

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public final Throwable m8693() {
        Throwable thM8684 = m8684();
        return thM8684 == null ? new ClosedReceiveChannelException("Channel was closed") : thM8684;
    }

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final void m8694(long j) {
        f14790.getClass();
        C1215 c1215 = (C1215) AbstractC3747.f13986.getObjectVolatile(this, f14793);
        while (true) {
            AtomicLongFieldUpdater atomicLongFieldUpdater = f14803;
            long j2 = atomicLongFieldUpdater.get(this);
            if (j < Math.max(this.f14804 + j2, f14802.get(this))) {
                return;
            }
            C3920 c3920 = this;
            if (atomicLongFieldUpdater.compareAndSet(c3920, j2, 1 + j2)) {
                long j3 = AbstractC2710.f10515;
                long j4 = j2 / j3;
                int i = (int) (j2 % j3);
                if (c1215.f11081 != j4) {
                    C1215 c1215M8685 = c3920.m8685(j4, c1215);
                    if (c1215M8685 != null) {
                        c1215 = c1215M8685;
                    }
                }
                C1215 c12152 = c1215;
                if (c3920.m8676(c12152, i, j2, null) != AbstractC2710.f10514 || j2 < c3920.m8692()) {
                    c12152.m10146();
                }
                this = c3920;
                c1215 = c12152;
            }
            this = c3920;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:30:0x0063, code lost:
    
        if (r5.m6991() == false) goto L43;
     */
    /* JADX WARN: Code restructure failed: missing block: B:31:0x0065, code lost:
    
        r5.m10145();
     */
    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m8695(long r7, defpackage.C1215 r9) {
        /*
            r6 = this;
        L0:
            long r0 = r9.f11081
            int r0 = (r0 > r7 ? 1 : (r0 == r7 ? 0 : -1))
            if (r0 >= 0) goto L11
            ᵶᵡᵛ r0 = r9.m10149()
            ˉᵫ r0 = (defpackage.C1215) r0
            if (r0 != 0) goto Lf
            goto L11
        Lf:
            r9 = r0
            goto L0
        L11:
            r5 = r9
        L12:
            boolean r7 = r5.mo6988()
            if (r7 == 0) goto L23
            ᵶᵡᵛ r7 = r5.m10149()
            ˉᵫ r7 = (defpackage.C1215) r7
            if (r7 != 0) goto L21
            goto L23
        L21:
            r5 = r7
            goto L12
        L23:
            java.util.concurrent.atomic.AtomicReferenceFieldUpdater r7 = defpackage.C3920.f14794
            r7.getClass()
            sun.misc.Unsafe r7 = defpackage.AbstractC3747.f13986
            long r8 = defpackage.C3920.f14798
            java.lang.Object r7 = r7.getObjectVolatile(r6, r8)
            r4 = r7
            ᵜᵱᵝ r4 = (defpackage.AbstractC2858) r4
            long r0 = r4.f11081
            long r2 = r5.f11081
            int r7 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
            if (r7 < 0) goto L3c
            goto L58
        L3c:
            boolean r7 = r5.m6990()
            if (r7 != 0) goto L44
            r9 = r5
            goto L11
        L44:
            sun.misc.Unsafe r0 = defpackage.AbstractC3747.f13986
            long r2 = defpackage.C3920.f14798
            r1 = r6
            boolean r6 = r0.compareAndSwapObject(r1, r2, r4, r5)
            if (r6 == 0) goto L59
            boolean r6 = r4.m6991()
            if (r6 == 0) goto L58
            r4.m10145()
        L58:
            return
        L59:
            java.lang.Object r6 = r0.getObjectVolatile(r1, r8)
            if (r6 == r4) goto L6a
            boolean r6 = r5.m6991()
            if (r6 == 0) goto L68
            r5.m10145()
        L68:
            r6 = r1
            goto L23
        L6a:
            r6 = r1
            goto L44
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.m8695(long, ˉᵫ):void");
    }

    /* JADX WARN: Code restructure failed: missing block: B:23:0x0046, code lost:
    
        r1 = (defpackage.C1215) r1.m10143();
     */
    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final defpackage.C1215 m8696(long r12) throws kotlinx.coroutines.DispatchException {
        /*
            Method dump skipped, instructions count: 217
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.m8696(long):ˉᵫ");
    }

    /* JADX WARN: Code restructure failed: missing block: B:69:0x00f1, code lost:
    
        m8670(r1);
     */
    /* JADX WARN: Code restructure failed: missing block: B:70:0x00f4, code lost:
    
        return;
     */
    /* JADX WARN: Removed duplicated region for block: B:84:0x00bc A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:88:0x0088 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:97:? A[SYNTHETIC] */
    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m8697() {
        /*
            Method dump skipped, instructions count: 245
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.m8697():void");
    }

    @Override // defpackage.InterfaceC2817
    /* renamed from: ᵴᵳ */
    public final C5553 mo5183() {
        ᵯˉˋ.ᵴᵳ(3, C0406.f2297);
        ᵯˉˋ.ᵴᵳ(3, C4140.f15469);
        return new C5553(this, (AbstractC5244) null);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object m8698(defpackage.C1215 r10, int r11, long r12, defpackage.AbstractC1989 r14) throws kotlinx.coroutines.DispatchException {
        /*
            Method dump skipped, instructions count: 241
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3920.m8698(ˉᵫ, int, long, ːᵱ):java.lang.Object");
    }

    @Override // defpackage.InterfaceC2817
    /* renamed from: ᵶᵷᵕ */
    public final Object mo5184(C4907 c4907) {
        return m8666(this, c4907);
    }

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public final C1215 m8699(long j, C1215 c1215) {
        Object objM8185;
        long j2;
        long j3;
        Unsafe unsafe;
        C1215 c12152 = AbstractC2710.f10511;
        C1565 c1565 = C1565.f6224;
        loop0: while (true) {
            objM8185 = AbstractC3575.m8185(c1215, j, c1565);
            if (!ᵿᵧ.ᵤᵙᵷ(objM8185)) {
                AbstractC2858 abstractC2858 = ᵿᵧ.ˑᵱ(objM8185);
                while (true) {
                    f14795.getClass();
                    Unsafe unsafe2 = AbstractC3747.f13986;
                    long j4 = f14800;
                    AbstractC2858 abstractC28582 = (AbstractC2858) unsafe2.getObjectVolatile(this, j4);
                    if (abstractC28582.f11081 >= abstractC2858.f11081) {
                        break loop0;
                    }
                    if (!abstractC2858.m6990()) {
                        break;
                    }
                    do {
                        unsafe = AbstractC3747.f13986;
                        if (unsafe.compareAndSwapObject(this, f14800, abstractC28582, abstractC2858)) {
                            if (abstractC28582.m6991()) {
                                abstractC28582.m10145();
                            }
                        }
                    } while (unsafe.getObjectVolatile(this, j4) == abstractC28582);
                    if (abstractC2858.m6991()) {
                        abstractC2858.m10145();
                    }
                }
            } else {
                break;
            }
        }
        boolean z = ᵿᵧ.ᵤᵙᵷ(objM8185);
        AtomicLongFieldUpdater atomicLongFieldUpdater = f14803;
        if (z) {
            m8686();
            if (c1215.f11081 * AbstractC2710.f10515 < atomicLongFieldUpdater.get(this)) {
                c1215.m10146();
                return null;
            }
        } else {
            C1215 c12153 = (C1215) ᵿᵧ.ˑᵱ(objM8185);
            long j5 = c12153.f11081;
            if (j5 <= j) {
                return c12153;
            }
            long j6 = j5 * AbstractC2710.f10515;
            do {
                j2 = f14796.get(this);
                j3 = 1152921504606846975L & j2;
                if (j3 >= j6) {
                    break;
                }
            } while (!f14796.compareAndSet(this, j2, j3 + (((int) (j2 >> 60)) << 60)));
            if (j5 * AbstractC2710.f10515 < atomicLongFieldUpdater.get(this)) {
                c12153.m10146();
            }
        }
        return null;
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final C1215 m8700() {
        f14794.getClass();
        Unsafe unsafe = AbstractC3747.f13986;
        Object objectVolatile = unsafe.getObjectVolatile(this, f14798);
        f14795.getClass();
        C1215 c1215 = (C1215) unsafe.getObjectVolatile(this, f14800);
        if (c1215.f11081 > ((C1215) objectVolatile).f11081) {
            objectVolatile = c1215;
        }
        f14790.getClass();
        C1215 c12152 = (C1215) unsafe.getObjectVolatile(this, f14793);
        if (c12152.f11081 > ((C1215) objectVolatile).f11081) {
            objectVolatile = c12152;
        }
        AbstractC4820 abstractC4820 = (AbstractC4820) objectVolatile;
        while (true) {
            AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = AbstractC4820.f17892;
            Object objM10142 = abstractC4820.m10142();
            if (objM10142 == AbstractC3575.f13380) {
                break;
            }
            AbstractC4820 abstractC48202 = (AbstractC4820) objM10142;
            if (abstractC48202 != null) {
                abstractC4820 = abstractC48202;
            } else if (abstractC4820.m10148()) {
                break;
            }
        }
        return (C1215) abstractC4820;
    }

    @Override // defpackage.InterfaceC2817
    /* renamed from: ᵹᵝᵶ */
    public final Object mo5185() {
        C1215 c1215;
        AtomicLongFieldUpdater atomicLongFieldUpdater = f14803;
        long j = atomicLongFieldUpdater.get(this);
        long j2 = f14796.get(this);
        if (m8688(true, j2)) {
            return new C5329(m8684());
        }
        long j3 = j2 & 1152921504606846975L;
        C4283 c4283 = C4189.f15661;
        if (j >= j3) {
            return c4283;
        }
        Object obj = AbstractC2710.f10518;
        f14790.getClass();
        C1215 c12152 = (C1215) AbstractC3747.f13986.getObjectVolatile(this, f14793);
        while (!this.m8671()) {
            long andIncrement = atomicLongFieldUpdater.getAndIncrement(this);
            long j4 = AbstractC2710.f10515;
            long j5 = andIncrement / j4;
            int i = (int) (andIncrement % j4);
            if (c12152.f11081 != j5) {
                C1215 c1215M8685 = this.m8685(j5, c12152);
                if (c1215M8685 == null) {
                    continue;
                } else {
                    c1215 = c1215M8685;
                }
            } else {
                c1215 = c12152;
            }
            C3920 c3920 = this;
            Object objM8676 = c3920.m8676(c1215, i, andIncrement, obj);
            c12152 = c1215;
            if (objM8676 == AbstractC2710.f10513) {
                InterfaceC5233 interfaceC5233 = obj instanceof InterfaceC5233 ? (InterfaceC5233) obj : null;
                if (interfaceC5233 != null) {
                    interfaceC5233.mo2137(c12152, i);
                }
                c3920.m8674(andIncrement);
                c12152.m6989();
                return c4283;
            }
            if (objM8676 != AbstractC2710.f10514) {
                if (objM8676 != AbstractC2710.f10512) {
                    c12152.m10146();
                    return objM8676;
                }
                ᵹˉᵞ.ᵳٴᵶ("unexpected");
                return null;
            }
            if (andIncrement < c3920.m8692()) {
                c12152.m10146();
            }
            this = c3920;
        }
        return new C5329(this.m8684());
    }

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final void m8701() {
        Object objectVolatile;
        C3920 c3920;
        loop0: while (true) {
            f14791.getClass();
            Unsafe unsafe = AbstractC3747.f13986;
            long j = f14801;
            objectVolatile = unsafe.getObjectVolatile(this, j);
            C0434 c0434 = objectVolatile == null ? AbstractC2710.f10510 : AbstractC2710.f10517;
            while (true) {
                Unsafe unsafe2 = AbstractC3747.f13986;
                c3920 = this;
                if (unsafe2.compareAndSwapObject(c3920, f14801, objectVolatile, c0434)) {
                    break loop0;
                } else if (unsafe2.getObjectVolatile(c3920, j) != objectVolatile) {
                    break;
                } else {
                    this = c3920;
                }
            }
            this = c3920;
        }
        if (objectVolatile == null) {
            return;
        }
        ᵯˉˋ.ᵴᵳ(1, objectVolatile);
        ((InterfaceC0362) objectVolatile).mo1588(c3920.m8684());
    }

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final void m8702(InterfaceC5233 interfaceC5233, boolean z) throws DispatchException {
        if (interfaceC5233 instanceof InterfaceC0719) {
            ((InterfaceC4943) interfaceC5233).mo2134(new C2952(z ? m8693() : m8683()));
            return;
        }
        if (interfaceC5233 instanceof C2075) {
            ((C2075) interfaceC5233).f8258.mo2134(new C4189(new C5329(m8684())));
            return;
        }
        if (!(interfaceC5233 instanceof C2200)) {
            if (interfaceC5233 instanceof C3707) {
                ((C3707) interfaceC5233).m8338(this, AbstractC2710.f10504);
                return;
            } else {
                C4069.m8939(interfaceC5233, "Unexpected waiter: ");
                return;
            }
        }
        C2200 c2200 = (C2200) interfaceC5233;
        C4385 c4385 = c2200.f8636;
        c2200.f8636 = null;
        c2200.f8637 = AbstractC2710.f10504;
        Throwable thM8684 = c2200.f8638.m8684();
        if (thM8684 == null) {
            c4385.mo2134(Boolean.FALSE);
        } else {
            c4385.mo2134(new C2952(thM8684));
        }
    }
}
