package vp;

import java.util.concurrent.atomic.AtomicReferenceArray;
import tp.y2;
import zp.e0;
import zp.h0;
import zp.z;

/* loaded from: classes3.dex */
public final class j extends e0 {

    /* renamed from: t, reason: collision with root package name */
    private final b f40444t;

    /* renamed from: u, reason: collision with root package name */
    private final AtomicReferenceArray f40445u;

    public j(long j10, j jVar, b bVar, int i10) {
        super(j10, jVar, i10);
        this.f40444t = bVar;
        this.f40445u = new AtomicReferenceArray(c.f40417b * 2);
    }

    private final void z(int i10, Object obj) {
        this.f40445u.lazySet(i10 * 2, obj);
    }

    public final void A(int i10, Object obj) {
        this.f40445u.set((i10 * 2) + 1, obj);
    }

    public final void B(int i10, Object obj) {
        z(i10, obj);
    }

    @Override // zp.e0
    public int n() {
        return c.f40417b;
    }

    /* JADX WARN: Code restructure failed: missing block: B:54:0x0063, code lost:
    
        s(r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x0066, code lost:
    
        if (r0 == false) goto L65;
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x0068, code lost:
    
        r3 = u().f40408q;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x006e, code lost:
    
        if (r3 == null) goto L66;
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x0070, code lost:
    
        zp.z.b(r3, r5, r6);
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x0073, code lost:
    
        return;
     */
    /* JADX WARN: Code restructure failed: missing block: B:60:?, code lost:
    
        return;
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:?, code lost:
    
        return;
     */
    @Override // zp.e0
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void o(int i10, Throwable th2, vm.g gVar) {
        dn.l lVar;
        h0 h0Var;
        h0 h0Var2;
        h0 h0Var3;
        h0 h0Var4;
        h0 h0Var5;
        int i11 = c.f40417b;
        boolean z10 = i10 >= i11;
        if (z10) {
            i10 -= i11;
        }
        Object v10 = v(i10);
        while (true) {
            Object w10 = w(i10);
            if (!(w10 instanceof y2) && !(w10 instanceof v)) {
                h0Var = c.f40425j;
                if (w10 == h0Var) {
                    break;
                }
                h0Var2 = c.f40426k;
                if (w10 == h0Var2) {
                    break;
                }
                h0Var3 = c.f40422g;
                if (w10 != h0Var3) {
                    h0Var4 = c.f40421f;
                    if (w10 != h0Var4) {
                        h0Var5 = c.f40424i;
                        if (w10 == h0Var5 || w10 == c.f40419d || w10 == c.z()) {
                            return;
                        }
                        throw new IllegalStateException(("unexpected state: " + w10).toString());
                    }
                } else {
                    continue;
                }
            } else {
                if (r(i10, w10, z10 ? c.f40425j : c.f40426k)) {
                    s(i10);
                    x(i10, !z10);
                    if (!z10 || (lVar = u().f40408q) == null) {
                        return;
                    }
                    z.b(lVar, v10, gVar);
                    return;
                }
            }
        }
    }

    public final boolean r(int i10, Object obj, Object obj2) {
        return i.a(this.f40445u, (i10 * 2) + 1, obj, obj2);
    }

    public final void s(int i10) {
        z(i10, null);
    }

    public final Object t(int i10, Object obj) {
        return this.f40445u.getAndSet((i10 * 2) + 1, obj);
    }

    public final b u() {
        b bVar = this.f40444t;
        kotlin.jvm.internal.t.d(bVar);
        return bVar;
    }

    public final Object v(int i10) {
        return this.f40445u.get(i10 * 2);
    }

    public final Object w(int i10) {
        return this.f40445u.get((i10 * 2) + 1);
    }

    public final void x(int i10, boolean z10) {
        if (z10) {
            u().G0((this.f53544r * c.f40417b) + i10);
        }
        p();
    }

    public final Object y(int i10) {
        Object v10 = v(i10);
        s(i10);
        return v10;
    }
}
