package p138.p176.p177.p190.p239;

import java.util.Arrays;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ဢ.ޖ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C4148<V> {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public long[] f13252 = new long[10];

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public V[] f13253 = (V[]) new Object[10];

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public int f13254;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public int f13255;

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public synchronized V m6729(long j) {
        return m6730(j, false);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final V m6730(long j, boolean z) {
        long j2 = Long.MAX_VALUE;
        V v = null;
        while (this.f13255 > 0) {
            long j3 = j - this.f13252[this.f13254];
            if (j3 < 0 && (z || (-j3) >= j2)) {
                break;
            }
            V[] vArr = this.f13253;
            int i = this.f13254;
            v = vArr[i];
            vArr[i] = null;
            this.f13254 = (i + 1) % vArr.length;
            this.f13255--;
            j2 = j3;
        }
        return v;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public synchronized void m6731() {
        this.f13254 = 0;
        this.f13255 = 0;
        Arrays.fill(this.f13253, (Object) null);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public synchronized void m6732(long j, V v) {
        if (this.f13255 > 0) {
            if (j <= this.f13252[((this.f13254 + r0) - 1) % this.f13253.length]) {
                m6731();
            }
        }
        m6734();
        int i = this.f13254;
        int i2 = this.f13255;
        V[] vArr = this.f13253;
        int length = (i + i2) % vArr.length;
        this.f13252[length] = j;
        vArr[length] = v;
        this.f13255 = i2 + 1;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public synchronized V m6733(long j) {
        return m6730(j, true);
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m6734() {
        int length = this.f13253.length;
        if (this.f13255 < length) {
            return;
        }
        int i = length * 2;
        long[] jArr = new long[i];
        V[] vArr = (V[]) new Object[i];
        int i2 = this.f13254;
        int i3 = length - i2;
        System.arraycopy(this.f13252, i2, jArr, 0, i3);
        System.arraycopy(this.f13253, this.f13254, vArr, 0, i3);
        int i4 = this.f13254;
        if (i4 > 0) {
            System.arraycopy(this.f13252, 0, jArr, i3, i4);
            System.arraycopy(this.f13253, 0, vArr, i3, this.f13254);
        }
        this.f13252 = jArr;
        this.f13253 = vArr;
        this.f13254 = 0;
    }
}
