package o;

import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.CancellationException;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.aZ, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0721aZ extends A implements InterfaceC0817bZ, InterfaceC0736ah {

    /* renamed from: o, reason: collision with root package name */
    public final C1210ff f447o;

    public C0721aZ(InterfaceC2747vn interfaceC2747vn, C1210ff c1210ff) {
        super(interfaceC2747vn, true);
        this.f447o = c1210ff;
    }

    @Override // o.C1375hJ
    public final void C(CancellationException cancellationException) {
        this.f447o.g(cancellationException, true);
        B(cancellationException);
    }

    @Override // o.J00
    public final Object a(InterfaceC0220Im interfaceC0220Im) {
        return this.f447o.a(interfaceC0220Im);
    }

    @Override // o.C1375hJ, o.TI, o.J00
    public final void c(CancellationException cancellationException) {
        if (isCancelled()) {
            return;
        }
        if (cancellationException == null) {
            cancellationException = new UI(F(), null, this);
        }
        C(cancellationException);
    }

    @Override // o.J00
    public final C0923cf iterator() {
        C1210ff c1210ff = this.f447o;
        c1210ff.getClass();
        return new C0923cf(c1210ff);
    }

    @Override // o.A
    public final void k0(Throwable th, boolean z) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        if (this.f447o.g(th, false) || z) {
            return;
        }
        AbstractC1155f00.t(th, this.n);
    }

    @Override // o.A
    public final void l0(Object obj) {
        C80.o(this.f447o);
    }

    @Override // o.InterfaceC1455i60
    public final Object n(Object obj, InterfaceC0220Im interfaceC0220Im) {
        return this.f447o.n(obj, interfaceC0220Im);
    }

    public final void n0(C1513in c1513in) {
        C1210ff c1210ff = this.f447o;
        c1210ff.getClass();
        AtomicReferenceFieldUpdater atomicReferenceFieldUpdater = C1210ff.u;
        while (!atomicReferenceFieldUpdater.compareAndSet(c1210ff, null, c1513in)) {
            if (atomicReferenceFieldUpdater.get(c1210ff) != null) {
                while (true) {
                    Object obj = atomicReferenceFieldUpdater.get(c1210ff);
                    C2943xq c2943xq = AbstractC1402hf.q;
                    if (obj != c2943xq) {
                        if (obj == AbstractC1402hf.r) {
                            throw new IllegalStateException("Another handler was already registered and successfully invoked");
                        }
                        throw new IllegalStateException(("Another handler is already registered: " + obj).toString());
                    }
                    C2943xq c2943xq2 = AbstractC1402hf.r;
                    while (!atomicReferenceFieldUpdater.compareAndSet(c1210ff, c2943xq, c2943xq2)) {
                        if (atomicReferenceFieldUpdater.get(c1210ff) != c2943xq) {
                            break;
                        }
                    }
                    c1513in.g(c1210ff.l());
                    return;
                }
            }
        }
    }

    @Override // o.J00
    public final Object o() {
        return this.f447o.o();
    }

    @Override // o.InterfaceC1455i60
    public final Object p(Object obj) {
        return this.f447o.p(obj);
    }

    @Override // o.J00
    public final Object r(C0836bj c0836bj) {
        C1210ff c1210ff = this.f447o;
        c1210ff.getClass();
        return C1210ff.B(c1210ff, c0836bj);
    }
}
