package defpackage;

import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;

/* renamed from: ᵼʢ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C5239 extends AbstractC3606 {

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final int f19631;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public C3460 f19632;

    public C5239(C3460 c3460, int i) {
        this.f19632 = c3460;
        this.f19631 = i;
    }

    @Override // defpackage.AbstractC3606
    /* renamed from: ᵸˑ */
    public final String mo1032() {
        InterfaceC4607 interfaceC4607;
        C3460 c3460 = this.f19632;
        if (c3460 == null || (interfaceC4607 = (InterfaceC4607) ((RunnableC1011) c3460.f12987).f4447) == null) {
            return null;
        }
        String string = interfaceC4607.toString();
        String strM8592 = AbstractC3915.m8592(new StringBuilder(string.length() + 11), "callable=[", string, "]");
        C4105 c4105 = (C4105) ((AtomicReference) this.f19632.f12990).get();
        if (c4105 == null) {
            return strM8592;
        }
        int length = strM8592.length();
        String string2 = c4105.toString();
        StringBuilder sb = new StringBuilder(string2.length() + length + 9 + 1);
        sb.append(strM8592);
        sb.append(", trial=[");
        sb.append(string2);
        sb.append("]");
        return sb.toString();
    }

    @Override // defpackage.AbstractC3606
    /* renamed from: ᵻᵢﹳᵰ */
    public final void mo1033() {
        AtomicLong atomicLong;
        long j;
        int i;
        int i2;
        boolean z;
        C3460 c3460 = this.f19632;
        this.f19632 = null;
        if (c3460 == null) {
            return;
        }
        AtomicReference atomicReference = (AtomicReference) c3460.f12990;
        do {
            atomicLong = (AtomicLong) c3460.f12991;
            j = atomicLong.get();
            i = (int) j;
            long j2 = j >>> 32;
            if (i == Integer.MIN_VALUE) {
                StringBuilder sb = new StringBuilder(String.valueOf(j).length() + 13);
                sb.append("Refcount is: ");
                sb.append(j);
                throw new AssertionError(sb.toString());
            }
            i2 = (int) j2;
            z = i == -2147483647;
            if (z) {
                i2++;
            }
        } while (!atomicLong.compareAndSet(j, (i2 << 32) | (4294967295L & (i - 1))));
        if (z) {
            while (true) {
                C4105 c4105 = (C4105) atomicReference.get();
                if (c4105 != null) {
                    if (c4105.f15338 <= this.f19631) {
                        c4105.cancel(true);
                        while (!atomicReference.compareAndSet(c4105, null)) {
                            if (atomicReference.get() != c4105) {
                                break;
                            }
                        }
                        return;
                    }
                    return;
                }
                return;
            }
        }
    }
}
