package defpackage;

import java.util.concurrent.ConcurrentLinkedQueue;

/* JADX INFO: renamed from: ᵔᵺː, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2280 extends AbstractC4977 {

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final /* synthetic */ int f8979 = 1;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final /* synthetic */ Object f8980;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C2280(String str, InterfaceC1841 interfaceC1841) {
        super(str);
        this.f8980 = interfaceC1841;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C2280(C2736 c2736, String str) {
        super(str);
        this.f8980 = c2736;
    }

    @Override // defpackage.AbstractC4977
    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final long mo5894() {
        switch (this.f8979) {
            case 0:
                C2736 c2736 = (C2736) this.f8980;
                long jNanoTime = System.nanoTime();
                long j = (jNanoTime - c2736.f10522) + 1;
                C4013 c4013 = null;
                long j2 = Long.MAX_VALUE;
                int i = 0;
                C4013 c40132 = null;
                C4013 c40133 = null;
                int i2 = 0;
                for (C4013 c40134 : (ConcurrentLinkedQueue) c2736.f10523) {
                    synchronized (c40134) {
                        if (c2736.m6633(c40134, jNanoTime) > 0) {
                            i2++;
                        } else {
                            long j3 = c40134.f15419;
                            if (j3 < j) {
                                j = j3;
                                c40132 = c40134;
                            }
                            i++;
                            if (j3 < j2) {
                                j2 = j3;
                                c40133 = c40134;
                            }
                        }
                    }
                }
                if (c40132 != null) {
                    c4013 = c40132;
                } else if (i > 5) {
                    j = j2;
                    c4013 = c40133;
                } else {
                    j = -1;
                }
                if (c4013 == null) {
                    if (c40133 != null) {
                        return (j2 + c2736.f10522) - jNanoTime;
                    }
                    if (i2 > 0) {
                        return c2736.f10522;
                    }
                    return -1L;
                }
                synchronized (c4013) {
                    if (c4013.f15415.isEmpty() && c4013.f15419 == j) {
                        c4013.f15420 = true;
                        ((ConcurrentLinkedQueue) c2736.f10523).remove(c4013);
                        AbstractC1190.m3664(c4013.f15416);
                        if (!((ConcurrentLinkedQueue) c2736.f10523).isEmpty()) {
                            return 0L;
                        }
                        ((C5380) c2736.f10520).m10971();
                        return 0L;
                    }
                    return 0L;
                }
            default:
                ((InterfaceC1841) this.f8980).mo1021();
                return -1L;
        }
    }
}
